I did what you said here and put a 3 in for the x part of it (because I have 3 titles at present) but nothing shows up for the titles or minimum posts. Any ideas? I'm using the showtitles template and it doesn't show anything for those 2 variables in there.
Quote:
Originally posted by Xenon
you'll have a problem: since you don't know how much titles you have, you can't make dynamic variables because in the templates you cannot make a loop to call them all.
you maust make a small sort of formating, or you make your template hardcoded to 3 or 4 or whatever count of your titles..
but if you want to do so:
replace this
PHP Code:
$titletext="";
while($title=$DB_site->fetch_array($titles)) {
$titletext.="<tr><td>".$title[minposts]."</td><td>".$title[title]."</td></tr>";
}
with this:
PHP Code:
$counter=0;
while($title=$DB_site->fetch_array($titles)) {
$titletext[$counter]=$title[title];
$titleposts[$counter]=$title[minposts];
$counter++;
}
then you can user $titletext[x] and $titleposts[x] in your templates
|