mirror of
https://github.com/e107inc/e107.git
synced 2025-07-26 01:11:28 +02:00
News template BC problem corrected. May require renaming some templates in your theme.php
This commit is contained in:
@@ -320,15 +320,13 @@ class news_shortcodes extends e_shortcode
|
||||
|
||||
function sc_newsimage($parm = '')
|
||||
{
|
||||
$tp = e107::getParser();
|
||||
if(!$this->news_item['news_thumbnail'])
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
$w = vartrue($pref['resize_dimensions']['news-image']['w']);
|
||||
$h = vartrue($pref['resize_dimensions']['news-image']['h']);
|
||||
|
||||
if($this->news_item['news_thumbnail'][0] == '{' && ($w || $h))
|
||||
|
||||
if($this->news_item['news_thumbnail'][0] == '{' ) // Always resize. Use {SETIMAGE: w=x&y=x&crop=0} PRIOR to calling shortcode to change.
|
||||
{
|
||||
$src = $tp->thumbUrl($this->news_item['news_thumbnail'],"w={$w}&h={$h}");
|
||||
}
|
||||
|
@@ -13,13 +13,51 @@ global $sc_style;
|
||||
###### Default list item (temporary) - TODO rewrite news, template standards ######
|
||||
//$NEWS_MENU_TEMPLATE['list']['start'] = '<ul class="nav nav-list news-menu-months">';
|
||||
//$NEWS_MENU_TEMPLATE['list']['end'] = '</ul>';
|
||||
|
||||
$NEWS_MENU_TEMPLATE['list']['start'] = '<div class="thumbnails">';
|
||||
$NEWS_MENU_TEMPLATE['list']['end'] = '</div>';
|
||||
|
||||
|
||||
// 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
|
||||
// {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'] = '
|
||||
<div class="list-item">
|
||||
<h2>{NEWSURLTITLE}</h2>
|
||||
{SETIMAGE: w=400&h=300&crop=1}
|
||||
<div class="thumbnail">
|
||||
<div class="row-fluid">
|
||||
<div class="span3">
|
||||
<div class="thumbnail">
|
||||
{NEWSIMAGE}
|
||||
</div>
|
||||
</div>
|
||||
<div class="span9">
|
||||
<h3>{NEWSTITLELINK}</h3>
|
||||
<p>
|
||||
{NEWSSUMMARY}
|
||||
</p>
|
||||
<p>
|
||||
<a href="{NEWSURL}" class="btn btn-info">Read More</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
|
||||
//$NEWS_MENU_TEMPLATE['list']['separator'] = '<br />';
|
||||
|
||||
|
||||
|
||||
// XXX As displayed by news.php (no query) or news.php?list.1.1 (ie. regular view of a particular category)
|
||||
$NEWS_TEMPLATE['default']['item'] = '
|
||||
{SETIMAGE: w=400}
|
||||
<div class="view-item">
|
||||
<h2>{NEWSTITLE}</h2>
|
||||
<div class="category">in {NEWSCATEGORY}</div>
|
||||
<div class="date">{NEWSDATE=short}</div>
|
||||
<div class="author">{NEWSAUTHOR}</div>
|
||||
|
||||
|
||||
<div class="body">
|
||||
{NEWSIMAGE}
|
||||
{NEWSBODY}
|
||||
@@ -30,12 +68,18 @@ $NEWS_TEMPLATE['list']['item'] = '
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
//$NEWS_MENU_TEMPLATE['list']['separator'] = '<br />';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
###### Default view item (temporary) - TODO rewrite news, template standards ######
|
||||
//$NEWS_MENU_TEMPLATE['view']['start'] = '<ul class="nav nav-list news-menu-months">';
|
||||
//$NEWS_MENU_TEMPLATE['view']['end'] = '</ul>';
|
||||
|
||||
// As displayed by news.php?extend.1
|
||||
$NEWS_TEMPLATE['view']['item'] = '
|
||||
{SETIMAGE: w=800}
|
||||
<div class="view-item">
|
||||
<h2>{NEWSTITLE}</h2>
|
||||
<div class="category">in {NEWSCATEGORY}</div>
|
||||
|
11
news.php
11
news.php
@@ -241,7 +241,7 @@ if ($action == 'cat' || $action == 'all' || vartrue($_GET['tag']))
|
||||
</div>\n";
|
||||
|
||||
}*/
|
||||
|
||||
|
||||
if(vartrue($NEWSLISTSTYLE))
|
||||
{
|
||||
$template = $NEWSLISTSTYLE;
|
||||
@@ -730,14 +730,15 @@ else
|
||||
$thispostday = 0;
|
||||
$pref['newsHeaderDate'] = 1;
|
||||
$gen = new convert();
|
||||
if(vartrue($NEWSLISTSTYLE)) $template = $NEWSLISTSTYLE;
|
||||
/*
|
||||
if(vartrue($NEWSLISTSTYLE)) $template = $NEWSLISTSTYLE; v1.x doesn't do this.. so no point doing it here.
|
||||
else
|
||||
{
|
||||
$tmp = e107::getTemplate('news', 'news', 'list');
|
||||
$template = $tmp['item'];
|
||||
unset($tmp);
|
||||
}
|
||||
|
||||
*/
|
||||
if (!defined("DATEHEADERCLASS")) {
|
||||
define("DATEHEADERCLASS", "nextprev");
|
||||
// if not defined in the theme, default class nextprev will be used for new date header
|
||||
@@ -748,7 +749,7 @@ else
|
||||
$param['current_action'] = $action;
|
||||
|
||||
// Get Correct Template
|
||||
// XXX we use $NEWSLISTSTYLE above - correct as we are currently in list mode
|
||||
// XXX we use $NEWSLISTSTYLE above - correct as we are currently in list mode - XXX No this is not NEWSLISTSTYLE - which provides only summaries.
|
||||
// TODO requires BC testing if we comment this one
|
||||
if(vartrue($NEWSSTYLE))
|
||||
{
|
||||
@@ -756,7 +757,7 @@ else
|
||||
}
|
||||
else
|
||||
{
|
||||
$tmp = e107::getTemplate('news', 'news', 'list');
|
||||
$tmp = e107::getTemplate('news', 'news', 'default'); // default - we show the full items, except for the 'extended' part..
|
||||
$template = $tmp['item'];
|
||||
unset($tmp);
|
||||
}
|
||||
|
Reference in New Issue
Block a user