Log in

View Full Version : Include Global.php on Main Site


Mistah Roth
12-04-2005, 07:33 PM
With vb 3.0.7 I could include global.php to give me access to things like bbuserinfo and such, which many of the scripts on my site work off of.

Now if I include it, I no longer have access to those variables, and it messes up my .htaccess settings so that everything is redirected to the main page.

Any solutions?

Marco van Herwaarden
12-04-2005, 07:46 PM
It still works the same, but the names of the variables have changed. See the topics on moving from 3.0 to 3.5 in the 3.5 tutorials section.

Mistah Roth
12-04-2005, 11:25 PM
okay I will look into the variable changes, but any help on the .htaccess thing? The specific .htaccess that isnt working is the following:

RewriteEngine On
RewriteCond %{REQUEST_URI} !(index\.php|media|forums|layout|gamingextreme|inc ludes|news|archive|dave)
RewriteRule ^(.*)\.html$ index.php?id=site/$1

Basically just makes

http://www.ffextreme.com/index.php?id=ff6

look like

http://www.ffextreme.com/ff6.html

When I include the global.php, it redirects all of the pages to the main page for some reason.

Marco van Herwaarden
12-05-2005, 05:16 AM
What is the exact code of your script?

Mistah Roth
12-08-2005, 06:04 PM
through the process of trial and error I figured out what the problem is, but I dont know how to fix it.

Basically if I include global.php, if I try to pass any variables through the URL, for example.

index.php?id=blah or index.php?page=blah they dont get passed, they just are NULL values.

Any idea why it does this?

Marco van Herwaarden
12-08-2005, 06:14 PM
You will have to use $vbulletin->input->clean_array_gpc or $vbulletin->input->clean_gpc on them.

Mistah Roth
12-08-2005, 06:20 PM
how exactly do you use that function?

Marco van Herwaarden
12-08-2005, 06:24 PM
$vbulletin->input->clean_array_gpc('r', array(
'id' => TYPE_INT,
));

Then use the var in the rest of your script:
$vbulletin->GPC['id']

Mistah Roth
12-08-2005, 06:36 PM
Okay I did that, now the variable is always giving the value 0. Is there a certain place I need to put the clean_array_gpc?

Marco van Herwaarden
12-08-2005, 06:45 PM
You might need to use TYPE_STR instead of TYPE_INT if it is not an integer var.

Mistah Roth
12-08-2005, 09:56 PM
I think its working now, a few things I have to work out first. Thanks a lot :)