vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Miscellaneous Hacks - Sharebar - Sidebarslider #2 (https://vborg.vbsupport.ru/showthread.php?t=281202)

Emeralda 04-07-2012 10:17 PM

I tried doing it like that:

Code:

<vb:if condition="!$bbuserinfo[field10] == 'Hide'">
<!-- SocialMediaTabs.com START -->
<script type="text/javascript">
      var smtabs_id = "1.0@blahblahblah";
</script>
<script type="text/javascript" src="http://cdn.socialmediatabs.com/loader/loader.1.0.min.js"></script>
<!-- SocialMediaTabs.com STOP -->
</vb:if>

When it was

<vb:if condition="$bbuserinfo[field10] == 'Show'">

It didn't show anything as default.

When I turned it to

<vb:if condition="!$bbuserinfo[field10] == 'Hide'">

It did show the buttons before changing the settings, it did hide them after clicking hide, but when choosing Show, it doesn't show them anymore.

Kraxell 04-08-2012 07:14 AM

For understanding:
You want to make an option for your users, to switch them off in UCP?

Kraxell 04-08-2012 07:30 AM

Make new profile-field and take radio-button with on/off-option.
Be sure to have "on as default".

Code:

<vb:if condition="$show['guest'] OR $bbuserinfo[fieldX] == 'on'">Script</vb:if>
Code is for guests -> ALWAYS and members on (SET on AS DEFAULT!)

Emeralda 04-08-2012 10:33 AM

That one surprisingly worked both ways, thankies.

EDIT: Ehh, nevermind, it also is problematic. The buttons just disappeared by default and won't show until the options are changed. The profile fields were set to use default http://prntscr.com/7vtjr, but it doesn't seem to work if you don't save the profile before, which is against the point of this, because I want people to see it first.

EDIT2: in one of previous codes something like this was used to prevent such situation

<vb:if condition="$bbuserinfo[field8] != ''">{vb:raw bbuserinfo.field8}<vb:else />1</vb:if>

But I'm not sure where to add != '' because I was doing it wrong I think, I was getting an error.

EDIT3: How to make ! (if not) conditionals? Maybe reversing the situation would work?

EDIT:4 Fixed it by using <vb:if condition="$bbuserinfo[field10] == 'Hide'"><vb:else />

davut_c20 04-10-2012 04:31 AM

Thank You,
Great Work .. Installed

Heardy 04-14-2012 10:22 AM

Thanks this looks awesome xD

hhumas 04-14-2012 07:27 PM

whenever i copy this i get this error

Code:

Warning: Invalid argument supplied for foreach() in [path]/includes/functions.php on line 3453

GameOverViper 04-15-2012 11:38 AM

This is clean, simple and fast. Compared to that last one I was using, this one blows that one away. I've installed it on 4.1.11 and 4.1.12 forums. Works fine.

Kraxell 04-15-2012 02:13 PM

Quote:

Originally Posted by hhumas (Post 2320148)
whenever i copy this i get this error

Code:

Warning: Invalid argument supplied for foreach() in [path]/includes/functions.php on line 3453

Do you have installed TMS?

temsamane 04-17-2012 09:23 PM

how can i make this visible only for users? to hide the option for guests


All times are GMT. The time now is 05:02 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.01200 seconds
  • Memory Usage 1,739KB
  • 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
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (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