[bbDev] current forum on topic.php

Bill Keller bkeller at digitalthread.com
Mon Jan 31 21:54:11 GMT 2005


Similar to the recently discussed topic of getting all forum_names to 
display on every page;

How can we show the current forum_name on topic.php?  The following 
code will display on forum.php just fine, but returns an error on a 
topic.php page.

This is using similar code discussed recently (and after changing the 
global line of get_header() to:
global $bb, $forum;):


<?php $forums = get_forums();
$topics = get_latest_topics();
if ( $forums ) : ?>
	<?php foreach ( $forums as $forum ) : ?>
		<?php forum_name(); ?>
	<?php endforeach; ?>
<?php endif; ?>

<?php $forum = get_forum ( $forum_id ); ?>

returns the following error:
SELECT * FROM bb_forums WHERE forum_id =

(not getting ID of the current forum.)

The top portion works fine, It returns my list of all forum_name's just 
fine...



More information about the bbDev mailing list