Log in

View Full Version : forum id


scales
04-20-2007, 11:17 PM
I have a PHP file that is included in phpinclude_start.


ob_start();
include_once('featuredcovers.php');
$included_file = ob_get_contents();
ob_end_clean();


However, I need to access the current forum id within my included file (featuredcovers.php). In vB templates, I use $thread[forumid] to print the current forum id. But this variable isn't available in the included file. Is there some way to access this variable somehow?

scales
04-22-2007, 10:08 PM
anyone?

Dismounted
04-23-2007, 06:04 AM
You'll probably need to move the hook to a position where $thread is already loaded. You'll also probably need to make the variable available.
global $thread;

scales
05-04-2007, 11:46 PM
Thanks for the response!

Here's my new phpinclude_start file:


ob_start();
global $thread;
include('featuredcovers.php');
$included_file = ob_get_contents();
ob_end_clean();


And then I tried to echo the variable in my include file but I see nothing...

Here's the include file aka featuredcovers.php:


global $thread;
echo $thread["forumid"];



I'm also trying to find where $thread[forumid] is defined. I can use this variable in certain templates, but it's not accessible in the "common templates" either.

I figured it out!

I just use $forumid in my include file.

Not sure why, but it works.