Changeset 1781
- Timestamp:
- 02/03/08 15:01:38 (10 months ago)
- Files:
-
- 1 modified
-
trunk/gregarius/plugins/rssview.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/gregarius/plugins/rssview.php
r1732 r1781 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_config 33 34 34 35 /** … … 38 39 * 0.6 - Don't put a link in admin and other locations 39 40 * 0.7 - Show ATOM link as well. 41 * 0.8 - Add configurable output count. 40 42 */ 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 } 41 69 42 70 function __rss_view_url($type = "rss") { … … 44 72 $url .= $_SERVER["REQUEST_URI"]; 45 73 74 $cnt = rss_plugins_get_option(RSSVIEW_CONFIG_OUTPUTCOUNT); 75 76 if(empty($cnt)) { 77 $cnt = RSSVIEW_DEFAULT_COUNT; 78 } 79 46 80 if (strstr($_SERVER['REQUEST_URI'],"?") !== FALSE) { 47 $url .= "&media=$type ";81 $url .= "&media=$type&count=$cnt"; 48 82 } else { 49 $url .= "?media=$type ";83 $url .= "?media=$type&count=$cnt"; 50 84 } 51 85 $url .= __rss_view_post2get();
