[bbDev] get_forums, forum_id

Bill Keller bkeller at digitalthread.com
Thu Jan 6 17:37:53 GMT 2005


<?php $current = forum_id();
print $current;
?>

<?php $forums = get_forums();
if ( $forums ) : ?>
<ul><?php foreach ( $forums as $forum ) : ?>
<li><?php print $current; print forum_id(); ?>
   <?php
if ($current == forum_id()){
	echo "current";
}
Else
	echo"not current ";
?>

I'm using this on the forums.php template.

The initial value of $current properly displays only the current 
forum_ID  but, when $current is used in that foreach loop, $current 
resets itself each time.

The output looks like this:

-------------------
2

11CURRENT forum title
22CURRENT forum title
33CURRENT forum title

--------------------

I'm assuming this is more of a PHP question, but shouldn't $current be 
set just that initial time, and not reset for each forum?

Thanks,
Bill



More information about the bbDev mailing list