Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-24-2009, 03:19 AM
briangreul briangreul is offline
 
Join Date: Aug 2009
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How can I find out what templates are used to render a page?

When doing minor modifications it's often nice to know what templates are involved. It's also nice to know what templates are used to build a page for debugging purposes.

Is there a way to find out what templates are being used on a given page?

I have a debugging issue right now where I broke something minor and it's killing inline moderation. I've looked at the 3 or 4 templates, but I don't see anything evil. The pages all work fine, it's only when I try to moderate them.

Generating a list of templates to evaluate would help me to narrow my search.

I've also done a lot of trial and error when trying to change something. I hate hunting for the offending template that needs modification.
Reply With Quote
  #2  
Old 08-24-2009, 03:42 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Turn on debug mode and all the templates are listed on the bottom of the page. Enter this in the config.php file:
PHP Code:
    $config['Misc']['debug'] = true
This shows for everyone, so do it on your test site.
Reply With Quote
  #3  
Old 08-24-2009, 12:29 PM
briangreul briangreul is offline
 
Join Date: Aug 2009
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
Turn on debug mode and all the templates are listed on the bottom of the page. Enter this in the config.php file:
PHP Code:
    $config['Misc']['debug'] = true
This shows for everyone, so do it on your test site.
THANK YOU! I've been struggling with this for a while. You have no idea how much hassle that will remove.

We don't get a large amount of traffic, so I can turn it on, see what I need to and turn it off without it being a big deal. If a couple of users see it, no big deal.

It's a shame that the vbulletin.com forums weren't as helpful. I got a very nasty "find it yourself" response over there.
Reply With Quote
  #4  
Old 08-24-2009, 02:05 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sometimes you run into a user that isn't helpful, but I'd give vb.com another chance because they really do have an outstanding group of support guys.


If you have a static IP, you can set debug to be on only for you:
PHP Code:
if ($_SERVER["REMOTE_ADDR"] == "xxx.xxx.xxx.xxx") {
    
// enable debug mode for only my IP address
    
$config['Misc']['debug'] = true;

Replace xxx.xxx.xxx.xxx with your IP. You cannot, however, set it to only show for userid 1, or whatever, because your userid is not known at the time the config.php file comes into play in the page.
Reply With Quote
  #5  
Old 08-25-2009, 02:16 AM
jchamber2010 jchamber2010 is offline
 
Join Date: Mar 2009
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This might or might not work, but add that line to another file like the bottom of global.php, then you could use

PHP Code:
if ($vbulletin->userinfo['userid'] == 1) {
    
// enable debug mode for only my USERID
    
$config['Misc']['debug'] = true;

Modifying vBulletin core files as described in this post is extremely in advisable.
Modifying core vBulletin files will result in loss of official support from vBulletin.com.
Use the contents of this post at your own risk!
Reply With Quote
  #6  
Old 08-25-2009, 07:19 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by jchamber2010 View Post
This might or might not work
You will lose the "explain" functionality if debug mode is set late in the execution.
Reply With Quote
  #7  
Old 10-05-2009, 04:07 AM
briangreul briangreul is offline
 
Join Date: Aug 2009
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I finally had some time to do some digging. I still have an issue.

I'm not sure why inline moderation is broken, but it is. I can't move, merge or otherwise affect posts from the thread view. I also have difficulty with inline moderation from the forum view where I can see multiple threads. The moderation tool at the bottom of the page is what is affected. It appears to submit the affected posts to inlinemod.php which blows up on line 3869.

I'm not necessarily wanting someone to solve my problem for me. I am however interested in suggestions on how to troubleshoot this or where to look for the problem.

I have a number of moderations to my templates. I have gone through and one by one disabled them, tested, and re-enabled them with no success.

I have a number of mods installed most of which are supported and I don't believe any of them are the culprit. They are mostly things like twitter hooks.

I'm reasonably confident that this isn't related to my mods. Most of my mods revolved around masking user info from guest users. I just wish I had a more meaningful error message then :
Parse error: syntax error, unexpected $end, expecting T_VARIABLE or '$' in /home/brianpz/public_html/forums/inlinemod.php on line 3869

That doesn't exactly tell me very much... other then looking at line 3869:

PHP Code:
$edit['parseurl'] = ($vbulletin->GPC['parseurl'] AND $vbulletin->forumcache["$destpost[forumid]"]['allowbbcode']);
    
$edit['disablesmilies'] =& $vbulletin->GPC['disablesmilies'];
    
$edit['enablesmilies'] = $edit['allowsmilie'] = ($edit['disablesmilies']) ? 1;
    
$edit['reason'] = fetch_censored_text($vbulletin->GPC['reason']);
    
$edit['title'] = $vbulletin->GPC['title'];

    
// Update First Post
3869--->    $postman =& datamanager_init('Post'$vbulletinERRTYPE_ARRAY'threadpost');
    
$postman->set_existing($destpost);
    
$postman->set_info('parseurl'$edit['parseurl']);
    
$postman->set('pagetext'$edit['message']);
    
$postman->set('userid'$useridtruefalse); // Bypass verify 
Any suggestions on how I should troubleshoot this?

So far I have:
- checked that template modifications weren't the obvious cause of the issue.
- turned on template tracing to get an idea what templates are involved.
- looked at the offending PHP code and line 3869 and took a glance at the preceding code... although I'm not really a PHP coder. I am very experienced in ASP/vbscript so this isn't that strange.

It seems like the next solution would be to try and backtrack in the code and figure out how it gets to 3869 and check for broken items.

It seems like the basic logic is that checking off the checkboxes on the thread selects the post ID and then sends these to inlinemod.php. From there inlinemod.php checks some security and performs functions. Somewhere along the way it's complaining about the data on page 3869.

I am using the legacy postbits... so there could be a conflict between them and the inlinemod.php.
Reply With Quote
  #8  
Old 10-05-2009, 05:06 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Have you tried using a totally default style and seeing if things work then?

Create a new style with no parent:
  • Styles & Templates > Style Manager > Add New Style
  • Parent Style: No Parent Style
  • Title: Default vBulletin
  • Allow User Selection: Yes
  • Save
Then browse the site using that totally default vbulletin style - do you still have the same problem?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:55 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04154 seconds
  • Memory Usage 2,259KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (5)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete