Kyberia v2.0
[mirrors/Kyberia-bloodline.git] / inc / smarty / node_methodz / function.get_banner.php
1 <?
2 function smarty_function_get_banner(&$smarty) {
3 $banners_directory = $_SERVER['DOCUMENT_ROOT']."/banners/";
4
5 $handle = opendir($banners_directory);
6 while (false !== ($target = readdir($handle))) {
7 if ($target != "." && $target != "..") {
8 list($name, $ext) = explode(".", $target);
9 if($ext == "swf") {
10 $banners_array[] = $target;
11 }
12 }
13 }
14
15 $rand = rand(0, count($banners_array) - 1);
16
17 $smarty->assign('get_banner', $banners_array[$rand]);
18 }
19 ?>
This page took 0.250807 seconds and 4 git commands to generate.