The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Post New Thread Redirect for one forum
Greetings,
I'm really not sure how to title this request, but I will try my best to explain what I'm trying to do. I have a dozen or so forums on my website, and in each one, when you select New Thread, it takes you to newthread.php. What I would like is to be able to change that for one of the forums, so that when someone clicks on the New Thread button, they are instead sent to a different php file. The reason being that for one specific forum, I am trying to install a form that would have to be filled out every time someone wants to start a new thread. I have everything set up, but I can't figure how to change the address for the New Thread button in just one specific forum. I hope this makes sense. If I didn't explain this well enough, please ask any questions, and I will do my best to answer them. I am currently running 3.0.0. TIA!!! Take care, ~Chris |
#2
|
||||
|
||||
use a condition
Code:
<a <if condition="$f==xx">href="newfilehere.php"<else />href="newthread.php"</if>>New Thread</a> |
#3
|
||||
|
||||
Okay, I'm not real bright when it comes to this stuff. I understand the concept of what you're saying, but I don't know what to change in your example to make it work for me, other than changing the file name. What would I put where you wrote $f==xx? What else would I need to do? I feel very close to solving this. Thank you for your help!
|
#4
|
||||
|
||||
Oh, wait, I think I get it. I should enter the forum number there, yes? It's f=53, so would I just write it as $f=53, or do I need two equals signs?
|
#5
|
||||
|
||||
You need two equal signs, since that is how you compare elements in PHP. So $f == 53 it is.
|
#6
|
||||
|
||||
Okay, that makes sense. Hopefully this will be my last question... Below is the part of the file where the link is created for the new Thread button. Where would I substitute the code above into this?
Code:
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="margin-top:3px"> <tr valign="top"> <td class="smallfont"><if condition="$show['newthreadlink']"><a href="newthread.php?$session[sessionurl]do=newthread&f=$foruminfo[forumid]"><img src="$stylevar[imgdir_button]/newthread.gif" alt="$vbphrase[post_new_thread]" border="0" /></a><else /> </if></td> <if condition="$pagenav"><td align="$stylevar[right]">$pagenav</td></if> </tr> </table> |
#7
|
||||
|
||||
Well, here is the link:
Code:
<a href="newthread.php?$session[sessionurl]do=newthread&f=$foruminfo[forumid]"> Code:
<a href="<if condition="$foruminfo['forumid'] == 53">otherfile.php<else />newthread.php?$session[sessionurl]do=newthread&f=$foruminfo[forumid]</if>"> |
#8
|
||||
|
||||
Thank you so much for your help! I will give this a try right away, and let you know how it goes.
Thanks again! Take care, ~Chris |
#9
|
||||
|
||||
Okay, when I tried to do that, I received this warning...
The following error occurred when attempting to evaluate this template: Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/pkrwud/public_html/vbulletin/includes/adminfunctions_template.php(3037) : eval()'d code on line 124 This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish. |
#10
|
||||
|
||||
Nevermind. Somehow I managed to change the code, but forgot to close the 'if'. I've corrected this, and it works excellent! I thank you very, very much for your time and assistance!
Take care, ~Chris |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|