MyBB Community Forums

Full Version: PHP in Template!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Well first of all, what is $cstyle, you have an if statment for something, what is that thing ($cstyle).

the code worked for me, i don't know where you have messed, so please send me your file

regards


ok, i try to make the CS make that i Requast.
so the $cstyle is the number of the Categorys(manuely write this)
the if command i explian in the code
if($cstyle >= 3)
                    {
                    $csty = '<tr><td width="250px" valign="top"><strong><font color="#000080"><u>$forum[name]</u></font></strong>'.$forums.'</td></tr>'; /// make new line every 3 Categorys.
                    }
                else
                    {
                    $csty = '<td width="250px" valign="top"><strong><font color="#000080"><u>$forum[name]</u></font></strong>'.$forums.'</td>'; /// make only category without new line.
                    }
                    eval("\$forumlisting .= \"".$templates->get("forumbit_depth$depth$forumcat")."\";");
now i enter this to index.php but is doing new line every cat(and not every 3 cats). so i dont get what i want..
Well ofcourse, you declared the item as that then it would be as that, you would need to do something like this.
if($cstyle == 3) {
	$csty = '<tr><td width="250px" valign="top"><strong><font color="#000080"><u>'.$forum['name'].'</u></font></strong>'.$forums.'</td></tr>'; /// make new line every 3 Categorys.
} else {
	$csty = '<td width="250px" valign="top"><strong><font color="#000080"><u>'.$forum['name'].'</u></font></strong>'.$forums.'</td>'; /// make only category without new line.
}
$cstyle++;
if($cstyle == 3) $cstyle = 0;
haa i understand, but i see, this check one time the nubmer of category one time only, so it do only new line or, do only without new line, so we need to put that in another place..
hope you understand me
nope, sorry I don't get that :/
ok i understand again.
what the if Command we make doing(what this if command doing i mean) : check if CStyle >= 5 and if it right so : make all the Cat in new line, Else make all the Category in another line.
Hmm, I really do not understand you, I'm really sorry :/
This if should check if there is 3 categories between before an new line, isn't that what you wanted?
and you may wanna declare $cstyle = 0;over the while loop.
i want that every 3 Category it make a new line. this is the right code for it?(now you have to understand)
Yes it is, it should make an new line after every 3end category.
but this not does.. i have 5 Categorys and this is not work.
can you show me the full code and where to put it(all from 0) becasue maybe i do something wrong.
Pages: 1 2 3