1
0
mirror of https://github.com/e107inc/e107.git synced 2025-02-18 21:44:42 +01:00

95 lines
2.2 KiB
PHP
Raw Normal View History

2006-12-02 04:36:16 +00:00
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <EFBFBD>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/banner_menu/banner_menu.php,v $
2008-08-03 08:08:36 +00:00
| $Revision: 1.2 $
| $Date: 2008-08-03 08:08:31 $
| $Author: e107steved $
2006-12-02 04:36:16 +00:00
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
/*
To define your own banner to use here ...
1. Go to admin -> banners and create a campaign, then add your banner to it
2. Add this line to this file ...
$campaign = NAME_OF_YOUR_CAMPAIGN
3. Save file
*/
global $THEMES_DIRECTORY;
2008-08-03 08:08:36 +00:00
if (file_exists(THEME."banner_template.php"))
{
require_once(THEME."banner_template.php");
}
else
{
require_once(e_BASE.$THEMES_DIRECTORY."templates/banner_template.php");
2006-12-02 04:36:16 +00:00
}
2008-08-03 08:08:36 +00:00
if(isset($campaign))
{
$parm = $campaign;
$bannersccode = file_get_contents(e_FILE."shortcode/banner.sc");
$BANNER = eval($bannersccode);
$txt = $BANNER_MENU_START;
$txt .= preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_MENU);
$txt .= $BANNER_MENU_END;
2006-12-02 04:36:16 +00:00
2008-08-03 08:08:36 +00:00
}
else
{
if (isset($menu_pref['banner_campaign']) && $menu_pref['banner_campaign'])
{
if(strstr($menu_pref['banner_campaign'], "|"))
2006-12-02 04:36:16 +00:00
{
2008-08-03 08:08:36 +00:00
$campaignlist = explode("|", $menu_pref['banner_campaign']);
$amount = ($menu_pref['banner_amount']<1 ? '1' : $menu_pref['banner_amount']);
$amount = ($amount > count($campaignlist) ? count($campaignlist) : $amount);
$keys = array_rand($campaignlist, $amount);
$parms = array();
foreach($keys as $k=>$v)
{
$parms[] = $campaignlist[$v];
}
2006-12-02 04:36:16 +00:00
}
2008-08-03 08:08:36 +00:00
else
{
$parms[] = $menu_pref['banner_campaign'];
2006-12-02 04:36:16 +00:00
}
2008-08-03 08:08:36 +00:00
}
2006-12-02 04:36:16 +00:00
2008-08-03 08:08:36 +00:00
$txt = $BANNER_MENU_START;
foreach($parms as $parm)
{
$bannersccode = file_get_contents(e_FILE."shortcode/banner.sc");
$BANNER = eval($bannersccode);
$txt .= preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_MENU);
}
$txt .= $BANNER_MENU_END;
}
2006-12-02 04:36:16 +00:00
if (isset($menu_pref['banner_rendertype']) && $menu_pref['banner_rendertype'] == 2)
{
2008-08-03 08:08:36 +00:00
$ns->tablerender($menu_pref['banner_caption'], $txt);
2006-12-02 04:36:16 +00:00
}
else
{
2008-08-03 08:08:36 +00:00
echo $txt;
2006-12-02 04:36:16 +00:00
}
?>