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)

Budget101 10-03-2012 04:11 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2360168)
Code:

<vb:if condition="$bbuserinfo['styleid'] == 2">


Thank you so very much!!

Lynne 10-03-2012 04:38 PM

Quote:

Originally Posted by jluerken (Post 2370462)
How does the template conditional need to look like if I want a text to appear if the forum is closed?

SHOW NOT abc if board is closed, ELSE show def...

What do you mean the "forum is closed"? Do you mean closed for posting or what? If the whole board is closed (as you state in your next line), nobody will be able to see the forum pages anyway.

TheSupportForum 10-04-2012 09:12 AM

Quote:

Originally Posted by jluerken (Post 2370462)
How does the template conditional need to look like if I want a text to appear if the forum is closed?

SHOW NOT abc if board is closed, ELSE show def...

there is a way to turn of a created page and have a custom message show if you turn the page off

you will need to do this in the php file

example would be...

Code:


// ###### YOUR CUSTOM CODE GOES HERE #####

if (!$vbulletin->options['mymod_active'])
            {
    eval(standard_error($vbulletin->options['mymod_closedreason']));
            }

as Lynne said, if the board is off then they will see the off message from

Reason For Turning Forum Off in Admincp

jluerken 10-05-2012 05:28 AM

Quote:

Originally Posted by jluerken (Post 2370462)
How does the template conditional need to look like if I want a text to appear if the forum is closed?

SHOW NOT abc if board is closed, ELSE show def...

anyone?

BirdOPrey5 10-05-2012 05:59 PM

Quote:

Originally Posted by jluerken (Post 2370887)
anyone?

Maybe..

Code:

<vb:if condition="$vboptions['bbactive']">
FORUM ACTIVE CODE
<vb:else />
FORUM OFF CODE
</vb:if>


TheSupportForum 10-05-2012 10:34 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2371030)
Maybe..

Code:

<vb:if condition="$vboptions['bbactive']">
FORUM ACTIVE CODE
<vb:else />
FORUM OFF CODE
</vb:if>


thats vb default, the <vb:else /> is already handled in admincp
as $vboptions['bbclosedreason']

Big-K 11-01-2012 10:15 AM

Folks, Is there a conditional for member of infraction groups?

I want to show specific avatars for infraction groups. I tried the following

<vb:if condition="$bbuserinfo['infractiongroupid'] ==1" />

also tried
<vb:if condition="is_member_of($infractiongroupid, 1)" />

RedTurtle 11-04-2012 06:18 PM

Quote:

Originally Posted by Big-K (Post 2377491)
Folks, Is there a conditional for member of infraction groups?

I want to show specific avatars for infraction groups. I tried the following

<vb:if condition="$bbuserinfo['infractiongroupid'] ==1" />

also tried
<vb:if condition="is_member_of($infractiongroupid, 1)" />

I'd also like to know if this is possible, but how to do it on a plugin also. It'd be great if I could have some code execute if the user had any active infractions.

Dax IX 11-25-2012 01:06 AM

I'm trying to get link forum links to open in a new window or tab, so here's what I have in forumhome_forumbit_level2_nopost

This is the code for the forum title link, and I've added a vb:if condition:

PHP Code:

            <h2 class="forumtitle"><a href="{vb:link forum, {vb:raw forum}}" class="forumtitle"<vb:if condition="in_array($forum['forumid'], array(22))"target="_blank"</vb:if>>{vb:raw .title}</a></h2

.

vB is telling me I have a malformed conditional and the code is not working, but damned if I can figure out why.

Lynne 11-25-2012 01:50 AM

Quote:

Originally Posted by Chani (Post 2384741)
I'm trying to get link forum links to open in a new window or tab, so here's what I have in forumhome_forumbit_level2_nopost

This is the code for the forum title link, and I've added a vb:if condition:

PHP Code:

            <h2 class="forumtitle"><a href="{vb:link forum, {vb:raw forum}}" class="forumtitle"<vb:if condition="in_array($forum['forumid'], array(22))"target="_blank"</vb:if>>{vb:raw .title}</a></h2

.

vB is telling me I have a malformed conditional and the code is not working, but damned if I can figure out why.

You need to tell us *exactly* where you are adding this so we may try it ourselves and see what is going on.


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

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.01711 seconds
  • Memory Usage 1,754KB
  • 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
  • (4)bbcode_code_printable
  • (2)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)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