vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   getting VB vars to work in a misc php file in the forum directory? (https://vborg.vbsupport.ru/showthread.php?t=35713)

Gutspiller 03-04-2002 03:49 PM

getting VB vars to work in a misc php file in the forum directory?
 
How would I do this? It's a php news file ( http://www.theforumz.com/forumz/frontpage.php ), but I want to use some fo the variables in VB to call numbers and features, like getting the number of people that are online. (I have FireFly's lil' hack) or getting a PM box on the page, etc. I try it and instead of grabbing the variable, it just shows the variable text instead of getting it. Do I need to require certain VB files inorder to get this to work?


If somebody can help me, I would greatly appreciate it.

Thanks!

Admin 03-04-2002 03:53 PM

PHP Code:

<?php
error_reporting
(7);
require(
'./global.php');

/* rest of your code here */

?>

That's the 'template' you should use for all vBulletin files. Requiring global.php actually gives you access to all the variables and database.

Gutspiller 03-04-2002 04:05 PM

What's the error reporting part suppose to be? It looks like it made it a link? :confused:

EDIT: I just checked my file and I am requiring the global.php file. :confused:

Admin 03-04-2002 04:13 PM

The link is just part of a hack, and error_reporting is a function to set the error reporting level. vBulletin uses 7 (E_ERROR | E_WARNING | E_PARSE) in all its scripts. You don't have to use it but you should.

Gutspiller 03-04-2002 04:41 PM

Firefly I have included the global.php file in the frontpage.php file and it just shows the var instead of executing it and getting the "code" that is attached to the variable. Anything else?

About the "error_reporting(7);" So I just actually write out

"error_reporting(7);"

It just seemed a little weird since it was so plain. (I thought the php code tag might of changed it.) :confused:

What other files can I include to get this to work?

Admin 03-04-2002 04:44 PM

How are you using these variables?

Gutspiller 03-04-2002 05:02 PM

<a href="http://www.theforumz.com/forumz/test.php" target="_blank">http://www.theforumz.com/forumz/test.php</a>

Upper left. Do I need to add more... stuff?

Admin 03-04-2002 06:03 PM

How? :) i.e what code...

Gutspiller 03-04-2002 06:18 PM

View source... duh. :)

Code:


<a href="http://www.theforumz.com/forumz/online.php"><b> $headeronline </b></a> Currently Online Users


Admin 03-04-2002 06:20 PM

What PHP code?


All times are GMT. The time now is 01:42 AM.

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.01086 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
  • (1)bbcode_code_printable
  • (1)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