4 * -------------------------------------------------------------
7 * Purpose: print out a counter value
8 * Credit: Taken from the original Smarty
9 * http://smarty.php.net
10 * -------------------------------------------------------------
12 function tpl_function_counter($params, &$tpl)
14 static $count = array();
15 static $skipval = array();
16 static $dir = array();
17 static $name = "default";
18 static $printval = array();
37 $count[$name] = $start;
39 elseif (!isset($count[$name]))
46 $printval[$name]=true;
50 $printval[$name]=$print;
55 $printval[$name] = false;
56 $tpl->assign($assign, $count[$name]);
61 $retval = $count[$name];
70 $skipval[$name] = $skip;
72 elseif (empty($skipval[$name]))
77 if (isset($direction))
79 $dir[$name] = $direction;
81 elseif (!isset($dir[$name]))
86 if ($dir[$name] == "down")
88 $count[$name] -= $skipval[$name];
92 $count[$name] +
= $skipval[$name];