mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 20:00:37 +02:00
Updated e_rss.php to v2.x spec.
This commit is contained in:
@@ -74,7 +74,7 @@ class rss_admin extends e_admin_dispatcher
|
||||
|
||||
|
||||
|
||||
|
||||
//TODO - Use this .. .
|
||||
class rss_ui extends e_admin_ui
|
||||
{
|
||||
|
||||
@@ -391,7 +391,7 @@ if(!isset($RSS_ADMIN_IMPORT_HEADER))
|
||||
<tr>
|
||||
<th>".RSS_LAN_ADMIN_16."</td>
|
||||
<th>".RSS_LAN_ADMIN_3."</td>
|
||||
<th>".RSS_LAN_ADMIN_4."</td>
|
||||
<th>".LAN_NAME."</td>
|
||||
<th>".RSS_LAN_ADMIN_5."</td>
|
||||
<th>".RSS_LAN_ADMIN_12."</td>
|
||||
</tr>";
|
||||
@@ -636,14 +636,30 @@ class rss
|
||||
$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");
|
||||
$plugin_feedlist = $eplug_rss_feed;
|
||||
|
||||
$className = $val."_rss";
|
||||
$data = false;
|
||||
|
||||
if(!$data = e107::callMethod($className,'config'))
|
||||
{
|
||||
$data = $eplug_rss_feed;
|
||||
}
|
||||
|
||||
foreach($data as $v)
|
||||
{
|
||||
array_push($plugin_feedlist,$v);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$feedlist = array_merge($feedlist, $plugin_feedlist);
|
||||
|
||||
// print_a($feedlist);
|
||||
|
||||
$render=FALSE;
|
||||
$i=0;
|
||||
@@ -654,7 +670,7 @@ class rss
|
||||
$feed['url'] = $tp -> toDB($feed['url']);
|
||||
|
||||
// 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']."' "))
|
||||
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);
|
||||
|
@@ -135,7 +135,7 @@ else
|
||||
if($rss = new rssCreate($content_type, $rss_type, $topic_id, $row))
|
||||
{
|
||||
$rss_title = ($rss->contentType ? $rss->contentType : ucfirst($content_type));
|
||||
$rss->buildRss ($rss_title);
|
||||
$rss->buildRss($rss_title);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -181,11 +181,11 @@ class rssCreate
|
||||
{
|
||||
$path = e_PLUGIN.$row['rss_path'].'/e_rss.php';
|
||||
}
|
||||
if(strpos($row['rss_path'],'|')!==FALSE)
|
||||
if(strpos($row['rss_path'],'|')!==FALSE) //FIXME remove this check completely.
|
||||
{
|
||||
$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]; // FIXME @Deprecated - use $parm['url'] instead in data() method within e_rss.php. Parm is used in e_rss.php to define which feed you need to prepare
|
||||
}
|
||||
|
||||
switch ($content_type)
|
||||
@@ -324,6 +324,16 @@ class rssCreate
|
||||
if (is_readable($path))
|
||||
{
|
||||
require_once($path);
|
||||
|
||||
$className = basename(dirname($path)).'_rss';
|
||||
|
||||
// v2.x standard
|
||||
if($data = e107::callMethod($className,'data', array('url' => $content_type, 'id' => $this->topicid, 'limit' => $this->limit)))
|
||||
{
|
||||
$eplug_rss_data = array(0 => $data);
|
||||
unset($data);
|
||||
}
|
||||
|
||||
foreach($eplug_rss_data as $key=>$rs)
|
||||
{
|
||||
foreach($rs as $k=>$row)
|
||||
@@ -498,9 +508,8 @@ class rssCreate
|
||||
$link = (e_LANQRY) ? str_replace("?","?".e_LANQRY,$value['link']) : $value['link'];
|
||||
$catlink = (e_LANQRY) ? str_replace("?","?".e_LANQRY,$value['category_link']) : $value['category_link'];
|
||||
|
||||
echo "
|
||||
<item>
|
||||
<title>".$tp->toRss($value['title'])."</title>\n";
|
||||
echo "<item>\n";
|
||||
echo "<title>".$tp->toRss($value['title'])."</title>\n";
|
||||
|
||||
if($link)
|
||||
{
|
||||
|
@@ -187,7 +187,7 @@ SC_END
|
||||
|
||||
SC_BEGIN RSS_ADMIN_IMPORT_TEXT
|
||||
global $feed;
|
||||
return $feed['text'];
|
||||
return ($feed['description']) ? $feed['description'] : $feed['text'];
|
||||
SC_END
|
||||
|
||||
SC_BEGIN RSS_ADMIN_IMPORT_URL
|
||||
|
Reference in New Issue
Block a user