PDA

View Full Version : Merging Template Hook Ins?


Liff
08-08-2012, 11:06 AM
Hey Guys,

Can one of you guys please take a look at this problem for me?

Lynne, or any other admin - Excuse me if this is an inappropriate place to post this but I have asked on the relevant Template thread and the OP has told me he is not a programmer and cannot help me so I'm looking for information on the most relevant place I can think of :o)

I have Chiploves thumbnails installed which is great and I want to keep it. I also want to install the Novo Slider for Logo rotation and I've linked to both mods below. The problem is that they both hook in to 'parse_templates' and these modifications are not compatible. The thumbnails always work fine which is great however the banner slider only works on the forum home page (ie listing the forums) but fails to work when in forumdisplay presumably because the Thumbnails are there already. When I disable the thumbnails it works fine again.

I'm on the very edge of my skill set even figuring that out, so I'm pretty unsure of where to go next to integrate the two hook ins. Would anyone be kind enough to advise me where to go next? I have included the coding on my last posts on the relevant threads below as well as a link to my forum with the details of the trial style I am using.

I sincerely thank anyone for taking the time to look, even if you cannot offer a solution of advice.

Installed: Chiplove.9xpro - Thread Thumbnails 2.2.9 ( 1 2 3 4 5 ... Last Page) (https://vborg.vbsupport.ru/showpost.php?p=2355455&postcount=289)

Logo Rotation (https://vborg.vbsupport.ru/showthread.php?t=252398&page=4)

http://twistsnturns.net

Style: Slider TNT67

Lynne
08-08-2012, 04:27 PM
Have you tried changing the execution order of the two plugins that use the same hook location?

Liff
08-08-2012, 04:43 PM
Hey Lynne,

Thanks very much for the suggestion.. It's a great idea but I've tried moving them and to no effect.. I've tried moving them both up and down the pecking order and it still does the exact same thing.

Lynne
08-08-2012, 05:34 PM
I don't even see a plugin in the Logo Rotation code that uses the parse_templates hook location - it uses the template_register_var hook location.

Liff
08-08-2012, 05:42 PM
I don't even see a plugin in the Logo Rotation code that uses the parse_templates hook location - it uses the template_register_var hook location.

Yeah, when I use that it generates a 503 error - When I pointed this out Thundercat (the OP) told me he had similar and used the Parse_Template hook in instead.

I had figured that if that one worked with the forum listings I could duplicate it and try another location for that would work in forumdisplay but sadly that didn't work either.

I take it that you run the w3schools site in your sig? I might need to spend a few weeks studying to catch up with what's going on, tbh :p

Lynne
08-08-2012, 10:35 PM
No, I don't run the w3schools site - it's just a site that I find very, very helpful!

Have you tried just combining the two plugins? Either put the thumbnail code at the beginning or end of the other plugin.

Liff
08-09-2012, 12:12 PM
Thanks again, Lynne - Still the same though.. The Thumbnails seem bulletrpoof, they always seem to work but the banner only works outside forumdisplay.

The slider works fine inside threads too..

Is there any way around using a plugin by putting this code anywhere else, or even creating a php file at server level or is that just being silly?

$templater = vB_Template::create('banner_rotator');
$templatevalues['banner_rotator'] = $templater->render();
vB_Template::preRegister('header', $templatevalues);

Lynne
08-09-2012, 02:51 PM
I honestly don't see why that code would cause issues, but you can certainly try using different hooks. Here's a list of the hooks used in order around where parse_templates is used (you could get this in debug mode on your test site). Try some other and see what happens.

fetch_foruminfo
load_show_variables
load_forum_show_variables
global_state_check
global_bootstrap_complete
global_start
style_fetch
global_setup_complete
forumdisplay_start
cache_templates
cache_templates_process
template_register_var
template_render_output
fetch_template_start
fetch_template_complete
fb_opengraph_array
parse_templates
notices_check_start
friendlyurl_clean_fragment
friendlyurl_geturl
notifications_list
process_templates_complete
friendlyurl_redirect_canonical
cache_ordered_forums

Liff
08-11-2012, 03:02 PM
Hey Lynne, sorry for taking so long to thank you for giving me those options to try - Work commitments get in the way too often lol!

I've tried each of those in order with no different results.

I guess the two plugins must be incompatible, but I'll see if I can fluke it by playing about with it.

Or some other thumbnail user may decide they fancy both mods and beat me to it *crosses fingers*