vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   vBulletin Arrays (https://vborg.vbsupport.ru/showthread.php?t=221337)

James Birkett 08-20-2009 08:54 AM

vBulletin Arrays
 
It seems (from my view) that vBulletin uses arrays in order to run things. Such as a $post array holding values like $post['username'], $post['userid']. The same is true for $user.

I was wondering, how would I go about showing these arrays on a separate page so I could see what $post, $user, $show etc. arrays hold what values. I want to learn more about vBulletin's code.

Marco van Herwaarden 08-20-2009 10:28 AM

You can show them on the current page, but you can't on a seperate page as this page would not have all the variables loaded that are on the primary page.

James Birkett 08-20-2009 11:33 AM

Is there any vBulletin page with all of them variables on it? So I can just print the array and see what each variable holds on one page rather than separate ones?

Marco van Herwaarden 08-20-2009 11:38 AM

No, they are dynamic.

James Birkett 08-20-2009 12:44 PM

Ah. Would a simple print_r($user); work in order to show the values of an array?
If so, would I put this in the template or the file (i.e. index.php)?

Marco van Herwaarden 08-21-2009 08:22 AM

For debugging you can use a print_r(), but you might need to end the script execution afterwards.

For debugging arrays i always use the following myself (have it assigned to a macro in my editor):
PHP Code:

echo "<br />Array array: <pre>";print_r($array);echo "</pre>"

Use the <pre> tag to get a ofrmatted output.

Dismounted 08-21-2009 09:38 AM

Quote:

Originally Posted by Marco van Herwaarden (Post 1871523)
Use the <pre> tag to get a ofrmatted output.

You can also view the source of the page to get a correctly line-broken output.

James Birkett 08-21-2009 10:29 AM

Thanks for the code Marco. I have tried a variety of locations (showthread.php, index.php, FORUMHOME template, POSTBIT template, SHOWTHREAD template) with this code with no luck. Would this code require it to go in the php file or the template?
Also, would I need debug mode on?


All times are GMT. The time now is 01:20 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.02255 seconds
  • Memory Usage 1,724KB
  • 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_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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