vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Include Global.php on Main Site (https://vborg.vbsupport.ru/showthread.php?t=102223)

Mistah Roth 12-04-2005 07:33 PM

Include Global.php on Main Site
 
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

PHP Code:

    $vbulletin->input->clean_array_gpc('r', array(
        
'id'    => TYPE_INT,
    )); 

Then use the var in the rest of your script:
PHP Code:

$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.


All times are GMT. The time now is 03:51 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01033 seconds
  • Memory Usage 1,728KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete