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

allow the 'caption=xxxx' menu parameter to function on all news menus.

This commit is contained in:
Cameron
2015-04-01 23:02:17 -07:00
parent b7e6837e34
commit 21f3f2ed19
4 changed files with 60 additions and 17 deletions

View File

@@ -11,6 +11,12 @@ if (!defined('e107_INIT')) { exit; }
$cString = 'nq_news_months_menu_'.md5($parm);
$cached = e107::getCache()->retrieve($cString);
if(!empty($parm))
{
parse_str($parm, $parms);
}
if(false === $cached)
{
if(!function_exists('newsFormatDate'))
@@ -25,11 +31,12 @@ if(false === $cached)
}
}
//parse_str($parm, $parms); // FIXME - menu settings...
if(!isset($parms['showarchive']))
{
$parms['showarchive'] = 0;
}
//e107::plugLan('blogcalendar_menu');
// e107::lan('blogcalendar_menu', e_LANGUAGE); // FIXME decide on language file structure (#743)
e107::includeLan(e_PLUGIN.'blogcalendar_menu/languages/English.php');
@@ -38,7 +45,7 @@ if(false === $cached)
$marray = e107::getDate()->terms('month');
// TODO parms
//$parms['year'] = "2011 0";
if(vartrue($parms['year']))
{

View File

@@ -15,11 +15,10 @@
*/
if (!defined('e107_INIT')) { exit; }
// FIXME full rewrite
global $e107cache;
// Load Data
if($cacheData = $e107cache->retrieve("nq_othernews2"))
if($cacheData = e107::getCache()->retrieve("nq_othernews2"))
{
echo $cacheData;
return;
@@ -31,6 +30,11 @@ unset($text);
global $OTHERNEWS2_STYLE;
$ix = new news;
if(!empty($parm))
{
parse_str($parm, $parms);
}
if(!$OTHERNEWS2_STYLE)
{
if(deftrue('BOOTSTRAP')) // v2.x
@@ -38,12 +42,26 @@ if(!$OTHERNEWS2_STYLE)
define("OTHERNEWS_COLS",false);
$template = e107::getTemplate('news', 'news_menu', 'other2');
$OTHERNEWS2_STYLE = $template['item'];
if(!empty($parms['caption']))
{
$template['caption'] = e107::getParser()->toHtml($parms['caption'],true,'TITLE');
}
}
else //v1.x
{
$template['start'] = '';
$template['end'] = '';
if(!empty($parms['caption']))
{
$template['caption'] = e107::getParser()->toHtml($parms['caption'],true,'TITLE');
}
else
{
$template['caption'] = TD_MENU_L2;
}
$OTHERNEWS2_STYLE = "
<table class='forumheader3' cellpadding='0' cellspacing='0' style='width:100%'>
@@ -108,7 +126,7 @@ LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id
WHERE n.news_class IN (".USERCLASS_LIST.") AND n.news_start < ".time()." AND (n.news_end=0 || n.news_end>".time().")
AND FIND_IN_SET(3, n.news_render_type) ORDER BY n.news_datestamp DESC LIMIT 0,". defset('OTHERNEWS2_LIMIT',5);
if ($sql->gen($query))
if (e107::getDb()->gen($query))
{
$text = $tp->parseTemplate($template['start'],true);
@@ -157,10 +175,10 @@ if ($sql->gen($query))
// Save Data
ob_start();
$ns->tablerender($template['caption'], $text, 'other_news2');
e107::getRender()->tablerender($template['caption'], $text, 'other_news2');
$cache_data = ob_get_flush();
$e107cache->set("nq_othernews2", $cache_data);
e107::getCache()->set("nq_othernews2", $cache_data);
}

View File

@@ -15,7 +15,7 @@
*/
if (!defined('e107_INIT')) { exit; }
// FIXME full rewrite
// Load Data
if($cacheData = e107::getCache()->retrieve("nq_othernews"))
{
@@ -24,6 +24,9 @@ if($cacheData = e107::getCache()->retrieve("nq_othernews"))
}
require_once(e_HANDLER."news_class.php");
unset($text);
global $OTHERNEWS_STYLE;
@@ -32,6 +35,11 @@ $ix = new news;
$caption = TD_MENU_L1;
if(!empty($parm))
{
parse_str($parm, $parms);
}
if(!$OTHERNEWS_STYLE)
{
if(deftrue('BOOTSTRAP')) // v2.x
@@ -42,6 +50,11 @@ if(!$OTHERNEWS_STYLE)
$item_selector = '<div class="btn-group pull-right"><a class="btn btn-mini btn-xs btn-default" href="#otherNews" data-slide="prev"></a>
<a class="btn btn-mini btn-xs btn-default" href="#otherNews" data-slide="next"></a></div>';
if(!empty($parms['caption']))
{
$template['caption'] = e107::getParser()->toHtml($parms['caption'],true,'TITLE');
}
$caption = "<div class='inline-text'>".$template['caption']." ".$item_selector."</div>";
$OTHERNEWS_STYLE = $template['item'];
@@ -49,6 +62,11 @@ if(!$OTHERNEWS_STYLE)
else //v1.x
{
if(!empty($parms['caption']))
{
$caption = e107::getParser()->toHtml($parms['caption'], true,'TITLE');
}
$template['start'] = '';
$template['end'] = '';

View File

@@ -132,7 +132,7 @@ class bootstrap_admintheme
if(deftrue('e_IFRAME'))
{
echo '
echo '<!-- Start Style: '.$style.' Mode: '.$mode.' and iFrame active -->
<div class="block">
<div class="block-text">
'.$text.'
@@ -185,7 +185,7 @@ class bootstrap_admintheme
*/
case 'no_caption' :
echo '
echo '<!-- Start Style: '.$style.' Mode: '.$mode.' -->
<div class="block">
<div class="block-text">
'.$text.'
@@ -196,7 +196,7 @@ class bootstrap_admintheme
default:
echo '
echo '<!-- Start Style: '.$style.' Mode: '.$mode.' -->
<div class="block">
<h4 class="caption">'.$caption.'</h4>
<div class="block-text">