diff --git a/e107_plugins/rss_menu/admin_prefs.php b/e107_plugins/rss_menu/admin_prefs.php
index 5f91ccd98..2c5bbf3a1 100644
--- a/e107_plugins/rss_menu/admin_prefs.php
+++ b/e107_plugins/rss_menu/admin_prefs.php
@@ -1,41 +1,36 @@
clear("rss");
}
-//create rss feed
+// Create rss feed
if(isset($_POST['create_rss']))
{
$message = $rss -> dbrss("create");
}
-//update rss feed
+// Update rss feed
if(isset($_POST['update_rss']))
{
$message = $rss -> dbrss("update");
}
-//import rss feed
+// Import rss feed
if(isset($_POST['import_rss']))
{
$message = $rss -> dbrssimport();
}
-//update_limit
+// Update_limit
if(isset($_POST['update_limit']))
{
$message = $rss -> dbrsslimit();
}
-//update options
+// Update options
if(isset($_POST['updatesettings']))
{
$message = $rss->dboptions();
}
-//config check
+// Config check
if($rss->file_check())
{
- $message = RSS_LAN_ERROR_2; // space found in file.
+ $message = RSS_LAN_ERROR_2; // Space found in file.
}
-
-//render message
+// Render message
if(isset($message))
{
$rss->show_message('', $message);
}
-
-//get template
+// Get template
if (is_readable(THEME."rss_template.php"))
{
require_once(THEME."rss_template.php");
@@ -107,8 +100,7 @@ else
require_once(e_PLUGIN."rss_menu/rss_template.php");
}
-
-//listing
+// Listing
if(e_QUERY)
{
$qs = explode(".", e_QUERY);
@@ -117,31 +109,30 @@ $action = varset($qs[0],'list');
$field = varset($qs[1], '');
$feedID = intval(varset($qs[2], 0));
- switch ($action)
- {
- case 'create' :
- if ($_POST)
- { //list
- $rss -> rssadminlist();
- }
- else
- { //create
- $rss -> rssadmincreate($field, $feedID);
- }
- break;
- case 'import' :
- $rss -> rssadminimport();
- break;
- case 'options' :
- $rss -> rssadminoptions();
- break;
- case 'r3' :
- $rss->show_message('', RSS_LAN_ADMIN_31); // Intentionally fall straight through after showing message
- case 'list' :
- default :
+switch ($action)
+{
+ case 'create' :
+ if ($_POST)
+ { // List
$rss -> rssadminlist();
- }
-
+ }
+ else
+ { // Create
+ $rss -> rssadmincreate($field, $feedID);
+ }
+ break;
+ case 'import' :
+ $rss -> rssadminimport();
+ break;
+ case 'options' :
+ $rss -> rssadminoptions();
+ break;
+ case 'r3' :
+ $rss->show_message('', RSS_LAN_ADMIN_31); // Intentionally fall straight through after showing message
+ case 'list' :
+ default :
+ $rss -> rssadminlist();
+}
require_once(e_ADMIN."footer.php");
@@ -169,14 +160,9 @@ function admin_prefs_adminmenu()
}
// ##### End --------------------------------------------------------------------------------------
-
-
-
-
-
class rss
{
- //check for config
+ // Check for config
function file_check()
{
$arrays = file_get_contents(e_BASE."e107_config.php");
@@ -188,8 +174,7 @@ class rss
return FALSE;
}
-
- //admin : list : existing rss feeds
+ // Admin : list : existing rss feeds
function rssadminlist()
{
global $ns, $sql, $tp, $field, $sort, $rss_shortcodes, $row, $RSS_ADMIN_LIST_HEADER, $RSS_ADMIN_LIST_TABLE, $RSS_ADMIN_LIST_FOOTER;
@@ -214,7 +199,7 @@ class rss
}
}
- //create or edit - put up a form
+ // Create or edit - put up a form
function rssadmincreate($action, $id=0)
{
global $ns, $sql, $tp, $rss_shortcodes, $row, $RSS_ADMIN_CREATE_TABLE;
@@ -238,8 +223,7 @@ class rss
$ns->tablerender(RSS_LAN_ADMIN_10, $text);
}
-
- // import - put up the list of possible feeds to import
+ // Import - put up the list of possible feeds to import
function rssadminimport()
{
global $sql, $ns, $i, $tp, $rss_shortcodes, $feed, $pref;
@@ -248,17 +232,17 @@ class rss
$sqli = new db;
$feedlist = array();
- //news
+ // News
$feed['name'] = ADLAN_0;
- $feed['url'] = 'news'; //the identifier for the rss feed url
- $feed['topic_id'] = ''; //the topic_id, empty on default (to select a certain category)
- $feed['path'] = 'news'; //this is the plugin path location
+ $feed['url'] = 'news'; // The identifier for the rss feed url
+ $feed['topic_id'] = ''; // The topic_id, empty on default (to select a certain category)
+ $feed['path'] = 'news'; // This is the plugin path location
$feed['text'] = RSS_PLUGIN_LAN_7;
$feed['class'] = '0';
$feed['limit'] = '9';
$feedlist[] = $feed;
- //news categories
+ // News categories
if($sqli -> db_Select("news_category", "*","category_id!='' ORDER BY category_name "))
{
while($rowi = $sqli -> db_Fetch())
@@ -270,11 +254,12 @@ class rss
$feed['text'] = RSS_PLUGIN_LAN_10.' '.$rowi['category_name'];
$feed['class'] = '0';
$feed['limit'] = '9';
+ // $feed['exclude_class'] = '';
$feedlist[] = $feed;
}
}
- //download
+/* // Download
$feed['name'] = ADLAN_24;
$feed['url'] = 'download';
$feed['topic_id'] = '';
@@ -284,7 +269,7 @@ class rss
$feed['limit'] = '9';
$feedlist[] = $feed;
- //download categories
+ // Download categories
if($sqli -> db_Select("download_category", "*","download_category_id!='' ORDER BY download_category_order "))
{
while($rowi = $sqli -> db_Fetch())
@@ -299,8 +284,8 @@ class rss
$feedlist[] = $feed;
}
}
-
- //comments
+*/
+ // Comments
$feed['name'] = RSS_PLUGIN_LAN_14;
$feed['url'] = 'comments';
$feed['topic_id'] = '';
@@ -310,7 +295,7 @@ class rss
$feed['limit'] = '9';
$feedlist[] = $feed;
- //plugin rss feed, using e_rss.php in plugin folder
+ // Plugin rss feed, using e_rss.php in plugin folder
$plugin_feedlist = array();
foreach($pref['e_rss_list'] as $val)
{
@@ -331,7 +316,7 @@ class rss
$feed['topic_id'] = $tp -> toDB($feed['topic_id']);
$feed['url'] = $tp -> toDB($feed['url']);
- //check if feed is not yet present
+ // Check if feed is not yet present
if(!$sql -> db_Select("rss", "*", "rss_path='".$feed['path']."' AND rss_url='".$feed['url']."' AND rss_topicid='".$feed['topic_id']."' "))
{
$render=TRUE;
@@ -351,8 +336,7 @@ class rss
}
}
-
- // options - display form
+ // Options - display form
function rssadminoptions()
{
global $ns, $sql, $tp, $rss_shortcodes, $row, $RSS_ADMIN_OPTIONS_TABLE;
@@ -362,17 +346,14 @@ class rss
return;
}
-
- //render message
+ // Render message
function show_message($caption='', $text='')
{
global $ns;
$ns -> tablerender($caption, "
$text
");
}
-
-
- //db:create/update
+ // Db:create/update
function dbrss($mode='create')
{
global $sql, $ns, $tp, $e107cache, $admin_log;
@@ -387,7 +368,7 @@ class rss
$rssVals['rss_text'] = $tp -> toDB($_POST['rss_text']);
$rssVals['rss_class'] = (intval($_POST['rss_class']) ? intval($_POST['rss_class']) : '0');
$rssVals['rss_limit'] = intval($_POST['rss_limit']);
-
+ // $rssVals['rss_exclude_class'] = intval($_POST['rss_exclude_class']);
if(isset($_POST['rss_datestamp']) && $_POST['rss_datestamp']!='')
{
$rssVals['rss_datestamp'] = intval($_POST['rss_datestamp']);
@@ -419,8 +400,7 @@ class rss
return $message;
}
-
- //import rss feeds
+ // Import rss feeds
function dbrssimport()
{
global $sql, $tp, $admin_log;
@@ -442,7 +422,6 @@ class rss
}
$message = count($_POST['importid'])." ".RSS_LAN_ADMIN_18;
return $message;
-
}
function dbrsslimit()
@@ -461,7 +440,7 @@ class rss
header("location:".e_SELF."?r3");
}
- //update options
+ // Update options
function dboptions()
{
global $tp, $pref, $admin_log;
@@ -469,6 +448,7 @@ class rss
$temp = array();
$temp['rss_othernews'] = $_POST['rss_othernews'];
$temp['rss_summarydiz'] = $_POST['rss_summarydiz'];
+ $temp['rss_shownewsimage'] = $_POST['rss_shownewsimage'];
if ($admin_log->logArrayDiffs($temp, $pref, 'RSS_06'))
{
save_prefs(); // Only save if changes
@@ -479,9 +459,5 @@ class rss
return RSS_LAN_ADMIN_28;
}
}
-
-
-} //end class
-
-
-?>
+} // End class rss
+?>
\ No newline at end of file
diff --git a/e107_plugins/rss_menu/e_meta.php b/e107_plugins/rss_menu/e_meta.php
index 2cdc20c20..91b760b4f 100644
--- a/e107_plugins/rss_menu/e_meta.php
+++ b/e107_plugins/rss_menu/e_meta.php
@@ -11,28 +11,26 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/rss_menu/e_meta.php,v $
-| $Revision: 1.6 $
-| $Date: 2009-07-19 11:44:29 $
-| $Author: marj_nl_fr $
+| $Revision: 1.7 $
+| $Date: 2009-09-18 19:05:50 $
+| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
global $tp,$PLUGINS_DIRECTORY;
- if($sql->db_Select("rss", "*", "rss_class='0' AND rss_limit>0 ORDER BY rss_name"))
- {
- while($row=$sql->db_Fetch())
+if($sql->db_Select("rss", "*", "rss_class='0' AND rss_limit>0 ORDER BY rss_name"))
+{
+ while($row=$sql->db_Fetch())
+ { // Wildcard topic_id's should not be listed
+ if(strpos($row['rss_url'], "*")===FALSE)
{
- //wildcard topic_id's should not be listed
- if(strpos($row['rss_url'], "*")===FALSE)
- {
- $url = SITEURL.$PLUGINS_DIRECTORY."rss_menu/rss.php?".$tp->toHTML($row['rss_url'], TRUE, 'constants, no_hook, emotes_off').".2";
- $url .= ($row['rss_topicid']) ? ".".$row['rss_topicid'] : "";
- $name = $tp->toHTML($row['rss_name'], TRUE, 'no_hook, emotes_off');
- echo "\n";
- }
+ $url = SITEURL.$PLUGINS_DIRECTORY."rss_menu/rss.php?".$tp->toHTML($row['rss_url'], TRUE, 'constants, no_hook, emotes_off').".2";
+ $url .= ($row['rss_topicid']) ? ".".$row['rss_topicid'] : "";
+ $name = $tp->toHTML($row['rss_name'], TRUE, 'no_hook, emotes_off');
+ echo "\n";
}
}
-
+}
?>
\ No newline at end of file
diff --git a/e107_plugins/rss_menu/languages/English_admin_rss_menu.php b/e107_plugins/rss_menu/languages/English_admin_rss_menu.php
index 24518370c..2d5bbe2a3 100644
--- a/e107_plugins/rss_menu/languages/English_admin_rss_menu.php
+++ b/e107_plugins/rss_menu/languages/English_admin_rss_menu.php
@@ -4,9 +4,9 @@
| e107 website system - Language File.
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/rss_menu/languages/English_admin_rss_menu.php,v $
-| $Revision: 1.1 $
-| $Date: 2008-12-13 12:34:53 $
-| $Author: e107steved $
+| $Revision: 1.2 $
+| $Date: 2009-09-18 19:05:50 $
+| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
@@ -87,7 +87,8 @@ define("RSS_LAN_ADMIN_27", "Uncheck All");
define('RSS_LAN_ADMIN_28', 'Nothing changed - not saved');
define("RSS_LAN_ADMIN_31", 'rss entries limits updated');
-
+define("RSS_LAN_ADMIN_32", "");
+define("RSS_LAN_ADMIN_33", "Show image in News Feed?");
define("RSS_LAN_0", "RSS");
define("RSS_LAN_2", "@nospam.com");
@@ -102,6 +103,4 @@ define('LAN_AL_RSS_04','RSS feed imported');
define('LAN_AL_RSS_05','RSS limits updated');
define('LAN_AL_RSS_06','RSS settings updated');
define('LAN_AL_RSS_07','');
-
-
-?>
+?>
\ No newline at end of file
diff --git a/e107_plugins/rss_menu/plugin.xml b/e107_plugins/rss_menu/plugin.xml
index 600a76d55..a4e33b218 100644
--- a/e107_plugins/rss_menu/plugin.xml
+++ b/e107_plugins/rss_menu/plugin.xml
@@ -1,8 +1,8 @@
-
+
-
+
RSS_PLUGIN_LAN_2
0.8
diff --git a/e107_plugins/rss_menu/rss.php b/e107_plugins/rss_menu/rss.php
index fbd56b8fc..d9af3e684 100644
--- a/e107_plugins/rss_menu/rss.php
+++ b/e107_plugins/rss_menu/rss.php
@@ -3,7 +3,7 @@
+ ----------------------------------------------------------------------------+
| e107 website system
|
-| ©Steve Dunstan 2001-2002
+| �Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/rss_menu/rss.php,v $
-| $Revision: 1.14 $
-| $Date: 2009-08-15 11:55:30 $
-| $Author: marj_nl_fr $
+| $Revision: 1.15 $
+| $Date: 2009-09-18 19:05:50 $
+| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
@@ -28,7 +28,7 @@ Plugins should use an e_rss.php file in their plugin folder
*/
require_once("../../class2.php");
-if (!plugInstalled('rss_menu'))
+if (!e107::isInstalled('rss_menu'))
{
header("Location: ".e_BASE."index.php");
exit;
@@ -45,10 +45,10 @@ if (!is_object($tp->e_bb))
$tp->e_bb = new e_bbcode;
}
-//get language file
+// Get language file
include_lan(e_PLUGIN."rss_menu/languages/".e_LANGUAGE."_admin_rss_menu.php");
-//get template
+// Get template
if (is_readable(THEME."rss_template.php"))
{
require_once(THEME."rss_template.php");
@@ -58,8 +58,7 @@ else
require_once(e_PLUGIN."rss_menu/rss_template.php");
}
-
-//query handler
+// Query handler
if (e_QUERY)
{
$tmp = explode(".", e_QUERY);
@@ -68,7 +67,7 @@ if (e_QUERY)
$topic_id = $tp->toDB($tmp[2],'');
}
-//list available rss feeds
+// List available rss feeds
if (!$rss_type)
{
require_once(HEADERF);
@@ -93,23 +92,23 @@ if (!$rss_type)
exit;
}
-//conversion table for old urls -------
+// Conversion table for old urls -------
$conversion[1] = "news";
$conversion[5] = "comments";
$conversion[10] = "bugtracker";
$conversion[12] = "download";
//-------------------------------------
-//convert certain old urls so we can check the db entries ---------------------
+// Convert certain old urls so we can check the db entries ---------------------
if($topic_id)
-{ //rss.php?1.2.14 (news, rss-2, cat=14)
+{ // Rss.php?1.2.14 (news, rss-2, cat=14)
if(is_numeric($content_type) && isset($conversion[$content_type]) )
{
$content_type = $conversion[$content_type];
}
}
else
-{ //rss.php?1.2 (news, rss-2) --> check = news (check conversion table)
+{ // Rss.php?1.2 (news, rss-2) --> check = news (check conversion table)
if(is_numeric($content_type) && isset($conversion[$content_type]) )
{
$content_type = $conversion[$content_type];
@@ -119,8 +118,7 @@ else
$check_topic = ($topic_id ? " AND rss_topicid = '".$topic_id."' " : "");
if(!$sql -> db_Select("rss", "*", "rss_class!='2' AND rss_url='".$content_type."' ".$check_topic." AND rss_limit>0 "))
-{
- //check if wildcard present for topic_id
+{ // Check if wildcard present for topic_id
$check_topic = ($topic_id ? " AND rss_topicid = '".str_replace($topic_id, "*", $topic_id)."' " : "");
if(!$sql -> db_Select("rss", "*", "rss_class!='2' AND rss_url='".$content_type."' ".$check_topic." AND rss_limit>0 "))
{
@@ -139,24 +137,26 @@ else
$row = $sql->db_Fetch();
}
-//debugging
+// Debugging
//echo $check." - ".$content_type." - ".$rss_type." - ".$topic_id."
";
//exit;
-
// ----------------------------------------------------------------------------
-if($rss = new rssCreate($content_type, $rss_type, $topic_id, $row)){
+if($rss = new rssCreate($content_type, $rss_type, $topic_id, $row))
+{
$rss_title = ($rss->contentType ? $rss->contentType : ucfirst($content_type));
$rss->buildRss ($rss_title);
-}else{
+}
+else
+{
require_once(HEADERF);
$ns->tablerender(RSS_LAN_ERROR_0, RSS_LAN_ERROR_1);
require_once(FOOTERF);
exit;
}
-class rssCreate {
-
+class rssCreate
+{
var $contentType;
var $rssType;
var $path;
@@ -168,8 +168,8 @@ class rssCreate {
var $rssNamespace;
var $rssCustomChannel;
- function rssCreate($content_type, $rss_type, $topic_id, $row) {
- // constructor
+ function rssCreate($content_type, $rss_type, $topic_id, $row)
+ { // Constructor
$sql_rs = new db;
global $tp, $sql, $e107, $PLUGINS_DIRECTORY, $pref, $rssgen;
$this -> path = e_PLUGIN."rss_menu/";
@@ -185,10 +185,11 @@ class rssCreate {
if(strpos($row['rss_path'],'|')!==FALSE){
$tmp = explode("|", $row['rss_path']);
$path = e_PLUGIN.$tmp[0]."/e_rss.php";
- $this -> parm = $tmp[1]; //parm is used in e_rss.php to define which feed you need to prepare
+ $this -> parm = $tmp[1]; // Parm is used in e_rss.php to define which feed you need to prepare
}
- switch ($content_type) {
+ switch ($content_type)
+ {
case 'news' :
case 1:
if($topic_id && is_numeric($topic_id))
@@ -199,6 +200,7 @@ class rssCreate {
{
$topic = '';
}
+
$path='';
$render = ($pref['rss_othernews'] != 1) ? "AND n.news_render_type < 2" : "";
$nobody_regexp = "'(^|,)(".str_replace(",", "|", e_UC_NOBODY).")(,|$)'";
@@ -212,23 +214,30 @@ class rssCreate {
$tmp = $sql->db_getList();
$this -> rssItems = array();
$loop=0;
- foreach($tmp as $value) {
+ foreach($tmp as $value)
+ {
$this -> rssItems[$loop]['title'] = $value['news_title'];
$this -> rssItems[$loop]['link'] = "http://".$_SERVER['HTTP_HOST'].e_HTTP."news.php?item.".$value['news_id'].".".$value['news_category'];
if($value['news_summary'] && $pref['rss_summarydiz'])
{
$this -> rssItems[$loop]['description'] = $value['news_summary'];
- }else{
+ }
+ else
+ {
$this -> rssItems[$loop]['description'] = $value['news_body'];
}
$this -> rssItems[$loop]['author'] = $value['user_name'];
$this -> rssItems[$loop]['author_email'] = $value['user_email'];
$this -> rssItems[$loop]['category'] = "".$value['category_name']."";
- if($value['news_allow_comments'] && $pref['comments_disabled'] != 1){
+ if($value['news_allow_comments'] && $pref['comments_disabled'] != 1)
+ {
$this -> rssItems[$loop]['comment'] = "http://".$_SERVER['HTTP_HOST'].e_HTTP."comment.php?comment.news.".$value['news_id'];
}
$this -> rssItems[$loop]['pubdate'] = $value['news_datestamp'];
+ if($pref['rss_shownewsimage'] == 1 && strlen(trim($value['news_thumbnail'])) > 0) {
+ $this -> rssItems[$loop]['news_thumbnail'] = $value['news_thumbnail'];
+ }
$loop++;
}
@@ -286,7 +295,8 @@ class rssCreate {
break;
case 8:
- if(!$this -> topicid) {
+ if(!$this -> topicid)
+ {
return FALSE;
}
$path = e_PLUGIN."forum/e_rss.php";
@@ -301,7 +311,8 @@ class rssCreate {
$tmp = $sql->db_getList();
$this -> rssItems = array();
$loop=0;
- foreach($tmp as $value) {
+ foreach($tmp as $value)
+ {
$nick = preg_replace("/[0-9]+\./", "", $value['bugtrack2_bugs_poster']);
$this -> rssItems[$loop]['author'] = $nick;
$this -> rssItems[$loop]['title'] = $value['bugtrack2_bugs_summary'];
@@ -313,7 +324,8 @@ class rssCreate {
*/
case 11:
- if(!$this -> topicid) {
+ if(!$this -> topicid)
+ {
return FALSE;
}
$path = e_PLUGIN."forum/e_rss.php";
@@ -321,91 +333,76 @@ class rssCreate {
case download:
case 12:
- if($topic_id && is_numeric($topic_id)){
- $topic = "d.download_category='".intval($topic_id)."' AND ";
- }else{
- $topic = "";
- }
- $path='';
- $class_list = "0,251,252,253";
- $query = "SELECT d.*, dc.* FROM #download AS d LEFT JOIN #download_category AS dc ON d.download_category = dc.download_category_id WHERE {$topic} d.download_active > 0 AND d.download_class IN (".$class_list.") ORDER BY d.download_datestamp DESC LIMIT 0,".$this -> limit;
- $sql -> db_Select_gen($query);
-
- // $sql->db_Select("download", "*", "{$topic} download_active > 0 AND download_class IN (".$class_list.") ORDER BY download_datestamp DESC LIMIT 0,".$this -> limit);
- $tmp = $sql->db_getList();
- $this -> rssItems = array();
- $loop=0;
- foreach($tmp as $value) {
- if($value['download_author']){
- $nick = preg_replace("/[0-9]+\./", "", $value['download_author']);
- $this -> rssItems[$loop]['author'] = $nick;
- }
- $this -> rssItems[$loop]['author_email'] = $value['download_author_email'];
- $this -> rssItems[$loop]['title'] = $value['download_name'];
- $this -> rssItems[$loop]['link'] = $e107->base_path."download.php?view.".$value['download_id'];
- $this -> rssItems[$loop]['description'] = ($rss_type == 3 ? $value['download_description'] : $value['download_description']);
- $this -> rssItems[$loop]['category_name'] = $value['download_category_name'];
- $this -> rssItems[$loop]['category_link'] = $e107->base_path."download.php?list.".$value['download_category_id'];
- $this -> rssItems[$loop]['enc_url'] = $e107->base_path."request.php?".$value['download_id'];
- $this -> rssItems[$loop]['enc_leng'] = $value['download_filesize'];
- $this -> rssItems[$loop]['enc_type'] = $this->getmime($value['download_url']);
- $this -> rssItems[$loop]['pubdate'] = $value['download_datestamp'];
- $loop++;
- }
+ $path = e_PLUGIN."download/e_rss.php";
break;
}
-
- if(isset($path) && $path!=''){
-
- //new rss reader from e_rss.php in plugin folder
- if (is_readable($path)) {
+ if(isset($path) && $path!='')
+ { // New rss reader from e_rss.php in plugin folder
+ if (is_readable($path))
+ {
require_once($path);
- foreach($eplug_rss_data as $key=>$rs){
- foreach($rs as $k=>$row){
+ foreach($eplug_rss_data as $key=>$rs)
+ {
+ foreach($rs as $k=>$row)
+ {
$this -> rssItems[$k]['author'] = $row['author'];
$this -> rssItems[$k]['author_email'] = $row['author_email'];
$this -> rssItems[$k]['title'] = $row['title'];
- if($row['link']){
- if(eregi("http",$row['link'])){
+ if($row['link'])
+ {
+ if(eregi("http",$row['link']))
+ {
$this -> rssItems[$k]['link'] = $row['link'];
- }else{
+ }
+ else
+ {
$this -> rssItems[$k]['link'] = $e107->base_path.$PLUGINS_DIRECTORY.$row['link'];
}
}
$this -> rssItems[$k]['description'] = $row['description'];
- if($row['enc_url']){
+ if($row['enc_url'])
+ {
$this -> rssItems[$k]['enc_url'] = $e107->base_path.$PLUGINS_DIRECTORY.$enc_url.$row['item_id'];
}
- if($row['enc_leng']){
+ if($row['enc_leng'])
+ {
$this -> rssItems[$k]['enc_leng'] = $row['enc_leng'];
}
- if($eplug_rss['enc_type']){
+ if($eplug_rss['enc_type'])
+ {
$this -> rssItems[$k]['enc_type'] = $this->getmime($eplug_rss['enc_type']);
- }elseif($row['enc_type']){
+ }
+ elseif($row['enc_type'])
+ {
$this -> rssItems[$k]['enc_type'] = $row['enc_type'];
}
$this -> rssItems[$k]['category_name'] = $row['category_name'];
- if($row['category_link']){
- if(eregi("http",$row['category_link'])){
+ if($row['category_link'])
+ {
+ if(eregi("http",$row['category_link']))
+ {
$this -> rssItems[$k]['category_link'] = $row['category_link'];
- }else{
+ }
+ else
+ {
$this -> rssItems[$k]['category_link'] = $e107->base_path.$PLUGINS_DIRECTORY.$row['category_link'];
}
}
- if($row['datestamp']){
+ if($row['datestamp'])
+ {
$this -> rssItems[$k]['pubdate'] = $row['datestamp'];
}
}
}
}
}
-
}
- function buildRss($rss_title) {
+ function buildRss($rss_title)
+ {
global $sql, $pref, $tp, $e107, $PLUGINS_DIRECTORY;
header('Content-type: application/xml', TRUE);
@@ -413,8 +410,9 @@ class rssCreate {
$rss_namespace = ($this->rssNamespace) ? "xmlns:".$this->rssNamespace : "";
$rss_custom_channel = ($this->rssCustomChannel) ? $this->rssCustomChannel : "";
$time = time();
- switch ($this -> rssType) {
- case 1: // Rss 1.0
+ switch ($this -> rssType)
+ {
+ case 1: // RSS 1.0
echo "
@@ -427,15 +425,20 @@ class rssCreate {
http://backend.userland.com/rss092\n";
foreach($this -> rssItems as $value)
- {
-
- // Multi-language rss links.
+ { // Multi-language rss links.
$link = (e_LANQRY) ? str_replace("?","?".e_LANQRY,$value['link']) : $value['link'];
echo "
-
".$tp->toRss($value['title'])."
- ".substr($tp->toRss($value['description']),0,150)."
+ ".substr($tp->toRss($value['description']),0,150);
+ if($pref['rss_shownewsimage'] == 1 && strlen(trim($value['news_thumbnail'])) > 0)
+ {
+ $news_thumbnail = SITEURLBASE.e_IMAGE_ABS."newspost_images/".$tp->toRss($value['news_thumbnail']);
+ echo "<a href="".$link.""><img src="".$news_thumbnail."" height="50" border="0" hspace="10" vspace="10" align="right"></a>";
+ unset($news_thumbail);
+ }
+ echo "
".$value['author']."<".$this->nospam($value['author_email']).">
".$link."
";
@@ -445,8 +448,8 @@ class rssCreate {
";
break;
- case 2: // rss 2.0
- $sitebutton = (strstr(SITEBUTTON, "http:") ? SITEBUTTON : SITEURL.str_replace("../", "", e_IMAGE).SITEBUTTON);
+ case 2: // RSS 2.0
+ $sitebutton = (strstr(SITEBUTTON, "http:") ? SITEBUTTON : SITEURL.str_replace("../", "", SITEBUTTON));
echo "
@@ -473,7 +476,7 @@ class rssCreate {
echo "
".$tp->toRss($rss_title)."
- ".(strstr(SITEBUTTON, "http:") ? SITEBUTTON : SITEURL.str_replace("../", "", e_IMAGE).SITEBUTTON)."
+ ".(strstr(SITEBUTTON, "http:")!==FALSE ? SITEBUTTON : SITEURL.str_replace("../", "",SITEBUTTON))."
".$pref['siteurl']."
88
31
@@ -482,8 +485,8 @@ class rssCreate {
}
// Generally Ignored by 99% of readers.
- /*
- echo "
+ /*
+ echo "
Search
Search ".$tp->toRss($pref['sitename'])."
@@ -493,8 +496,7 @@ class rssCreate {
*/
foreach($this -> rssItems as $value)
- {
- // Multi-language rss links.
+ { // Multi-language rss links.
$link = (e_LANQRY) ? str_replace("?","?".e_LANQRY,$value['link']) : $value['link'];
$catlink = (e_LANQRY) ? str_replace("?","?".e_LANQRY,$value['category_link']) : $value['category_link'];
@@ -502,45 +504,57 @@ class rssCreate {
-
".$tp->toRss($value['title'])."\n";
- if($link){
+ if($link)
+ {
echo "".$link."\n";
}
- echo "".$tp->toRss($value['description'],TRUE)."\n";
-
- if($value['category_name'] && $catlink){
+ echo "".$tp->toRss($value['description'],TRUE);
+ if($pref['rss_shownewsimage'] == 1 && strlen(trim($value['news_thumbnail'])) > 0)
+ {
+ $news_thumbnail = SITEURLBASE.e_IMAGE_ABS."newspost_images/".$tp->toRss($value['news_thumbnail']);
+ echo "<a href="".$link.""><img src="".$news_thumbnail."" height="50" border="0" hspace="10" vspace="10" align="right"></a>";
+ unset($news_thumbail);
+ }
+ echo "\n";
+
+ if($value['category_name'] && $catlink)
+ {
echo "".$tp -> toRss($value['category_name'])."\n";
}
- if($value['comment']){
- //echo "".$tp->toRss($value['comment'])."\n";
+ if($value['comment'])
+ {
echo "".$value['comment']."\n";
}
- if($value['author']){
+ if($value['author'])
+ {
echo "".$this->nospam($value['author_email'])." (".$value['author'].")\n";
}
- // enclosure support for podcasting etc.
- if($value['enc_url'] && $value['enc_leng'] && $value['enc_type']){
+ // Enclosure support for podcasting etc.
+ if($value['enc_url'] && $value['enc_leng'] && $value['enc_type'])
+ {
echo "\n";
}
echo "".date("r", ($value['pubdate'] + $this -> offset))."\n";
- if($link){
+ if($link)
+ {
echo "".$link."\n";
}
echo "
";
}
- // echo " contentType).".4.".$this -> topicId ."\" rel=\"self\" type=\"application/rss+xml\" />";
+ // echo " contentType).".4.".$this -> topicId ."\" rel=\"self\" type=\"application/rss+xml\" />";
echo "
";
break;
- case 3: // rdf
+ case 3: // RDF
echo "
@@ -561,9 +575,7 @@ class rssCreate {
";
foreach($this -> rssItems as $value)
- {
-
- // Multi-language rss links.
+ { // Multi-language rss links.
$link = (e_LANQRY) ? str_replace("?","?".e_LANQRY,$value['link']) : $value['link'];
echo "
@@ -578,10 +590,8 @@ class rssCreate {
reset($this -> rssItems);
unset($link);
foreach($this -> rssItems as $value)
- {
-
- // Multi-language rss links.
- $link = (e_LANQRY) ? str_replace("?","?".e_LANQRY,$value['link']) : $value['link'];
+ {
+ $link = (e_LANQRY) ? str_replace("?","?".e_LANQRY,$value['link']) : $value['link']; // Multi-language rss links.
echo "
-
@@ -590,31 +600,37 @@ class rssCreate {
".$this->get_iso_8601_date($time + $this -> offset)."
".$value['author']."
".$tp->toRss($value['category_name'])."
- ".$tp->toRss($value['description'])."
+ ".$tp->toRss($value['description']);
+ if($pref['rss_shownewsimage'] == 1 && strlen(trim($value['news_thumbnail'])) > 0)
+ {
+ $news_thumbnail = SITEURLBASE.e_IMAGE_ABS."newspost_images/".$tp->toRss($value['news_thumbnail']);
+ echo "<a href="".$link.""><img src="".$news_thumbnail."" height="50" border="0" hspace="10" vspace="10" align="right"></a>";
+ unset($news_thumbail);
+ }
+ echo "
";
}
echo "
";
break;
- //new feed for atom - still in development, and not yet tested
+ // Atom
case 4:
echo "\n
\n";
/*
\n";
- */
-
- //required
+ xmlns='http://purl.org/atom/ns#'
+ xmlns:dc='http://purl.org/dc/elements/1.1/'
+ xml:lang='".CORE_LC.(defined("CORE_LC2") ? "-".CORE_LC2 : "")."'>\n";
+ */
+ // Required
echo "
".$pref['siteurl']."\n
".$tp->toRss($rss_title)."\n
".$this->get_iso_8601_date($time + $this -> offset)."\n";
- //recommended
+ // Recommended
echo "
\n
e107\n";
@@ -624,7 +640,7 @@ class rssCreate {
\n
\n";
- //optional
+ // Optional
include(e_ADMIN."ver.php");
echo "
\n
@@ -634,7 +650,7 @@ class rssCreate {
e107\n";
///icon.jpg\n
echo "
- ".(strstr(SITEBUTTON, "http:") ? SITEBUTTON : SITEURL.str_replace("../", "", e_IMAGE).SITEBUTTON)."\n
+ ".(strstr(SITEBUTTON, "http:") ? SITEBUTTON : SITEURL.str_replace("../", "", SITEBUTTON))."\n
".$pref['siteadmin']." - ".$this->nospam($pref['siteadminemail'])."\n";
if($pref['sitedescription']){
echo "
@@ -644,13 +660,13 @@ class rssCreate {
echo "
\n";
- //required
+ // Required
echo "
".$value['link']."\n
".$tp->toRss($value['title'])."\n
".$this->get_iso_8601_date($value['pubdate'] + $this -> offset)."\n";
- //recommended
+ // Recommended
$author = ($value['author']) ? $value['author'] : "unknown";
echo "
@@ -662,9 +678,16 @@ class rssCreate {
//complete story here\n
echo "
\n
- ".$tp->toRss($value['description'])."\n";
-
- //optional
+ ".$tp->toRss($value['description']);
+ if($pref['rss_shownewsimage'] == 1 && strlen(trim($value['news_thumbnail'])) > 0)
+ {
+ $news_thumbnail = SITEURLBASE.e_IMAGE_ABS."newspost_images/".$tp->toRss($value['news_thumbnail']);
+ echo "<a href="".$value['link'].""><img src="".$news_thumbnail."" height="50" border="0" hspace="10" vspace="10" align="right"></a>";
+ unset($news_thumbail);
+ }
+ echo "\n";
+
+ // Optional
if($value['category_name']){
echo "\n";
}
@@ -676,7 +699,7 @@ class rssCreate {
// http://example.org/
// Fourty-Two
// 2003-12-13T18:30:02Z
- // © 2005 Example, Inc.
+ // � 2005 Example, Inc.
//
//© 2005 John Doe
echo "
@@ -684,19 +707,19 @@ class rssCreate {
}
echo "
\n";
-
break;
}
}
- function getmime($file){
+ function getmime($file)
+ {
$ext = strtolower(str_replace(".","",strrchr(basename($file), ".")));
$mime["mp3"] = "audio/mpeg";
return $mime[$ext];
}
- function get_iso_8601_date($int_date) {
- //$int_date: current date in UNIX timestamp
+ function get_iso_8601_date($int_date)
+ { //$int_date: current date in UNIX timestamp
$date_mod = date('Y-m-d\TH:i:s', $int_date);
$pre_timezone = date('O', $int_date);
$time_zone = substr($pre_timezone, 0, 3).":".substr($pre_timezone, 3, 2);
@@ -704,11 +727,10 @@ class rssCreate {
return $date_mod;
}
- function nospam($text){
+ function nospam($text)
+ {
$tmp = explode("@",$text);
return ($tmp[0] != "") ? $tmp[0].RSS_LAN_2 : RSS_LAN_3;
}
-
-}
-
-?>
+} // End class rssCreate
+?>
\ No newline at end of file
diff --git a/e107_plugins/rss_menu/rss_menu.php b/e107_plugins/rss_menu/rss_menu.php
index 77d011be1..61fc4cfc1 100644
--- a/e107_plugins/rss_menu/rss_menu.php
+++ b/e107_plugins/rss_menu/rss_menu.php
@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/rss_menu/rss_menu.php,v $
-| $Revision: 1.4 $
-| $Date: 2009-08-15 11:55:30 $
-| $Author: marj_nl_fr $
+| $Revision: 1.5 $
+| $Date: 2009-09-18 19:05:50 $
+| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
@@ -29,38 +29,41 @@ include_lan(e_PLUGIN."rss_menu/languages/".e_LANGUAGE."_admin_rss_menu.php");
$des = "";
$topic = "";
-if(strstr(e_SELF, "comment.php") && $sql -> db_Select("rss", "rss_path", " rss_path = 'comments' LIMIT 1")) {
+if(strstr(e_SELF, "comment.php") && $sql -> db_Select("rss", "rss_path", " rss_path = 'comments' LIMIT 1"))
+{
$type = 5;
$des = RSS_MENU_L4;
}
-if(strstr(e_SELF, "/forum")&& $sql -> db_Select("rss", "rss_path", " rss_path = 'forum|name' LIMIT 1") ) {
+if(strstr(e_SELF, "/forum")&& $sql -> db_Select("rss", "rss_path", " rss_path = 'forum|name' LIMIT 1") )
+{
$type = 6;
$des = RSS_MENU_L5;
}
-if(strstr(e_SELF, "forum_viewtopic") && $sql -> db_Select("rss", "rss_path", " rss_path = 'forum|topic' LIMIT 1")) {
+if(strstr(e_SELF, "forum_viewtopic") && $sql -> db_Select("rss", "rss_path", " rss_path = 'forum|topic' LIMIT 1"))
+{
$type = 7;
$des = RSS_MENU_L6;
}
-if(strstr(e_SELF, "chat.php")&& $sql -> db_Select("rss", "rss_path", " rss_path = 'chatbox_menu' LIMIT 1")) {
+if(strstr(e_SELF, "chat.php")&& $sql -> db_Select("rss", "rss_path", " rss_path = 'chatbox_menu' LIMIT 1"))
+{
$type = 9;
$des = RSS_MENU_L7;
}
-
-if(strstr(e_SELF, "/bugtracker")) {
+if(strstr(e_SELF, "/bugtracker"))
+{
$type = 10;
$des = RSS_MENU_L8;
}
-
-if(strstr(e_SELF, "download.php") && $sql -> db_Select("rss", "rss_path", " rss_path = 'download' LIMIT 1")) {
+if(strstr(e_SELF, "download.php") && $sql -> db_Select("rss", "rss_path", " rss_path = 'download' LIMIT 1"))
+{
$type = 12;
$des = RSS_MENU_L9;
}
-
-if(!$des) {
+if(!$des)
+{
$type = 1;
$des = RSS_MENU_L3;
}
-
if(e_PAGE == "news.php" && $pref['rss_newscats'])
{
@@ -77,8 +80,9 @@ $text = "



+
";
$caption = (file_exists(THEME."images/RSS_menu.png") ? "
".RSS_MENU_L2 : RSS_MENU_L2);
-
$ns->tablerender($caption, $text, 'backend');
+?>
\ No newline at end of file
diff --git a/e107_plugins/rss_menu/rss_shortcodes.php b/e107_plugins/rss_menu/rss_shortcodes.php
index 293b23d27..fdcb11d2c 100644
--- a/e107_plugins/rss_menu/rss_shortcodes.php
+++ b/e107_plugins/rss_menu/rss_shortcodes.php
@@ -1,11 +1,10 @@
e_sc -> parse_scbatch(__FILE__);
/*
-
SC_BEGIN RSS_FEED
global $row, $tp;
$url2 = e_PLUGIN."rss_menu/rss.php?".e_LANQRY.$tp->toHTML($row['rss_url'], TRUE, 'constants').".2".($row['rss_topicid'] ? ".".$row['rss_topicid'] : '');
@@ -39,9 +38,7 @@ $text = "
return $text;
SC_END
-
//##### ADMIN --------------------------------------------------
-
SC_BEGIN RSS_ADMIN_CAPTION
global $sort;
list($field,$txt) = explode(",",$parm);
@@ -95,8 +92,6 @@ $options = "
return $options;
SC_END
-
-
SC_BEGIN RSS_ADMIN_FORM_NAME
global $row;
return "\n";
@@ -126,7 +121,8 @@ SC_BEGIN RSS_ADMIN_FORM_CLASS
global $row;
$vals = array(RSS_LAN_ADMIN_21,RSS_LAN_ADMIN_22,RSS_LAN_ADMIN_23);
$text = "