PDA

View Full Version : how to use variables in global.php in header template?


DionDev
11-16-2008, 11:26 PM
i have a little hack i added to the global.php file:


// forum stats start
$numbersmembers=$db->query_first('SELECT COUNT(*) AS users,MAX(userid) AS max FROM user');
$numbermembers=number_format($numbersmembers['users']);
$countposts=$db->query_first('SELECT COUNT(*) AS posts FROM post');
$totalposts=number_format($countposts['posts']);
$countthreads=$db->query_first('SELECT COUNT(*) AS threads FROM thread');
$totalthreads=number_format($countthreads['threads']);
// forum stats end


now this works when i use the variables on a non-vb page

how do i use these variables in the header template?

--------------- Added 1226888073 at 1226888073 ---------------

i tried adding this as a plugin to global_start and it still didnt work. UGH

mikewastaken
11-17-2008, 02:04 AM
the hack way around it would be to download "Let PHP Live" and change that to PHP and input it in the header template.

PHP Live is for v3.5 I think, but it works flawlessly.

DionDev
11-17-2008, 03:18 AM
thank you SO MUCH for that product!!!!!!!!!!!!!!!!!!