mirror of
https://github.com/e107inc/e107.git
synced 2025-04-19 20:21:51 +02:00
rss plugin - add plugin.xml, admin logging, bit of a tidy up
This commit is contained in:
parent
b157186a4f
commit
e842d52f71
@ -11,9 +11,9 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/rss_menu/admin_prefs.php,v $
|
||||
| $Revision: 1.3 $
|
||||
| $Date: 2007-02-07 22:45:10 $
|
||||
| $Author: e107coders $
|
||||
| $Revision: 1.4 $
|
||||
| $Date: 2008-12-13 12:34:53 $
|
||||
| $Author: e107steved $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
/*
|
||||
@ -29,102 +29,128 @@ Notes:
|
||||
*/
|
||||
|
||||
require_once("../../class2.php");
|
||||
if(!getperms("P")){ header("location:".e_BASE."index.php"); }
|
||||
$lan_file = e_PLUGIN."rss_menu/languages/".e_LANGUAGE.".php";
|
||||
require_once(file_exists($lan_file) ? $lan_file : e_PLUGIN."rss_menu/languages/English.php");
|
||||
if(!getperms("P") || !plugInstalled('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."packs/".$imode."/admin_images/";
|
||||
$lan_file = e_PLUGIN.'rss_menu/languages/'.e_LANGUAGE.'.php';
|
||||
include_once(file_exists($lan_file) ? $lan_file : e_PLUGIN.'rss_menu/languages/English.php');
|
||||
require_once(e_PLUGIN.'rss_menu/rss_shortcodes.php');
|
||||
$rss = new rss;
|
||||
|
||||
global $tp;
|
||||
|
||||
//delete entry
|
||||
if(isset($_POST['delete'])){
|
||||
if(isset($_POST['delete']))
|
||||
{
|
||||
$d_idt = array_keys($_POST['delete']);
|
||||
$message = ($sql -> db_Delete("rss", "rss_id='".$d_idt[0]."'")) ? LAN_DELETED : LAN_DELETED_FAILED;
|
||||
$message = ($sql -> db_Delete("rss", "rss_id=".intval($d_idt[0]))) ? LAN_DELETED : LAN_DELETED_FAILED;
|
||||
$admin_log->log_event('RSS_01','ID: '.intval($d_idt[0]).' - '.$message,E_LOG_INFORMATIVE,'');
|
||||
$e107cache->clear("rss");
|
||||
}
|
||||
|
||||
//create rss feed
|
||||
if(isset($_POST['create_rss'])){
|
||||
if(isset($_POST['create_rss']))
|
||||
{
|
||||
$message = $rss -> dbrss("create");
|
||||
}
|
||||
|
||||
//update rss feed
|
||||
if(isset($_POST['update_rss'])){
|
||||
if(isset($_POST['update_rss']))
|
||||
{
|
||||
$message = $rss -> dbrss("update");
|
||||
}
|
||||
|
||||
//import rss feed
|
||||
if(isset($_POST['import_rss'])){
|
||||
if(isset($_POST['import_rss']))
|
||||
{
|
||||
$message = $rss -> dbrssimport();
|
||||
}
|
||||
|
||||
//update_limit
|
||||
if(isset($_POST['update_limit'])){
|
||||
if(isset($_POST['update_limit']))
|
||||
{
|
||||
$message = $rss -> dbrsslimit();
|
||||
}
|
||||
|
||||
//update options
|
||||
if(isset($_POST['updatesettings'])){
|
||||
if(isset($_POST['updatesettings']))
|
||||
{
|
||||
$message = $rss->dboptions();
|
||||
}
|
||||
|
||||
//config check
|
||||
if($rss->file_check()){
|
||||
if($rss->file_check())
|
||||
{
|
||||
$message = RSS_LAN_ERROR_2; // space found in file.
|
||||
}
|
||||
|
||||
|
||||
//render message
|
||||
if(isset($message)){
|
||||
if(isset($message))
|
||||
{
|
||||
$rss->show_message('', $message);
|
||||
}
|
||||
|
||||
|
||||
//get template
|
||||
if (is_readable(THEME."rss_template.php")) {
|
||||
if (is_readable(THEME."rss_template.php"))
|
||||
{
|
||||
require_once(THEME."rss_template.php");
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
require_once(e_PLUGIN."rss_menu/rss_template.php");
|
||||
}
|
||||
|
||||
|
||||
//listing
|
||||
if(e_QUERY){
|
||||
if(e_QUERY)
|
||||
{
|
||||
$qs = explode(".", e_QUERY);
|
||||
$field = (isset($qs[1])) ? $qs[1] : "";
|
||||
$sort = (isset($qs[2])) ? $qs[2] : "";
|
||||
}
|
||||
$action = varset($qs[0],'list');
|
||||
$field = varset($qs[1], '');
|
||||
$feedID = intval(varset($qs[2], 0));
|
||||
|
||||
//create
|
||||
if(isset($qs[0]) && $qs[0] == 'create' && !$_POST){
|
||||
$rss -> rssadmincreate();
|
||||
|
||||
//import
|
||||
}elseif(isset($qs[0]) && $qs[0] == 'import'){
|
||||
$rss -> rssadminimport();
|
||||
|
||||
//options
|
||||
}elseif(isset($qs[0]) && $qs[0] == 'options'){
|
||||
$rss -> rssadminoptions();
|
||||
|
||||
//list
|
||||
}else{
|
||||
|
||||
$rss -> rssadminlist();
|
||||
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");
|
||||
|
||||
// ##### Display options --------------------------------------------------------------------------
|
||||
function admin_prefs_adminmenu(){
|
||||
function admin_prefs_adminmenu()
|
||||
{
|
||||
global $sql, $qs;
|
||||
|
||||
$act = $qs[0];
|
||||
if($act==""){$act="list";}
|
||||
$act = varset($qs[0], 'list');
|
||||
|
||||
$var['list']['text'] = RSS_LAN_ADMINMENU_2;
|
||||
$var['list']['link'] = e_SELF."?list";
|
||||
@ -148,21 +174,25 @@ function admin_prefs_adminmenu(){
|
||||
|
||||
|
||||
|
||||
class rss{
|
||||
|
||||
class rss
|
||||
{
|
||||
//check for config
|
||||
function file_check(){
|
||||
function file_check()
|
||||
{
|
||||
$arrays = file_get_contents(e_BASE."e107_config.php");
|
||||
$arrays2 = file_get_contents(e_PLUGIN."rss_menu/languages/".e_LANGUAGE.".php");
|
||||
if($arrays[0] != "<" || $arrays2[0] != "<"){
|
||||
$arrays2 = file_get_contents(e_PLUGIN."rss_menu/languages/".e_LANGUAGE."_admin_rss_menu.php");
|
||||
if($arrays[0] != "<" || $arrays2[0] != "<")
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
//admin : list : existing rss feeds
|
||||
function rssadminlist(){
|
||||
global $qs, $ns, $sql, $rs, $tp, $field, $sort, $rss_shortcodes, $row, $RSS_ADMIN_LIST_HEADER, $RSS_ADMIN_LIST_TABLE, $RSS_ADMIN_LIST_FOOTER;
|
||||
function rssadminlist()
|
||||
{
|
||||
global $ns, $sql, $tp, $field, $sort, $rss_shortcodes, $row, $RSS_ADMIN_LIST_HEADER, $RSS_ADMIN_LIST_TABLE, $RSS_ADMIN_LIST_FOOTER;
|
||||
|
||||
$fieldstag = array('id'=>'rss_id','path'=>'rss_path','name'=>'rss_name','url'=>'rss_url','limit'=>'rss_limit');
|
||||
$order = (isset($fieldstag[$field])) ? "ORDER BY ".$fieldstag[$field]." ".$sort : "ORDER BY rss_id";
|
||||
@ -184,16 +214,20 @@ class rss{
|
||||
}
|
||||
}
|
||||
|
||||
//create
|
||||
function rssadmincreate(){
|
||||
global $ns, $qs, $rs, $sql, $tp, $rss_shortcodes, $row, $RSS_ADMIN_CREATE_TABLE;
|
||||
//create or edit - put up a form
|
||||
function rssadmincreate($action, $id=0)
|
||||
{
|
||||
global $ns, $sql, $tp, $rss_shortcodes, $row, $RSS_ADMIN_CREATE_TABLE;
|
||||
|
||||
if( isset($qs[1]) && $qs[1] == "edit" && isset($qs[2]) && is_numeric($qs[2]) ){
|
||||
if(!$sql -> db_Select("rss", "*", "rss_id='".intval($qs[2])."' ")){
|
||||
if (($action == "edit") && $id )
|
||||
{
|
||||
if(!$sql -> db_Select("rss", "*", "rss_id=".$id))
|
||||
{
|
||||
$this->show_message(LAN_ERROR, RSS_LAN_ERROR_5);
|
||||
}else{
|
||||
}
|
||||
else
|
||||
{
|
||||
$row = $sql -> db_Fetch();
|
||||
|
||||
$row['rss_name'] = $tp -> toForm($row['rss_name']);
|
||||
$row['rss_path'] = $tp -> toForm($row['rss_path']);
|
||||
$row['rss_url'] = $tp -> toForm($row['rss_url']);
|
||||
@ -204,9 +238,11 @@ class rss{
|
||||
$ns->tablerender(RSS_LAN_ADMIN_10, $text);
|
||||
}
|
||||
|
||||
//import
|
||||
function rssadminimport(){
|
||||
global $sql, $ns, $i, $qs, $rs, $tp, $rss_shortcodes, $feed, $pref;
|
||||
|
||||
// import - put up the list of possible feeds to import
|
||||
function rssadminimport()
|
||||
{
|
||||
global $sql, $ns, $i, $tp, $rss_shortcodes, $feed, $pref;
|
||||
global $RSS_ADMIN_IMPORT_HEADER, $RSS_ADMIN_IMPORT_TABLE, $RSS_ADMIN_IMPORT_FOOTER;
|
||||
|
||||
$sqli = new db;
|
||||
@ -223,8 +259,10 @@ class rss{
|
||||
$feedlist[] = $feed;
|
||||
|
||||
//news categories
|
||||
if($sqli -> db_Select("news_category", "*","category_id!='' ORDER BY category_name ")){
|
||||
while($rowi = $sqli -> db_Fetch()){
|
||||
if($sqli -> db_Select("news_category", "*","category_id!='' ORDER BY category_name "))
|
||||
{
|
||||
while($rowi = $sqli -> db_Fetch())
|
||||
{
|
||||
$feed['name'] = ADLAN_0.' > '.$rowi['category_name'];
|
||||
$feed['url'] = 'news';
|
||||
$feed['topic_id'] = $rowi['category_id'];
|
||||
@ -247,8 +285,10 @@ class rss{
|
||||
$feedlist[] = $feed;
|
||||
|
||||
//download categories
|
||||
if($sqli -> db_Select("download_category", "*","download_category_id!='' ORDER BY download_category_order ")){
|
||||
while($rowi = $sqli -> db_Fetch()){
|
||||
if($sqli -> db_Select("download_category", "*","download_category_id!='' ORDER BY download_category_order "))
|
||||
{
|
||||
while($rowi = $sqli -> db_Fetch())
|
||||
{
|
||||
$feed['name'] = ADLAN_24.' > '.$rowi['download_category_name'];
|
||||
$feed['url'] = 'download';
|
||||
$feed['topic_id'] = $rowi['download_category_id'];
|
||||
@ -274,27 +314,20 @@ class rss{
|
||||
$plugin_feedlist = array();
|
||||
foreach($pref['e_rss_list'] as $val)
|
||||
{
|
||||
if (is_readable(e_PLUGIN.$val."/e_rss.php")) {
|
||||
if (is_readable(e_PLUGIN.$val."/e_rss.php"))
|
||||
{
|
||||
require_once(e_PLUGIN.$val."/e_rss.php");
|
||||
$plugin_feedlist = $eplug_rss_feed;
|
||||
}
|
||||
}
|
||||
|
||||
/* if($sqli -> db_Select("plugin","plugin_path","plugin_installflag = '1' ORDER BY plugin_path ")){
|
||||
while($rowi = $sqli -> db_Fetch()){
|
||||
if (is_readable(e_PLUGIN.$rowi['plugin_path']."/e_rss.php")) {
|
||||
require_once(e_PLUGIN.$rowi['plugin_path']."/e_rss.php");
|
||||
$plugin_feedlist = $eplug_rss_feed;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
$feedlist = array_merge($feedlist, $plugin_feedlist);
|
||||
|
||||
$render=FALSE;
|
||||
$i=0;
|
||||
$text = $RSS_ADMIN_IMPORT_HEADER;
|
||||
foreach($feedlist as $k=>$feed){
|
||||
foreach($feedlist as $k=>$feed)
|
||||
{
|
||||
$feed['topic_id'] = $tp -> toDB($feed['topic_id']);
|
||||
$feed['url'] = $tp -> toDB($feed['url']);
|
||||
|
||||
@ -308,102 +341,143 @@ class rss{
|
||||
}
|
||||
$text .= $tp -> parseTemplate($RSS_ADMIN_IMPORT_FOOTER, FALSE, $rss_shortcodes);
|
||||
|
||||
if(!$render){
|
||||
if(!$render)
|
||||
{
|
||||
$this->show_message(RSS_LAN_ADMIN_11, RSS_LAN_ERROR_6);
|
||||
}else{
|
||||
}
|
||||
else
|
||||
{
|
||||
$ns->tablerender(RSS_LAN_ADMIN_11, $text);
|
||||
}
|
||||
}
|
||||
|
||||
//options
|
||||
function rssadminoptions(){
|
||||
global $ns, $qs, $rs, $sql, $tp, $rss_shortcodes, $row, $RSS_ADMIN_OPTIONS_TABLE;
|
||||
|
||||
// options - display form
|
||||
function rssadminoptions()
|
||||
{
|
||||
global $ns, $sql, $tp, $rss_shortcodes, $row, $RSS_ADMIN_OPTIONS_TABLE;
|
||||
|
||||
$text = $tp -> parseTemplate($RSS_ADMIN_OPTIONS_TABLE, FALSE, $rss_shortcodes);
|
||||
$ns->tablerender(LAN_OPTIONS, $text);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//render message
|
||||
function show_message($caption='', $text=''){
|
||||
function show_message($caption='', $text='')
|
||||
{
|
||||
global $ns;
|
||||
$ns -> tablerender($caption, "<div style='text-align:center'><b>$text</b></div>");
|
||||
}
|
||||
|
||||
|
||||
|
||||
//db:create/update
|
||||
function dbrss($mode='create'){
|
||||
global $qs, $sql, $ns, $rs, $tp, $e107cache;
|
||||
function dbrss($mode='create')
|
||||
{
|
||||
global $sql, $ns, $tp, $e107cache, $admin_log;
|
||||
|
||||
if($_POST['rss_name'] && $_POST['rss_url'] && $_POST['rss_path']){
|
||||
if($_POST['rss_name'] && $_POST['rss_url'] && $_POST['rss_path'])
|
||||
{
|
||||
$rssVals = array();
|
||||
$rssVals['rss_name'] = $tp -> toDB(trim($_POST['rss_name']));
|
||||
$rssVals['rss_url'] = $tp -> toDB($_POST['rss_url']);
|
||||
$rssVals['rss_topicid'] = $tp -> toDB($_POST['rss_topicid']);
|
||||
$rssVals['rss_path'] = $tp -> toDB($_POST['rss_path']);
|
||||
$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']);
|
||||
|
||||
$_POST['rss_name'] = $tp -> toDB(trim($_POST['rss_name']));
|
||||
$_POST['rss_url'] = $tp -> toDB($_POST['rss_url']);
|
||||
$_POST['rss_topicid'] = $tp -> toDB($_POST['rss_topicid']);
|
||||
$_POST['rss_path'] = $tp -> toDB($_POST['rss_path']);
|
||||
$_POST['rss_text'] = $tp -> toDB($_POST['rss_text']);
|
||||
$_POST['rss_class'] = (intval($_POST['rss_class']) ? intval($_POST['rss_class']) : '0');
|
||||
$_POST['rss_limit'] = intval($_POST['rss_limit']);
|
||||
|
||||
if(isset($_POST['rss_datestamp']) && $_POST['rss_datestamp']!=''){
|
||||
$datestamp = intval($_POST['rss_datestamp']);
|
||||
}else{
|
||||
$datestamp = time();
|
||||
if(isset($_POST['rss_datestamp']) && $_POST['rss_datestamp']!='')
|
||||
{
|
||||
$rssVals['rss_datestamp'] = intval($_POST['rss_datestamp']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$rssVals['rss_datestamp'] = time();
|
||||
}
|
||||
|
||||
if($mode == 'create'){
|
||||
$message = ($sql -> db_Insert("rss", "'0', '".$_POST['rss_name']."', '".$_POST['rss_url']."', '".$_POST['rss_topicid']."', '".$_POST['rss_path']."', '".$_POST['rss_text']."', '".$datestamp."', '".$_POST['rss_class']."', '".$_POST['rss_limit']."' ")) ? LAN_CREATED : LAN_CREATED_FAILED;
|
||||
$e107cache->clear("rss");
|
||||
switch ($mode)
|
||||
{
|
||||
case 'create' :
|
||||
$message = ($sql -> db_Insert('rss',$rssVals)) ? LAN_CREATED : LAN_CREATED_FAILED;
|
||||
$admin_log->logArrayAll('RSS_02',$rssVals, $message);
|
||||
$e107cache->clear('rss');
|
||||
break;
|
||||
|
||||
}elseif($mode == 'update'){
|
||||
$message = ($sql -> db_Update("rss", "rss_name = '".$_POST['rss_name']."', rss_url = '".$_POST['rss_url']."', rss_topicid = '".$_POST['rss_topicid']."', rss_path = '".$_POST['rss_path']."', rss_text = '".$_POST['rss_text']."', rss_datestamp = '".$datestamp."', rss_class = '".$_POST['rss_class']."', rss_limit = '".$_POST['rss_limit']."' WHERE rss_id = '".intval($_POST['rss_id'])."' ")) ? LAN_UPDATED : LAN_UPDATED_FAILED;
|
||||
$e107cache->clear("rss");
|
||||
case 'update' :
|
||||
$message = ($sql -> db_UpdateArray('rss', $rssVals, " WHERE rss_id = ".intval($_POST['rss_id']))) ? LAN_UPDATED : LAN_UPDATED_FAILED;
|
||||
$admin_log->logArrayAll('RSS_03',$rssVals, $message);
|
||||
$e107cache->clear('rss');
|
||||
break;
|
||||
}
|
||||
}else{
|
||||
}
|
||||
else
|
||||
{
|
||||
$message = RSS_LAN_ERROR_7;
|
||||
}
|
||||
return $message;
|
||||
}
|
||||
|
||||
|
||||
//import rss feeds
|
||||
function dbrssimport(){
|
||||
global $sql, $tp;
|
||||
function dbrssimport()
|
||||
{
|
||||
global $sql, $tp, $admin_log;
|
||||
|
||||
foreach($_POST['importid'] as $key=>$value)
|
||||
{
|
||||
$rss_topcid = ($_POST['topic_id'][$key] ? $tp -> toDB($_POST['topic_id'][$key]) : '');
|
||||
$rss_url = ($_POST['url'][$key] ? $tp -> toDB($_POST['url'][$key]) : '');
|
||||
$rss_path = ($_POST['path'][$key] ? $tp -> toDB($_POST['path'][$key]) : '');
|
||||
$rss_name = ($_POST['name'][$key] ? $tp -> toDB($_POST['name'][$key]) : '');
|
||||
$rss_text = ($_POST['text'][$key] ? $tp -> toDB($_POST['text'][$key]) : '');
|
||||
$rss_datestamp = time();
|
||||
$rss_class = ($_POST['class'][$key] ? intval($_POST['class'][$key]) : '0');
|
||||
$rss_limit = ($_POST['limit'][$key] ? intval($_POST['limit'][$key]) : '0');
|
||||
$rssVals = array();
|
||||
$rssVals['rss_topicid'] = $tp -> toDB(varset($_POST['topic_id'][$key], ''));
|
||||
$rssVals['rss_url'] = $tp -> toDB(varset($_POST['url'][$key], ''));
|
||||
$rssVals['rss_path'] = $tp -> toDB(varset($_POST['path'][$key], ''));
|
||||
$rssVals['rss_name'] = $tp -> toDB(varset($_POST['name'][$key], ''));
|
||||
$rssVals['rss_text'] = $tp -> toDB(varset($_POST['text'][$key], ''));
|
||||
$rssVals['rss_datestamp'] = time();
|
||||
$rssVals['rss_class'] = intval(varset($_POST['class'][$key], '0'));
|
||||
$rssVals['rss_limit'] = intval(varset($_POST['limit'][$key], '0'));
|
||||
|
||||
$sql -> db_Insert("rss", "'0', '".$rss_name."', '".$rss_url."', '".$rss_topcid."', '".$rss_path."', '".$rss_text."', '".$rss_datestamp."', '".$rss_class."', '".$rss_limit."' ");
|
||||
$sql -> db_Insert("rss", $rssVals);
|
||||
$admin_log->logArrayAll('RSS_04',$rssVals);
|
||||
}
|
||||
$message = count($_POST['importid'])." ".RSS_LAN_ADMIN_18;
|
||||
return $message;
|
||||
|
||||
}
|
||||
|
||||
function dbrsslimit(){
|
||||
global $sql, $tp;
|
||||
function dbrsslimit()
|
||||
{
|
||||
global $sql, $tp, $admin_log;
|
||||
|
||||
$limitVals = array();
|
||||
foreach($_POST['limit'] as $key=>$value)
|
||||
{
|
||||
$sql -> db_Update("rss", "rss_limit = '".intval($value)."' WHERE rss_id = '".intval($key)."' ");
|
||||
$key = intval($key);
|
||||
$value = intval($value);
|
||||
$limitVals[$key] = $value;
|
||||
$sql -> db_Update("rss", "rss_limit = ".$value." WHERE rss_id = ".$key);
|
||||
}
|
||||
$admin_log->logArrayAll('RSS_05',$limitVals);
|
||||
header("location:".e_SELF."?r3");
|
||||
}
|
||||
|
||||
//update options
|
||||
function dboptions(){
|
||||
global $tp, $pref;
|
||||
function dboptions()
|
||||
{
|
||||
global $tp, $pref, $admin_log;
|
||||
|
||||
$pref['rss_othernews'] = $_POST['rss_othernews'];
|
||||
$pref['rss_summarydiz'] = $_POST['rss_summarydiz'];
|
||||
|
||||
save_prefs();
|
||||
return LAN_SAVED;
|
||||
$temp = array();
|
||||
$temp['rss_othernews'] = $_POST['rss_othernews'];
|
||||
$temp['rss_summarydiz'] = $_POST['rss_summarydiz'];
|
||||
if ($admin_log->logArrayDiffs($temp, $pref, 'RSS_06'))
|
||||
{
|
||||
save_prefs(); // Only save if changes
|
||||
return LAN_SAVED;
|
||||
}
|
||||
else
|
||||
{
|
||||
return RSS_LAN_ADMIN_28;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -11,8 +11,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/rss_menu/e_meta.php,v $
|
||||
| $Revision: 1.4 $
|
||||
| $Date: 2007-12-06 20:23:13 $
|
||||
| $Revision: 1.5 $
|
||||
| $Date: 2008-12-13 12:34:53 $
|
||||
| $Author: e107steved $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
@ -22,9 +22,11 @@ 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()){
|
||||
while($row=$sql->db_Fetch())
|
||||
{
|
||||
//wildcard topic_id's should not be listed
|
||||
if(strpos($row['rss_url'], "*")===FALSE){
|
||||
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');
|
||||
|
@ -3,10 +3,10 @@
|
||||
+ ----------------------------------------------------------------------------+
|
||||
| e107 website system - Language File.
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/rss_menu/languages/English.php,v $
|
||||
| $Revision: 1.2 $
|
||||
| $Date: 2007-02-07 22:45:10 $
|
||||
| $Author: e107coders $
|
||||
| $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 $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
@ -34,6 +34,7 @@ define("RSS_FOR", "Forum");
|
||||
define("RSS_DL", "Downloads");
|
||||
|
||||
define("RSS_PLUGIN_LAN_1", "RSS");
|
||||
define("RSS_PLUGIN_LAN_2", "RSS Feeds from your site");
|
||||
|
||||
define("RSS_PLUGIN_LAN_6", "Feed Links");
|
||||
define("RSS_PLUGIN_LAN_7", "The rss feed of the news");
|
||||
@ -83,12 +84,24 @@ define("RSS_LAN_ADMIN_23", "inactive");
|
||||
|
||||
define("RSS_LAN_ADMIN_26", "Check All");
|
||||
define("RSS_LAN_ADMIN_27", "Uncheck All");
|
||||
define('RSS_LAN_ADMIN_28', 'Nothing changed - not saved');
|
||||
|
||||
define("RSS_LAN_ADMIN_31", "rss entries limit updated");
|
||||
define("RSS_LAN_ADMIN_31", 'rss entries limits updated');
|
||||
|
||||
|
||||
define("RSS_LAN_0", "RSS");
|
||||
define("RSS_LAN_2", "@nospam.com");
|
||||
define("RSS_LAN_3", "noauthor@nospam.com");
|
||||
|
||||
// Admin log messages
|
||||
//-------------------
|
||||
define('LAN_AL_RSS_01','RSS feed deleted');
|
||||
define('LAN_AL_RSS_02','RSS feed created');
|
||||
define('LAN_AL_RSS_03','RSS feed updated');
|
||||
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,111 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
+ ----------------------------------------------------------------------------+
|
||||
| e107 website system
|
||||
|
|
||||
| ©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/plugin.php,v $
|
||||
| $Revision: 1.1.1.1 $
|
||||
| $Date: 2006-12-02 04:35:41 $
|
||||
| $Author: mcfly_e107 $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
$lan_file = e_PLUGIN."rss_menu/languages/".e_LANGUAGE.".php";
|
||||
require_once(file_exists($lan_file) ? $lan_file : e_PLUGIN."rss_menu/languages/English.php");
|
||||
|
||||
// Plugin info ----------------------------------------------------------------
|
||||
$eplug_name = "RSS_PLUGIN_LAN_1";
|
||||
$eplug_version = "1.1";
|
||||
$eplug_author = "e107dev";
|
||||
$eplug_logo = "";
|
||||
$eplug_url = "http://e107.org";
|
||||
$eplug_email = "";
|
||||
$eplug_description = RSS_MENU_L2;
|
||||
$eplug_compatible = "e107v0.7+";
|
||||
$eplug_readme = ""; //leave blank if no readme file
|
||||
$eplug_latest = FALSE; //Show reported threads in admin (use latest.php)
|
||||
$eplug_status = FALSE; //Show post count in admin (use status.php)
|
||||
|
||||
// Name of the plugin's folder ------------------------------------------------
|
||||
$eplug_folder = "rss_menu";
|
||||
|
||||
// Name of menu item for plugin -----------------------------------------------
|
||||
$eplug_menu_name = "rss_menu";
|
||||
|
||||
// Name of the admin configuration file ---------------------------------------
|
||||
$eplug_conffile = "admin_prefs.php";
|
||||
|
||||
// Icon image and caption text ------------------------------------------------
|
||||
$eplug_icon = $eplug_folder."/images/rss_32.png";
|
||||
$eplug_icon_small = $eplug_folder."/images/rss_16.png";
|
||||
$eplug_caption = LAN_CONFIGURE;
|
||||
|
||||
// List of preferences --------------------------------------------------------
|
||||
$eplug_prefs = '';
|
||||
|
||||
// List of table names --------------------------------------------------------
|
||||
$eplug_table_names = array("rss");
|
||||
|
||||
// List of sql requests to create tables --------------------------------------
|
||||
$eplug_tables = array(
|
||||
"CREATE TABLE ".MPREFIX."rss (
|
||||
rss_id int(10) unsigned NOT NULL auto_increment,
|
||||
rss_name varchar(255) NOT NULL default '',
|
||||
rss_url text NOT NULL,
|
||||
rss_topicid varchar(255) NOT NULL default '',
|
||||
rss_path varchar(255) NOT NULL default '',
|
||||
rss_text longtext NOT NULL,
|
||||
rss_datestamp int(10) unsigned NOT NULL default '0',
|
||||
rss_class tinyint(1) unsigned NOT NULL default '0',
|
||||
rss_limit tinyint(3) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (rss_id)
|
||||
) TYPE=MyISAM;",
|
||||
|
||||
"INSERT INTO ".MPREFIX."rss VALUES
|
||||
(0, '".RSS_NEWS."', 'news', '', 'news', '".RSS_PLUGIN_LAN_7."', '".time()."', 0, 9),
|
||||
(0, '".RSS_DL."', 'download', '', 'download', '".RSS_PLUGIN_LAN_8."', '".time()."', 0, 9),
|
||||
(0, '".RSS_COM."', 'comments', '', 'comments', '".RSS_PLUGIN_LAN_9."', '".time()."', 0, 9)
|
||||
"
|
||||
);
|
||||
|
||||
// Create a link in main menu (yes=TRUE, no=FALSE) ----------------------------
|
||||
$eplug_link = FALSE;
|
||||
$eplug_link_name = '';
|
||||
$eplug_link_url = '';
|
||||
|
||||
|
||||
// upgrading ------------------------------------------------------------------
|
||||
$upgrade_add_prefs = "";
|
||||
$upgrade_remove_prefs = "";
|
||||
|
||||
$upgrade_alter_tables = array(
|
||||
"CREATE TABLE ".MPREFIX."rss (
|
||||
rss_id int(10) unsigned NOT NULL auto_increment,
|
||||
rss_name varchar(255) NOT NULL default '',
|
||||
rss_url text NOT NULL,
|
||||
rss_topicid varchar(255) NOT NULL default '',
|
||||
rss_path varchar(255) NOT NULL default '',
|
||||
rss_text longtext NOT NULL,
|
||||
rss_datestamp int(10) unsigned NOT NULL default '0',
|
||||
rss_class tinyint(1) unsigned NOT NULL default '0',
|
||||
rss_limit tinyint(3) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (rss_id)
|
||||
) TYPE=MyISAM;",
|
||||
|
||||
"INSERT INTO ".MPREFIX."rss VALUES
|
||||
(0, '".RSS_NEWS."', 'news', '', 'news', '".RSS_PLUGIN_LAN_7."', '".time()."', 0, 9),
|
||||
(0, '".RSS_DL."', 'download', '', 'download', '".RSS_PLUGIN_LAN_8."', '".time()."', 0, 9),
|
||||
(0, '".RSS_COM."', 'comments', '', 'comments', '".RSS_PLUGIN_LAN_9."', '".time()."', 0, 9)
|
||||
"
|
||||
);
|
||||
|
||||
|
||||
?>
|
20
e107_plugins/rss_menu/plugin.xml
Normal file
20
e107_plugins/rss_menu/plugin.xml
Normal file
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
|
||||
<!-- $Id: plugin.xml,v 1.1 2008-12-13 12:34:53 e107steved Exp $ -->
|
||||
|
||||
<e107Plugin name="RSS_PLUGIN_LAN_1" version="1.1" compatibility="0.8" installRequired="true">
|
||||
<author name="e107dev" url="http://e107.org" />
|
||||
<description>RSS_PLUGIN_LAN_2</description>
|
||||
<compatibility>0.8</compatibility>
|
||||
<folder>rss_menu</folder>
|
||||
<logLanguageFile filename="languages/--LAN--_admin_rss_menu.php" />
|
||||
<copyright>Copyright e107 Inc e107.org, Licensed under GPL (http://www.gnu.org/licenses/gpl.txt)</copyright>
|
||||
<administration>
|
||||
<configFile>admin_prefs.php</configFile>
|
||||
<icon>images/rss_32.png</icon>
|
||||
<iconSmall>images/rss_16.png</iconSmall>
|
||||
<caption>LAN_CONFIGURE</caption>
|
||||
</administration>
|
||||
<mainPrefs>
|
||||
</mainPrefs>
|
||||
</e107Plugin>
|
@ -11,8 +11,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/rss_menu/rss.php,v $
|
||||
| $Revision: 1.9 $
|
||||
| $Date: 2008-11-02 22:29:33 $
|
||||
| $Revision: 1.10 $
|
||||
| $Date: 2008-12-13 12:34:53 $
|
||||
| $Author: e107steved $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
@ -28,31 +28,37 @@ Plugins should use an e_rss.php file in their plugin folder
|
||||
*/
|
||||
|
||||
require_once("../../class2.php");
|
||||
if (!plugInstalled('rss_menu'))
|
||||
{
|
||||
header("Location: ".e_BASE."index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
global $tp;
|
||||
|
||||
require_once(e_PLUGIN."rss_menu/rss_shortcodes.php");
|
||||
require_once(e_HANDLER."userclass_class.php");
|
||||
|
||||
if (!is_object($tp->e_bb)) {
|
||||
if (!is_object($tp->e_bb))
|
||||
{
|
||||
require_once(e_HANDLER.'bbcode_handler.php');
|
||||
$tp->e_bb = new e_bbcode;
|
||||
}
|
||||
|
||||
//get language file
|
||||
if (is_readable(e_PLUGIN."rss_menu/languages/".e_LANGUAGE.".php")) {
|
||||
include_once(e_PLUGIN."rss_menu/languages/".e_LANGUAGE.".php");
|
||||
} else {
|
||||
include_once(e_PLUGIN."rss_menu/languages/English.php");
|
||||
}
|
||||
@include_lan(e_PLUGIN."rss_menu/languages/".e_LANGUAGE."_admin_rss_menu.php");
|
||||
|
||||
//get template
|
||||
if (is_readable(THEME."rss_template.php")) {
|
||||
if (is_readable(THEME."rss_template.php"))
|
||||
{
|
||||
require_once(THEME."rss_template.php");
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
require_once(e_PLUGIN."rss_menu/rss_template.php");
|
||||
}
|
||||
|
||||
|
||||
//query handler
|
||||
if (e_QUERY)
|
||||
{
|
||||
|
@ -11,15 +11,20 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/rss_menu/rss_menu.php,v $
|
||||
| $Revision: 1.1.1.1 $
|
||||
| $Date: 2006-12-02 04:35:42 $
|
||||
| $Author: mcfly_e107 $
|
||||
| $Revision: 1.2 $
|
||||
| $Date: 2008-12-13 12:34:53 $
|
||||
| $Author: e107steved $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
if (!plugInstalled('rss_menu'))
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
global $FILES_DIRECTORY,$pref,$sql;
|
||||
$path = e_PLUGIN."rss_menu/";
|
||||
@include_lan(e_PLUGIN."rss_menu/languages/".e_LANGUAGE."_admin_rss_menu.php");
|
||||
|
||||
$des = "";
|
||||
$topic = "";
|
||||
|
@ -8,5 +8,6 @@ CREATE TABLE rss (
|
||||
rss_datestamp int(10) unsigned NOT NULL default '0',
|
||||
rss_class tinyint(1) unsigned NOT NULL default '0',
|
||||
rss_limit tinyint(3) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (rss_id)
|
||||
PRIMARY KEY (rss_id),
|
||||
KEY rss_name (rss_name)
|
||||
) TYPE=MyISAM;
|
||||
|
Loading…
x
Reference in New Issue
Block a user