1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-25 17:01:43 +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

@@ -26,7 +26,7 @@ if(!empty($pref['signup_option_class']))
$text .= "<div class='input-group'>"; $text .= "<div class='input-group'>";
$text .= $frm->text('email','', null, array('placeholder'=> NLLAN_73)); $text .= $frm->text('email','', null, array('placeholder'=> NLLAN_73));
$text .= "<span class='input-group-btn'>"; $text .= "<span class='input-group-btn'>";
$text .= $frm->button('subscribe', 1, 'submit', NLLAN_52, array('class'=>'btn-default')); $text .= $frm->button('subscribe', 1, 'submit', NLLAN_52, array('class'=>'btn-primary'));
$text .= "</span>"; $text .= "</span>";
$text .= "</div>"; $text .= "</div>";
$text .= $frm->close(); $text .= $frm->close();

View File

@@ -603,7 +603,7 @@ class poll
return ' return '
<div class="progress"> <div class="progress">
<div class="bar progress-bar" role="progressbar" aria-valuenow="'.$val.'" aria-valuemin="0" aria-valuemax="100" style="width: '.$val.'%;"> <div class="bar progress-bar" role="progressbar" aria-valuenow="'.$val.'" aria-valuemin="0" aria-valuemax="100" style="width: '.$val.'%;">
<span class="sr-only">'.$val.'%</span> <span class="sr-only visually-hidden">'.$val.'%</span>
</div> </div>
</div>'; </div>';
@@ -1006,7 +1006,7 @@ class poll_shortcodes extends e_shortcode
return ' return '
<div class="progress"> <div class="progress">
<div class="bar progress-bar" role="progressbar" aria-valuenow="'.$val.'" aria-valuemin="0" aria-valuemax="100" style="width: '.$val.'%;"> <div class="bar progress-bar" role="progressbar" aria-valuenow="'.$val.'" aria-valuemin="0" aria-valuemax="100" style="width: '.$val.'%;">
<span class="sr-only">'.$val.'%</span> <span class="sr-only visually-hidden">'.$val.'%</span>
</div> </div>
</div>'; </div>';

View File

@@ -103,8 +103,8 @@ $POLL_DISALLOWED_END = "
"; ";
/* ################################# */
/* template for forum polls when user HASN'T voted*/ // template for forum polls when user HASN'T voted
$POLL_FORUM_NOTVOTED_START = " $POLL_FORUM_NOTVOTED_START = "
<div style='text-align:center; margin-left: auto; margin-right: auto;'> <div style='text-align:center; margin-left: auto; margin-right: auto;'>
@@ -216,7 +216,7 @@ $POLL_TEMPLATE['results']['start'] = "
"; ";
$POLL_TEMPLATE['results']['item'] = " $POLL_TEMPLATE['results']['item'] = "
<strong>{OPTION}</strong><small class='pull-right float-right'><a href='#' class='e-tip' title=\"{VOTES}\">{PERCENTAGE}</a></small> <strong>{OPTION}</strong><small class='pull-right float-right float-end'><a href='#' class='e-tip' title=\"{VOTES}\">{PERCENTAGE}</a></small>
{BAR} {BAR}
"; ";

View File

@@ -34,7 +34,7 @@ if (!e107::isInstalled('rss_menu'))
$tp = e107::getParser(); $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'); require_once(e_HANDLER.'userclass_class.php');
/* /*
@@ -49,15 +49,7 @@ if (!is_object($tp->e_bb))
// Get language file // Get language file
e107::includeLan(e_PLUGIN.'rss_menu/languages/'.e_LANGUAGE.'_admin_rss_menu.php'); 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 // Query handler
if(!empty($_GET['type'])) if(!empty($_GET['type']))
@@ -87,7 +79,9 @@ if (empty($rss_type))
// Display list of all feeds // Display list of all feeds
require_once(HEADERF); 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`")) 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 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()) 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); $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>";