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)

RL714 01-26-2010 08:51 PM

Quote:

Originally Posted by huuquynh (Post 1964520)
I want to use condition with the custom field. For example, I use custom field number 6 for private information, and I want the member can view it but hide it for everyone.

Is there any example?

you can use this line to show only register user
Quote:

<vb:if condition="$show['member']">Show this to members only</vb:if>

huuquynh 01-27-2010 04:11 PM

Quote:

Originally Posted by RL714 (Post 1967429)
you can use this line to show only register user

sorry for my bad english. I mean the private information is showed for him only, the other members can not see it.

the condition you give is for every member... it can not be used in this case.

RL714 01-29-2010 10:50 PM

Quote:

Originally Posted by huuquynh (Post 1968107)
sorry for my bad english. I mean the private information is showed for him only, the other members can not see it.

the condition you give is for every member... it can not be used in this case.

this the one you're looking for huuquynh, replace the user id

Quote:

<vb:if condition="$bbuserinfo['userid'] == 318713">Show this only to the member with the user id of 318713</vb:if>

huuquynh 01-30-2010 02:36 PM

Hi RL714,

I think your code is right. But this is not simple likes that, because it is not for only a member or owner site. I mean the number 318713 is the dynamic number, it is exactly userid in custom field table. So if condition is: $bbuserinfo['userid'] is exactly his userid, so he can see the value. But if the other member can not see.

For example: you can see your custom field number 6, but I can not see it. And vice versa, I can see my custom field number 6, but you can not see mine.

sadiq6210 01-30-2010 06:17 PM

Thanks :)

Veer 01-30-2010 10:56 PM

Thank you for the article.

Please guide me in converting this to vb4:
Code:

<if condition="is_array($NewestMap)">
and this one too please:
Code:

{$map_page}
{$NewestMap['m_image']}


egyptsons 02-01-2010 11:24 PM

Thanks for your article

I want to add advertisement after the first post in some special forums
so I edit the "ad_showthread_firstpost" Template and add this

Code:

<vb:if condition="in_array($forum['forumid'], array(1,2,3))">Show this to forum 1, 2 and 3</vb:if>
But nothing change in the special forums and the ads not appear

also if I used this
Code:

<vb:if  condition="!in_array($forum[forumid], array(1,2,3))">Show this to forum 1, 2 and 3</vb:if>
it's appear in all forums not only the special (1,2,3)

Can you advice me plz ?

Best regards

fly 02-02-2010 08:29 PM

Hoping someone can help...

I'm trying to convert this template conditional (in threadbit, I'm guessing it matters)...

Code:

<if condition="! $ignore[ $thread['postuserid'] ]">
Using the guide here, I know it should look like this, but it doesn't work:

Code:

<vb:if condition="!$ignore[$thread['postuserid']]">
Could it be that the $ignore variable isn't available in that template? I've seen mention of that in other articles here, I think.

isurua 02-03-2010 03:52 AM

Anyone know a way of getting this to work?

Code:

<vb:if condition='"{vb:raw title}" == "The Latest"'><p>ME</p></vb:if>
{vb:raw title} returns The Latest exactly as I would expect when put into the style but for some reason it may not be working inside a conditional statement. =\

fly 02-03-2010 09:21 AM

Quote:

Originally Posted by isurua (Post 1973651)
Anyone know a way of getting this to work?

Code:

<vb:if condition='"{vb:raw title}" == "The Latest"'><p>ME</p></vb:if>
{vb:raw title} returns The Latest exactly as I would expect when put into the style but for some reason it may not be working inside a conditional statement. =\

Quote:

Originally Posted by from first post
First off remember you can not use {vb:raw var} in template conditionals.

that


All times are GMT. The time now is 08:55 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.01536 seconds
  • Memory Usage 1,751KB
  • 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
  • (8)bbcode_code_printable
  • (7)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