[bbDev] initial reactions

Justin French justin.french at indent.com.au
Thu Jan 6 13:31:29 GMT 2005


On 06/01/2005, at 8:04 PM, Matthew Mullenweg wrote:

> Justin French wrote:
>> Yes, that works, and I can print_r($forums), but things like 
>> forum_name() aren't working... any ideas?
>
> Those functions assume the presence of a global object $forum that 
> contains the information they're looking for.
>
> $forum = get_forum ( $forum_id );

Yeah, that's what I figured from the default templates:

A header.php file consisting of:

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

Results in:

<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>

So $forums is populated with 8 items (I can see them when I 
print_r($forums)), but forum_name() doesn't seem to "get it".

For what it's worth, here's an excerpt of print_r($forums):

Array
(
     [0] => stdClass Object
         (
             [forum_id] => 1
             [forum_name] => Travel
             [forum_desc] => This is the description.
             [forum_order] => 0
             [topics] => 1
             [posts] => 1
         )

     [1] => stdClass Object
         (
             [forum_id] => 2
             [forum_name] => Career
             [forum_desc] => This is the description.
             [forum_order] => 0
             [topics] => 0
             [posts] => 0
         )

Regards,

---
Justin French, Indent.com.au
justin.french at indent.com.au
Web Application Development & Graphic Design



More information about the bbDev mailing list