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

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

Quote:
Originally Posted by Lynne View Post
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?
Here is the template code:

Code:
<link rel="stylesheet" href="clientscript/nivo-slider.css" type="text/css" media="screen" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script src="clientscript/jquery.nivo.slider.pack.js" type="text/javascript"></script>

<div id="slider">
<a href="http://www.repairmanjack.com"><img src="http://www.repairmanjack.com/forum/animate_logo/rj_logo00.png" /></a>
<a href="http://www.repairmanjack.com"><img src="http://www.repairmanjack.com/forum/animate_logo/rj_logo01.png" /></a>
<a href="http://www.repairmanjack.com"><img src="http://www.repairmanjack.com/forum/animate_logo/rj_logo02.png" /></a>
<a href="http://www.repairmanjack.com"><img src="http://www.repairmanjack.com/forum/animate_logo/rj_logo00.png" /></a>
<a href="http://www.repairmanjack.com"><img src="http://www.repairmanjack.com/forum/animate_logo/rj_logo03.png" /></a>
<a href="http://www.repairmanjack.com"><img src="http://www.repairmanjack.com/forum/animate_logo/rj_logo04.png" /></a>
<a href="http://www.repairmanjack.com"><img src="http://www.repairmanjack.com/forum/animate_logo/rj_logo00.png" /></a>
<a href="http://www.repairmanjack.com"><img src="http://www.repairmanjack.com/forum/animate_logo/rj_logo05.png" /></a>
<a href="http://www.repairmanjack.com"><img src="http://www.repairmanjack.com/forum/animate_logo/rj_logo.png" /></a>
</div>

<vb:literal>
<script type="text/javascript">
$(window).load(function() {
var total = $('#slider img').length;
var rand = Math.floor(Math.random()*total);
	$('#slider').nivoSlider({
		effect:'random',
		slices:15,
		animSpeed:500,
		pauseTime:7000,
                startSlide:rand,
		directionNav:false,
		directionNavHide:true,
		controlNav:false,
		controlNavThumbs:false,
                controlNavThumbsFromRel:false,
		keyboardNav:true,
		pauseOnHover:true,
		manualAdvance:false,
		captionOpacity:0.8,
		beforeChange: function(){},
		afterChange: function(){},
		slideshowEnd: function(){}
	});
});
</script>
</vb:literal>
I also did an experiment where the plugin called a non-existent template. Not sure if an Internal Server Error would normally cause this, but it did.
Reply With Quote
  #12  
Old 07-20-2011, 02:44 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I tested to make sure - using a non-existent template should just result in a (more or less) empty string.

If you haven't already, maybe try this code:

PHP Code:
$templatevalues['banner_rotator'] = "Test Banner Rotator";
vB_Template::preRegister('header'$templatevalues); 

I'm not really an expert on these kinds of thing, but based on what I've seen before I'm kind of getting a feeling like it's a problem other than what you're doing, like maybe a php configuration issue or something wrong with the vb installation. Is this a new install of vb? Did you try running "Suspect File Versions" under Maintenance in the adminCP?
Reply With Quote
  #13  
Old 07-20-2011, 03:34 PM
thunderclap82 thunderclap82 is offline
 
Join Date: Nov 2008
Posts: 305
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
I tested to make sure - using a non-existent template should just result in a (more or less) empty string.

If you haven't already, maybe try this code:

PHP Code:
$templatevalues['banner_rotator'] = "Test Banner Rotator";
vB_Template::preRegister('header'$templatevalues); 

I'm not really an expert on these kinds of thing, but based on what I've seen before I'm kind of getting a feeling like it's a problem other than what you're doing, like maybe a php configuration issue or something wrong with the vb installation. Is this a new install of vb? Did you try running "Suspect File Versions" under Maintenance in the adminCP?
This is an upgrade to vB 4.1.4 from 3.8.4.

I changed the plugin code and that stopped the Internal Server Error. Not sure why
Code:
$templater->render()
was crashing the system, but it seems to have been the cause.

But the images in the slider won't load. Not sure what's up with that, but that's a different problem entirely.
Reply With Quote
  #14  
Old 07-20-2011, 03:36 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, in retrospect I guess that didn't help much since you already knew it was the call to render causing the problem. But taking it out isn't really a fix since you should be able to reder a template there if you want.
Reply With Quote
  #15  
Old 07-20-2011, 03:59 PM
thunderclap82 thunderclap82 is offline
 
Join Date: Nov 2008
Posts: 305
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
Well, in retrospect I guess that didn't help much since you already knew it was the call to render causing the problem. But taking it out isn't really a fix since you should be able to reder a template there if you want.
Could that rendering command being deleted cause the images not to load? Those are called in the template itself.

Also, should it be
Code:
$template->render()
as opposed to
Code:
$templater->render()
with emphasis on the r in templater?
Reply With Quote
  #16  
Old 07-20-2011, 04:24 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

$templater->render() is correct since that is what he defined.

Try this for preregistering:

Code:
vB_Template::preRegister('header', array('templatevalues' => $templatevalues));
And did you already define $templatevalues as an array somewhere?
Reply With Quote
  #17  
Old 07-20-2011, 04:43 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Also, is it *any* template you render via a plugin on that site that causes issues, or just this one? If it is any template, then I would suspect something like mod_security or suhosin to be the problem. Have you run diagnostics > problematic webserver modules?
Reply With Quote
  #18  
Old 07-20-2011, 05:47 PM
thunderclap82 thunderclap82 is offline
 
Join Date: Nov 2008
Posts: 305
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
Try this for preregistering:

Code:
vB_Template::preRegister('header', array('templatevalues' => $templatevalues));
And did you already define $templatevalues as an array somewhere?
I added that line but it didn't fix the problem. And I haven't definre $templatevalues as an array anywhere.

Quote:
Originally Posted by Lynne View Post
Also, is it *any* template you render via a plugin on that site that causes issues, or just this one? If it is any template, then I would suspect something like mod_security or suhosin to be the problem. Have you run diagnostics > problematic webserver modules?
Nope... just this plugin. And our host said that mod_security was blocking it but they whitelist it for us.

Problematic Webserver pops up with No to "Module Loaded" and "AJAX Unicode Issue".

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

Just a minor update. When I add your code:
Code:
vB_Template::preRegister('header', array('templatevalues' => $templatevalues));
This is the error I get:

Fatal error: Call to a member function render() on a non-object in /home/fpaul46/public_html/forum/includes/class_core.php(4257) : eval()'d code on line 2
Reply With Quote
  #19  
Old 07-21-2011, 09:03 PM
thunderclap82 thunderclap82 is offline
 
Join Date: Nov 2008
Posts: 305
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No other ideas?
Reply With Quote
  #20  
Old 07-21-2011, 09:22 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ah, yeah, I can't believe I didn't think of this before, but did you try a different hook location, like maybe parse_templates? The one you're using is actually in the vB_Template code and is called when a variable is registered, so that could be causing strange things to happen.
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 05:49 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.03987 seconds
  • Memory Usage 2,265KB
  • 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
  • (7)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