View Full Version : Setting PHP Variables
If I set a variable in "forumdisplay.php" should I be able to access it in any of the templates called by "forumdisplay.php"? Because I have tried and not been able to.
Admin
06-08-2002, 05:39 AM
You should be able to.
Where did you set the variable and where are you using it?
I set it right after the moderator section in "forum_display.php" around line 119, and I'm trying to use it in "forumdisplay_forumbit_level1_post" .
Also where is the "$forum[moderators]" variable set at in the code, I've searched everywhere and can't find it.
Admin
06-08-2002, 02:45 PM
(1) Globalize the variable name in the makeforumbit() function, in that same file.
(2) Here:
unset($forum['moderators']);
$listexploded=explode(",", $forum['parentlist']);
while ( list($mkey1,$mval1)=each($listexploded) ) {
if ( !isset($imodcache["$mval1"]) ) {
continue;
}
reset($imodcache["$mval1"]);
while ( list($mkey2,$moderator)=each($imodcache["$mval1"]) ) {
if ( !isset($forum['moderators']) ) {
eval("\$forum['moderators'] = \"".gettemplate('forumhome_moderator')."\";");
} else {
eval("\$forum['moderators'] .= \", ".gettemplate('forumhome_moderator')."\";");
}
}
}
if ( !isset($forum['moderators']) ) {
$forum['moderators'] = ' ';
}
Worked Perfectly
Thanks A Bunch :)
conductorchris
06-12-2002, 11:10 PM
I'm having a similar problem: I appended an image swapping script to the global.php file and the variables are not being read by the header template: <img src="<?echo $imgsrc;?>" >
What does it mean to globalize the variable name?
Thanks, Chris
Admin
06-13-2002, 05:59 AM
conductorchris, please go to this (http://www.vbulletin.com/members/vbulletin.org.php) page and enter your username, to show you are licensed. (you will need to use your customer number and password to access that page)
Thank you.
gmarik
06-13-2002, 01:50 PM
Tell me please (gmarik@hotbox.ru) is there a site, where is explained the PHP code of vb.2.2.6. and the new things, that will be in vb.3.0.?
Admin
06-13-2002, 02:08 PM
gmarik, please go to this (http://www.vbulletin.com/members/vbulletin.org.php) page and enter your username, to show you are licensed. (you will need to use your customer number and password to access that page)
Thank you.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.