Ignore:
Timestamp:
Apr 1, 2013, 12:29:37 AM (12 years ago)
Author:
chronos
Message:
  • Upraveno: Procházení sdílení přetvořeno na aplikační modul.
  • Ukládání a udržování souborů na disku bude nyní samostatný modul. Na tomto modulu zavisí moduly Finance a News.
Location:
trunk/Modules/NetworkShare
Files:
2 added
3 deleted
4 edited
1 moved

Legend:

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

    r129 r505  
    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          }
  • trunk/Modules/NetworkShare/online.php

    r438 r505  
    11<?php
    2 
    3 include_once('../Common/Global.php');
    4 
     2include('../global.php');
    53//$Database->select_db('share');
    64echo("\n====================== Kontrola online pocitacu ============================\n\n");
  • trunk/Modules/NetworkShare/playlist.php

    r438 r505  
    11<?php
    2 
    3 include_once('../Common/Global.php');
    4 
    5 // Omezení na online/offline uľivatele
     2include('../global.php');
     3// Omezení na online/offline uµivatele
    64
    75$DbResult = $Database->query('SELECT id FROM hosts WHERE online=1 AND block=0 AND user>0');
     
    1513$Database->select_db('share');
    1614
    17 // Maximální vnoření
     15// Maximální vnoøení
    1816$MaxNesting = 20;
    1917
    20 // Najde cestu ke keřenu
     18// Najde cestu ke keøenu
    2119function PlnaCesta($Row)
    2220{
  • trunk/Modules/NetworkShare/update.php

    r40 r505  
    11<?php
    2 include('../style.php');
    32
    43//$Perioda = 3600*3;    // prochazet po tech hodinach
     
    98  $Hosts = array();
    109  $StartTime = GetMicrotime();
    11   $DbResult = $Database->query("SELECT * FROM hosts WHERE online=1 AND (block=0 OR name='centrala') AND (name!='GATE') AND user>0");
     10  $DbResult = $Database->query("SELECT * FROM NetworkDevice WHERE Online=1 AND (Block=0 OR Name='centrala') AND (Name!='GATE') AND User>0");
    1211  while($Row = $DbResult->fetch_array())
    1312  {
     
    1918    if($Dnes != $Row['last_share_check'])
    2019    {
    21       echo("Kontroluji ".$Row['name']."...\n");
    22       passthru('env browse_host='.$Row['name'].' browse_id='.$HostID.' php -q -c php.ini -f browse.php');
     20      echo("Kontroluji ".$Row['Name']."...\n");
     21      passthru('env browse_host='.$Row['Name'].' browse_id='.$HostID.' php -q -c php.ini -f browse.php');
    2322    }
    24     else echo("Vynechavam ".$Row['name']."...\n");
     23    else echo("Vynechavam ".$Row['Name']."...\n");
    2524    // Aktualizuj datum prochazeni   
    26     $Database->update('hosts',"name='".$Row['name']."'",array('last_share_check' => $Dnes));
     25    $Database->update('Hosts', "name='".$Row['name']."'",array('last_share_check' => $Dnes));
    2726  }
    2827  $Rozdil = GetMicrotime()-$StartTime+10;
    2928 
    3029  // Oprav a zoptimalizuj tabulku
    31   $Database->select_db('share');
     30  //$Database->select_db('share');
    3231  echo('Opravuji tabulku...');
    33   $Database->query('REPAIR TABLE items');
     32  $Database->query('REPAIR TABLE NetworkShareItem');
    3433  echo("\nOptimalizuji tabulku...");
    35   $Database->query('OPTIMIZE TABLE items');
     34  $Database->query('OPTIMIZE TABLE NetworkShareItem');
    3635 
    3736  echo("\nDoba procháení ".date("H:i:s",$Rozdil-3600)."\n\n");
Note: See TracChangeset for help on using the changeset viewer.