vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Replace New Thread Button in Specific Forums (https://vborg.vbsupport.ru/showthread.php?t=214663)

Derekclarke 05-27-2009 12:32 PM

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

Lynne 05-27-2009 12:55 PM

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>


Derekclarke 05-27-2009 01:10 PM

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.

snakes1100 05-27-2009 01:57 PM

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>


Derekclarke 05-27-2009 02:17 PM

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?

Lynne 05-27-2009 02:24 PM

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.

snakes1100 05-27-2009 04:33 PM

Quote:

Originally Posted by Derekclarke (Post 1818126)
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


All times are GMT. The time now is 09:38 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.01149 seconds
  • Memory Usage 1,731KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (3)bbcode_html_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete