summaryrefslogtreecommitdiff
path: root/smartyplugins/function.banner.php
blob: 077796339fab9911c0e4e0d00052b2623a86fc12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
namespace Bitweaver\Plugins;

/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */

/**
* smarty_function_banner
*/
function smarty_function_banner($params, &$gBitSmarty)
{
	global $gBitSystem;
	include_once BANNERS_PKG_PATH.'banner_lib.php';
	if(!isset($bannerlib)) {
	  $bannerlib = new \Bitweaver\BannerLib();
	}

	extract($params);
	// Param = zone

	if (empty($zone)) {
		$gBitSmarty->trigger_error("assign: missing 'zone' parameter");
		return;
	}
	$banner = $bannerlib->select_banner($zone);
	print $banner;
}