Changeset 505 for trunk/Modules/NetworkShare/browse.php
- Timestamp:
- Apr 1, 2013, 12:29:37 AM (12 years ago)
- Location:
- trunk/Modules/NetworkShare
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/NetworkShare/browse.php
r129 r505 48 48 //$Vlozit = ''; 49 49 // Nacti parent ID 50 $DbResult = $Database->query('SELECT LAST_INSERT_ID() FROM itemsLIMIT 0,1');50 $DbResult = $Database->query('SELECT LAST_INSERT_ID() FROM NetworkShareItem LIMIT 0,1'); 51 51 //echo(DB_NumRows()); 52 52 $Row = $DbResult->fetch_array(); … … 99 99 $Nazev = substr($Nazev,0,strrpos($Nazev,'.')); 100 100 } 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) ". 102 102 //"VALUES ('$Nazev','$Velikost',NOW(),'$Ext','$Parent','$Type','$HostID'); "; 103 103 104 $Database->insert(' items', array(104 $Database->insert('NetworkShareItem', array( 105 105 'name' => $Nazev, 106 106 'size' => $Velikost, … … 126 126 127 127 // Aktualizuj velikost 128 //DB_Query("SELECT SUM(size) FROM itemsWHERE (parent=".$Parent.")");128 //DB_Query("SELECT SUM(size) FROM NetworkShareItem WHERE (parent=".$Parent.")"); 129 129 //$Row = DB_Row(); 130 $Database->update(' items', 'id='.$Parent, array('size' => $VelikostSlozky));130 $Database->update('NetworkShareItem', 'id='.$Parent, array('size' => $VelikostSlozky)); 131 131 //closedir($Dir); 132 132 return($VelikostSlozky); … … 134 134 135 135 // Proskenuj jednotlive sdileni 136 $Database->query('DELETE FROM itemsWHERE host='.$HostID); // Smaz predchozi polozky136 $Database->query('DELETE FROM NetworkShareItem WHERE host='.$HostID); // Smaz predchozi polozky 137 137 138 138 // Zapis nazev pocitace 139 $Database->insert(' items',array(139 $Database->insert('NetworkShareItem',array( 140 140 'name' => $Host, 141 141 'size' => 0, … … 148 148 149 149 // Nacti Parent ID 150 $DbResult = $Database->query('SELECT LAST_INSERT_ID() FROM itemsLIMIT 0,1');150 $DbResult = $Database->query('SELECT LAST_INSERT_ID() FROM NetworkShareItem LIMIT 0,1'); 151 151 $Row = $DbResult->fetch_array(); 152 152 $Parent = $Row[0]; … … 170 170 { 171 171 // Přidej poloľku sdílení do datanáze 172 $Database->insert(' items',array(172 $Database->insert('NetworkShareItem',array( 173 173 'name' => $Share, 174 174 'size' => 0, … … 196 196 197 197 // Aktualizuj velikost dat pocitace 198 $DbResult = $Database->query("SELECT SUM(size) FROM itemsWHERE 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])); 201 201 202 202 // Zaktivuj strom … … 207 207 $NewID = $Row['id']; 208 208 $Database->select_db('share'); 209 $Database->query("DELETE FROM itemsWHERE 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)); 211 211 echo("OK\n"); 212 212 … … 219 219 220 220 $Database->select_db('share'); 221 $DbResult = $Database->query("SELECT SUM(size) FROM itemsWHERE ((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])); 224 224 225 225 // Zapiš chyby do databáze 226 226 echo("Chyby sdílení...\n"); 227 $Database->delete(' errors', 'host="'.$Host.'"');227 $Database->delete('NetworkShareError', 'host="'.$Host.'"'); 228 228 if(is_dir($TempDir.'errors')) 229 229 { … … 244 244 { 245 245 $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)); 247 247 echo($Row."\n"); 248 248 }
Note:
See TracChangeset
for help on using the changeset viewer.