vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Mod for only specific forum (https://vborg.vbsupport.ru/showthread.php?t=276769)

raiderphil83 01-11-2012 02:52 AM

Mod for only specific forum
 
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 04:12 AM

not without knowing what mod, and what hook you used etc....

kh99 01-11-2012 05:14 PM

Quote:

Originally Posted by raiderphil83 (Post 2286338)
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:

Code:

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 06: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 08: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.


All times are GMT. The time now is 11:50 PM.

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.01126 seconds
  • Memory Usage 1,719KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete