Log in

View Full Version : Mod for only specific forum


raiderphil83
01-11-2012, 01:52 AM
Is it possible to make an installed mod applicable to only one forum? I have added a mod that adds to a thread (via adding a hook to SHOWTHREAD) a new pane that shows who has voted for the thread. I only have thread voting enabled in one forum though so this feature looks goofy in other forums on the same site. Is it possible to restrict this change to SHOWTHREAD to only the one forum?

Thanks.

LifesGreatestGift
01-11-2012, 03:12 AM
not without knowing what mod, and what hook you used etc....

kh99
01-11-2012, 04:14 PM
I have added a mod that adds to a thread (via adding a hook to SHOWTHREAD) ....


If you know which plugins it uses you could try editing them and surrounding the code with:

if ($foruminfo['forumid'] == ID)
{

// existing plugin code here

}


and of course you want to change ID to the id of the forum where you want the mod to be active.

raiderphil83
01-11-2012, 05:09 PM
Ha! So easy and I didn't even consider it. That worked great. I just surrounded the template hook in SHOWTHREAD with:

<if condition="$foruminfo['forumid'] == 14">
$template_hook
</if>

Thanks!

Lynne
01-11-2012, 07:41 PM
That is fine if only that one modification uses that template hook. However, it means the code is still evaled and if that means queries, then those queries will get run even though they are not needed. Much better, usually, to put the condition around the code itself.