function.fonl.php 1.06 KB
<?php
/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */


/**
 * Smarty {math} function plugin
 *
 * Type:     function<br>
 * Name:     math<br>
 * Purpose:  handle math computations in template<br>
 * @link http://smarty.php.net/manual/en/language.function.math.php {math}
 *          (Smarty online manual)
 * @author   Monte Ohrt <monte at ohrt dot com>
 * @param array
 * @param Smarty
 * @return string
 */
function smarty_function_fonl($params, &$smarty)
{ 	/*$array = array("kurtki_new.jpg","kid_all.jpg");
	$array_link = array(
	"http://extremstyle.ua/kurtki-catalogs/",
	"http://extremstyle.ua/kurtki-catalogs/filter;brend=Rossignol;filter=g48_novaya-kollektsiya/"	
); */
global $objFon;
$row = $objFon->getFonRand();
	
	
	//$key = rand(0, 1);
	$out = 'style="';
    $out .= 'width:100%;';
    $out .= 'height: 2126px;';
    $out .= 'position:absolute;';
	$out .= 'z-index:1;';
	$out .= 'background: url(/uploaded/pic/fon/'.$row['pic'].') top center no-repeat;';
	$out .= '" ';
	$out .= 'href="'.$row['url'].'"';
	return $out;
}

/* vim: set expandtab: */

?>