vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   On/off or yes/no conditional help, please. (https://vborg.vbsupport.ru/showthread.php?t=193076)

Guest210212002 10-08-2008 05:09 PM

Hmm, that sort of works, I see what you mean. If I just add that in there like this:

<if condition="$vbulletin->userinfo[field18] <> 'No' AND is_member_of($bbuserinfo,5,6)">
(sidebar code)

then If it's set to Yes, and I'm in the right group, it shows the code.

But if someone NOT in that usergroup has it set, then the conditional isn't matched and the code doesn't show.

I might need to use a bunch of else's here, eh?

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

[high]* Guest210212002 hasn't had enough coffee
[/high]

What I need here is a conditional to ignore the yes/no conditional for everyone BUT contributors. That way the code is shown to everyone who does NOT have permission to use the yes/no thing.

Does that make sense?

Lynne 10-08-2008 05:15 PM

I don't understand what you are saying.... If someone not in the usergroup (right now with your statement, only usergroup 5 and 6 which are admins/super mods) sets field18, it should not do a thing for them. Isn't that what you want?

Guest210212002 10-08-2008 05:27 PM

My head hurts. :D

Here's my layout. Without conditionals, I have sidebar code for everyone. Then I want to only show it on the index, so I added this:

<if condition="THIS_SCRIPT == 'index'">

Then I want it to show or not show, based on the CPF, so I added this:

<if condition="$vbulletin->userinfo[field18] <> 'No'">

That works right now, for everyone - they can all show or hide the sidebar (huzzah!).

So my code looks like:

Code:

<if condition="THIS_SCRIPT == 'index'">
<if condition="$vbulletin->userinfo[field18] <> 'No'">

Hooray, this is my sidebar!

What I need to do now is ignore the on/off conditional for everyone BUT me (for starters). That way, regardless of what a not-me person sets the CPF to, it displays anyway. What I tried was this:

Code:

<if condition="THIS_SCRIPT == 'index'">
<if condition="in_array($bbuserinfo['usergroupid'], array(5, 6))">
<if condition="$vbulletin->userinfo[field18] <> 'No'">
</if>

Thinking that the new and improved on/off conditional would only actually register for for my usergroup. So if the usergroup didn't match 5 or 6, the code would display anyway. If the usergroup DID match 5 or 6, and the conditional was set to Yes, it would display the code.

Unfortunately that didn't work. :( With that setup, the sidebar always shows. Basically what I need is for it to show to everyone, unless they are in group 5/6, and if they are in group 5/6, only if the on/off conditional is set to Yes.

Lynne 10-08-2008 05:35 PM

Let me get this straight..... You want "Hooray, this is my sidebar" (using the example) to show for everyone *unless* they are in group 5/6, and if they are in group 5/6, only if the on/off conditional is set to Yes.
HTML Code:

<if condition="THIS_SCRIPT == 'index'">
<if condition="(in_array($bbuserinfo['usergroupid'], array(5, 6)) AND $vbulletin->userinfo[field18] <> 'No') OR !in_array($bbuserinfo['usergroupid'], array(5, 6))">
Hooray, this is my sidebar
</if>
</if>

Now my head hurts, too!

Guest210212002 10-08-2008 05:38 PM

I am so sorry. :D

Yes, you have it right. That conditional gives me a malformed error though, but I think that's the right idea.

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

I think I finally got it! Your conditional was just missin' one closing parenthesis (or my browser is bad at copy/paste)

Code:

<if condition="(in_array($bbuserinfo['usergroupid'], array(5, 6)) AND $vbulletin->userinfo[field18] <> 'No') OR !in_array($bbuserinfo['usergroupid'], array(5, 6))">
Lynne you are AWESOME, thanks again so much!

Lynne 10-08-2008 07:25 PM

You must have grabbed my condition as soon as I posted it cuz I modified it less than a minute later to add the closing parenthesis!


All times are GMT. The time now is 02:33 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.01039 seconds
  • Memory Usage 1,727KB
  • 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_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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