1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-05 06:07:32 +02:00

Update Featurebox RSS feed to v2 standards

This commit is contained in:
Tijn Kuyper
2019-10-24 09:58:21 +02:00
parent dba8a8896e
commit fb3ac6e297
2 changed files with 63 additions and 5 deletions

View File

@@ -2,7 +2,67 @@
if (!defined('e107_INIT')) { exit; }
//FIXME TODO - Use v2 method. See chatbox_menu/e_rss.php
// v2.x Standard
class featurebox_rss // plugin-folder + '_rss'
{
/**
* Admin RSS Configuration
*/
function config()
{
$config = array();
$config[] = array(
'name' => LAN_PLUGIN_FEATUREBOX_NAME,
'url' => 'featurebox',
'topic_id' => '',
'description' => LAN_PLUGIN_FEATUREBOX_RSSFEED, // that's 'description' not 'text'
'class' => '0',
'limit' => '9'
);
return $config;
}
/**
* Compile RSS Data
* @param $parms array url, limit, id
* @return array
*/
function data($parms='')
{
$sql = e107::getDb();
$rss = array();
$i=0;
if($items = $sql->select('featurebox', "*", "fb_class = '0' LIMIT 0,".$parms['limit']))
{
while($row = $sql->fetch())
{
$rss[$i]['author'] = '';
$rss[$i]['author_email'] = '';
$rss[$i]['link'] = '';
$rss[$i]['linkid'] = '';
$rss[$i]['title'] = $row['fb_title'];
$rss[$i]['description'] = $row['fb_text'];
$rss[$i]['category_name'] = '';
$rss[$i]['category_link'] = '';
$rss[$i]['datestamp'] = '';
$rss[$i]['enc_url'] = '';
$rss[$i]['enc_leng'] = '';
$rss[$i]['enc_type'] = '';
$i++;
}
}
return $rss;
}
}
/* OLD V1 CODE
//##### create feed for admin, return array $eplug_rss_feed --------------------------------
$feed['name'] = 'Featurebox';
@@ -38,6 +98,4 @@ if($items = $sqlrss->select('featurebox', "*", "fb_class = 0 DESC LIMIT 0,".$thi
}
}
$eplug_rss_data[] = $rss;
//##### ------------------------------------------------------------------------------------
?>
//##### ------------------------------------------------------------------------------------

View File

@@ -10,4 +10,4 @@ define("LAN_PLUGIN_FEATUREBOX_NAME", "Feature Box");
define("LAN_PLUGIN_FEATUREBOX_DESCRIPTION", "Displays an animated area on the top of your page with news-items and other content you would like to feature.");
define("LAN_PLUGIN_FEATUREBOX_BATCH", "Create Featurebox Item");
define("LAN_PLUGIN_FEATUREBOX_RSSFEED", "This is the rss feed for the featurebox entries.");