![]() |
Different "New Thread" graphic for each forum - without creating new templates
In vbulletin 2.2.1, we want different "New Thread" graphics for each forum.
In the template called "forumdisplay_newthreadlink" The original code shows <a href="newthread.php?s=$session[sessionhash]&action=newthread&forumid=$foruminfo[forumid]"> <img src="{newthreadimage}" border="0" alt="Post New Thread"></a><br> ----------------------------------------- How can we change the image tag to be dependent on the $foruminfo[forumid] The could might be something like: //------------------------------------------------------------; switch($foruminfo[forumid]) { case "84": <img src="/images/image84.gif" border="0" alt="Post New Thread"></a><br> break; //--- break prevents the code from running other cases; case "5": <img src="/images/image5.gif" border="0" alt="Post New Thread"></a><br> break; case "3": <img src="/images/image3.gif" border="0" alt="Post New Thread"></a><br> break; default: <img src="{newthreadimage}" border="0" alt="Post New Thread"></a><br> break; }//-- end switch; --------------------------------------------- but this doesn't work as an in-line script. Any ideas of a script that would switch out the button code based on the forum id? Thanks in advance |
Put this in the proper part of forumdisplay.php
PHP Code:
PHP Code:
PHP Code:
|
it worked - thanks !
|
No problem, glad I could help :)
|
demo/ss?
|
It just changes your newthread button depending on which image you choose for which forumid.
|
The easiest thing to do here would be to to add a new field to the forum table :)
- miSt |
or edit the template
Code:
img src="newreply{forumid}.gif" |
^ The best idea i've heard all day ;)
[high]* Mist wonders how he forgets the easy things like this [/high] I think you may have to use a variable instead but that's a good principle - you'll have to make a new image for EVERY forum you have though unfortunately :) - miSt |
Yep that's why my way is still better :p
You can have an else statement, and you don't have to name your reply buttons your forumids ;) |
All times are GMT. The time now is 04:20 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|