vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=242)
-   -   vB4 Template Conditionals List (https://vborg.vbsupport.ru/showthread.php?t=231525)

nymyth 08-19-2010 01:00 PM

does AND still work if I want to combine statements, for example if I want to combine if a person is a guest and the forum is 1, show this else show something else...how would I do that?

BirdOPrey5 08-19-2010 03:31 PM

Just use 'AND'

<vb:if condition="$forum[forumid] == 5 AND $show['member']">Show this if forum id is 5 and user is a member.</vb:if>

nymyth 08-19-2010 08:08 PM

yeah, thats what I tried, but I cannot seem to get the forumid thing to work, I am using one of the ad templates

BirdOPrey5 08-19-2010 08:46 PM

You could try putting the condition in the header / footer or navbar template instead of the ad location... it will have the same ultimate effect.

ICannt.org 08-25-2010 11:03 AM

So in the template FORUMDISPLAY I've done this:
Code:

<vb:if condition="!in_array($forum['forumid'], array(4, 5))"><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></vb:if>
Except it isn't working, is there something I'm missing by some chance?

Cheers.

tech4c 08-25-2010 02:15 PM

thanks

BirdOPrey5 08-25-2010 07:24 PM

Quote:

Originally Posted by ICannt.org (Post 2089294)
So in the template FORUMDISPLAY I've done this:
Code:

<vb:if condition="!in_array($forum['forumid'], array(4, 5))"><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></vb:if>
Except it isn't working, is there something I'm missing by some chance?

Cheers.

I don't know if "$show['newthreadlink']" works in forumdisplay but if it does you're better off using an AND statement than two IF's...

Code:

<vb:if condition="!in_array($forum['forumid'], array(4, 5)) AND $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>

ICannt.org 08-28-2010 06:37 AM

Hello,
The "$show['newthreadlink']" was in forumdisplay to begin with, I just added the array bit.

I tried what you gave, yet it still didn't hide the New thread button from display :/

BirdOPrey5 08-28-2010 01:39 PM

What exactly are you trying to do- I know hide "New Thread" but under what conditions?

ICannt.org 08-29-2010 03:10 AM

Essentially, we've got Easy Forms installed and we want users to only be able to submit a form on particular forums so they can follow a pre-defined template instead of being able to post whatever they want.
I've got a "Notice" on the forums saying with a bit of text, including a link to the needed form, but I know of no other way to hide the "New Thread" button.

I originally tried simply taking away permissions for Registered Users to Create New Threads, but then that wouldn't let them upload attachments to the form - which is a necessity.

If you know of any other way to do this, that would be greatly appreciated.


All times are GMT. The time now is 07:49 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02283 seconds
  • Memory Usage 1,737KB
  • 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
  • (3)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete