Changeset 1762
- Timestamp:
- 10/17/07 22:58:01 (14 months ago)
- Location:
- trunk/gregarius
- Files:
-
- 4 modified
-
admin/channels.php (modified) (5 diffs)
-
extlib/rss_dbcache.inc (modified) (2 diffs)
-
schema.php (modified) (1 diff)
-
util.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/gregarius/admin/channels.php
r1748 r1762 489 489 // Delete properties 490 490 deleteProperty($id,'rss.input.allowupdates'); 491 492 deleteProperty($id,'rss.config.refreshinterval'); 491 493 492 494 // Invalidate cache … … 647 649 $old_priv = ($_POST['old_priv'] == '1'); 648 650 649 650 651 // Feed Properties 651 652 $prop_rss_input_allowupdates = rss_real_escape_string($_POST['prop_rss_input_allowupdates']); … … 655 656 setProperty($cid, 'rss.input.allowupdates' , 'feed', ($prop_rss_input_allowupdates == 1)); 656 657 } 657 658 659 deleteProperty($cid, 'rss.config.refreshinterval'); 660 661 $rss_config_refreshinterval = rss_real_escape_string($_POST['rss_config_refreshinterval']); 662 if($rss_config_refreshinterval > 60) { 663 setProperty($cid, 'rss.config.refreshinterval', 'feed', $rss_config_refreshinterval); 664 } 658 665 659 666 if ($priv != $old_priv) { … … 905 912 if(!empty($daterefreshed)) { 906 913 echo "<p><label>" . __('Added') . ": " . date("M-d-Y H:i", strtotime($dateadded)) . "</label></p>" 907 ."<p><label>" . __('Last Update') . ": ".date("M-d-Y H:i", strtotime($daterefreshed))." </label></p>\n";914 ."<p><label>" . __('Last Update') . ": ".date("M-d-Y H:i", strtotime($daterefreshed))." (Age: " . round(((time() - strtotime($daterefreshed))/60)) . " minutes)</label></p>\n"; 908 915 } else { 909 916 echo "<p><label>" . __('Added') . ": " . date("M-d-Y H:i", strtotime($dateadded)) . "</label></p>" … … 1039 1046 1040 1047 ."</p>\n"; 1048 1049 echo "<p>" 1050 ."<span style=\"float:left;\">Refresh Interval (minutes): </span>" 1051 ." " 1052 ."</p>"; 1053 1054 $rss_config_refreshinterval_default_current = getProperty($cid, 'rss.config.refreshinterval'); 1055 1056 echo "<p id=\"rss_config_refreshinterval_options\">" 1057 ."<input type=\"text\" id=\"rss_config_refreshinterval\" name=\"rss_config_refreshinterval\" value=\"" . (true == empty($rss_config_refreshinterval_default_current) ? 60 : $rss_config_refreshinterval_default_current) . "\">" 1058 ."</p>"; 1041 1059 echo "</fieldset>\n"; 1042 1060 1043 1061 1044 echo "<p style=\"clear:both; padding: 1em 0\"><input type=\"submit\" name=\"action_\" value=\"". __('Submit Changes') ."\" /></p>";1062 echo "<p style=\"clear:both; padding: 1em 0\"><input type=\"submit\" name=\"action_\" value=\"". __('Submit Changes') ."\" /></p>"; 1045 1063 1046 1064 echo "</form></div>\n"; -
trunk/gregarius/extlib/rss_dbcache.inc
r1534 r1762 109 109 } 110 110 111 $res = rss_query("select UNIX_TIMESTAMP(daterefreshed) as ts , refreshintervalfrom " . getTable("channels")111 $res = rss_query("select UNIX_TIMESTAMP(daterefreshed) as ts from " . getTable("channels") 112 112 . " where id=$cid"); 113 113 if ( ! $res ) { … … 116 116 } 117 117 118 list($dateRefreshed, $refreshInterval) = rss_fetch_row($res); 119 120 // Lets hope that the web server and sql server have their clocks in sync 118 list($dateRefreshed) = rss_fetch_row($res); 119 $refreshInterval = getProperty($cid, 'rss.config.refreshinterval'); 120 if(true == empty($refreshInterval)) { 121 $refreshInterval = 60; 122 } 123 124 // Lets hope that the web server and sql server have their clocks in sync 121 125 $age = time() - $dateRefreshed; 126 122 127 if (!$refreshInterval || ($refreshInterval < 10)) { 123 128 // We should change the Gregarius UA if we allow refreshInterval to be small -
trunk/gregarius/schema.php
r1725 r1762 144 144 // date feed was last refreshed, added in 0.5.3 145 145 rss_query('alter table ' .getTable('channels') .' add column daterefreshed datetime null default 1'); 146 if (rss_is_sql_error(RSS_SQL_ERROR_NO_ERROR)) {147 $updated++;148 rss_error("updated schema for table " . getTable('channels'), RSS_ERROR_NOTICE);149 } else {150 rss_error("Failed updating schema for table " . getTable('channels')151 .": " . rss_sql_error_message(), RSS_ERROR_ERROR152 );153 }154 // break; - fallthrough allowed on purpose because these are added at the same time155 case 'c.refreshinterval':156 case 'refreshinterval':157 // refresh interval of a feed (in minutes), added in 0.5.3158 rss_query('alter table ' .getTable('channels') .' add column refreshinterval int(16) not null default 60');159 146 if (rss_is_sql_error(RSS_SQL_ERROR_NO_ERROR)) { 160 147 $updated++; -
trunk/gregarius/util.php
r1730 r1762 456 456 $np = "0"; 457 457 } 458 458 459 459 // Here we go! 460 460 //error_reporting(E_ALL); … … 463 463 error_reporting($old_level); 464 464 465 466 465 if ($rss) { 467 466 if ($title_) { … … 484 483 $siteurl = ""; 485 484 } 485 486 $refreshinterval = 0; 487 if(is_object($rss) && array_key_exists('syn', $rss->channel)) { 488 $syn = $rss->channel['syn']; 489 490 if(array_key_exists('updateperiod', $syn)) { 491 if("hourly" == $syn['updateperiod']) { 492 if(array_key_exists('updatefrequency', $syn)) { 493 $refreshinterval = 60 * $syn['updatefrequency']; 494 } 495 } 496 } 497 } 486 498 487 499 if ($descr_) { … … 546 558 __exp__submitTag($newid,$tags,"'channel'"); 547 559 } 560 561 if(false == empty($refreshinterval)) { 562 setProperty($newid, 'rss.config.refreshinterval', $refreshinterval); 563 } 548 564 549 565 return array ($newid, "");
