vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   rewrite variable from $name to $vbulletin->name (https://vborg.vbsupport.ru/showthread.php?t=156617)

marocnl 08-30-2007 11:23 AM

rewrite variable from $name to $vbulletin->name
 
Hi,

what are the other ways to get the variables:
$stylevar[]
and
$vbphrase[]

like the format $vbulletin->var['']

because I need those for my external PHP which I have includes in the template (and I can't seem to access $vbphrase[] just like that)

Sincerely,
Baris

Dismounted 08-30-2007 11:34 AM

$vbphrase can be accessed (almost) anywhere in vBulletin-powered scripts. There is no class equivalent.

marocnl 08-30-2007 11:44 AM

Unfortunately, it does not work. For example if I call $session[dbsessionhash] in my PHP file I get nothing, but if I call $vbulletin->session->vars['dbsessionhash'] I get what I want.

I have included a PHP file with the plugin system, like explained on http://www.vbulletin.com/forum/showthread.php?t=173937

Then in the template I call the output of my external script and that works fine.
But when I want to access $vbphrase[good] for example, I get nothing. So that is why I hoped there was a rewrite because that worked with the session info (also with userinfo).

So how can I call $vbphrase[good] in my external PHP file which I include in the template with the plugin option?

Dismounted 08-30-2007 11:51 AM

There are a few variables that don't have class equivalents ($vbphrase being one of them). $session does have its equivalent, therefore, you can call it via $vbulletin->session->vars. Make sure that you've included the correct phrase groups.

marocnl 08-30-2007 12:37 PM

Quote:

Originally Posted by Dismounted (Post 1328823)
Make sure that you've included the correct phrase groups.

How and where do I do that? I just followed the instructions on how to include a PHP file but can't find anything there about including phrase groups.

Is that also the case for $stylevar or is there a class for that one?

Sincerely,
Baris


All times are GMT. The time now is 03:29 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.01006 seconds
  • Memory Usage 1,718KB
  • 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
  • (1)bbcode_quote_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