PDA

View Full Version : Changing the link of the Post New Thread button


bennie900
10-28-2010, 08:33 PM
So i have a few forms which do certain things, main one is the application form, there is a specific forum for it, now my question is can i change the link of the "Post New Thread" button so it directs the user to my form and not create a new topic?

Help is appreciated

Lynne
10-28-2010, 11:28 PM
Just edit the template and put in a condition - if in forumid xx, then this link, else that link.

bennie900
10-29-2010, 12:39 PM
Which template do i add it too and whats the full code I need to add?

Thanks

Lynne
10-29-2010, 01:37 PM
To find the template to modify, do this - vboptions > General Settings > Add Template Name in HTML Comments > set to Yes . Then go back to your page and view the source code and you will see the name of the template called around your part of the code. (Sometimes the template is the one mentioned at the very top of the page source.)

I'm guessing you are talking about the FORUMDISPLAY template.

I'd guess you'd want something like (in a couple places):
<vb:if condition="$foruminfo['forumid'] == x">
your link
<vb:else />
<a href="newthread.php?{vb:raw session.sessionurl}do=newthread&amp;f={vb:raw foruminfo.forumid}" rel="nofollow" class="newcontent_textcontrol" id="newthreadlink_top"><span>+</span> {vb:rawphrase post_new_thread}</a>
</vb:if>

bennie900
10-29-2010, 05:55 PM
Correct, this works great. Thanks for the help!

EDIT: Is there a elseif function? Because theres another seperate forumid i want to add which goes to a different link and have found not an easy or practical way.

Lynne
10-29-2010, 10:42 PM
Yes, <vb:elseif condition="stuff" />

bennie900
10-30-2010, 06:08 PM
Works great thanks alot!

Injustice
11-17-2010, 03:18 PM
To find the template to modify, do this - vboptions > General Settings > Add Template Name in HTML Comments > set to Yes . Then go back to your page and view the source code and you will see the name of the template called around your part of the code. (Sometimes the template is the one mentioned at the very top of the page source.)

I'm guessing you are talking about the FORUMDISPLAY template.

I'd guess you'd want something like (in a couple places):
<vb:if condition="$foruminfo['forumid'] == x">
your link
<vb:else />
<a href="newthread.php?{vb:raw session.sessionurl}do=newthread&amp;f={vb:raw foruminfo.forumid}" rel="nofollow" class="newcontent_textcontrol" id="newthreadlink_top"><span>+</span> {vb:rawphrase post_new_thread}</a>
</vb:if>

Could you guide me through how to this and where exactly in ForumDisplay to do this?

bennie900
11-17-2010, 04:43 PM
The forumdisplay template is in Admin > Styles & Templates > Style Manager > (The style your using) > Forum Display Templates > and edit FORUMDISPLAY.

I added the lines in the body under here:
<body>

{vb:raw header}

{vb:raw navbar}

<vb:if condition="$announcebits">
<ol id="announcements" class="announcements">
{vb:raw announcebits}
</ol>
</vb:if>

I think this is what you mean?

Injustice
11-17-2010, 04:46 PM
Thanks for your fast reply, that helped a bit but what I was aiming at was editing the code:

I want to redirect a specific 'Post New Thread' link to a form I created using Easy Form Mod. The link I want to redirect is http://www.spyike.org/newthread.php?do=newthread&f=19 and I want to redirect that to http://www.spyike.org/misc.php?do=form&fid=1

I also want to do this with other 'Post New Threads'

<vb:if condition="$foruminfo['forumid'] == x">
your link
<vb:else />
<a href="newthread.php?{vb:raw session.sessionurl}do=newthread&amp;f={vb:raw foruminfo.forumid}" rel="nofollow" class="newcontent_textcontrol" id="newthreadlink_top"><span>+</span> {vb:rawphrase post_new_thread}</a>
</vb:if>

bennie900
11-17-2010, 05:00 PM
Ok well here is my set up:

<vb:if condition="$foruminfo['forumid'] == 6">
<a href="misc.php?do=form&fid=3" {vb:raw session.sessionurl}do=newthread&amp;f={vb:raw foruminfo.forumid}" rel="nofollow" class="newcontent_textcontrol" id="newthreadlink_top"><span>+</span> {vb:rawphrase post_application}</a>

<vb:elseif condition="$foruminfo['forumid'] == 38" />
<a href="misc.php?do=form&fid=1" {vb:raw session.sessionurl}do=newthread&amp;f={vb:raw foruminfo.forumid}" rel="nofollow" class="newcontent_textcontrol" id="newthreadlink_top"><span>+</span> {vb:rawphrase post_new_thread}</a>

<vb:else />
<a href="newthread.php?{vb:raw session.sessionurl}do=newthread&amp;f={vb:raw foruminfo.forumid}" rel="nofollow" class="newcontent_textcontrol" id="newthreadlink_top"><span>+</span> {vb:rawphrase post_new_thread}</a>
</vb:if>

--------------

<vb:if condition="$foruminfo['forumid'] == 19">
<a href="http://www.spyike.org/misc.php?do=form&fid=1" {vb:raw session.sessionurl}do=newthread&amp;f={vb:raw foruminfo.forumid}" rel="nofollow" class="newcontent_textcontrol" id="newthreadlink_top"><span>+</span> {vb:rawphrase post_new_thread}</a>

<vb:elseif condition="$foruminfo['forumid'] == PLACE NEW FORUM ID HERE" />
<a href="PLACE URL HERE" {vb:raw session.sessionurl}do=newthread&amp;f={vb:raw foruminfo.forumid}" rel="nofollow" class="newcontent_textcontrol" id="newthreadlink_top"><span>+</span> {vb:rawphrase post_new_thread}</a>

<vb:else />
<a href="newthread.php?{vb:raw session.sessionurl}do=newthread&amp;f={vb:raw foruminfo.forumid}" rel="nofollow" class="newcontent_textcontrol" id="newthreadlink_top"><span>+</span> {vb:rawphrase post_new_thread}</a>
</vb:if>

Green = I edited the first bit based on what you gave me.
Blue = If you need another link (edit as required (you do not NEED to use this))
Red = States if in a other forum, it posts a topic like usual.
( You need to use both green and red atleast)
Hope this helps..

--------------- Added 1290022353 at 1290022353 ---------------

1. I dont see the code i told you to put in or is that the original code?
2. What code is that?

Injustice
11-17-2010, 05:37 PM
Worked, thanks but now I have another problem! Two 'Post New Thread'

https://vborg.vbsupport.ru/external/2010/11/18.jpg

bennie900
11-17-2010, 05:42 PM
Well i assume you either left a bit of code in or didnt put the correct forum ID in, whats the code you got upto that point?

Injustice
11-17-2010, 05:50 PM
<body>

{vb:raw header}

{vb:raw navbar}

<vb:if condition="$announcebits">
<ol id="announcements" class="announcements">
{vb:raw announcebits}
</ol>
</vb:if>
<vb:if condition="$foruminfo['forumid'] == 19">
<a href="http://www.spyike.org/misc.php?do=form&fid=1" {vb:raw session.sessionurl}do=newthread&amp;f={vb:raw foruminfo.forumid}" rel="nofollow" class="newcontent_textcontrol" id="newthreadlink_top"><span>+</span> {vb:rawphrase post_new_thread}</a>
<vb:else />
<a href="newthread.php?{vb:raw session.sessionurl}do=newthread&amp;f={vb:raw foruminfo.forumid}" rel="nofollow" class="newcontent_textcontrol" id="newthreadlink_top"><span>+</span> {vb:rawphrase post_new_thread}</a>
</vb:if>
<div id="above_threadlist" class="above_threadlist">
<vb:if condition="$show['newthreadlink']"><a href="newthread.php?{vb:raw session.sessionurl}do=newthread&amp;f={vb:raw foruminfo.forumid}" rel="nofollow" class="newcontent_textcontrol" id="newthreadlink_top"><span>+</span> {vb:rawphrase post_new_thread}</a></vb:if>

bennie900
11-17-2010, 05:54 PM
Remove <vb:if condition="$show['newthreadlink']"><a href="newthread.php?{vb:raw session.sessionurl}do=newthread&amp;f={vb:raw foruminfo.forumid}" rel="nofollow" class="newcontent_textcontrol" id="newthreadlink_top"><span>+</span> {vb:rawphrase post_new_thread}</a></vb:if> from the bottom

Injustice
11-17-2010, 06:00 PM
Thank you!!! How do I move the Post icon a bit down so it's not exactly below the announcement! THANK YOUUU

bennie900
11-17-2010, 06:13 PM
All I can say is maybe add some <br /> tags (on each line e.g.
<br />
<br />
(buttons here))

Other than that I can't help you with it ;)

Injustice
11-17-2010, 06:47 PM
THANK YOU! LOve you <3