Show
Ignore:
Timestamp:
12/26/07 22:37:40 (10 months ago)
Author:
cfriesen
Message:

Individual update (hope nothing is missing)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/gregarius/update.php

    r1581 r1774  
    2828define ('RSS_NO_CACHE',true); 
    2929require_once('init.php'); 
     30 
    3031$cline = isset($argv) && !$_REQUEST && isset($argc) && $argc; 
    3132if (!$cline && getConfig('rss.config.restrictrefresh')) { 
     
    4142sajax_init(); 
    4243 
    43      
    4444if (array_key_exists('js',$_GET)) { 
    4545    header('Content-Type: text/javascript'); 
     
    5252} 
    5353 
    54  
    5554$browser = new Browser(); 
    5655$silent = array_key_exists('silent', $_GET) || ($cline && in_array('--silent',$argv)); 
    5756$newsonly = array_key_exists('newsonly', $_GET) || ($cline && in_array('--newsonly', $argv)); 
    5857$mobile = array_key_exists('mobile',$_GET); 
     58 
     59$cid = DEFAULT_CID; 
     60if(array_key_exists('cid', $_GET)) { 
     61    $cid = $_GET['cid']; 
     62} else if ($cline && in_array('--update-only', $argv)) { 
     63    foreach($argv as $k => $v) { 
     64        if ('--update-only' == $v) { 
     65            $cid = $argv[$k+1]; 
     66            break; 
     67        } 
     68    } 
     69} 
    5970 
    6071$GLOBALS['rss'] -> header = new Header( 
     
    6879$GLOBALS['rss'] -> feedList = new FeedList(false); 
    6980 
    70  
    7181// Instantiate a different Update object, depending on the client 
    7282if ($cline && !$silent && !$newsonly) { 
    73     $update = new CommandLineUpdate(); 
     83    $update = new CommandLineUpdate($cid); 
    7484 
    7585} elseif ($cline && !$silent && $newsonly) { 
    76     $update = new CommandLineUpdateNews(); 
     86    $update = new CommandLineUpdateNews($cid); 
    7787     
    7888} elseif (getConfig('rss.config.serverpush') && !$silent && $browser->supportsServerPush()) { 
    79     $update = new HTTPServerPushUpdate();    
     89    $update = new HTTPServerPushUpdate($cid);    
    8090     
    8191} elseif(!$silent && $browser->supportsAJAX()) { 
    82     $update = new AJAXUpdate();  
     92    $update = new AJAXUpdate($cid);  
    8393 
    8494} elseif($mobile) { 
    85     $update = new MobileUpdate(); 
     95    $update = new MobileUpdate($cid); 
    8696     
    8797} else { 
    8898    error_reporting(0); 
    89     $update = new SilentUpdate(); 
     99    $update = new SilentUpdate($cid); 
    90100} 
    91101