The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Is there a way to dump out all variables that is available at the template level?
If not, is there at least a way to use print_r/var_dump inside a template? |
#2
|
|||
|
|||
![]()
Yes and No. (use hooks prior to template call or modify fetch_template to instead of echoing out the template, it does a print_r call.)
It would be easier to look at where the template is called from and work out template scope from there. |
#3
|
||||
|
||||
![]()
Best idea I can come up with is a plugin that sets a variable with your vardump like this:
$var = print_r($var,true); then put $var into your template. |
#4
|
|||
|
|||
![]()
That wont work. print_r prints directly to stdout.
You would need to use output buffering at the very least, and variable scope could change between the plugin and the template. |
#5
|
|||
|
|||
![]()
Thanks for the info guys but I was hoping there was a debug mode for the template (ex. smarty's debug mode) that prints out all variables at the template scope.
This way I dont have to know the variable name in order to find what I'm looking for. |
#6
|
||||
|
||||
![]()
If you want to print_r to a variable, use "print_r($var, true)" the second arguement makes it return instead of echo/print it.
I always just do it in the file I'm working on (which is usually a custom file, not a vB file... even if it is a vB file, just put it back after because that is MUCH easier than working with plugins for debug code). Try using vBulletin's print_r function. I think it is is functions_misc.php (either print_array() or print_ar(). It is a formatted version of print_r. |
#7
|
|||
|
|||
![]()
Didnt know that one, thanks
![]() As for a template debug mode, just modify the function temporarily. |
#8
|
||||
|
||||
![]()
you can also just use print_r($array); exit;
Then the results will be viewable with nothing else clogging the screen. |
#9
|
||||
|
||||
![]() Quote:
Whatever makes debugging faster is good! ![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|