vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   $forum['forumid'] in showthread (https://vborg.vbsupport.ru/showthread.php?t=244024)

Mr Happy 06-06-2010 01:01 AM

$forum['forumid'] in showthread
 
So after a lot of head scratching I found out that $forum['forumid'] isn't registered in showthread.php and it's only in forumdisplay.

HTML Code:

<vb:if condition="in_array($foruminfo['forumid'], array(1,2,3))">Show Me in 1 2 or 3</vb:if>

<vb:if condition="in_array($forum['forumid'], array(4,5,6))">Show Me in 4, 5 or 6</vb:if>

The above conditions work in forumdisplay but I want something similar to work in showthread or the postbit etc.

It would be really useful for eg showing adverts in certain forums only, showing additional custom fields in certain forums and certain links in certain forums. eg a sales history link only showing in the sales forum. I've loads of uses for it.

Anyone have any suggestion or came across a mod or product that has somthing similar to this already I may be able to use?

If nothing exists how would I go about coding one (what hooks would you suggest).

Any information or advice is welcome. Thanks

Lynne 06-06-2010 02:36 AM

Try $thread or $threadinfo instead of $forum or $foruminfo.

inenigma 06-06-2010 06:43 AM

Quote:

Originally Posted by Mr Happy (Post 2049019)
So after a lot of head scratching I found out that $forum['forumid'] isn't registered in showthread.php and it's only in forumdisplay.

I'm still quite the newbie to PHP, but, can't you just register it in showthread.php ??? :confused:

Boofo 06-06-2010 06:48 AM

Quote:

Originally Posted by Mr Happy (Post 2049019)
So after a lot of head scratching I found out that $forum['forumid'] isn't registered in showthread.php and it's only in forumdisplay.

HTML Code:

<vb:if condition="in_array($foruminfo['forumid'], array(1,2,3))">Show Me in 1 2 or 3</vb:if>

<vb:if condition="in_array($forum['forumid'], array(4,5,6))">Show Me in 4, 5 or 6</vb:if>

The above conditions work in forumdisplay but I want something similar to work in showthread or the postbit etc.

It would be really useful for eg showing adverts in certain forums only, showing additional custom fields in certain forums and certain links in certain forums. eg a sales history link only showing in the sales forum. I've loads of uses for it.

Anyone have any suggestion or came across a mod or product that has somthing similar to this already I may be able to use?

If nothing exists how would I go about coding one (what hooks would you suggest).

Any information or advice is welcome. Thanks

Have you looked in the showthread.php file and done a search for forumid and see how they use it in there?

rossco_2005 06-06-2010 08:47 PM

$threadinfo['forumid'] should work (depending on what template or hook though...).


All times are GMT. The time now is 09:10 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.02366 seconds
  • Memory Usage 1,726KB
  • 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
  • (2)bbcode_html_printable
  • (2)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