mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 13:17:24 +02:00
Minor code tidy up
This commit is contained in:
@@ -11,9 +11,9 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/banner_menu/banner_menu.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/banner_menu/banner_menu.php,v $
|
||||||
| $Revision: 1.1.1.1 $
|
| $Revision: 1.2 $
|
||||||
| $Date: 2006-12-02 04:34:44 $
|
| $Date: 2008-08-03 08:08:31 $
|
||||||
| $Author: mcfly_e107 $
|
| $Author: e107steved $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -32,21 +32,27 @@ To define your own banner to use here ...
|
|||||||
|
|
||||||
|
|
||||||
global $THEMES_DIRECTORY;
|
global $THEMES_DIRECTORY;
|
||||||
if (file_exists(THEME."banner_template.php")) {
|
if (file_exists(THEME."banner_template.php"))
|
||||||
|
{
|
||||||
require_once(THEME."banner_template.php");
|
require_once(THEME."banner_template.php");
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
require_once(e_BASE.$THEMES_DIRECTORY."templates/banner_template.php");
|
require_once(e_BASE.$THEMES_DIRECTORY."templates/banner_template.php");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($campaign)){
|
if(isset($campaign))
|
||||||
$parm = (isset($campaign) ? $campaign : "");
|
{
|
||||||
|
$parm = $campaign;
|
||||||
$bannersccode = file_get_contents(e_FILE."shortcode/banner.sc");
|
$bannersccode = file_get_contents(e_FILE."shortcode/banner.sc");
|
||||||
$BANNER = eval($bannersccode);
|
$BANNER = eval($bannersccode);
|
||||||
$txt = $BANNER_MENU_START;
|
$txt = $BANNER_MENU_START;
|
||||||
$txt .= preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_MENU);
|
$txt .= preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_MENU);
|
||||||
$txt .= $BANNER_MENU_END;
|
$txt .= $BANNER_MENU_END;
|
||||||
|
|
||||||
}else{
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
if (isset($menu_pref['banner_campaign']) && $menu_pref['banner_campaign'])
|
if (isset($menu_pref['banner_campaign']) && $menu_pref['banner_campaign'])
|
||||||
{
|
{
|
||||||
if(strstr($menu_pref['banner_campaign'], "|"))
|
if(strstr($menu_pref['banner_campaign'], "|"))
|
||||||
@@ -56,7 +62,8 @@ if(isset($campaign)){
|
|||||||
$amount = ($amount > count($campaignlist) ? count($campaignlist) : $amount);
|
$amount = ($amount > count($campaignlist) ? count($campaignlist) : $amount);
|
||||||
$keys = array_rand($campaignlist, $amount);
|
$keys = array_rand($campaignlist, $amount);
|
||||||
$parms = array();
|
$parms = array();
|
||||||
foreach($keys as $k=>$v){
|
foreach($keys as $k=>$v)
|
||||||
|
{
|
||||||
$parms[] = $campaignlist[$v];
|
$parms[] = $campaignlist[$v];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -67,7 +74,8 @@ if(isset($campaign)){
|
|||||||
}
|
}
|
||||||
|
|
||||||
$txt = $BANNER_MENU_START;
|
$txt = $BANNER_MENU_START;
|
||||||
foreach($parms as $parm){
|
foreach($parms as $parm)
|
||||||
|
{
|
||||||
$bannersccode = file_get_contents(e_FILE."shortcode/banner.sc");
|
$bannersccode = file_get_contents(e_FILE."shortcode/banner.sc");
|
||||||
$BANNER = eval($bannersccode);
|
$BANNER = eval($bannersccode);
|
||||||
$txt .= preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_MENU);
|
$txt .= preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_MENU);
|
||||||
@@ -75,15 +83,13 @@ if(isset($campaign)){
|
|||||||
$txt .= $BANNER_MENU_END;
|
$txt .= $BANNER_MENU_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
$text = $txt;
|
|
||||||
|
|
||||||
if (isset($menu_pref['banner_rendertype']) && $menu_pref['banner_rendertype'] == 2)
|
if (isset($menu_pref['banner_rendertype']) && $menu_pref['banner_rendertype'] == 2)
|
||||||
{
|
{
|
||||||
$ns->tablerender($menu_pref['banner_caption'], $text);
|
$ns->tablerender($menu_pref['banner_caption'], $txt);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
echo $text;
|
echo $txt;
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
Reference in New Issue
Block a user