vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   [SOLVED] If and or Condition (https://vborg.vbsupport.ru/showthread.php?t=321930)

nhawk 02-26-2016 06:26 PM

so you want

Option ON
Guest View and Admin View
Registered can NOT VIEW

Option OFF
Guest View
Admin and Registered can NOT VIEW

Dr.CustUmz 02-26-2016 06:29 PM

Quote:

Originally Posted by nhawk (Post 2565676)
so you want

Option ON
Guest View and Admin View
Registered can NOT VIEW

Option OFF
Guest View
Admin and Registered can NOT VIEW

EXACTLY =)

im playing with it too.

i attached the file also if you didnt see that post

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

it really seems like
Code:

<if condition="$show['registerbutton'] OR ($vboptions[drc_rb_edt] == 1 AND ($vboptions[drc_rb_edt] == 1 AND $show['admin']))">
would be the code i need, but for some reason thats not working

nhawk 02-26-2016 06:50 PM

Are you setting $show['admin'] anywhere in your add-on?

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

Wait a second, this should work...
Code:

<if condition="$show['registerbutton'] AND (($vboptions['drc_rb_edt'] == 0 AND !$userinfo['userid']) OR (($vboptions['drc_rb_edt'] == 1 AND !$userinfo['userid']) OR ($vboptions['drc_rb_edt'] == 1 AND $show['admin'])))">
The $show['registerbutton'] eliminates all registered users.

The rest takes care of the other options.

You may need to change userinfo to bbuserinfo. It's been a very long time since I did anything with vB3.

Dr.CustUmz 02-26-2016 07:12 PM

wholly wow thats a long condition lol, but i have tried that with no avail.

replace userinfo with bbuserinfo, and userid with 1 and still nothing =/

i didnt think this would be this difficult to achieve =/

and no i dont set show admin anywhere in the addon, it is attached up a little further

side note: even with all this code it is viewable from a guest, so somethings partially right lol

nhawk 02-26-2016 07:17 PM

OK, so a guest can view it with or without the option set?

Then the problem is the admin, correct?

If that's the case then this should show it to the admin...
Code:

<if condition="(($show['registerbutton'] AND $vboptions['drc_rb_edt'] == 0) OR (($show['registerbutton'] AND $vboptions['drc_rb_edt'] == 1) OR ($vboptions['drc_rb_edt'] == 1 AND $show['admin'])))">

Dr.CustUmz 02-26-2016 07:26 PM

that didnt work either, i broke it down like:
Code:

<if condition="$show['registerbutton']">
REG ON
</if>

<if condition="$vboptions[drc_rb_edt] == 1 AND $show['admin']">
IS ADMIN OPTION ON
</if>

<if condition="$vboptions[drc_rb_edt] == 1">
OPTION ON
</if>

<if condition="$show['admin']">
IS ADMIN
</if>

and wasnt getting my admin blocks, so a simple change to
Code:

is_member_of($bbuserinfo, 6)
solved that issue. so im going to give the original code one more shot and ill let you know =)

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

Code:

<if condition="$show['registerbutton'] OR ($vboptions[drc_rb] == 1 AND ($vboptions[drc_rb_edt] == 1 AND is_member_of($bbuserinfo, 6)))">
WORKS! =)

wholly crap that was too much lol, but why didnt the show admin work... there should have been no issue there....


All times are GMT. The time now is 09:42 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.02474 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
  • (6)bbcode_code_printable
  • (1)bbcode_quote_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