mirror of
https://github.com/e107inc/e107.git
synced 2025-03-14 01:19:44 +01:00
News template BC fixes and added news-list start and end templates.
This commit is contained in:
parent
166043720c
commit
58435c2cc6
@ -10,7 +10,7 @@ if (!defined('e107_INIT')) exit;
|
||||
|
||||
global $sc_style;
|
||||
|
||||
###### Default list item (temporary) - TODO rewrite news, template standards ######
|
||||
###### Default list item (temporary) - TODO rewrite news ######
|
||||
//$NEWS_MENU_TEMPLATE['list']['start'] = '<ul class="nav nav-list news-menu-months">';
|
||||
//$NEWS_MENU_TEMPLATE['list']['end'] = '</ul>';
|
||||
|
||||
@ -23,8 +23,9 @@ $NEWS_MENU_TEMPLATE['list']['end'] = '</div>';
|
||||
// {NEWSBODY} should not appear in the LISTSTYLE as it is NOT the same as what would appear on news.php (no query)
|
||||
|
||||
// Template/CSS to be reviewed for best bootstrap implementation
|
||||
$NEWS_TEMPLATE['list']['item'] = '
|
||||
{SETIMAGE: w=400&h=300&crop=1}
|
||||
$NEWS_TEMPLATE['list']['start'] = '{SETIMAGE: w=400&h=300&crop=1}';
|
||||
$NEWS_TEMPLATE['list']['end'] = '';
|
||||
$NEWS_TEMPLATE['list']['item'] = '
|
||||
<div class="thumbnail">
|
||||
<div class="row-fluid">
|
||||
<div class="span3">
|
||||
@ -38,7 +39,7 @@ $NEWS_TEMPLATE['list']['item'] = '
|
||||
{NEWSSUMMARY}
|
||||
</p>
|
||||
<p>
|
||||
<a href="{NEWSURL}" class="btn btn-info">Read More</a>
|
||||
<a href="{NEWSURL}" class="btn btn-info">'.LAN_READ_MORE.'</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -40,9 +40,10 @@ $NEWS_TEMPLATE['default']['item'] = '
|
||||
|
||||
|
||||
// XXX The ListStyle template offers a listed summary of items with a minimum of 10 items per page.
|
||||
// As displayed by news.php?cat.1 OR news.php?all
|
||||
$NEWS_TEMPLATE['list']['item'] = '
|
||||
{SETIMAGE: w=400&h=300&crop=1}
|
||||
// As displayed by news.php?cat.1 OR news.php?all OR news.php?tag=xxx
|
||||
$NEWS_TEMPLATE['list']['start'] = '{SETIMAGE: w=400&h=300&crop=1}';
|
||||
$NEWS_TEMPLATE['list']['end'] = '';
|
||||
$NEWS_TEMPLATE['list']['item'] = '
|
||||
<div class="thumbnail">
|
||||
<div class="row-fluid">
|
||||
<div class="span3">
|
||||
@ -56,7 +57,7 @@ $NEWS_TEMPLATE['list']['item'] = '
|
||||
{NEWSSUMMARY}
|
||||
</p>
|
||||
<p>
|
||||
<a href="{NEWSURL}" class="btn btn-info">Read More</a>
|
||||
<a href="{NEWSURL}" class="btn btn-info">'.LAN_READ_MORE.'</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -511,32 +511,6 @@ TMPL;
|
||||
|
||||
|
||||
|
||||
|
||||
$NEWSLISTSTYLE = "
|
||||
\n\n<!-- New List -->\n\n
|
||||
|
||||
<table class='newsboxes' cellpadding='0' cellspacing='0' style='border-top:1px solid black;width:100%'>
|
||||
|
||||
<tr><td style='padding:4px;width:20px;vertical-align:top'>
|
||||
{NEWSCATICON}
|
||||
</td><td style='padding:4px;vertical-align:top'>
|
||||
|
||||
{NEWSTITLELINK}
|
||||
<br />
|
||||
{NEWSSUMMARY}
|
||||
</td>
|
||||
<td style='padding:4px;text-align:right'>
|
||||
{NEWSTHUMBNAIL}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
\n\n<!-- End News List -->\n\n
|
||||
"
|
||||
|
||||
;
|
||||
|
||||
|
||||
$NEWSCAT = "\n\n\n\n<!-- News Category -->\n\n\n\n
|
||||
<div style='padding:2px;padding-bottom:12px'>
|
||||
<div class='newscat_caption'>
|
||||
|
58
news.php
58
news.php
@ -225,39 +225,13 @@ if ($action == 'cat' || $action == 'all' || vartrue($_GET['tag']))
|
||||
require_once(HEADERF);
|
||||
$action = $currentNewsAction;
|
||||
|
||||
/*
|
||||
if(!$NEWSLISTSTYLE)
|
||||
{
|
||||
$NEWSLISTSTYLE = "
|
||||
<div style='padding:3px;width:100%'>
|
||||
<table style='border-bottom:1px solid black;width:100%' cellpadding='0' cellspacing='0'>
|
||||
<tr>
|
||||
<td style='vertical-align:top;padding:3px;width:20px'>
|
||||
{NEWSCATICON}
|
||||
</td><td style='text-align:left;padding:3px'>
|
||||
{NEWSTITLELINK=extend}
|
||||
<br />
|
||||
{NEWSSUMMARY}
|
||||
<span class='smalltext'>
|
||||
{NEWSDATE}
|
||||
{NEWSCOMMENTS}
|
||||
</span>
|
||||
</td><td style='width:55px'>
|
||||
{NEWSTHUMBNAIL}
|
||||
</td></tr></table>
|
||||
</div>\n";
|
||||
|
||||
}*/
|
||||
|
||||
if(vartrue($NEWSLISTSTYLE))
|
||||
if(vartrue($NEWSLISTSTYLE)) // Legacy v1.x
|
||||
{
|
||||
$template = $NEWSLISTSTYLE;
|
||||
}
|
||||
else
|
||||
else // v2.x
|
||||
{
|
||||
$tmp = e107::getTemplate('news', 'news', 'list');
|
||||
$template = $tmp['item'];
|
||||
unset($tmp);
|
||||
$template = e107::getTemplate('news', 'news', 'list');
|
||||
}
|
||||
|
||||
$param = array();
|
||||
@ -270,11 +244,22 @@ if ($action == 'cat' || $action == 'all' || vartrue($_GET['tag']))
|
||||
// NEW - allow news batch shortcode override (e.g. e107::getScBatch('news', 'myplugin', true); )
|
||||
e107::getEvent()->trigger('news_list_parse', $newsList);
|
||||
|
||||
if(vartrue($template['start']))
|
||||
{
|
||||
$text .= $tp->parseTemplate($template['start'], true);
|
||||
}
|
||||
|
||||
foreach($newsList as $row)
|
||||
{
|
||||
$text .= $ix->render_newsitem($row, 'return', '', $template, $param);
|
||||
$text .= $ix->render_newsitem($row, 'return', '', $template['item'], $param);
|
||||
}
|
||||
|
||||
if(vartrue($template['end']))
|
||||
{
|
||||
$text .= $tp->parseTemplate($template['end'], true);
|
||||
}
|
||||
|
||||
|
||||
$icon = ($row['category_icon']) ? "<img src='".e_IMAGE."icons/".$row['category_icon']."' alt='' />" : "";
|
||||
|
||||
// Deprecated.
|
||||
@ -283,11 +268,12 @@ if ($action == 'cat' || $action == 'all' || vartrue($_GET['tag']))
|
||||
//
|
||||
// $text .= "<div class='nextprev'>".$tp->parseTemplate("{NEXTPREV={$parms}}")."</div>";
|
||||
|
||||
$amount = NEWSLIST_LIMIT;
|
||||
$nitems = defined('NEWS_NEXTPREV_NAVCOUNT') ? '&navcount='.NEWS_NEXTPREV_NAVCOUNT : '' ;
|
||||
$url = rawurlencode(e107::getUrl()->create($newsRoute, $newsUrlparms));
|
||||
$parms = 'tmpl_prefix='.deftrue('NEWS_NEXTPREV_TMPL', 'default').'&total='.$news_total.'&amount='.$amount.'¤t='.$newsfrom.$nitems.'&url='.$url;
|
||||
$text .= $tp->parseTemplate("{NEXTPREV={$parms}}");
|
||||
$amount = NEWSLIST_LIMIT;
|
||||
$nitems = defined('NEWS_NEXTPREV_NAVCOUNT') ? '&navcount='.NEWS_NEXTPREV_NAVCOUNT : '' ;
|
||||
$url = rawurlencode(e107::getUrl()->create($newsRoute, $newsUrlparms));
|
||||
$parms = 'tmpl_prefix='.deftrue('NEWS_NEXTPREV_TMPL', 'default').'&total='.$news_total.'&amount='.$amount.'¤t='.$newsfrom.$nitems.'&url='.$url;
|
||||
|
||||
$text .= $tp->parseTemplate("{NEXTPREV={$parms}}");
|
||||
|
||||
if(!$NEWSLISTTITLE)
|
||||
{
|
||||
@ -297,7 +283,7 @@ if ($action == 'cat' || $action == 'all' || vartrue($_GET['tag']))
|
||||
{
|
||||
$NEWSLISTTITLE = str_replace("{NEWSCATEGORY}",$tp->toHTML($category_name,FALSE,'TITLE'),$NEWSLISTTITLE);
|
||||
}
|
||||
$text .= "<div style='text-align:center;'><a href='".e_SELF."'>".LAN_NEWS_84."</a></div>";
|
||||
$text .= "<div class='center'><a class='btn' href='".e_SELF."'>".LAN_NEWS_84."</a></div>";
|
||||
ob_start();
|
||||
$ns->tablerender($NEWSLISTTITLE, $text, 'news');
|
||||
$cache_data = ob_get_flush();
|
||||
|
Loading…
x
Reference in New Issue
Block a user