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:
@@ -11,6 +11,12 @@ if (!defined('e107_INIT')) { exit; }
|
|||||||
$cString = 'nq_news_months_menu_'.md5($parm);
|
$cString = 'nq_news_months_menu_'.md5($parm);
|
||||||
$cached = e107::getCache()->retrieve($cString);
|
$cached = e107::getCache()->retrieve($cString);
|
||||||
|
|
||||||
|
if(!empty($parm))
|
||||||
|
{
|
||||||
|
parse_str($parm, $parms);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(false === $cached)
|
if(false === $cached)
|
||||||
{
|
{
|
||||||
if(!function_exists('newsFormatDate'))
|
if(!function_exists('newsFormatDate'))
|
||||||
@@ -25,11 +31,12 @@ if(false === $cached)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!isset($parms['showarchive']))
|
||||||
|
{
|
||||||
|
$parms['showarchive'] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
//parse_str($parm, $parms); // FIXME - menu settings...
|
|
||||||
$parms['showarchive'] = 0;
|
|
||||||
|
|
||||||
//e107::plugLan('blogcalendar_menu');
|
|
||||||
// e107::lan('blogcalendar_menu', e_LANGUAGE); // FIXME decide on language file structure (#743)
|
// e107::lan('blogcalendar_menu', e_LANGUAGE); // FIXME decide on language file structure (#743)
|
||||||
e107::includeLan(e_PLUGIN.'blogcalendar_menu/languages/English.php');
|
e107::includeLan(e_PLUGIN.'blogcalendar_menu/languages/English.php');
|
||||||
|
|
||||||
@@ -38,7 +45,7 @@ if(false === $cached)
|
|||||||
|
|
||||||
$marray = e107::getDate()->terms('month');
|
$marray = e107::getDate()->terms('month');
|
||||||
|
|
||||||
// TODO parms
|
|
||||||
//$parms['year'] = "2011 0";
|
//$parms['year'] = "2011 0";
|
||||||
if(vartrue($parms['year']))
|
if(vartrue($parms['year']))
|
||||||
{
|
{
|
||||||
|
@@ -15,11 +15,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
// FIXME full rewrite
|
|
||||||
global $e107cache;
|
|
||||||
|
|
||||||
// Load Data
|
// Load Data
|
||||||
if($cacheData = $e107cache->retrieve("nq_othernews2"))
|
if($cacheData = e107::getCache()->retrieve("nq_othernews2"))
|
||||||
{
|
{
|
||||||
echo $cacheData;
|
echo $cacheData;
|
||||||
return;
|
return;
|
||||||
@@ -31,19 +30,38 @@ unset($text);
|
|||||||
global $OTHERNEWS2_STYLE;
|
global $OTHERNEWS2_STYLE;
|
||||||
$ix = new news;
|
$ix = new news;
|
||||||
|
|
||||||
|
if(!empty($parm))
|
||||||
|
{
|
||||||
|
parse_str($parm, $parms);
|
||||||
|
}
|
||||||
|
|
||||||
if(!$OTHERNEWS2_STYLE)
|
if(!$OTHERNEWS2_STYLE)
|
||||||
{
|
{
|
||||||
if(deftrue('BOOTSTRAP')) // v2.x
|
if(deftrue('BOOTSTRAP')) // v2.x
|
||||||
{
|
{
|
||||||
define("OTHERNEWS_COLS",false);
|
define("OTHERNEWS_COLS",false);
|
||||||
$template = e107::getTemplate('news', 'news_menu', 'other2');
|
$template = e107::getTemplate('news', 'news_menu', 'other2');
|
||||||
$OTHERNEWS2_STYLE = $template['item'];
|
$OTHERNEWS2_STYLE = $template['item'];
|
||||||
|
|
||||||
|
if(!empty($parms['caption']))
|
||||||
|
{
|
||||||
|
$template['caption'] = e107::getParser()->toHtml($parms['caption'],true,'TITLE');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else //v1.x
|
else //v1.x
|
||||||
{
|
{
|
||||||
$template['start'] = '';
|
$template['start'] = '';
|
||||||
$template['end'] = '';
|
$template['end'] = '';
|
||||||
$template['caption'] = TD_MENU_L2;
|
|
||||||
|
|
||||||
|
if(!empty($parms['caption']))
|
||||||
|
{
|
||||||
|
$template['caption'] = e107::getParser()->toHtml($parms['caption'],true,'TITLE');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$template['caption'] = TD_MENU_L2;
|
||||||
|
}
|
||||||
|
|
||||||
$OTHERNEWS2_STYLE = "
|
$OTHERNEWS2_STYLE = "
|
||||||
<table class='forumheader3' cellpadding='0' cellspacing='0' style='width:100%'>
|
<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().")
|
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);
|
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);
|
$text = $tp->parseTemplate($template['start'],true);
|
||||||
|
|
||||||
@@ -157,10 +175,10 @@ if ($sql->gen($query))
|
|||||||
// Save Data
|
// Save Data
|
||||||
ob_start();
|
ob_start();
|
||||||
|
|
||||||
$ns->tablerender($template['caption'], $text, 'other_news2');
|
e107::getRender()->tablerender($template['caption'], $text, 'other_news2');
|
||||||
|
|
||||||
$cache_data = ob_get_flush();
|
$cache_data = ob_get_flush();
|
||||||
$e107cache->set("nq_othernews2", $cache_data);
|
e107::getCache()->set("nq_othernews2", $cache_data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
// FIXME full rewrite
|
|
||||||
// Load Data
|
// Load Data
|
||||||
if($cacheData = e107::getCache()->retrieve("nq_othernews"))
|
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");
|
require_once(e_HANDLER."news_class.php");
|
||||||
unset($text);
|
unset($text);
|
||||||
global $OTHERNEWS_STYLE;
|
global $OTHERNEWS_STYLE;
|
||||||
@@ -32,6 +35,11 @@ $ix = new news;
|
|||||||
|
|
||||||
$caption = TD_MENU_L1;
|
$caption = TD_MENU_L1;
|
||||||
|
|
||||||
|
if(!empty($parm))
|
||||||
|
{
|
||||||
|
parse_str($parm, $parms);
|
||||||
|
}
|
||||||
|
|
||||||
if(!$OTHERNEWS_STYLE)
|
if(!$OTHERNEWS_STYLE)
|
||||||
{
|
{
|
||||||
if(deftrue('BOOTSTRAP')) // v2.x
|
if(deftrue('BOOTSTRAP')) // v2.x
|
||||||
@@ -41,13 +49,23 @@ 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>
|
$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>';
|
<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>";
|
$caption = "<div class='inline-text'>".$template['caption']." ".$item_selector."</div>";
|
||||||
|
|
||||||
$OTHERNEWS_STYLE = $template['item'];
|
$OTHERNEWS_STYLE = $template['item'];
|
||||||
}
|
}
|
||||||
else //v1.x
|
else //v1.x
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if(!empty($parms['caption']))
|
||||||
|
{
|
||||||
|
$caption = e107::getParser()->toHtml($parms['caption'], true,'TITLE');
|
||||||
|
}
|
||||||
|
|
||||||
$template['start'] = '';
|
$template['start'] = '';
|
||||||
$template['end'] = '';
|
$template['end'] = '';
|
||||||
|
@@ -132,7 +132,7 @@ class bootstrap_admintheme
|
|||||||
|
|
||||||
if(deftrue('e_IFRAME'))
|
if(deftrue('e_IFRAME'))
|
||||||
{
|
{
|
||||||
echo '
|
echo '<!-- Start Style: '.$style.' Mode: '.$mode.' and iFrame active -->
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<div class="block-text">
|
<div class="block-text">
|
||||||
'.$text.'
|
'.$text.'
|
||||||
@@ -185,7 +185,7 @@ class bootstrap_admintheme
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
case 'no_caption' :
|
case 'no_caption' :
|
||||||
echo '
|
echo '<!-- Start Style: '.$style.' Mode: '.$mode.' -->
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<div class="block-text">
|
<div class="block-text">
|
||||||
'.$text.'
|
'.$text.'
|
||||||
@@ -196,7 +196,7 @@ class bootstrap_admintheme
|
|||||||
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
echo '
|
echo '<!-- Start Style: '.$style.' Mode: '.$mode.' -->
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<h4 class="caption">'.$caption.'</h4>
|
<h4 class="caption">'.$caption.'</h4>
|
||||||
<div class="block-text">
|
<div class="block-text">
|
||||||
|
Reference in New Issue
Block a user