vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   where is the $vbulletin->GPC[] array set up? (https://vborg.vbsupport.ru/showthread.php?t=184663)

StephenKay 07-07-2008 09:19 PM

where is the $vbulletin->GPC[] array set up?
 
I want to add my own additional HTML query variable to some of the regular query strings, and I gather that this is how the queries are handled in vBulletin: somewhere, they are put into an array that the functions can then reference, but I can't locate where in the code it is initially set up....

Thanks!

Opserty 07-07-2008 09:21 PM

You don't need to worry about where it is set up.

Using the vBulletin Input Cleaner

StephenKay 07-07-2008 09:43 PM

Uhmmm... thanks, but for example, say that I want to add a variable to the string:

Code:

showthread.php?goto=newpost&t=XXXXX
such that it would be:

Code:

showthread.php?goto=newpost&t=XXXXX&translate=en_fr
In the showthread.php code, they do things like:

PHP Code:

switch($vbulletin->GPC['goto'])
{
    case 
'newpost'

...so I am wondering how to get my variable into that array, or is there some other way I should be trying to read this...

Dismounted 07-08-2008 05:58 AM

PHP Code:

// run it through the cleaner
$vbulletin->input->clean_gpc('g''translate'TYPE_STR);

// access it like so
echo $vbulletin->GPC['translate']; 

If you are using it directly in a query, make sure you use escape_string(). If you are displaying it on a page, make sure you use TYPE_NOHTML instead.

StephenKay 07-08-2008 10:54 PM

Thank you! worked great. :)


All times are GMT. The time now is 06:57 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.02216 seconds
  • Memory Usage 1,723KB
  • 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_code_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete