PDA

View Full Version : $forum['forumid'] in showthread


Mr Happy
06-06-2010, 01:01 AM
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.

<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
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
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.

<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...).