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

RSS template upgraded to v2.x spec. Bootstrap 5 styling fixes.

This commit is contained in:
Cameron
2021-01-03 07:54:43 -08:00
parent c3c830d296
commit 3b0ff5d4ef
7 changed files with 69 additions and 52 deletions

View File

@@ -34,7 +34,7 @@ if (!e107::isInstalled('rss_menu'))
$tp = e107::getParser();
require_once(e_PLUGIN.'rss_menu/rss_shortcodes.php');
//require_once(e_PLUGIN.'rss_menu/rss_shortcodes.php');
require_once(e_HANDLER.'userclass_class.php');
/*
@@ -49,15 +49,7 @@ if (!is_object($tp->e_bb))
// Get language file
e107::includeLan(e_PLUGIN.'rss_menu/languages/'.e_LANGUAGE.'_admin_rss_menu.php');
// Get template
if (is_readable(THEME.'rss_template.php'))
{
require_once(THEME.'rss_template.php');
}
else
{
require_once(e_PLUGIN.'rss_menu/rss_template.php');
}
// Query handler
if(!empty($_GET['type']))
@@ -87,7 +79,9 @@ if (empty($rss_type))
// Display list of all feeds
require_once(HEADERF);
// require_once(e_PLUGIN.'rss_menu/rss_template.php'); Already loaded
require_once(e_PLUGIN.'rss_menu/rss_shortcodes.php');
$sc = e107::getScBatch('rss_menu', true);
$sc->wrapper('rss/page');
if(!$sql->select('rss', '*', "`rss_class` = 0 AND `rss_limit` > 0 AND `rss_topicid` NOT REGEXP ('\\\*') ORDER BY `rss_name`"))
{
@@ -95,12 +89,34 @@ if (empty($rss_type))
}
else
{
$text = $RSS_LIST_HEADER;
if($template = e107::getTemplate('rss_menu', 'rss', 'page'))
{
$RSS_LIST_HEADER = $template['start'];
$RSS_LIST_TABLE = $template['item'];
$RSS_LIST_FOOTER = $template['end'];
}
else
{
// Get Legacy template
if (is_readable(THEME.'rss_template.php'))
{
require_once(THEME.'rss_template.php');
}
else
{
require_once(e_PLUGIN.'rss_menu/rss_template.php');
}
}
$text = $tp->parseTemplate($RSS_LIST_HEADER);
while($row = $sql->fetch())
{
$text .= $tp->parseTemplate($RSS_LIST_TABLE, FALSE, $rss_shortcodes);
$text .= $tp->parseTemplate($RSS_LIST_TABLE, false, $sc);
}
$text .= $RSS_LIST_FOOTER;
$text .= $tp->parseTemplate($RSS_LIST_FOOTER);
$ns->tablerender(RSS_MENU_L2, $text);
}

View File

@@ -288,4 +288,4 @@ class rss_menu_shortcodes extends e_shortcode
}
$rss_shortcodes = new rss_menu_shortcodes;
// $rss_shortcodes = new rss_menu_shortcodes;

View File

@@ -1,31 +0,0 @@
<?php
if(!defined("USER_WIDTH")){ define("USER_WIDTH","width:100%"); }
// Rss listing
if(!isset($RSS_LIST_HEADER))
{
$RSS_LIST_HEADER = "<table class='table table-striped table-bordered fborder' style='".USER_WIDTH."'>
<tr>
<th class='fcaption' style='width:70%'> </th>
<th class='fcaption' style='text-align:right'>".RSS_PLUGIN_LAN_6."</th>
</tr>";
}
if(!isset($RSS_LIST_TABLE))
{
$RSS_LIST_TABLE = "
<tr>
<td class='forumheader3'>{RSS_FEED}<br />
<span class='smalltext' ><small>{RSS_TEXT}</small></span>
</td>
<td class='forumheader3' style='text-align:right'>
{RSS_TYPES}
</td>
</tr>";
}
if(!isset($RSS_LIST_FOOTER))
{
$RSS_LIST_FOOTER = "</table>";
}

View File

@@ -0,0 +1,32 @@
<?php
$RSS_TEMPLATE = [];
//$RSS_WRAPPER['page']['RSS_TEXT'] = '(pre){---}(post)';
$RSS_TEMPLATE['page']['start'] = "<!-- RSS Template -->
<table class='table table-striped table-bordered fborder'>
<tr>
<th class='fcaption' style='width:70%'> </th>
<th class='fcaption' style='text-align:right'>{LAN=RSS_PLUGIN_LAN_6}</th>
</tr>";
$RSS_TEMPLATE['page']['item'] = "
<tr>
<td class='forumheader3'>{RSS_FEED}<br />
<span class='smalltext' ><small>{RSS_TEXT}</small></span>
</td>
<td class='forumheader3' style='text-align:right'>
{RSS_TYPES}
</td>
</tr>";
$RSS_TEMPLATE['page']['end'] = "</table>";