Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 10-28-2010, 08:33 PM
bennie900 bennie900 is offline
 
Join Date: Sep 2010
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Changing the link of the Post New Thread button

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
Reply With Quote
  #2  
Old 10-28-2010, 11:28 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just edit the template and put in a condition - if in forumid xx, then this link, else that link.
Reply With Quote
  #3  
Old 10-29-2010, 12:39 PM
bennie900 bennie900 is offline
 
Join Date: Sep 2010
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Which template do i add it too and whats the full code I need to add?

Thanks
Reply With Quote
  #4  
Old 10-29-2010, 01:37 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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):
HTML Code:
<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>
Reply With Quote
  #5  
Old 10-29-2010, 05:55 PM
bennie900 bennie900 is offline
 
Join Date: Sep 2010
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 10-29-2010, 10:42 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, <vb:elseif condition="stuff" />
Reply With Quote
  #7  
Old 10-30-2010, 06:08 PM
bennie900 bennie900 is offline
 
Join Date: Sep 2010
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works great thanks alot!
Reply With Quote
  #8  
Old 11-17-2010, 03:18 PM
Injustice Injustice is offline
 
Join Date: Nov 2010
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
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):
HTML Code:
<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?
Reply With Quote
  #9  
Old 11-17-2010, 04:43 PM
bennie900 bennie900 is offline
 
Join Date: Sep 2010
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:
Code:
<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?
Reply With Quote
  #10  
Old 11-17-2010, 04:46 PM
Injustice Injustice is offline
 
Join Date: Nov 2010
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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'

Code:
<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>
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:49 PM.


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.04070 seconds
  • Memory Usage 2,249KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (2)bbcode_html
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete