Hi,
in one of my codes I have
Code:
$listings = "<a href=reviews.php?s=$session[sessionhash]&action=view&revid=$ra[id]>$ra[review_name]</a>-$ra[review_by]<br>";
eval("dooutput(\"".gettemplate("reviews_list")."\");");
How would I repeat $listings, as many times as I need?
I saw a code that firefly posted, see below:
Code:
function loop_template($vars, $template, $subtemplate, $table, $conditions = '') {
global $DB_site;
$dblink = $DB_site->query("SELECT $vars FROM $table $conditions");
while ($db_array = $DB_site->fetch_array($dblink)) {
foreach ($db_array as $field => $value) { // DO NOT use while here
$array["{$subtemplate}_{$field}"] = $value;
unset($array["$field"]);
}
eval('$return .= "'.gettemplate($template.'_'.$subtemplate).'";');
}
$DB_site->free_result($dblink);
return $return;
}
How would I apply my stuff to that?
Thanks in Advance
Drk