Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 05-27-2009, 12:32 PM
Derekclarke's Avatar
Derekclarke Derekclarke is offline
 
Join Date: Dec 2005
Location: N.Devon
Posts: 194
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Replace New Thread Button in Specific Forums

Hi,

I am using the easy forms Mod, and would like to replace the New Thread Button within certain forums and have a New Advert Button that links to one of the Forms i have created.

I would also like to do the Same for a Support forum, the user would click a New Ticket Button and this would take them to the new ticket form.

I have already created the Images, and placed them in the Forum description so they show as well as the new Thread button.

But people still click the New Thread and get told they do not have priviliges to do so.

Can anyone help me with this.

Thanks
Derek
Reply With Quote
  #2  
Old 05-27-2009, 12:55 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just put a condition around it - something like this :
HTML Code:
    <if condition="!in_array($foruminfo[forumid], array(x,y,z))">
      New Thread Button
    <else />
        <if condition="in_array($foruminfo[forumid], array(x,y))">
          New Advert Button
        <else />
          New Ticket Button
        </if> 
    </if>
Reply With Quote
  #3  
Old 05-27-2009, 01:10 PM
Derekclarke's Avatar
Derekclarke Derekclarke is offline
 
Join Date: Dec 2005
Location: N.Devon
Posts: 194
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

how do i define the button? I have only done small amounts of coding and the link.

would it be something like this?

HTML Code:
<if condition="!in_array($foruminfo[168], array(x,y,z))"><tr><a href="misc.php?do=form&fid=1"><img src="$stylevar[imgdir_button]/new_advert.gif" alt="$vbphrase[post_new_Ad]" border="0" /></a><else />&nbsp;</if>

EDIT* I just place the Above code into the FORUMDISPLAY template, and now i have both the New Thread and New Ad buttons showing right on top of each other.

Just need to work out how to remove the New Thread button from the specific forums.

--------------- Added [DATE]1243435904[/DATE] at [TIME]1243435904[/TIME] ---------------

Ahh.. I have just noticed this has placed the New Ad button in every forum. not just the one specified.
Reply With Quote
  #4  
Old 05-27-2009, 01:57 PM
snakes1100 snakes1100 is offline
 
Join Date: Dec 2001
Location: Michigan
Posts: 3,733
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
 <if condition="!in_array($foruminfo[forumid], array(1,2,3))">
      New Thread Button
    <else />
        <if condition="in_array($foruminfo[forumid], array(4,168))">
          New Advert Button
        <else />
          New Ticket Button
        </if> 
    </if>
Reply With Quote
  #5  
Old 05-27-2009, 02:17 PM
Derekclarke's Avatar
Derekclarke Derekclarke is offline
 
Join Date: Dec 2005
Location: N.Devon
Posts: 194
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Have just tried your code too Snakes and it is not working either.

I am assuming the numbers in the array (4,168) are the forum Id's?
Reply With Quote
  #6  
Old 05-27-2009, 02:24 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is how I was intending the conditions to be used.... Let's say forumid 168 and 169 are for the New Advert Button and forumid 1 and 2 are for the New Ticket Button:

HTML Code:
 <if condition="!in_array($foruminfo[forumid], array(168,169,1,2))">
      New Thread Button
    <else />
        <if condition="in_array($foruminfo[forumid], array(168,169))">
          New Advert Button
        <else />
          New Ticket Button
        </if> 
    </if>
As for the button code, you can basically copy the New Thread Button code and change the image source and link url.
Reply With Quote
  #7  
Old 05-27-2009, 04:33 PM
snakes1100 snakes1100 is offline
 
Join Date: Dec 2001
Location: Michigan
Posts: 3,733
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Derekclarke View Post
Have just tried your code too Snakes and it is not working either.

I am assuming the numbers in the array (4,168) are the forum Id's?
change the forumid's to yours, like lynne, i only used an example set of numbers for the id's
Reply With Quote
Reply


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 06:19 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
  • Page Generation 0.05780 seconds
  • Memory Usage 2,227KB
  • Queries Executed 13 (?)
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
  • (1)bbcode_code
  • (3)bbcode_html
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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_postinfo_query
  • fetch_postinfo
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete