View Full Version : Postbit Variables
Mike Cout
03-20-2004, 08:49 PM
Hello,
Where do I need to define a variable in VB so it will show up in the postbit?
I would like a variable defined in PHP to show up in the postbit and have been unsuccessful in figuring it out.
Thanks,
-mc
NTLDR
03-20-2004, 09:21 PM
Use $GLOBALS[varname] where for a variable like $varname
Mike Cout
03-20-2004, 09:26 PM
What file should that be used in? Would showthread be sufficient?
Instead of defining $varname, I would define $GLOBALS[varname]?
Thanks,
-mc
NTLDR
03-20-2004, 09:48 PM
Put $GLOBALS[varname] inside the postbit template where you want the variables contents to appear. $GLOBALS[varname] will contain the same content as $varname.
So if you have:
$myvar = 12;
In showthread.php you'd put:
$GLOBALS[myvar]
In your postbit template.
Mike Cout
03-20-2004, 10:47 PM
Thanks!
Is it possible to have the posts username in functions_showthread?
Im trying to show a users pointtotal in their postbit.
This is what I have in functions_showthread.
$query=$DB_site->query("SELECT points FROM dev_user WHERE username='$post[musername]';");
while($result=$DB_site->fetch_array($query)) {
$pointtotal = $result["points"];
}
Trying to run the query based on their username. It does not work.
Is their a way to make it work this way or is there another way?
Thanks,
-mc
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.