mirror of
https://github.com/e107inc/e107.git
synced 2025-08-05 14:17:49 +02:00
Fixes #948 - RSS admin area rewrite. RSS menu updated for Bootstrap and RSS sef-urls added.
This commit is contained in:
@@ -20,7 +20,7 @@ if (!defined('e107_INIT')) { exit; }
|
|||||||
|
|
||||||
//##### create feed for admin, return array $eplug_rss_feed --------------------------------
|
//##### create feed for admin, return array $eplug_rss_feed --------------------------------
|
||||||
// Download
|
// Download
|
||||||
$feed['name'] = ADLAN_24;
|
$feed['name'] = LAN_PLUGIN_DOWNLOAD_NAME;
|
||||||
$feed['url'] = 'download';
|
$feed['url'] = 'download';
|
||||||
$feed['topic_id'] = '';
|
$feed['topic_id'] = '';
|
||||||
$feed['path'] = 'download';
|
$feed['path'] = 'download';
|
||||||
@@ -36,9 +36,9 @@ if (!defined('e107_INIT')) { exit; }
|
|||||||
|
|
||||||
if($sqli -> db_Select("download_category", "*","download_category_id!='' ORDER BY download_category_order "))
|
if($sqli -> db_Select("download_category", "*","download_category_id!='' ORDER BY download_category_order "))
|
||||||
{
|
{
|
||||||
while($rowi = $sqli -> db_Fetch())
|
while($rowi = $sqli ->fetch())
|
||||||
{
|
{
|
||||||
$feed['name'] = ADLAN_24.' > '.$rowi['download_category_name'];
|
$feed['name'] = LAN_PLUGIN_DOWNLOAD_NAME.' > '.$rowi['download_category_name'];
|
||||||
$feed['url'] = 'download';
|
$feed['url'] = 'download';
|
||||||
$feed['topic_id'] = $rowi['download_category_id'];
|
$feed['topic_id'] = $rowi['download_category_id'];
|
||||||
$feed['path'] = 'download';
|
$feed['path'] = 'download';
|
||||||
|
@@ -55,10 +55,10 @@ class rss_admin extends e_admin_dispatcher
|
|||||||
protected $adminMenu = array(
|
protected $adminMenu = array(
|
||||||
|
|
||||||
'main/list' => array('caption'=> LAN_MANAGE, 'perm' => 'P'),
|
'main/list' => array('caption'=> LAN_MANAGE, 'perm' => 'P'),
|
||||||
'main/create' => array('caption'=> LAN_CREATE, 'perm' => 'P'),
|
'main/import' => array('caption'=> "Add New Feed", 'perm' => 'P'),
|
||||||
|
|
||||||
/*
|
|
||||||
'main/prefs' => array('caption'=> LAN_PREFS, 'perm' => 'P'),
|
'main/prefs' => array('caption'=> LAN_PREFS, 'perm' => 'P'),
|
||||||
|
/*
|
||||||
'main/custom' => array('caption'=> 'Custom Page', 'perm' => 'P')
|
'main/custom' => array('caption'=> 'Custom Page', 'perm' => 'P')
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -69,6 +69,15 @@ class rss_admin extends e_admin_dispatcher
|
|||||||
);
|
);
|
||||||
|
|
||||||
protected $menuTitle = 'RSS';
|
protected $menuTitle = 'RSS';
|
||||||
|
|
||||||
|
|
||||||
|
function init()
|
||||||
|
{
|
||||||
|
if(E107_DEBUG_LEVEL > 0)
|
||||||
|
{
|
||||||
|
$this->adminMenu['main/create'] = array('caption'=> "Add Custom Feed", 'perm' => 'P');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -79,33 +88,32 @@ class rss_ui extends e_admin_ui
|
|||||||
{
|
{
|
||||||
|
|
||||||
protected $pluginTitle = 'RSS';
|
protected $pluginTitle = 'RSS';
|
||||||
protected $pluginName = 'myplugin';
|
protected $pluginName = 'core';
|
||||||
protected $table = 'rss';
|
protected $table = 'rss';
|
||||||
protected $pid = 'rss_id';
|
protected $pid = 'rss_id';
|
||||||
protected $perPage = 10;
|
protected $perPage = 10;
|
||||||
|
|
||||||
protected $fields = array ( 'checkboxes' => array ( 'title' => '', 'type' => '', 'data' => '', 'width' => '5%', 'thclass' => 'center', 'forced' => '1', 'class' => 'center', 'toggle' => 'e-multiselect', ),
|
protected $fields = array ( 'checkboxes' => array ( 'title' => '', 'type' => '', 'data' => '', 'width' => '5%', 'thclass' => 'center', 'forced' => '1', 'class' => 'center', 'toggle' => 'e-multiselect', ),
|
||||||
'rss_id' => array ( 'title' => 'LAN_ID', 'data' => 'int', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
'rss_id' => array ( 'title' => LAN_ID, 'data' => 'int', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||||
'rss_name' => array ( 'title' => 'LAN_TITLE', 'type' => 'text', 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
'rss_name' => array ( 'title' => LAN_TITLE, 'type' => 'text', 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||||
'rss_url' => array ( 'title' => 'LAN_URL', 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '.{Type}.{Topic id}', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
'rss_path' => array ( 'title' => 'Plugin-Dir', 'type' => 'text', 'data' => 'int', 'readonly'=>1, 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||||
|
'rss_url' => array ( 'title' => LAN_URL, 'type' => 'method', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||||
'rss_topicid' => array ( 'title' => 'Topic id', 'type' => 'text', 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
|
'rss_topicid' => array ( 'title' => 'Topic id', 'type' => 'text', 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
|
||||||
'rss_path' => array ( 'title' => 'Path', 'type' => 'text', 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
|
||||||
'rss_text' => array ( 'title' => 'Text', 'type' => 'textarea', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
|
'rss_text' => array ( 'title' => 'Text', 'type' => 'textarea', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
|
||||||
'rss_datestamp' => array ( 'title' => 'LAN_DATESTAMP', 'type' => 'datestamp', 'data' => 'int', 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
'rss_datestamp' => array ( 'title' => LAN_DATESTAMP, 'type' => 'datestamp', 'data' => 'int', 'readonly'=>true, 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||||
'rss_class' => array ( 'title' => 'LAN_VISIBILITY', 'type' => 'method', 'data' => 'int', 'width' => 'auto', 'batch' => true, 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
'rss_class' => array ( 'title' => LAN_VISIBILITY, 'type' => 'dropdown', 'data' => 'int', 'width' => 'auto', 'batch' => true, 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => array('optArray'=> array(RSS_LAN_ADMIN_21,RSS_LAN_ADMIN_22,RSS_LAN_ADMIN_23),'size'=>'xlarge'), 'class' => 'left', 'thclass' => 'left', ),
|
||||||
'rss_limit' => array ( 'title' => 'Limit', 'type' => 'number', 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
'rss_limit' => array ( 'title' => 'Limit', 'type' => 'number', 'data' => 'int', 'inline'=>true, 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||||
'options' => array ( 'title' => 'LAN_OPTIONS', 'type' => null, 'data' => '', 'width' => '10%', 'thclass' => 'center last', 'class' => 'center last', 'forced' => '1', ),
|
'options' => array ( 'title' => LAN_OPTIONS, 'type' => null, 'data' => '', 'width' => '10%', 'thclass' => 'center last', 'class' => 'center last', 'forced' => '1', ),
|
||||||
);
|
);
|
||||||
|
|
||||||
protected $fieldpref = array('checkboxes', 'rss_name','rss_url', 'rss_topicid', 'rss_path', 'rss_class', 'options');
|
protected $fieldpref = array('checkboxes', 'rss_name','rss_url', 'rss_topicid', 'rss_limit', 'rss_class', 'options');
|
||||||
|
|
||||||
|
|
||||||
|
protected $prefs = array(
|
||||||
/*
|
'rss_othernews' => array('title'=> RSS_LAN_ADMIN_13, 'type' => 'boolean', 'data' => 'int'),
|
||||||
protected = array(
|
'rss_summarydiz' => array('title'=> RSS_LAN_ADMIN_19, 'type' => 'boolean', 'data' => 'integer'),
|
||||||
'pref_type' => array('title'=> 'type', 'type'=>'text', 'data' => 'string', 'validate' => true),
|
'rss_shownewsimage' => array('title'=> RSS_LAN_ADMIN_33, 'type' => 'boolean', 'data' => 'int')
|
||||||
'pref_folder' => array('title'=> 'folder', 'type' => 'boolean', 'data' => 'integer'),
|
|
||||||
'pref_name' => array('title'=> 'name', 'type' => 'text', 'data' => 'string', 'validate' => 'regex', 'rule' => '#^[\w]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@@ -113,17 +121,222 @@ class rss_ui extends e_admin_ui
|
|||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if(!empty($_POST['importid']))
|
||||||
|
{
|
||||||
|
$this->dbrssImport();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function customPage()
|
function dbrssImport()
|
||||||
{
|
{
|
||||||
$ns = e107::getRender();
|
$sql = e107::getDb();
|
||||||
$text = 'Hello World!';
|
$tp = e107::getParser();
|
||||||
$ns->tablerender('Hello',$text);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
foreach($_POST['importid'] as $key=>$value)
|
||||||
|
{
|
||||||
|
$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->insert("rss", $rssVals);
|
||||||
|
e107::getLog()->logArrayAll('RSS_04',$rssVals);
|
||||||
|
}
|
||||||
|
$message = count($_POST['importid'])." ".RSS_LAN_ADMIN_18;
|
||||||
|
return $message;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function importPage()
|
||||||
|
{
|
||||||
|
// Import - put up the list of possible feeds to import
|
||||||
|
|
||||||
|
|
||||||
|
$sql = e107::getDb();
|
||||||
|
$ns = e107::getRender();
|
||||||
|
$mes = e107::getMessage();
|
||||||
|
$tp = e107::getParser();
|
||||||
|
$frm = e107::getForm();
|
||||||
|
|
||||||
|
global $i,$rss_shortcodes, $feed, $pref;
|
||||||
|
|
||||||
|
require_once(e_PLUGIN.'rss_menu/rss_shortcodes.php');
|
||||||
|
|
||||||
|
if(!isset($RSS_ADMIN_IMPORT_HEADER))
|
||||||
|
{
|
||||||
|
$RSS_ADMIN_IMPORT_HEADER = "
|
||||||
|
<form action='".e_SELF."' id='imlistform' method='post' >
|
||||||
|
<table class='table adminform'>
|
||||||
|
<tr>
|
||||||
|
<th>".RSS_LAN_ADMIN_16."</td>
|
||||||
|
<th>".RSS_LAN_ADMIN_3."</td>
|
||||||
|
<th>".LAN_NAME."</td>
|
||||||
|
<th>".RSS_LAN_ADMIN_5."</td>
|
||||||
|
<th>".RSS_LAN_ADMIN_12."</td>
|
||||||
|
</tr>";
|
||||||
|
}
|
||||||
|
if(!isset($RSS_ADMIN_IMPORT_TABLE))
|
||||||
|
{
|
||||||
|
$RSS_ADMIN_IMPORT_TABLE = "
|
||||||
|
<tr>
|
||||||
|
<td>{RSS_ADMIN_IMPORT_CHECK}</td>
|
||||||
|
<td>{RSS_ADMIN_IMPORT_PATH}</td>
|
||||||
|
<td><b>{RSS_ADMIN_IMPORT_NAME}</b><br />{RSS_ADMIN_IMPORT_TEXT}</td>
|
||||||
|
<td>{RSS_ADMIN_IMPORT_URL}</td>
|
||||||
|
<td>{RSS_ADMIN_IMPORT_TOPICID}</td>
|
||||||
|
</tr>";
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!isset($RSS_ADMIN_IMPORT_FOOTER))
|
||||||
|
{
|
||||||
|
$RSS_ADMIN_IMPORT_FOOTER = "
|
||||||
|
</table>
|
||||||
|
<div class='buttons-bar center'>
|
||||||
|
".$frm->admin_button('import_rss',RSS_LAN_ADMIN_17,'submit')."
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// global $RSS_ADMIN_IMPORT_HEADER, $RSS_ADMIN_IMPORT_TABLE, $RSS_ADMIN_IMPORT_FOOTER;
|
||||||
|
|
||||||
|
$sqli = new db;
|
||||||
|
$feedlist = array();
|
||||||
|
|
||||||
|
// 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['text'] = RSS_PLUGIN_LAN_7;
|
||||||
|
$feed['class'] = '0';
|
||||||
|
$feed['limit'] = '9';
|
||||||
|
$feedlist[] = $feed;
|
||||||
|
|
||||||
|
// News categories
|
||||||
|
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'];
|
||||||
|
$feed['path'] = 'news';
|
||||||
|
$feed['text'] = RSS_PLUGIN_LAN_10.' '.$rowi['category_name'];
|
||||||
|
$feed['class'] = '0';
|
||||||
|
$feed['limit'] = '9';
|
||||||
|
// $feed['exclude_class'] = '';
|
||||||
|
$feedlist[] = $feed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* // Download
|
||||||
|
$feed['name'] = ADLAN_24;
|
||||||
|
$feed['url'] = 'download';
|
||||||
|
$feed['topic_id'] = '';
|
||||||
|
$feed['path'] = 'download';
|
||||||
|
$feed['text'] = RSS_PLUGIN_LAN_8;
|
||||||
|
$feed['class'] = '0';
|
||||||
|
$feed['limit'] = '9';
|
||||||
|
$feedlist[] = $feed;
|
||||||
|
|
||||||
|
// Download categories
|
||||||
|
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'];
|
||||||
|
$feed['path'] = 'download';
|
||||||
|
$feed['text'] = RSS_PLUGIN_LAN_11.' '.$rowi['download_category_name'];
|
||||||
|
$feed['class'] = '0';
|
||||||
|
$feed['limit'] = '9';
|
||||||
|
$feedlist[] = $feed;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
// Comments
|
||||||
|
$feed['name'] = RSS_PLUGIN_LAN_14;
|
||||||
|
$feed['url'] = 'comments';
|
||||||
|
$feed['topic_id'] = '';
|
||||||
|
$feed['path'] = 'comments';
|
||||||
|
$feed['text'] = RSS_PLUGIN_LAN_9;
|
||||||
|
$feed['class'] = '0';
|
||||||
|
$feed['limit'] = '9';
|
||||||
|
$feedlist[] = $feed;
|
||||||
|
|
||||||
|
// Plugin rss feed, using e_rss.php in plugin folder
|
||||||
|
$plugin_feedlist = array();
|
||||||
|
foreach($pref['e_rss_list'] as $val)
|
||||||
|
{
|
||||||
|
$eplug_rss_feed = array();
|
||||||
|
if (is_readable(e_PLUGIN.$val."/e_rss.php"))
|
||||||
|
{
|
||||||
|
require_once(e_PLUGIN.$val."/e_rss.php");
|
||||||
|
|
||||||
|
$className = $val."_rss";
|
||||||
|
$data = false;
|
||||||
|
|
||||||
|
if(!$data = e107::callMethod($className,'config'))
|
||||||
|
{
|
||||||
|
$data = $eplug_rss_feed;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach($data as $v)
|
||||||
|
{
|
||||||
|
$v['path'] = $val;
|
||||||
|
array_push($plugin_feedlist,$v);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$feedlist = array_merge($feedlist, $plugin_feedlist);
|
||||||
|
|
||||||
|
// print_a($feedlist);
|
||||||
|
|
||||||
|
$render=FALSE;
|
||||||
|
$i=0;
|
||||||
|
$text = $RSS_ADMIN_IMPORT_HEADER;
|
||||||
|
foreach($feedlist as $k=>$feed)
|
||||||
|
{
|
||||||
|
$feed['topic_id'] = $tp -> toDB($feed['topic_id']);
|
||||||
|
$feed['url'] = $tp -> toDB($feed['url']);
|
||||||
|
|
||||||
|
// Check if feed is not yet present
|
||||||
|
if(!$sql->select("rss", "*", "rss_path='".$feed['path']."' AND rss_url='".$feed['url']."' AND rss_topicid='".$feed['topic_id']."' "))
|
||||||
|
{
|
||||||
|
$render=TRUE;
|
||||||
|
$text .= $tp -> parseTemplate($RSS_ADMIN_IMPORT_TABLE, FALSE, $rss_shortcodes);
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$text .= $tp -> parseTemplate($RSS_ADMIN_IMPORT_FOOTER, FALSE, $rss_shortcodes);
|
||||||
|
|
||||||
|
if(!$render)
|
||||||
|
{
|
||||||
|
$this->show_message(RSS_LAN_ADMIN_11, RSS_LAN_ERROR_6);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// $ns->tablerender(RSS_LAN_ADMIN_11, $mes->render(). $text);
|
||||||
|
|
||||||
|
return $text;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,31 +347,37 @@ class rss_form_ui extends e_admin_form_ui
|
|||||||
|
|
||||||
|
|
||||||
// Custom Method/Function
|
// Custom Method/Function
|
||||||
function rss_class($curVal,$mode)
|
function rss_url($curVal,$mode)
|
||||||
{
|
{
|
||||||
$frm = e107::getForm();
|
|
||||||
$array = array(RSS_LAN_ADMIN_21,RSS_LAN_ADMIN_22,RSS_LAN_ADMIN_23);
|
|
||||||
|
|
||||||
switch($mode)
|
switch($mode)
|
||||||
{
|
{
|
||||||
case 'read': // List Page
|
case 'read': // List Page
|
||||||
return vartrue($array[$curVal]);
|
|
||||||
|
$type = $this->getController()->getListModel()->get('rss_type');
|
||||||
|
$topic = $this->getController()->getListModel()->get('rss_topicid');
|
||||||
|
|
||||||
|
$link = e107::url('rss_menu', 'rss', array('rss_type'=>$type, 'rss_url'=>$curVal, 'rss_topicid'=>$topic));
|
||||||
|
return "<a href='".$link."'>".$curVal."</a>";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'write': // Edit Page
|
case 'write': // Edit Page
|
||||||
return $frm->select('rss_class',$array, $curVal);
|
$link = SITEURL."feed/"; // e107::url('rss_menu','index').'/';
|
||||||
|
return "<div class='form-inline'>".$link.e107::getForm()->text('rss_url', $curVal,255, 'size=small')."/rss/{Topic id}</div>";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'filter':
|
case 'filter':
|
||||||
case 'batch':
|
case 'batch':
|
||||||
return $array;
|
return null;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
new rss_admin();
|
new rss_admin();
|
||||||
|
|
||||||
require_once(e_ADMIN."auth.php");
|
require_once(e_ADMIN."auth.php");
|
||||||
@@ -168,7 +387,6 @@ require_once(e_ADMIN."footer.php");
|
|||||||
exit;
|
exit;
|
||||||
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -177,6 +395,7 @@ exit;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// ------------------------------- Legacy Code -------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -801,7 +1020,9 @@ class rss
|
|||||||
// Update options
|
// Update options
|
||||||
function dboptions()
|
function dboptions()
|
||||||
{
|
{
|
||||||
global $tp, $pref, $admin_log;
|
global $tp, $pref;
|
||||||
|
|
||||||
|
$admin_log = e107::getLog();
|
||||||
|
|
||||||
$temp = array();
|
$temp = array();
|
||||||
$temp['rss_othernews'] = $_POST['rss_othernews'];
|
$temp['rss_othernews'] = $_POST['rss_othernews'];
|
||||||
|
@@ -23,16 +23,24 @@ global $PLUGINS_DIRECTORY;
|
|||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
$sql = e107::getDb();
|
$sql = e107::getDb();
|
||||||
|
|
||||||
if(USER_AREA && $sql->db_Select("rss", "*", "rss_class='0' AND rss_limit>0 ORDER BY rss_name"))
|
if(USER_AREA && $sql->select("rss", "*", "rss_class='0' AND rss_limit>0 ORDER BY rss_name"))
|
||||||
{
|
{
|
||||||
while($row=$sql->db_Fetch())
|
while($row = $sql->fetch())
|
||||||
{ // 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";
|
if(strpos($row['rss_url'], "*") === false) // Wildcard topic_id's should not be listed
|
||||||
$url .= ($row['rss_topicid']) ? ".".$row['rss_topicid'] : "";
|
{
|
||||||
|
// $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'] : "";
|
||||||
|
|
||||||
|
$url2 = e107::url('rss_menu','rss', $row);
|
||||||
|
$url4 = e107::url('rss_menu','atom', $row);
|
||||||
|
|
||||||
$name = $tp->toHTML($row['rss_name'], TRUE, 'no_hook, emotes_off');
|
$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";
|
|
||||||
|
echo "<link rel='alternate' type='application/rss+xml' title='".htmlspecialchars(SITENAME, ENT_QUOTES, 'utf-8')." ".htmlspecialchars($name, ENT_QUOTES, 'utf-8')."' href='".$url2."' />\n";
|
||||||
|
echo "<link rel='alternate' type='application/atom+xml' title='".htmlspecialchars(SITENAME, ENT_QUOTES, 'utf-8')." ".htmlspecialchars($name, ENT_QUOTES, 'utf-8')."' href='".$url4."' />\n";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
42
e107_plugins/rss_menu/e_url.php
Normal file
42
e107_plugins/rss_menu/e_url.php
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* e107 Bootstrap CMS
|
||||||
|
*
|
||||||
|
* Copyright (C) 2008-2014 e107 Inc (e107.org)
|
||||||
|
* Released under the terms and conditions of the
|
||||||
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
|
// v2.x Standard - Simple mod-rewrite module.
|
||||||
|
|
||||||
|
class rss_menu_url // plugin-folder + '_url'
|
||||||
|
{
|
||||||
|
function config()
|
||||||
|
{
|
||||||
|
$config = array();
|
||||||
|
|
||||||
|
$config['rss'] = array(
|
||||||
|
'regex' => '^feed/(.*)/rss/?([\d]*)?$',
|
||||||
|
'sef' => 'feed/{rss_url}/rss/{rss_topicid}',
|
||||||
|
'redirect' => '{e_PLUGIN}rss_menu/rss.php?cat=$1&type=2&topic=$2'
|
||||||
|
);
|
||||||
|
|
||||||
|
$config['atom'] = array(
|
||||||
|
'regex' => '^feed/(.*)/atom/?([\d]*)?$',
|
||||||
|
'sef' => 'feed/{rss_url}/atom/{rss_topicid}',
|
||||||
|
'redirect' => '{e_PLUGIN}rss_menu/rss.php?cat=$1&type=4&topic=$2'
|
||||||
|
);
|
||||||
|
|
||||||
|
$config['index'] = array(
|
||||||
|
'regex' => '^feed/?$',
|
||||||
|
'sef' => 'feed',
|
||||||
|
'redirect' => '{e_PLUGIN}rss_menu/rss.php',
|
||||||
|
);
|
||||||
|
|
||||||
|
return $config;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -2,5 +2,6 @@
|
|||||||
|
|
||||||
define("LAN_PLUGIN_RSS_NAME", "RSS");
|
define("LAN_PLUGIN_RSS_NAME", "RSS");
|
||||||
define("LAN_PLUGIN_RSS_DESCRIPTION", "RSS Feeds from your site.");
|
define("LAN_PLUGIN_RSS_DESCRIPTION", "RSS Feeds from your site.");
|
||||||
|
define("LAN_PLUGIN_RSS_SUBSCRIBE", "Subscribe");
|
||||||
|
define("LAN_PLUGIN_RSS_SUBSCRIBE_TO", "Subscribe to [x]");
|
||||||
?>
|
?>
|
@@ -19,9 +19,13 @@ Query string: content_type.rss_type.[topic id]
|
|||||||
Plugins should use an e_rss.php file in their plugin folder
|
Plugins should use an e_rss.php file in their plugin folder
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
if (!defined('e107_INIT'))
|
||||||
|
{
|
||||||
require_once('../../class2.php');
|
require_once('../../class2.php');
|
||||||
|
}
|
||||||
|
|
||||||
$e107 = e107::getInstance();
|
$e107 = e107::getInstance();
|
||||||
|
|
||||||
if (!$e107->isInstalled('rss_menu'))
|
if (!$e107->isInstalled('rss_menu'))
|
||||||
{
|
{
|
||||||
header('Location: '.e_BASE.'index.php');
|
header('Location: '.e_BASE.'index.php');
|
||||||
@@ -56,7 +60,14 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Query handler
|
// Query handler
|
||||||
if (e_QUERY)
|
if(!empty($_GET))
|
||||||
|
{
|
||||||
|
$content_type = $tp->toDB($_GET['cat']);
|
||||||
|
$rss_type = intval(varset($_GET['type'],0));
|
||||||
|
$topic_id = $tp->toDB($_GET['topic'],'');
|
||||||
|
|
||||||
|
}
|
||||||
|
elseif (e_QUERY)
|
||||||
{
|
{
|
||||||
$tmp = explode('.', e_QUERY);
|
$tmp = explode('.', e_QUERY);
|
||||||
$content_type = $tp->toDB($tmp[0]);
|
$content_type = $tp->toDB($tmp[0]);
|
||||||
@@ -64,6 +75,7 @@ if (e_QUERY)
|
|||||||
$topic_id = $tp->toDB($tmp[2],'');
|
$topic_id = $tp->toDB($tmp[2],'');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// List available rss feeds
|
// List available rss feeds
|
||||||
if (!$rss_type)
|
if (!$rss_type)
|
||||||
{ // Display list of all feeds
|
{ // Display list of all feeds
|
||||||
|
@@ -2,67 +2,27 @@
|
|||||||
/*
|
/*
|
||||||
* e107 website system
|
* e107 website system
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
* Copyright (C) 2008-2015 e107 Inc (e107.org)
|
||||||
* Released under the terms and conditions of the
|
* Released under the terms and conditions of the
|
||||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/rss_menu/rss_menu.php,v $
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
if (!e107::isInstalled('rss_menu'))
|
if (!e107::isInstalled('rss_menu'))
|
||||||
{
|
{
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$FILES_DIRECTORY = e107::getInstance()->getFolder('files');
|
|
||||||
$sql = e107::getDb();
|
$sql = e107::getDb();
|
||||||
$path = e_PLUGIN_ABS."rss_menu/";
|
|
||||||
include_lan(e_PLUGIN."rss_menu/languages/".e_LANGUAGE."_admin_rss_menu.php");
|
|
||||||
|
|
||||||
$des = "";
|
e107::includeLan(e_PLUGIN."rss_menu/languages/".e_LANGUAGE."_admin_rss_menu.php");
|
||||||
|
|
||||||
$topic = "";
|
$topic = "";
|
||||||
|
$caption = "";
|
||||||
|
|
||||||
|
|
||||||
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") )
|
|
||||||
{
|
|
||||||
$type = 6;
|
|
||||||
$des = RSS_MENU_L5;
|
|
||||||
}
|
|
||||||
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"))
|
|
||||||
{
|
|
||||||
$type = 9;
|
|
||||||
$des = RSS_MENU_L7;
|
|
||||||
}
|
|
||||||
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"))
|
|
||||||
{
|
|
||||||
$type = 12;
|
|
||||||
$des = RSS_MENU_L9;
|
|
||||||
}
|
|
||||||
if(!$des)
|
|
||||||
{
|
|
||||||
$type = 1;
|
|
||||||
$des = RSS_MENU_L3;
|
|
||||||
}
|
|
||||||
if(e_PAGE == "news.php" && e107::getPref('rss_newscats'))
|
if(e_PAGE == "news.php" && e107::getPref('rss_newscats'))
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -73,16 +33,71 @@ if(e_PAGE == "news.php" && e107::getPref('rss_newscats'))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(deftrue('e_CURRENT_PLUGIN') && $res = $sql->retrieve("rss", "rss_path,rss_url", " rss_path = '".e_CURRENT_PLUGIN."' LIMIT 1"))
|
||||||
|
{
|
||||||
|
$caption = e107::getParser()->lanVars(LAN_PLUGIN_RSS_SUBSCRIBE_TO, deftrue('LAN_PLUGIN_'.strtoupper(e_CURRENT_PLUGIN).'_NAME'));
|
||||||
|
$type = $res['rss_url'];
|
||||||
|
$plug = $res['rss_path'];
|
||||||
|
}
|
||||||
|
elseif($sql->select("rss", "rss_path", " rss_path = 'news' LIMIT 1")) // Fall back to news, if available.
|
||||||
|
{
|
||||||
|
$caption = LAN_PLUGIN_RSS_SUBSCRIBE;
|
||||||
|
$type = 'news';
|
||||||
|
$plug = 'news';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if(!empty($type))
|
||||||
|
{
|
||||||
|
$arr = array('rss_topicid'=> $topic, 'rss_url'=>$type);
|
||||||
|
|
||||||
|
|
||||||
|
if(deftrue('BOOTSTRAP') === 3) // v2.x
|
||||||
|
{
|
||||||
$text = "
|
$text = "
|
||||||
<div>
|
<div>
|
||||||
".$des.RSS_MENU_L1."<br />
|
<a class='btn btn-sm btn-default' href='".e107::url('rss_menu', 'rss', $arr)."'>".$tp->toGlyph('fa-rss')." RSS</a>
|
||||||
<div class='spacer'><a href='".$path."rss.php?$type.1".($topic ? ".".$topic : "")."'><img src='".$path."images/rss1.png' alt='rss1.0' /></a></div>
|
<a class='btn btn-sm btn-default' href='".e107::url('rss_menu', 'atom', $arr)."'>".$tp->toGlyph('fa-rss')." Atom</a>
|
||||||
<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></div>
|
|
||||||
<div class='spacer'><a href='".$path."rss.php?$type.4".($topic ? ".".$topic : "")."'><img src='".$path."images/rss4.png' alt='atom' /></a></div>
|
|
||||||
</div>";
|
</div>";
|
||||||
|
|
||||||
// Deprecated - can be controlled within tablestyle (theme) - case mod == 'rss_menu'
|
}
|
||||||
//$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);
|
else // v1.x
|
||||||
e107::getRender()->tablerender(RSS_MENU_L2, $text, 'rss_menu');
|
{
|
||||||
|
$path = e_PLUGIN_ABS."rss_menu/";
|
||||||
|
|
||||||
|
$description = array(
|
||||||
|
|
||||||
|
'chatbox' => RSS_MENU_L7,
|
||||||
|
'download' => RSS_MENU_L9,
|
||||||
|
'bugtracker' => RSS_MENU_L8,
|
||||||
|
'forumtopic' => RSS_MENU_L6,
|
||||||
|
'forumname' => RSS_MENU_L5,
|
||||||
|
'forumposts' => '',
|
||||||
|
'comments' => RSS_MENU_L4,
|
||||||
|
5 => RSS_MENU_L4,
|
||||||
|
6 => RSS_MENU_L5,
|
||||||
|
7 => RSS_MENU_L6,
|
||||||
|
9 => RSS_MENU_L7,
|
||||||
|
10 => RSS_MENU_L8,
|
||||||
|
12 => RSS_MENU_L9,
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
$text = "
|
||||||
|
<div>
|
||||||
|
".varset($description[$type]).RSS_MENU_L1."<br />
|
||||||
|
|
||||||
|
<div class='spacer'><a href='".e107::url('rss_menu', 'rss', $arr)."'><img src='".$path."images/rss2.png' alt='rss2.0' /></a></div>
|
||||||
|
<div class='spacer'><a href='".e107::url('rss_menu', 'atom', $arr)."'><img src='".$path."images/rss4.png' alt='atom' /></a></div>
|
||||||
|
</div>";
|
||||||
|
|
||||||
|
$caption = RSS_MENU_L2;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
e107::getRender()->tablerender($caption, $text, 'rss_menu');
|
||||||
|
}
|
||||||
?>
|
?>
|
@@ -3,88 +3,133 @@
|
|||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
include_once(e_HANDLER.'shortcode_handler.php');
|
include_once(e_HANDLER.'shortcode_handler.php');
|
||||||
$rss_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
|
// $rss_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
|
||||||
/*
|
|
||||||
SC_BEGIN RSS_FEED
|
|
||||||
|
|
||||||
|
class rss_menu_shortcodes extends e_shortcode
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function sc_rss_feed()
|
||||||
|
{
|
||||||
global $row, $tp;
|
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'] : '');
|
// $url2 = e_PLUGIN."rss_menu/rss.php?".e_LANQRY.$tp->toHTML($row['rss_url'], TRUE, 'constants').".2".($row['rss_topicid'] ? ".".$row['rss_topicid'] : '');
|
||||||
|
$url2 = e107::url('rss_menu','rss', $row);
|
||||||
return "<a href='".$url2."'>".$tp->toHTML($row['rss_name'], TRUE)."</a>";
|
return "<a href='".$url2."'>".$tp->toHTML($row['rss_name'], TRUE)."</a>";
|
||||||
SC_END
|
}
|
||||||
|
|
||||||
SC_BEGIN RSS_ICON
|
function sc_rss_icon()
|
||||||
|
{
|
||||||
global $row, $tp;
|
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'] : '');
|
// $url2 = e_PLUGIN_ABS."rss_menu/rss.php?".e_LANQRY.$tp->toHTML($row['rss_url'], TRUE, 'constants').".2".($row['rss_topicid'] ? ".".$row['rss_topicid'] : '');
|
||||||
|
$url2 = e107::url('rss_menu','rss', $row);
|
||||||
return "<a href='".$url2."'>".RSS_ICON."</a>";
|
return "<a href='".$url2."'>".RSS_ICON."</a>";
|
||||||
SC_END
|
}
|
||||||
|
|
||||||
SC_BEGIN RSS_TEXT
|
function sc_rss_text()
|
||||||
|
{
|
||||||
global $row, $tp;
|
global $row, $tp;
|
||||||
return $tp->toHTML($row['rss_text'], TRUE, "defs");
|
return $tp->toHTML($row['rss_text'], TRUE, "defs");
|
||||||
SC_END
|
}
|
||||||
|
|
||||||
SC_BEGIN RSS_TYPES
|
function sc_rss_types()
|
||||||
|
{
|
||||||
global $row, $tp;
|
global $row, $tp;
|
||||||
$url1 = e_PLUGIN_ABS."rss_menu/rss.php?".e_LANQRY.$tp->toHTML($row['rss_url'], TRUE, 'constants').".1".($row['rss_topicid'] ? ".".$row['rss_topicid'] : '');
|
// $url1 = e_PLUGIN_ABS."rss_menu/rss.php?".e_LANQRY.$tp->toHTML($row['rss_url'], TRUE, 'constants').".1".($row['rss_topicid'] ? ".".$row['rss_topicid'] : '');
|
||||||
$url2 = e_PLUGIN_ABS."rss_menu/rss.php?".e_LANQRY.$tp->toHTML($row['rss_url'], TRUE, 'constants').".2".($row['rss_topicid'] ? ".".$row['rss_topicid'] : '');
|
// $url2 = e_PLUGIN_ABS."rss_menu/rss.php?".e_LANQRY.$tp->toHTML($row['rss_url'], TRUE, 'constants').".2".($row['rss_topicid'] ? ".".$row['rss_topicid'] : '');
|
||||||
$url3 = e_PLUGIN_ABS."rss_menu/rss.php?".e_LANQRY.$tp->toHTML($row['rss_url'], TRUE, 'constants').".3".($row['rss_topicid'] ? ".".$row['rss_topicid'] : '');
|
// $url3 = e_PLUGIN_ABS."rss_menu/rss.php?".e_LANQRY.$tp->toHTML($row['rss_url'], TRUE, 'constants').".3".($row['rss_topicid'] ? ".".$row['rss_topicid'] : '');
|
||||||
$url4 = e_PLUGIN_ABS."rss_menu/rss.php?".e_LANQRY.$tp->toHTML($row['rss_url'], TRUE, 'constants').".4".($row['rss_topicid'] ? ".".$row['rss_topicid'] : '');
|
// $url4 = e_PLUGIN_ABS."rss_menu/rss.php?".e_LANQRY.$tp->toHTML($row['rss_url'], TRUE, 'constants').".4".($row['rss_topicid'] ? ".".$row['rss_topicid'] : '');
|
||||||
|
|
||||||
$text = "
|
$url2 = e107::url('rss_menu','rss', $row);
|
||||||
<a href='".$url1."' class='rss'><img src='".e_PLUGIN."rss_menu/images/rss1.png' class='icon' alt='RSS 0.92' /></a>
|
$url4 = e107::url('rss_menu','atom', $row);
|
||||||
<a href='".$url2."' class='rss'><img src='".e_PLUGIN."rss_menu/images/rss2.png' class='icon' alt='RSS 2.0' /></a>
|
|
||||||
<a href='".$url3."' class='rss'><img src='".e_PLUGIN."rss_menu/images/rss3.png' class='icon' alt='RDF' /></a>
|
|
||||||
<a href='".$url4."' class='rss'><img src='".e_PLUGIN."rss_menu/images/rss4.png' class='icon' alt='ATOM' /></a>
|
$text = "";
|
||||||
";
|
// $text .= "<a href='".$url1."' class='rss'><img src='".e_PLUGIN_ABS."rss_menu/images/rss1.png' class='icon' alt='RSS 0.92' /></a>";
|
||||||
|
$text .= "<a href='".$url2."' class='rss'><img src='".e_PLUGIN_ABS."rss_menu/images/rss2.png' class='icon' alt='RSS 2.0' /></a>";
|
||||||
|
// $text .= "<a href='".$url3."' class='rss'><img src='".e_PLUGIN_ABS."rss_menu/images/rss3.png' class='icon' alt='RDF' /></a>";
|
||||||
|
$text .= "<a href='".$url4."' class='rss'><img src='".e_PLUGIN_ABS."rss_menu/images/rss4.png' class='icon' alt='ATOM' /></a>";
|
||||||
return $text;
|
return $text;
|
||||||
SC_END
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//##### ADMIN --------------------------------------------------
|
//##### ADMIN --------------------------------------------------
|
||||||
SC_BEGIN RSS_ADMIN_CAPTION
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function sc_rss_admin_caption($parm='')
|
||||||
|
{
|
||||||
global $sort;
|
global $sort;
|
||||||
list($field,$txt) = explode(",",$parm);
|
list($field,$txt) = explode(",",$parm);
|
||||||
$txt = constant($txt);
|
$txt = constant($txt);
|
||||||
return "<a href='".e_SELF."?list.{$field}.".($sort == "desc" ? "asc" : "desc")."'>".$txt."</a>\n";
|
return "<a href='".e_SELF."?list.{$field}.".($sort == "desc" ? "asc" : "desc")."'>".$txt."</a>\n";
|
||||||
SC_END
|
}
|
||||||
|
|
||||||
SC_BEGIN RSS_ADMIN_ID
|
function sc_rss_admin_id()
|
||||||
|
{
|
||||||
global $row;
|
global $row;
|
||||||
return $row['rss_id'];
|
return $row['rss_id'];
|
||||||
SC_END
|
}
|
||||||
|
|
||||||
SC_BEGIN RSS_ADMIN_NAME
|
function sc_rss_admin_name()
|
||||||
|
{
|
||||||
global $row;
|
global $row;
|
||||||
return $row['rss_name'];
|
return $row['rss_name'];
|
||||||
SC_END
|
}
|
||||||
|
|
||||||
SC_BEGIN RSS_ADMIN_PATH
|
function sc_rss_admin_path()
|
||||||
|
{
|
||||||
global $row;
|
global $row;
|
||||||
return $row['rss_path'];
|
return $row['rss_path'];
|
||||||
SC_END
|
}
|
||||||
|
|
||||||
SC_BEGIN RSS_ADMIN_URL
|
function sc_rss_admin_url()
|
||||||
|
{
|
||||||
global $row;
|
global $row;
|
||||||
return "<a href='".e_PLUGIN."rss_menu/rss.php?".e_LANQRY.$row['rss_url']."'>".$row['rss_url']."</a>";
|
return "<a href='".e_PLUGIN."rss_menu/rss.php?".e_LANQRY.$row['rss_url']."'>".$row['rss_url']."</a>";
|
||||||
SC_END
|
}
|
||||||
|
|
||||||
SC_BEGIN RSS_ADMIN_TOPICID
|
function sc_rss_admin_topicid()
|
||||||
|
{
|
||||||
global $row;
|
global $row;
|
||||||
return $row['rss_topicid'];
|
return $row['rss_topicid'];
|
||||||
SC_END
|
}
|
||||||
|
|
||||||
SC_BEGIN RSS_ADMIN_LIMIT
|
function sc_rss_admin_limit()
|
||||||
|
{
|
||||||
global $row, $rs;
|
global $row, $rs;
|
||||||
$id = $row['rss_id'];
|
$id = $row['rss_id'];
|
||||||
$frm = e107::getForm();
|
$frm = e107::getForm();
|
||||||
return $frm->number("limit[$id]",$row['rss_limit']);
|
return $frm->number("limit[$id]",$row['rss_limit']);
|
||||||
return "<input class='tbox' type='text' name=\"limit[$id]\" title=\"".RSS_LAN05."\" value='".intval($row['rss_limit'])."' size='3' maxlength='3' />";
|
return "<input class='tbox' type='text' name=\"limit[$id]\" title=\"".RSS_LAN05."\" value='".intval($row['rss_limit'])."' size='3' maxlength='3' />";
|
||||||
SC_END
|
}
|
||||||
|
|
||||||
SC_BEGIN RSS_ADMIN_LIMITBUTTON
|
function sc_rss_admin_limitbutton()
|
||||||
|
{
|
||||||
$frm = e107::getForm();
|
$frm = e107::getForm();
|
||||||
return $frm->admin_button('update_limit',LAN_UPDATE,'update');
|
return $frm->admin_button('update_limit',LAN_UPDATE,'update');
|
||||||
SC_END
|
}
|
||||||
|
|
||||||
SC_BEGIN RSS_ADMIN_OPTIONS
|
function sc_rss_admin_options()
|
||||||
|
{
|
||||||
global $row, $tp;
|
global $row, $tp;
|
||||||
$delname = $row['rss_name'];
|
$delname = $row['rss_name'];
|
||||||
$delid = $row['rss_id'];
|
$delid = $row['rss_id'];
|
||||||
@@ -92,34 +137,40 @@ $options = "
|
|||||||
<a href='".e_SELF."?create.edit.".$row['rss_id']."' >".ADMIN_EDIT_ICON."</a>
|
<a href='".e_SELF."?create.edit.".$row['rss_id']."' >".ADMIN_EDIT_ICON."</a>
|
||||||
<input type='image' title=\"".LAN_DELETE."\" name='delete[{$delid}]' src='".ADMIN_DELETE_ICON_PATH."' onclick=\"return jsconfirm('".$tp->toJS(LAN_CONFIRMDEL ." [".RSS_LAN_ADMIN_2.": ".$delid." : ".$delname."]\\n\\n")."')\"/>";
|
<input type='image' title=\"".LAN_DELETE."\" name='delete[{$delid}]' src='".ADMIN_DELETE_ICON_PATH."' onclick=\"return jsconfirm('".$tp->toJS(LAN_CONFIRMDEL ." [".RSS_LAN_ADMIN_2.": ".$delid." : ".$delname."]\\n\\n")."')\"/>";
|
||||||
return $options;
|
return $options;
|
||||||
SC_END
|
}
|
||||||
|
|
||||||
SC_BEGIN RSS_ADMIN_FORM_NAME
|
function sc_rss_admin_form_name()
|
||||||
|
{
|
||||||
global $row;
|
global $row;
|
||||||
return "<input class='tbox' type='text' name='rss_name' size='74' value=\"".$row['rss_name']."\" />\n";
|
return "<input class='tbox' type='text' name='rss_name' size='74' value=\"".$row['rss_name']."\" />\n";
|
||||||
SC_END
|
}
|
||||||
|
|
||||||
SC_BEGIN RSS_ADMIN_FORM_URL
|
function sc_rss_admin_form_url()
|
||||||
|
{
|
||||||
global $row,$PLUGINS_DIRECTORY;
|
global $row,$PLUGINS_DIRECTORY;
|
||||||
return SITEURL.$PLUGINS_DIRECTORY."rss_menu/rss.php?".e_LANQRY." <input class='tbox' type='text' name='rss_url' size='10' value=\"".$row['rss_url']."\" maxlength='50' /> .{".LAN_TYPE."}.{".RSS_LAN_ADMIN_12."}";
|
return SITEURL.$PLUGINS_DIRECTORY."rss_menu/rss.php?".e_LANQRY." <input class='tbox' type='text' name='rss_url' size='10' value=\"".$row['rss_url']."\" maxlength='50' /> .{".LAN_TYPE."}.{".RSS_LAN_ADMIN_12."}";
|
||||||
SC_END
|
}
|
||||||
|
|
||||||
SC_BEGIN RSS_ADMIN_FORM_TOPICID
|
function sc_rss_admin_form_topicid()
|
||||||
|
{
|
||||||
global $row;
|
global $row;
|
||||||
return "<input class='tbox' type='text' name='rss_topicid' size='74' value=\"".$row['rss_topicid']."\" maxlength='250' />";
|
return "<input class='tbox' type='text' name='rss_topicid' size='74' value=\"".$row['rss_topicid']."\" maxlength='250' />";
|
||||||
SC_END
|
}
|
||||||
|
|
||||||
SC_BEGIN RSS_ADMIN_FORM_PATH
|
function sc_rss_admin_form_path()
|
||||||
|
{
|
||||||
global $row;
|
global $row;
|
||||||
return "<input class='tbox' type='text' name='rss_path' size='74' value=\"".$row['rss_path']."\" maxlength='250' />";
|
return "<input class='tbox' type='text' name='rss_path' size='74' value=\"".$row['rss_path']."\" maxlength='250' />";
|
||||||
SC_END
|
}
|
||||||
|
|
||||||
SC_BEGIN RSS_ADMIN_FORM_TEXT
|
function sc_rss_admin_form_text()
|
||||||
|
{
|
||||||
global $row;
|
global $row;
|
||||||
return "<textarea class='tbox' name='rss_text' cols='74' rows='5' >".$row['rss_text']."</textarea>\n";
|
return "<textarea class='tbox' name='rss_text' cols='74' rows='5' >".$row['rss_text']."</textarea>\n";
|
||||||
SC_END
|
}
|
||||||
|
|
||||||
SC_BEGIN RSS_ADMIN_FORM_CLASS
|
function sc_rss_admin_form_class()
|
||||||
|
{
|
||||||
global $row;
|
global $row;
|
||||||
$vals = array(RSS_LAN_ADMIN_21,RSS_LAN_ADMIN_22,RSS_LAN_ADMIN_23);
|
$vals = array(RSS_LAN_ADMIN_21,RSS_LAN_ADMIN_22,RSS_LAN_ADMIN_23);
|
||||||
$text = "<select class='tbox' name='rss_class'>";
|
$text = "<select class='tbox' name='rss_class'>";
|
||||||
@@ -130,18 +181,20 @@ foreach($vals as $key=>$val)
|
|||||||
}
|
}
|
||||||
$text .= "</select>";
|
$text .= "</select>";
|
||||||
return $text;
|
return $text;
|
||||||
SC_END
|
}
|
||||||
|
|
||||||
SC_BEGIN RSS_ADMIN_FORM_LIMIT
|
function sc_rss_admin_form_limit()
|
||||||
|
{
|
||||||
global $row;
|
global $row;
|
||||||
$frm = e107::getForm();
|
$frm = e107::getForm();
|
||||||
|
|
||||||
return $frm->number('rss_limit',$row['rss_limit'],3);
|
return $frm->number('rss_limit',$row['rss_limit'],3);
|
||||||
return "<input class='tbox' name='rss_limit' size='3' title=\"".RSS_LAN05."\" value='".intval($row['rss_limit'])."' maxlength='3' />";
|
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
|
function sc_rss_admin_form_createbutton()
|
||||||
|
{
|
||||||
global $row;
|
global $row;
|
||||||
$qs = explode(".", e_QUERY);
|
$qs = explode(".", e_QUERY);
|
||||||
$frm = e107::getForm();
|
$frm = e107::getForm();
|
||||||
@@ -160,9 +213,10 @@ else
|
|||||||
|
|
||||||
}
|
}
|
||||||
return $text;
|
return $text;
|
||||||
SC_END
|
}
|
||||||
|
|
||||||
SC_BEGIN RSS_ADMIN_IMPORT_CHECK
|
function sc_rss_admin_import_check()
|
||||||
|
{
|
||||||
global $feed, $rs, $tp, $i;
|
global $feed, $rs, $tp, $i;
|
||||||
if($feed['description'])
|
if($feed['description'])
|
||||||
{
|
{
|
||||||
@@ -178,31 +232,39 @@ $text .= "<input type='hidden' name='text[$i]' value='".$tp->toForm($feed['text'
|
|||||||
$text .= "<input type='hidden' name='class[$i]' value='".$tp->toForm($feed['class'])."' />";
|
$text .= "<input type='hidden' name='class[$i]' value='".$tp->toForm($feed['class'])."' />";
|
||||||
$text .= "<input type='hidden' name='limit[$i]' value='".intval($feed['limit'])."' />";
|
$text .= "<input type='hidden' name='limit[$i]' value='".intval($feed['limit'])."' />";
|
||||||
return $text;
|
return $text;
|
||||||
SC_END
|
}
|
||||||
|
|
||||||
SC_BEGIN RSS_ADMIN_IMPORT_PATH
|
function sc_rss_admin_import_path()
|
||||||
|
{
|
||||||
global $feed;
|
global $feed;
|
||||||
return $feed['path'];
|
return $feed['path'];
|
||||||
SC_END
|
}
|
||||||
|
|
||||||
SC_BEGIN RSS_ADMIN_IMPORT_NAME
|
function sc_rss_admin_import_name()
|
||||||
|
{
|
||||||
global $feed;
|
global $feed;
|
||||||
return $feed['name'];
|
return $feed['name'];
|
||||||
SC_END
|
}
|
||||||
|
|
||||||
SC_BEGIN RSS_ADMIN_IMPORT_TEXT
|
function sc_rss_admin_import_text()
|
||||||
|
{
|
||||||
global $feed;
|
global $feed;
|
||||||
return ($feed['description']) ? $feed['description'] : $feed['text'];
|
return ($feed['description']) ? $feed['description'] : $feed['text'];
|
||||||
SC_END
|
}
|
||||||
|
|
||||||
SC_BEGIN RSS_ADMIN_IMPORT_URL
|
function sc_rss_admin_import_url()
|
||||||
|
{
|
||||||
global $feed;
|
global $feed;
|
||||||
return $feed['url'];
|
return $feed['url'];
|
||||||
SC_END
|
}
|
||||||
|
|
||||||
SC_BEGIN RSS_ADMIN_IMPORT_TOPICID
|
function sc_rss_admin_import_topicid()
|
||||||
|
{
|
||||||
global $feed;
|
global $feed;
|
||||||
return $feed['topic_id'];
|
return $feed['topic_id'];
|
||||||
SC_END
|
}
|
||||||
*/
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$rss_shortcodes = new rss_menu_shortcodes;
|
||||||
?>
|
?>
|
@@ -7,8 +7,8 @@ if(!isset($RSS_LIST_HEADER))
|
|||||||
{
|
{
|
||||||
$RSS_LIST_HEADER = "<table class='table table-striped fborder' style='".USER_WIDTH."'>
|
$RSS_LIST_HEADER = "<table class='table table-striped fborder' style='".USER_WIDTH."'>
|
||||||
<tr>
|
<tr>
|
||||||
<td class='fcaption' style='width:55%'> </td>
|
<th class='fcaption' style='width:55%'> </th>
|
||||||
<td class='fcaption' style='text-align:right'>".RSS_PLUGIN_LAN_6."</td>
|
<th class='fcaption' style='text-align:right'>".RSS_PLUGIN_LAN_6."</th>
|
||||||
</tr>";
|
</tr>";
|
||||||
}
|
}
|
||||||
if(!isset($RSS_LIST_TABLE))
|
if(!isset($RSS_LIST_TABLE))
|
||||||
|
Reference in New Issue
Block a user