mirror of
https://github.com/e107inc/e107.git
synced 2025-07-30 19:30:25 +02:00
RSS display news image feature added (thanks nlstart) and some fixes.
This commit is contained in:
@@ -1,41 +1,36 @@
|
||||
<?php
|
||||
/*
|
||||
+ ----------------------------------------------------------------------------+
|
||||
| e107 website system
|
||||
|
|
||||
| <EFBFBD>Steve Dunstan 2001-2002
|
||||
| http://e107.org
|
||||
| jalist@e107.org
|
||||
|
|
||||
| Released under the terms and conditions of the
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/rss_menu/admin_prefs.php,v $
|
||||
| $Revision: 1.6 $
|
||||
| $Date: 2009-08-15 11:55:30 $
|
||||
| $Author: marj_nl_fr $
|
||||
+----------------------------------------------------------------------------+
|
||||
+ ----------------------------------------------------------------------------+
|
||||
| e107 website system
|
||||
|
|
||||
| Copyright (c) e107 Inc. 2001-2009
|
||||
| http://e107.org
|
||||
|
|
||||
| Released under the terms and conditions of the
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/rss_menu/admin_prefs.php,v $
|
||||
| $Revision: 1.7 $
|
||||
| $Date: 2009-09-18 19:05:49 $
|
||||
| $Author: e107coders $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
/*
|
||||
Notes:
|
||||
|
||||
- array_flip method deprecated for delete item detection.
|
||||
- using form handler is deprecated and present only for backwards compatibility.
|
||||
- using generic terms like EDIT and DELETE in Language file is deprecated, use LAN_EDIT etc. instead.
|
||||
- using terms like created, update, options etc..deprecated should use built in terms.
|
||||
- generic admin icons used. ADMIN_ICON_EDIT etc.
|
||||
- using $caption = "whatever", is unneccessary.
|
||||
|
||||
*/
|
||||
|
||||
require_once("../../class2.php");
|
||||
if(!getperms("P") || !plugInstalled('rss_menu'))
|
||||
if(!getperms("P") || !e107::isInstalled('rss_menu'))
|
||||
{
|
||||
header("location:".e_BASE."index.php");
|
||||
}
|
||||
|
||||
include_lan(e_PLUGIN."rss_menu/languages/".e_LANGUAGE."_admin_rss_menu.php");
|
||||
|
||||
require_once(e_ADMIN."auth.php");
|
||||
|
||||
$imagedir = e_IMAGE."admin_images/";
|
||||
@@ -44,7 +39,7 @@ $rss = new rss;
|
||||
|
||||
global $tp;
|
||||
|
||||
//delete entry
|
||||
// Delete entry
|
||||
if(isset($_POST['delete']))
|
||||
{
|
||||
$d_idt = array_keys($_POST['delete']);
|
||||
@@ -53,51 +48,49 @@ if(isset($_POST['delete']))
|
||||
$e107cache->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, "<div style='text-align:center'><b>$text</b></div>");
|
||||
}
|
||||
|
||||
|
||||
|
||||
//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
|
||||
?>
|
@@ -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 "<link rel='alternate' type='application/rss+xml' title='".htmlspecialchars(SITENAME, ENT_QUOTES, 'utf-8')." ".htmlspecialchars($name, ENT_QUOTES, 'utf-8')."' href='".$url."' />\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 "<link rel='alternate' type='application/rss+xml' title='".htmlspecialchars(SITENAME, ENT_QUOTES, 'utf-8')." ".htmlspecialchars($name, ENT_QUOTES, 'utf-8')."' href='".$url."' />\n";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
@@ -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','');
|
||||
|
||||
|
||||
?>
|
||||
?>
|
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- $Id: plugin.xml,v 1.4 2009-07-17 14:41:54 marj_nl_fr Exp $ -->
|
||||
<!-- $Id: plugin.xml,v 1.5 2009-09-18 19:05:50 e107coders Exp $ -->
|
||||
|
||||
<e107Plugin name="RSS_PLUGIN_LAN_1" version="1.1" compatibility="0.8" installRequired="true">
|
||||
<e107Plugin name="RSS_PLUGIN_LAN_1" version="1.3" compatibility="0.8" installRequired="true">
|
||||
<author name="e107 Inc." url="http://e107.org" />
|
||||
<description>RSS_PLUGIN_LAN_2</description>
|
||||
<compatibility>0.8</compatibility>
|
||||
|
@@ -3,7 +3,7 @@
|
||||
+ ----------------------------------------------------------------------------+
|
||||
| e107 website system
|
||||
|
|
||||
| <20>Steve Dunstan 2001-2002
|
||||
| <20>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."<br />";
|
||||
//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'] = "<category domain='".SITEURL."news.php?cat.".$value['news_category']."'>".$value['category_name']."</category>";
|
||||
|
||||
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 "<?xml version=\"1.0\" encoding=\"utf-8\" ?>
|
||||
<!-- generator=\"e107\" -->
|
||||
<!-- content type=\"".$this -> contentType."\" -->
|
||||
@@ -427,15 +425,20 @@ class rssCreate {
|
||||
<docs>http://backend.userland.com/rss092</docs>\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 "
|
||||
<item>
|
||||
<title>".$tp->toRss($value['title'])."</title>
|
||||
<description>".substr($tp->toRss($value['description']),0,150)."</description>
|
||||
<description>".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 "</description>
|
||||
<author>".$value['author']."<".$this->nospam($value['author_email'])."></author>
|
||||
<link>".$link."</link>
|
||||
</item>";
|
||||
@@ -445,8 +448,8 @@ class rssCreate {
|
||||
</rss>";
|
||||
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 "<?xml version=\"1.0\" encoding=\"utf-8\"?>
|
||||
<!-- generator=\"e107\" -->
|
||||
<!-- content type=\"".$this -> contentType."\" -->
|
||||
@@ -473,7 +476,7 @@ class rssCreate {
|
||||
echo "
|
||||
<image>
|
||||
<title>".$tp->toRss($rss_title)."</title>
|
||||
<url>".(strstr(SITEBUTTON, "http:") ? SITEBUTTON : SITEURL.str_replace("../", "", e_IMAGE).SITEBUTTON)."</url>
|
||||
<url>".(strstr(SITEBUTTON, "http:")!==FALSE ? SITEBUTTON : SITEURL.str_replace("../", "",SITEBUTTON))."</url>
|
||||
<link>".$pref['siteurl']."</link>
|
||||
<width>88</width>
|
||||
<height>31</height>
|
||||
@@ -482,8 +485,8 @@ class rssCreate {
|
||||
}
|
||||
|
||||
// Generally Ignored by 99% of readers.
|
||||
/*
|
||||
echo "
|
||||
/*
|
||||
echo "
|
||||
<textInput>
|
||||
<title>Search</title>
|
||||
<description>Search ".$tp->toRss($pref['sitename'])."</description>
|
||||
@@ -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 {
|
||||
<item>
|
||||
<title>".$tp->toRss($value['title'])."</title>\n";
|
||||
|
||||
if($link){
|
||||
if($link)
|
||||
{
|
||||
echo "<link>".$link."</link>\n";
|
||||
}
|
||||
|
||||
echo "<description>".$tp->toRss($value['description'],TRUE)."</description>\n";
|
||||
|
||||
if($value['category_name'] && $catlink){
|
||||
echo "<description>".$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 "</description>\n";
|
||||
|
||||
if($value['category_name'] && $catlink)
|
||||
{
|
||||
echo "<category domain='".$catlink."'>".$tp -> toRss($value['category_name'])."</category>\n";
|
||||
}
|
||||
|
||||
if($value['comment']){
|
||||
//echo "<comments>".$tp->toRss($value['comment'])."</comments>\n";
|
||||
if($value['comment'])
|
||||
{
|
||||
echo "<comments>".$value['comment']."</comments>\n";
|
||||
}
|
||||
|
||||
if($value['author']){
|
||||
if($value['author'])
|
||||
{
|
||||
echo "<author>".$this->nospam($value['author_email'])." (".$value['author'].")</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 "<enclosure url=\"".$value['enc_url']."\" length=\"".$value['enc_leng']."\" type=\"".$value['enc_type']."\" />\n";
|
||||
}
|
||||
|
||||
echo "<pubDate>".date("r", ($value['pubdate'] + $this -> offset))."</pubDate>\n";
|
||||
|
||||
if($link){
|
||||
if($link)
|
||||
{
|
||||
echo "<guid isPermaLink=\"true\">".$link."</guid>\n";
|
||||
}
|
||||
|
||||
echo "</item>";
|
||||
}
|
||||
// echo "<atom:link href=\"".e_SELF."?".($this -> contentType).".4.".$this -> topicId ."\" rel=\"self\" type=\"application/rss+xml\" />";
|
||||
// echo "<atom:link href=\"".e_SELF."?".($this -> contentType).".4.".$this -> topicId ."\" rel=\"self\" type=\"application/rss+xml\" />";
|
||||
echo "
|
||||
</channel>
|
||||
</rss>";
|
||||
break;
|
||||
|
||||
case 3: // rdf
|
||||
case 3: // RDF
|
||||
echo "<?xml version=\"1.0\" encoding=\"utf-8\" ?>
|
||||
<!-- generator=\"e107\" -->
|
||||
<!-- content type=\"".$this -> contentType."\" -->
|
||||
@@ -561,9 +575,7 @@ class rssCreate {
|
||||
<rdf:Seq>";
|
||||
|
||||
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 "
|
||||
<item rdf:about=\"".$link."\">
|
||||
@@ -590,31 +600,37 @@ class rssCreate {
|
||||
<dc:date>".$this->get_iso_8601_date($time + $this -> offset)."</dc:date>
|
||||
<dc:creator>".$value['author']."</dc:creator>
|
||||
<dc:subject>".$tp->toRss($value['category_name'])."</dc:subject>
|
||||
<description>".$tp->toRss($value['description'])."</description>
|
||||
<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 "</description>
|
||||
</item>";
|
||||
}
|
||||
echo "
|
||||
</rdf:RDF>";
|
||||
break;
|
||||
|
||||
//new feed for atom - still in development, and not yet tested
|
||||
// Atom
|
||||
case 4:
|
||||
echo "<?xml version='1.0' encoding='utf-8'?>\n
|
||||
<feed xmlns='http://www.w3.org/2005/Atom'>\n";
|
||||
/*
|
||||
<feed version='0.3'
|
||||
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
|
||||
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 "
|
||||
<id>".$pref['siteurl']."</id>\n
|
||||
<title type='text'>".$tp->toRss($rss_title)."</title>\n
|
||||
<updated>".$this->get_iso_8601_date($time + $this -> offset)."</updated>\n";
|
||||
|
||||
//recommended
|
||||
// Recommended
|
||||
echo "
|
||||
<author>\n
|
||||
<name>e107</name>\n";
|
||||
@@ -624,7 +640,7 @@ class rssCreate {
|
||||
</author>\n
|
||||
<link rel='self' href='".$e107->base_path.$PLUGINS_DIRECTORY."rss_menu/".e_PAGE."?".e_QUERY."' />\n";
|
||||
|
||||
//optional
|
||||
// Optional
|
||||
include(e_ADMIN."ver.php");
|
||||
echo "
|
||||
<category term='e107'/>\n
|
||||
@@ -634,7 +650,7 @@ class rssCreate {
|
||||
<generator uri='http://e107.org/' version='".$e107info['e107_version']."'>e107</generator>\n";
|
||||
//<icon>/icon.jpg</icon>\n
|
||||
echo "
|
||||
<logo>".(strstr(SITEBUTTON, "http:") ? SITEBUTTON : SITEURL.str_replace("../", "", e_IMAGE).SITEBUTTON)."</logo>\n
|
||||
<logo>".(strstr(SITEBUTTON, "http:") ? SITEBUTTON : SITEURL.str_replace("../", "", SITEBUTTON))."</logo>\n
|
||||
<rights type='html'>".$pref['siteadmin']." - ".$this->nospam($pref['siteadminemail'])."</rights>\n";
|
||||
if($pref['sitedescription']){
|
||||
echo "
|
||||
@@ -644,13 +660,13 @@ class rssCreate {
|
||||
echo "
|
||||
<entry>\n";
|
||||
|
||||
//required
|
||||
// Required
|
||||
echo "
|
||||
<id>".$value['link']."</id>\n
|
||||
<title type='text'>".$tp->toRss($value['title'])."</title>\n
|
||||
<updated>".$this->get_iso_8601_date($value['pubdate'] + $this -> offset)."</updated>\n";
|
||||
|
||||
//recommended
|
||||
// Recommended
|
||||
$author = ($value['author']) ? $value['author'] : "unknown";
|
||||
|
||||
echo "
|
||||
@@ -662,9 +678,16 @@ class rssCreate {
|
||||
//<content>complete story here</content>\n
|
||||
echo "
|
||||
<link rel='alternate' type='text/html' href='".$value['link']."' />\n
|
||||
<summary type='text'>".$tp->toRss($value['description'])."</summary>\n";
|
||||
|
||||
//optional
|
||||
<summary type='text'>".$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 "</summary>\n";
|
||||
|
||||
// Optional
|
||||
if($value['category_name']){
|
||||
echo "<category term='".$tp -> toRss($value['category_name'])."'/>\n";
|
||||
}
|
||||
@@ -676,7 +699,7 @@ class rssCreate {
|
||||
// <id>http://example.org/</id>
|
||||
// <title>Fourty-Two</title>
|
||||
// <updated>2003-12-13T18:30:02Z</updated>
|
||||
// <rights><3E> 2005 Example, Inc.</rights>
|
||||
// <rights><3E> 2005 Example, Inc.</rights>
|
||||
//</source>
|
||||
//<rights type='html'>&copy; 2005 John Doe</rights>
|
||||
echo "
|
||||
@@ -684,19 +707,19 @@ class rssCreate {
|
||||
}
|
||||
echo "
|
||||
</feed>\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
|
||||
?>
|
@@ -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 = "
|
||||
<div class='spacer'><a href='".$path."rss.php?$type.1".($topic ? ".".$topic : "")."'><img src='".$path."images/rss1.png' alt='rss1.0' /></a></div>
|
||||
<div class='spacer'><a href='".$path."rss.php?$type.2".($topic ? ".".$topic : "")."'><img src='".$path."images/rss2.png' alt='rss2.0' /></a></div>
|
||||
<div class='spacer'><a href='".$path."rss.php?$type.3".($topic ? ".".$topic : "")."'><img src='".$path."images/rss3.png' alt='rdf' /></a><br /></div>
|
||||
<div class='spacer'><a href='".$path."rss.php?$type.4".($topic ? ".".$topic : "")."'><img src='".$path."images/rss4.png' alt='atom' /></a><br /></div>
|
||||
</div>";
|
||||
|
||||
$caption = (file_exists(THEME."images/RSS_menu.png") ? "<img src='".THEME_ABS."images/RSS_menu.png' alt='' style='vertical-align:middle' /> ".RSS_MENU_L2 : RSS_MENU_L2);
|
||||
|
||||
$ns->tablerender($caption, $text, 'backend');
|
||||
?>
|
@@ -1,11 +1,10 @@
|
||||
<?php
|
||||
// $Id: rss_shortcodes.php,v 1.3 2007-11-27 21:47:24 e107steved Exp $
|
||||
// $Id: rss_shortcodes.php,v 1.4 2009-09-18 19:05:50 e107coders Exp $
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
include_once(e_HANDLER.'shortcode_handler.php');
|
||||
$rss_shortcodes = $tp -> 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 "<input class='tbox' type='text' name='rss_name' size='74' value=\"".$row['rss_name']."\" />\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 = "<select class='tbox' name='rss_class'>";
|
||||
foreach($vals as $key=>$val){
|
||||
foreach($vals as $key=>$val)
|
||||
{
|
||||
$sel = ($row['rss_class'] == $key) ? " selected='selected'" : "";
|
||||
$text .= "<option value='{$key}'{$sel}>$val</option>\n";
|
||||
}
|
||||
@@ -139,20 +135,22 @@ global $row;
|
||||
return "<input class='tbox' name='rss_limit' size='3' title=\"".RSS_LAN05."\" value='".intval($row['rss_limit'])."' maxlength='3' />";
|
||||
SC_END
|
||||
|
||||
|
||||
SC_BEGIN RSS_ADMIN_FORM_CREATEBUTTON
|
||||
global $row, $qs;
|
||||
if(isset($qs[1]) && $qs[1] == "edit" && isset($qs[2]) && is_numeric($qs[2]) ){
|
||||
if(isset($qs[1]) && $qs[1] == "edit" && isset($qs[2]) && is_numeric($qs[2]) )
|
||||
{
|
||||
$text = "<input type='hidden' name='rss_datestamp' value='".$row['rss_datestamp']."' />
|
||||
<input type='hidden' name='rss_id' value='".$row['rss_id']."' />
|
||||
<input class='button' type='submit' name='update_rss' value=\"".LAN_UPDATE."\" />";
|
||||
}else{
|
||||
}
|
||||
else
|
||||
{
|
||||
$text = "<input class='button' type='submit' name='create_rss' value=\"".LAN_CREATE."\" />";
|
||||
}
|
||||
return $text;
|
||||
SC_END
|
||||
|
||||
|
||||
|
||||
SC_BEGIN RSS_ADMIN_IMPORT_CHECK
|
||||
global $feed, $rs, $tp, $i;
|
||||
$text = "<input type='checkbox' name='importid[$i]' value='1' />";
|
||||
@@ -190,6 +188,5 @@ SC_BEGIN RSS_ADMIN_IMPORT_TOPICID
|
||||
global $feed;
|
||||
return $feed['topic_id'];
|
||||
SC_END
|
||||
|
||||
*/
|
||||
?>
|
@@ -1,17 +1,18 @@
|
||||
<?php
|
||||
|
||||
if (!defined('ADMIN_WIDTH')) { define("ADMIN_WIDTH", "width:98%;"); }
|
||||
if(!defined("USER_WIDTH")){ define("USER_WIDTH","width:100%"); }
|
||||
|
||||
//rss listing
|
||||
if(!isset($RSS_LIST_HEADER)){
|
||||
// Rss listing
|
||||
if(!isset($RSS_LIST_HEADER))
|
||||
{
|
||||
$RSS_LIST_HEADER = "<table class='fborder' style='".USER_WIDTH."'>
|
||||
<tr>
|
||||
<td class='fcaption' style='width:55%'>".RSS_LAN_ADMIN_4."</td>
|
||||
<td class='fcaption' style='text-align:right'>".RSS_PLUGIN_LAN_6."</td>
|
||||
</tr>";
|
||||
}
|
||||
if(!isset($RSS_LIST_TABLE)){
|
||||
if(!isset($RSS_LIST_TABLE))
|
||||
{
|
||||
$RSS_LIST_TABLE = "
|
||||
<tr>
|
||||
<td class='forumheader3'>{RSS_FEED}<br />
|
||||
@@ -22,12 +23,14 @@ if(!isset($RSS_LIST_TABLE)){
|
||||
</td>
|
||||
</tr>";
|
||||
}
|
||||
if(!isset($RSS_LIST_FOOTER)){
|
||||
if(!isset($RSS_LIST_FOOTER))
|
||||
{
|
||||
$RSS_LIST_FOOTER = "</table>";
|
||||
}
|
||||
|
||||
//admin : rss listing
|
||||
if(!isset($RSS_ADMIN_LIST_HEADER)){
|
||||
// Admin : rss listing
|
||||
if(!isset($RSS_ADMIN_LIST_HEADER))
|
||||
{
|
||||
$RSS_ADMIN_LIST_HEADER = "
|
||||
<div style='text-align:center;'>
|
||||
<form action='".e_SELF.(e_QUERY ? "?".e_QUERY : "")."' id='dataform' method='post' >
|
||||
@@ -42,7 +45,8 @@ if(!isset($RSS_ADMIN_LIST_HEADER)){
|
||||
<td class='fcaption' style='white-space:nowrap;'>".LAN_OPTIONS."</td>
|
||||
</tr>";
|
||||
}
|
||||
if(!isset($RSS_ADMIN_LIST_TABLE)){
|
||||
if(!isset($RSS_ADMIN_LIST_TABLE))
|
||||
{
|
||||
$RSS_ADMIN_LIST_TABLE = "
|
||||
<tr>
|
||||
<td class='forumheader3'>{RSS_ADMIN_ID}</td>
|
||||
@@ -54,7 +58,8 @@ if(!isset($RSS_ADMIN_LIST_TABLE)){
|
||||
<td class='forumheader3' style='text-align:center'>{RSS_ADMIN_OPTIONS}</td>
|
||||
</tr>";
|
||||
}
|
||||
if(!isset($RSS_ADMIN_LIST_FOOTER)){
|
||||
if(!isset($RSS_ADMIN_LIST_FOOTER))
|
||||
{
|
||||
$RSS_ADMIN_LIST_FOOTER = "
|
||||
<tr>
|
||||
<td class='forumheader' colspan='7' style='text-align:center'>
|
||||
@@ -66,8 +71,9 @@ if(!isset($RSS_ADMIN_LIST_FOOTER)){
|
||||
</div>";
|
||||
}
|
||||
|
||||
//admin : rss create/edit
|
||||
if(!isset($RSS_ADMIN_CREATE_TABLE)){
|
||||
// Admin : rss create/edit
|
||||
if(!isset($RSS_ADMIN_CREATE_TABLE))
|
||||
{
|
||||
$RSS_ADMIN_CREATE_TABLE = "
|
||||
<div style='text-align:center;'>
|
||||
<form action='".e_SELF.(e_QUERY ? "?".e_QUERY : "")."' id='dataform' method='post' >
|
||||
@@ -100,6 +106,7 @@ if(!isset($RSS_ADMIN_CREATE_TABLE)){
|
||||
<td class='forumheader3'>".RSS_LAN_ADMIN_8."</td>
|
||||
<td class='forumheader3'>{RSS_ADMIN_FORM_CLASS}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class='forumheader' colspan='2' style='text-align:center;'>{RSS_ADMIN_FORM_CREATEBUTTON}</td>
|
||||
</tr>
|
||||
@@ -108,8 +115,9 @@ if(!isset($RSS_ADMIN_CREATE_TABLE)){
|
||||
</div>";
|
||||
}
|
||||
|
||||
//admin : rss options
|
||||
if(!isset($RSS_ADMIN_OPTIONS_TABLE)){
|
||||
// Admin : rss options
|
||||
if(!isset($RSS_ADMIN_OPTIONS_TABLE))
|
||||
{
|
||||
$RSS_ADMIN_OPTIONS_TABLE = "
|
||||
<div style='text-align:center;'>
|
||||
<form action='".e_SELF.(e_QUERY ? "?".e_QUERY : "")."' id='dataform' method='post' >
|
||||
@@ -130,6 +138,12 @@ if(!isset($RSS_ADMIN_OPTIONS_TABLE)){
|
||||
<input type='checkbox' name='rss_summarydiz' value='1' ".($pref['rss_summarydiz'] == 1 ? " checked='checked' " : "")." />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='forumheader3'>".RSS_LAN_ADMIN_33."</td>
|
||||
<td class='forumheader3'>
|
||||
<input type='checkbox' name='rss_shownewsimage' value='1' ".($pref['rss_shownewsimage'] == 1 ? " checked='checked' " : "")." />
|
||||
</td>
|
||||
</tr>
|
||||
<tr style='vertical-align:top'>
|
||||
<td colspan='2' style='text-align:center' class='forumheader'>
|
||||
<input class='button' type='submit' name='updatesettings' value='".LAN_SAVE."' />
|
||||
@@ -140,8 +154,9 @@ if(!isset($RSS_ADMIN_OPTIONS_TABLE)){
|
||||
</div>";
|
||||
}
|
||||
|
||||
//admin : rss import
|
||||
if(!isset($RSS_ADMIN_IMPORT_HEADER)){
|
||||
// Admin : rss import
|
||||
if(!isset($RSS_ADMIN_IMPORT_HEADER))
|
||||
{
|
||||
$RSS_ADMIN_IMPORT_HEADER = "
|
||||
<div style='text-align:center;'>
|
||||
<form action='".e_SELF."' id='imlistform' method='post' >
|
||||
@@ -155,7 +170,8 @@ if(!isset($RSS_ADMIN_IMPORT_HEADER)){
|
||||
<td class='fcaption'>".RSS_LAN_ADMIN_12."</td>
|
||||
</tr>";
|
||||
}
|
||||
if(!isset($RSS_ADMIN_IMPORT_TABLE)){
|
||||
if(!isset($RSS_ADMIN_IMPORT_TABLE))
|
||||
{
|
||||
$RSS_ADMIN_IMPORT_TABLE = "
|
||||
<tr>
|
||||
<td class='forumheader3'>{RSS_ADMIN_IMPORT_CHECK}</td>
|
||||
@@ -166,7 +182,8 @@ if(!isset($RSS_ADMIN_IMPORT_TABLE)){
|
||||
</tr>";
|
||||
}
|
||||
|
||||
if(!isset($RSS_ADMIN_IMPORT_FOOTER)){
|
||||
if(!isset($RSS_ADMIN_IMPORT_FOOTER))
|
||||
{
|
||||
$RSS_ADMIN_IMPORT_FOOTER = "
|
||||
<tr style='vertical-align:top'>
|
||||
<td colspan='5' style='text-align:center' class='forumheader'>
|
||||
@@ -177,5 +194,4 @@ if(!isset($RSS_ADMIN_IMPORT_FOOTER)){
|
||||
</form>
|
||||
</div>";
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
Reference in New Issue
Block a user