Changeset 1783
- Timestamp:
- 02/10/08 14:19:07 (10 months ago)
- Files:
-
- 1 modified
-
trunk/gregarius/plugins/rssview.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/gregarius/plugins/rssview.php
r1782 r1783 31 31 /// Description: Adds a RSS link to the header and the footer of each page 32 32 /// Version: 0.7 33 /// Configuration: __rss_view_config34 33 35 34 /** … … 39 38 * 0.6 - Don't put a link in admin and other locations 40 39 * 0.7 - Show ATOM link as well. 41 * 0.8 - Add configurable output count.42 40 */ 43 44 define ('RSSVIEW_CONFIG_OUTPUTCOUNT', 'rssview.outputcount');45 define ('RSSVIEW_DEFAULT_COUNT', 10);46 47 function __rss_view_config () {48 $cnt = rss_plugins_get_option(RSSVIEW_CONFIG_OUTPUTCOUNT);49 50 if(empty($cnt)) {51 $cnt = RSSVIEW_DEFAULT_COUNT;52 }53 54 if(rss_plugins_is_submit()) {55 if(!empty($_REQUEST['rv_oc'])) {56 $cnt = $_REQUEST['rv_oc'];57 }58 59 rss_plugins_add_option(RSSVIEW_CONFIG_OUTPUTCOUNT, $cnt, 'num');60 return;61 }62 63 print ("<fieldset>\n");64 print (" <legend>" . __('Output Count') . "</legend>\n");65 print (" <p><label for='rv_oc'>" . __('Count') . "</label></br>");66 print (" <input id='rv_oc' type='text' value='" . $cnt . "' name='rv_oc'></p>\n");67 print ("</fieldset>\n");68 }69 41 70 42 function __rss_view_url($type = "rss") { … … 72 44 $url .= $_SERVER["REQUEST_URI"]; 73 45 74 $cnt = rss_plugins_get_option(RSSVIEW_CONFIG_OUTPUTCOUNT);75 76 if(empty($cnt)) {77 $cnt = RSSVIEW_DEFAULT_COUNT;78 }79 80 46 if (strstr($_SERVER['REQUEST_URI'],"?") !== FALSE) { 81 $url .= "&media=$type& count=$cnt";47 $url .= "&media=$type&"; 82 48 } else { 83 $url .= "?media=$type &count=$cnt";49 $url .= "?media=$type"; 84 50 } 85 51 $url .= __rss_view_post2get();
