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

Reply
 
Thread Tools Display Modes
  #1  
Old 07-18-2011, 08:47 PM
thunderclap82 thunderclap82 is offline
 
Join Date: Nov 2008
Posts: 305
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Plugin Problem

I have a plugin working fine on one vB site (running 4.1.2) and when I try implementing the same plugin on another site (4.1.4) it crashes the system with an Internal Error. Here is the actual plug-in code:

The Product is vBulletin, the Hook Location is template_register_var and the Execution Order is 5.

Code:
$templater = vB_Template::create('banner_rotator');
$templatevalues['banner_rotator'] = $templater->render();
vB_Template::preRegister('header', $templatevalues);
It references a template I created called banner_rotator.

Like I said, on my vB 4.1.2 site it works fine but on the newer 4.1.4 site it crashes. I was wondering if there was something that vB updated that changes some of this code?
Reply With Quote
  #2  
Old 07-18-2011, 08:56 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 changing the Execution Order? Do you have any other modifications that use the same hook location? Have you tried disabling your other products (or even going one-by-one) to see if it is a problem between two mods that is causing the error?

I don't see anything obviously wrong with that code you posted.
Reply With Quote
  #3  
Old 07-19-2011, 01:06 AM
thunderclap82 thunderclap82 is offline
 
Join Date: Nov 2008
Posts: 305
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I tried changing the execution order to 1 and 10 and neither worked. No other mod uses that hook location, and I've tried disabling all mods as well as their plug-ins.

Is it possible something in the template that the plugin is calling at fault? (I did change the template name that's called in the plugin but that resulted in the same error.)

And here is the exact error message:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@[domain].com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Apache mod_fcgid/2.3.6 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at www.repairmanjack.com Port 80

And I did check the error log and all I get is:

[Mon Jul 18 21:14:59 2011] [error] [client {IP ADDRESS}] File does not exist: /home/fpaul46/public_html/500.shtml

--------------- Added [DATE]1311082958[/DATE] at [TIME]1311082958[/TIME] ---------------

After some more digging this seems to be the actual error message when trying to activate the plugin:

[19-Jul-2011 00:51:15] PHP Warning: chdir() [<a href='function.chdir'>function.chdir</a>]: No such file or directory (errno 2) in /home/fpaul46/public_html/forum/index.php on line 38

This is the code in index.php:

Code:
chdir('./' . VB_RELATIVE_PATH);
Does that help at all?
Reply With Quote
  #4  
Old 07-19-2011, 05:30 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Actually, the full code there is:
PHP Code:
// Do not edit.
if (defined('VB_RELATIVE_PATH'))
{
    
chdir('./' VB_RELATIVE_PATH);

So, did you define VB_RELATIVE_PATH in the code above there? By default, it is commented out, so it shouldn't be defined and that line should never be evaled.
Reply With Quote
  #5  
Old 07-19-2011, 06:12 PM
thunderclap82 thunderclap82 is offline
 
Join Date: Nov 2008
Posts: 305
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
Actually, the full code there is:
PHP Code:
// Do not edit.
if (defined('VB_RELATIVE_PATH'))
{
    
chdir('./' VB_RELATIVE_PATH);

So, did you define VB_RELATIVE_PATH in the code above there? By default, it is commented out, so it shouldn't be defined and that line should never be evaled.
Nope. It's not defined as the index file in in the forum directory, and not the root.
Reply With Quote
  #6  
Old 07-19-2011, 07:07 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That seems strange to me - why should something in a plugin affect code in index.php, and how is it even getting there? Maybe an include() or require() is loading the wrong file or something?

Does the same thing happen if you put some totally different code in the plugin?
Reply With Quote
  #7  
Old 07-19-2011, 09:09 PM
thunderclap82 thunderclap82 is offline
 
Join Date: Nov 2008
Posts: 305
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
That seems strange to me - why should something in a plugin affect code in index.php, and how is it even getting there? Maybe an include() or require() is loading the wrong file or something?

Does the same thing happen if you put some totally different code in the plugin?
I'm really not a programmer, just someone who can usually muddle his way through it. So I have no idea what else I can put in the plugin to test your idea.

I double checked with our host and this is what they said:

From the php code the plugin introduces, the following is causing the error:

$templatevalues['banner_rotator'] = $templater->render();


They asked me to double check the template code (I have) and it's the same as it is on the other site I run.
Reply With Quote
  #8  
Old 07-19-2011, 10:15 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

And what is that template code? And are you sure that template exists in that style?

And what happens if you remove line 38 from your index.php page? Then what is the error in your error_log?
Reply With Quote
  #9  
Old 07-19-2011, 11:34 PM
thunderclap82 thunderclap82 is offline
 
Join Date: Nov 2008
Posts: 305
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
And what is that template code? And are you sure that template exists in that style?
Here is the mod which, incidentally, you helped me with. And the template is in the style.

https://vborg.vbsupport.ru/showthread.php?t=252398

Quote:
And what happens if you remove line 38 from your index.php page? Then what is the error in your error_log?
Same error page appears, but nothing appears in the log.
Reply With Quote
  #10  
Old 07-20-2011, 01:54 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by thunderclap82 View Post
Here is the mod which, incidentally, you helped me with. And the template is in the style.

https://vborg.vbsupport.ru/showthread.php?t=252398
But your template doesn't actually look like that unless you left "your URL" and "link to your image file" in there (which you should not have). So, exactly what does your template look like?
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:12 PM.


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.06366 seconds
  • Memory Usage 2,269KB
  • 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
  • (2)bbcode_code
  • (2)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete