Ignore:
Timestamp:
Jan 18, 2012, 9:32:07 PM (13 years ago)
Author:
chronos
Message:
  • Upraveno: Doplněny rozšiřující typy s jinou velikostí.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/NetworkShare/browse.php

    r129 r362  
    4848  //$Vlozit = '';
    4949  // Nacti parent ID
    50   $DbResult = $Database->query('SELECT LAST_INSERT_ID() FROM items LIMIT 0,1');
     50  $DbResult = $Database->query('SELECT LAST_INSERT_ID() FROM NetworkShareItem LIMIT 0,1');
    5151  //echo(DB_NumRows());
    5252  $Row = $DbResult->fetch_array();
     
    9999      $Nazev = substr($Nazev,0,strrpos($Nazev,'.'));
    100100    } else $Ext = '';
    101     //$Vlozit .= "INSERT INTO items (name,size,date,ext,parent,type,host) ".
     101    //$Vlozit .= "INSERT INTO NetworkShareItem (name,size,date,ext,parent,type,host) ".
    102102    //"VALUES ('$Nazev','$Velikost',NOW(),'$Ext','$Parent','$Type','$HostID'); ";
    103103   
    104     $Database->insert('items', array(
     104    $Database->insert('NetworkShareItem', array(
    105105      'name' => $Nazev,
    106106      'size' => $Velikost,
     
    126126 
    127127  // Aktualizuj velikost
    128   //DB_Query("SELECT SUM(size) FROM items WHERE (parent=".$Parent.")");
     128  //DB_Query("SELECT SUM(size) FROM NetworkShareItem WHERE (parent=".$Parent.")");
    129129  //$Row = DB_Row();
    130   $Database->update('items', 'id='.$Parent, array('size' => $VelikostSlozky));
     130  $Database->update('NetworkShareItem', 'id='.$Parent, array('size' => $VelikostSlozky));
    131131  //closedir($Dir);
    132132  return($VelikostSlozky);
     
    134134
    135135// Proskenuj jednotlive sdileni
    136 $Database->query('DELETE FROM items WHERE host='.$HostID);      // Smaz predchozi polozky
     136$Database->query('DELETE FROM NetworkShareItem WHERE host='.$HostID);   // Smaz predchozi polozky
    137137
    138138// Zapis nazev pocitace
    139 $Database->insert('items',array(
     139$Database->insert('NetworkShareItem',array(
    140140  'name' => $Host,
    141141  'size' => 0,
     
    148148
    149149// Nacti Parent ID
    150 $DbResult = $Database->query('SELECT LAST_INSERT_ID() FROM items LIMIT 0,1');
     150$DbResult = $Database->query('SELECT LAST_INSERT_ID() FROM NetworkShareItem LIMIT 0,1');
    151151$Row = $DbResult->fetch_array();
    152152$Parent = $Row[0];
     
    170170    {
    171171      // Přidej poloľku sdílení do datanáze
    172       $Database->insert('items',array(
     172      $Database->insert('NetworkShareItem',array(
    173173        'name' => $Share,
    174174        'size' => 0,
     
    196196
    197197// Aktualizuj velikost dat pocitace
    198 $DbResult = $Database->query("SELECT SUM(size) FROM items WHERE parent=".$Parent);
    199 $Row = $DbResult->fetch_array();
    200 $Database->update('items','id='.$Parent,array('size' => $Row[0]));
     198$DbResult = $Database->query("SELECT SUM(size) FROM NetworkShareItem WHERE parent=".$Parent);
     199$Row = $DbResult->fetch_array();
     200$Database->update('NetworkShareItem','id='.$Parent,array('size' => $Row[0]));
    201201
    202202// Zaktivuj strom
     
    207207$NewID = $Row['id'];
    208208$Database->select_db('share');
    209 $Database->query("DELETE FROM items WHERE host=".$NewID);
    210 $Database->update('items','host='.$HostID,array('host' => $NewID));
     209$Database->query("DELETE FROM NetworkShareItem WHERE host=".$NewID);
     210$Database->update('NetworkShareItem','host='.$HostID,array('host' => $NewID));
    211211echo("OK\n");
    212212
     
    219219 
    220220$Database->select_db('share');
    221 $DbResult = $Database->query("SELECT SUM(size) FROM items WHERE ((parent=1) AND (host IN (".substr($Vyber,0,-1).')))');
    222 $Row = $DbResult->fetch_array();
    223 $Database->update('items','id=1',array('size' => $Row[0]));
     221$DbResult = $Database->query("SELECT SUM(size) FROM NetworkShareItem WHERE ((parent=1) AND (host IN (".substr($Vyber,0,-1).')))');
     222$Row = $DbResult->fetch_array();
     223$Database->update('NetworkShareItem','id=1',array('size' => $Row[0]));
    224224
    225225// Zapiš chyby do databáze
    226226echo("Chyby sdílení...\n");
    227 $Database->delete('errors', 'host="'.$Host.'"');
     227$Database->delete('NetworkShareError', 'host="'.$Host.'"');
    228228if(is_dir($TempDir.'errors'))
    229229{
     
    244244          {
    245245            $Row = substr($ShareFull.'/'.substr($Row, 39), 0, -1);
    246             $Database->insert('errors', array('host' => $Host, 'message' => $Row));
     246            $Database->insert('NetworkShareError', array('host' => $Host, 'message' => $Row));
    247247            echo($Row."\n");
    248248          }
Note: See TracChangeset for help on using the changeset viewer.