Changeset 1774 for trunk/gregarius/cls

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

Individual update (hope nothing is missing)

Location:
trunk/gregarius/cls
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/gregarius/cls/update.php

    r1629 r1774  
    3232define('NO_NEW_ITEMS', '-'); 
    3333define ('UPDATING','...'); 
     34define ('DEFAULT_CID', -1); 
    3435 
    3536 
     
    6465    var $chans = array (); 
    6566 
    66     function Update($doPopulate = true, $updatePrivateAlso = false) { 
     67    function Update($doPopulate = true, $updatePrivateAlso = false, $cid = DEFAULT_CID) { 
    6768        rss_plugin_hook('rss.plugins.updates.before', null); 
    6869        if($doPopulate) { 
    69             $this->populate($updatePrivateAlso); 
     70            $this->populate($updatePrivateAlso, $cid); 
    7071        } 
    7172 
     
    7576    } 
    7677 
    77     function populate($updatePrivateAlso = false) { 
     78    function populate($updatePrivateAlso = false, $cid) { 
    7879        $sql = "select c.id, c.url, c.title from ".getTable("channels") . " c " 
    7980               . " inner join " . getTable('folders') . " f on f.id = c.parent " 
     
    8384            $sql .= " and not(mode & ".RSS_MODE_PRIVATE_STATE.") "; 
    8485        } 
    85  
    86         if (getConfig('rss.config.absoluteordering')) { 
    87             $sql .= " order by f.position asc, c.position asc"; 
    88         } else { 
    89             $sql .= " order by f.name, c.title asc"; 
    90         } 
     86         
     87        if(DEFAULT_CID != $cid) { 
     88            $sql .= " and c.id = " . $cid . " "; 
     89                } else { 
     90                    if (getConfig('rss.config.absoluteordering')) { 
     91                            $sql .= " order by f.position asc, c.position asc"; 
     92                    } else { 
     93                            $sql .= " order by f.name, c.title asc"; 
     94                    } 
     95                } 
    9196 
    9297        $res = rss_query($sql); 
     
    159164} 
    160165 
    161  
    162166/** 
    163167 * HTTP Server Push update 
     
    165169class HTTPServerPushUpdate extends Update { 
    166170 
    167     function HTTPServerPushUpdate() { 
    168         parent::Update(); 
     171    function HTTPServerPushUpdate($cid) { 
     172        parent::Update($doPopulate = true, $updatePrivateAlso = false, $cid); 
    169173 
    170174        $GLOBALS['rss']->header->appendHeader("Connection: close"); 
     
    228232} 
    229233 
    230  
    231234/** 
    232235 * AJAXUpdate updates feeds via AJAX. It's a bit more server-intesive 
     
    235238class AJAXUpdate extends Update { 
    236239 
    237     function AJAXUpdate() { 
    238         parent::Update(); 
     240    function AJAXUpdate($cid) { 
     241        parent::Update($doPopulate = true, $updatePrivateAlso = false, $cid); 
    239242        $GLOBALS['rss']->header->extraHTML .= "<script type=\"text/javascript\" src=\"" 
    240243                                              .getPath()."update.php?js\"></script>\n"; 
     
    275278} 
    276279 
    277  
    278  
    279280class CommandLineUpdate extends Update { 
    280     function CommandLineUpdate() { 
    281         parent::Update($doPopulate = true, $updatePrivateAlso = true); 
     281    function CommandLineUpdate($cid) { 
     282        parent::Update($doPopulate = true, $updatePrivateAlso = true, $cid); 
    282283    } 
    283284 
     
    309310 
    310311class MobileUpdate extends Update { 
    311     function MobileUpdate() { 
    312         parent::Update($doPopulate = true); 
    313     } 
     312    function MobileUpdate($cid) { 
     313        parent::Update($doPopulate = true, $updatePrivateAlso = false, $cid); 
     314    } 
     315     
    314316    function render() { 
    315317        $newIds = array(); 
     
    334336    } 
    335337} 
    336  
    337338 
    338339/** 
     
    372373} 
    373374 
    374  
    375  
    376375/** 
    377376 * SilentUpdate updates the feeds silently for those lame  
     
    380379 */ 
    381380class SilentUpdate extends Update { 
    382     function SilentUpdate() { 
    383         parent::Update($doPopulate = false); 
     381    function SilentUpdate($cid) { 
     382        parent::Update($doPopulate = false, $updatePrivateAlso = false, $cid); 
    384383    } 
    385384 
  • trunk/gregarius/cls/wrappers/feeds.php

    r1561 r1774  
    112112} 
    113113 
     114function rss_feeds_feed_id() { 
     115    return ($GLOBALS['rss']->currentFeedsFeed-> id); 
     116} 
     117 
    114118function rss_feeds_feed_title_entities() { 
    115119    return htmlentities($GLOBALS['rss']->currentFeedsFeed-> title);