- Timestamp:
- 12/26/07 22:37:40 (11 months ago)
- Location:
- trunk/gregarius
- Files:
-
- 1 added
- 5 modified
-
admin/channels.php (modified) (2 diffs)
-
cls/update.php (modified) (13 diffs)
-
cls/wrappers/feeds.php (modified) (1 diff)
-
themes/default/web/feedsfeed.php (modified) (1 diff)
-
themes/default/web/media/arrow_refresh.png (added)
-
update.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/gregarius/admin/channels.php
r1766 r1774 232 232 ."&".CST_ADMIN_VIEW."=". CST_ADMIN_DOMAIN_CHANNEL 233 233 ."&action=". CST_ADMIN_EDIT_ACTION. "&cid=$id\">" . __('edit') 234 ."</a>|<a href=\"".$_SERVER['PHP_SELF']. "?".CST_ADMIN_DOMAIN."=". CST_ADMIN_DOMAIN_CHANNEL 234 ."</a>"; 235 if(!getConfig('rss.config.restrictrefresh')) { 236 echo "|<a href=\"".getPath()."update.php?cid=$id\">" . __('update') . "</a>\n"; 237 } 238 echo "|<a href=\"".$_SERVER['PHP_SELF']. "?".CST_ADMIN_DOMAIN."=". CST_ADMIN_DOMAIN_CHANNEL 235 239 ."&".CST_ADMIN_VIEW."=". CST_ADMIN_DOMAIN_CHANNEL 236 240 ."&action=". CST_ADMIN_DELETE_ACTION ."&cid=$id\">" . __('delete') ."</a></td>\n" … … 561 565 // Parse into and OPML object 562 566 $opml=getOpml($url); 563 567 564 568 if (sizeof($opml) > 0) { 565 569 -
trunk/gregarius/cls/update.php
r1629 r1774 32 32 define('NO_NEW_ITEMS', '-'); 33 33 define ('UPDATING','...'); 34 define ('DEFAULT_CID', -1); 34 35 35 36 … … 64 65 var $chans = array (); 65 66 66 function Update($doPopulate = true, $updatePrivateAlso = false ) {67 function Update($doPopulate = true, $updatePrivateAlso = false, $cid = DEFAULT_CID) { 67 68 rss_plugin_hook('rss.plugins.updates.before', null); 68 69 if($doPopulate) { 69 $this->populate($updatePrivateAlso );70 $this->populate($updatePrivateAlso, $cid); 70 71 } 71 72 … … 75 76 } 76 77 77 function populate($updatePrivateAlso = false ) {78 function populate($updatePrivateAlso = false, $cid) { 78 79 $sql = "select c.id, c.url, c.title from ".getTable("channels") . " c " 79 80 . " inner join " . getTable('folders') . " f on f.id = c.parent " … … 83 84 $sql .= " and not(mode & ".RSS_MODE_PRIVATE_STATE.") "; 84 85 } 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 } 91 96 92 97 $res = rss_query($sql); … … 159 164 } 160 165 161 162 166 /** 163 167 * HTTP Server Push update … … 165 169 class HTTPServerPushUpdate extends Update { 166 170 167 function HTTPServerPushUpdate( ) {168 parent::Update( );171 function HTTPServerPushUpdate($cid) { 172 parent::Update($doPopulate = true, $updatePrivateAlso = false, $cid); 169 173 170 174 $GLOBALS['rss']->header->appendHeader("Connection: close"); … … 228 232 } 229 233 230 231 234 /** 232 235 * AJAXUpdate updates feeds via AJAX. It's a bit more server-intesive … … 235 238 class AJAXUpdate extends Update { 236 239 237 function AJAXUpdate( ) {238 parent::Update( );240 function AJAXUpdate($cid) { 241 parent::Update($doPopulate = true, $updatePrivateAlso = false, $cid); 239 242 $GLOBALS['rss']->header->extraHTML .= "<script type=\"text/javascript\" src=\"" 240 243 .getPath()."update.php?js\"></script>\n"; … … 275 278 } 276 279 277 278 279 280 class 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); 282 283 } 283 284 … … 309 310 310 311 class 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 314 316 function render() { 315 317 $newIds = array(); … … 334 336 } 335 337 } 336 337 338 338 339 /** … … 372 373 } 373 374 374 375 376 375 /** 377 376 * SilentUpdate updates the feeds silently for those lame … … 380 379 */ 381 380 class SilentUpdate extends Update { 382 function SilentUpdate( ) {383 parent::Update($doPopulate = false );381 function SilentUpdate($cid) { 382 parent::Update($doPopulate = false, $updatePrivateAlso = false, $cid); 384 383 } 385 384 -
trunk/gregarius/cls/wrappers/feeds.php
r1561 r1774 112 112 } 113 113 114 function rss_feeds_feed_id() { 115 return ($GLOBALS['rss']->currentFeedsFeed-> id); 116 } 117 114 118 function rss_feeds_feed_title_entities() { 115 119 return htmlentities($GLOBALS['rss']->currentFeedsFeed-> title); -
trunk/gregarius/themes/default/web/feedsfeed.php
r1302 r1774 2 2 <?php if($icon = rss_feeds_feed_icon()) { ?> 3 3 <img src="<?php echo $icon; ?>" class="favicon" alt="" /> 4 <?php } ?> 5 <?php if(!getConfig('rss.config.restrictrefresh')) { ?> 6 <?php echo "<a href=\"" . getPath() . "update.php?cid=" . rss_feeds_feed_id() . "\"><img src=\"" . getExternalThemeFile("media/arrow_refresh.png") . "\" width=\"16\" height=\"16\"></a>"; ?> 4 7 <?php } ?> 5 8 <a class="<?php echo rss_feeds_feed_class(); ?>" title="<?php echo rss_feeds_feed_description_entities(); ?>" href="<?php echo rss_feeds_feed_link(); ?>"><?php echo rss_feeds_feed_title(); ?></a> -
trunk/gregarius/update.php
r1581 r1774 28 28 define ('RSS_NO_CACHE',true); 29 29 require_once('init.php'); 30 30 31 $cline = isset($argv) && !$_REQUEST && isset($argc) && $argc; 31 32 if (!$cline && getConfig('rss.config.restrictrefresh')) { … … 41 42 sajax_init(); 42 43 43 44 44 if (array_key_exists('js',$_GET)) { 45 45 header('Content-Type: text/javascript'); … … 52 52 } 53 53 54 55 54 $browser = new Browser(); 56 55 $silent = array_key_exists('silent', $_GET) || ($cline && in_array('--silent',$argv)); 57 56 $newsonly = array_key_exists('newsonly', $_GET) || ($cline && in_array('--newsonly', $argv)); 58 57 $mobile = array_key_exists('mobile',$_GET); 58 59 $cid = DEFAULT_CID; 60 if(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 } 59 70 60 71 $GLOBALS['rss'] -> header = new Header( … … 68 79 $GLOBALS['rss'] -> feedList = new FeedList(false); 69 80 70 71 81 // Instantiate a different Update object, depending on the client 72 82 if ($cline && !$silent && !$newsonly) { 73 $update = new CommandLineUpdate( );83 $update = new CommandLineUpdate($cid); 74 84 75 85 } elseif ($cline && !$silent && $newsonly) { 76 $update = new CommandLineUpdateNews( );86 $update = new CommandLineUpdateNews($cid); 77 87 78 88 } elseif (getConfig('rss.config.serverpush') && !$silent && $browser->supportsServerPush()) { 79 $update = new HTTPServerPushUpdate( );89 $update = new HTTPServerPushUpdate($cid); 80 90 81 91 } elseif(!$silent && $browser->supportsAJAX()) { 82 $update = new AJAXUpdate( );92 $update = new AJAXUpdate($cid); 83 93 84 94 } elseif($mobile) { 85 $update = new MobileUpdate( );95 $update = new MobileUpdate($cid); 86 96 87 97 } else { 88 98 error_reporting(0); 89 $update = new SilentUpdate( );99 $update = new SilentUpdate($cid); 90 100 } 91 101
