Show
Ignore:
Timestamp:
01/12/07 17:06:34 (14 years ago)
Author:
exi
Message:

Changes to sync_server.php to reduce the memory load during script execution.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • dev/common/admin_sync.php

    r162 r176  
    1616    { 
    1717        $html .= "Could not connect to Server:<br/>\n"; 
    18         $html .= $http-getError(); 
     18        $html .= $http->getError(); 
    1919 
    2020        $page->addContext($menubox->generate()); 
     
    7979            unset($data); 
    8080            $results = count($matches[1]); 
     81            if (isset($_REQUEST['itm_overwrite'])) 
     82            { 
     83                $add_qrystr = ''; 
     84            } 
     85            else 
     86            { 
     87                $add_qrystr = ' AND itm_value=0'; 
     88            } 
     89 
    8190            for ($i = 0; $i<$results; $i++) 
    8291            { 
    83                 $update->execute("update kb3_items set itm_externalid='".addslashes($matches[2][$i])."', itm_value='".addslashes($matches[3][$i])."' where itm_name='".addslashes($matches[1][$i])."' limit 1"); 
     92                $update->execute("update kb3_items set itm_externalid='".addslashes($matches[2][$i])."', itm_value='".addslashes($matches[3][$i])."' where itm_name='".addslashes($matches[1][$i])."'".$add_qrystr." limit 1"); 
    8493            } 
    8594            if ($results == 0) 
     
    129138    $html .= "<tr><td width=120><b>Update item values</b></td><td><input type=checkbox name=itm_update id=itm_update"; 
    130139    $html .= " checked=\"checked\"></td></tr>"; 
     140    $html .= "<tr><td width=120><b>Overwrite local values</b></td><td><input type=checkbox name=itm_overwrite id=itm_overwrite"; 
     141    $html .= " checked=\"checked\">(If disabled only values with 0 will be overwritten)</td></tr>"; 
    131142    $html .= '<input type="hidden" name="do" value="sync">'; 
    132143    $html .= '<tr><td width=120></td><td><input type=submit name=submit value="Synchronize now"></td></tr></table></form>';