2 function smarty_function_get_banner(&$smarty) {
3 $banners_directory = $_SERVER['DOCUMENT_ROOT']."/banners/";
5 $handle = opendir($banners_directory);
6 while (false !== ($target = readdir($handle))) {
7 if ($target != "." && $target != "..") {
8 list($name, $ext) = explode(".", $target);
10 $banners_array[] = $target;
15 $rand = rand(0, count($banners_array) - 1);
17 $smarty->assign('get_banner', $banners_array[$rand]);
This page took 0.385859 seconds and 4 git commands to generate.