View Full Version : What VB variables are exposed to determine which page I'm currently on?
HostReach
Sat 14th Sep '02, 9:19am
Can someone list some PHP variables of VB I can use to determine which page within the forum I'm currently on (ie: frontpage, forum category "test" etc)? For example, what are the variables for:
-Forum/ forum category title
-The type of page (showthread, previewthread etc)
-and so on.
I'm trying to write a simple PHP script that delivers a different text depending on the page it's on. But I need to know which variables in VB I can access to help determine this.
Thanks,
Scott MacVicar
Sat 14th Sep '02, 9:42am
only $scriptpath is found during global.php
then
$filename = strtok($scriptpath, '?');
$pos = strrpos ($filename, '/');
if (!is_string($pos) || $pos) {
$filename = substr($filename, $pos+1);
}
will give you $filename such as showthreads.php etc
kippesp
Sat 14th Sep '02, 1:07pm
Scott's code is from online.php. The what() function in online.php drills down to the user's activity on the page.
HostReach
Sat 14th Sep '02, 4:57pm
Hi:
Works like a charm Scott. Thanks. BTW, if I'm using the code:
$filename = strtok($scriptpath, '?');
$pos = strrpos ($filename, '/');
if (!is_string($pos) || $pos) {
$filename = substr($filename, $pos+1);
}
inside phpinclude template, should I rename "$filename" to avoid conflicting with the code block inside online.php, or does it not matter?
Thanks,
Scott MacVicar
Sun 15th Sep '02, 5:27am
No, its ok, $filename is not a global variable for the function.
vBulletin® v3.8.0 Release Candidate 1, Copyright ©2000-2008, Jelsoft Enterprises Ltd.