vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Hide certain postbit elements via option in user CP? (https://vborg.vbsupport.ru/showthread.php?t=318307)

Rlad78 04-18-2015 08:05 PM

Hide certain postbit elements via option in user CP?
 
Some of our users have been asking us if there can be ways to change what displays in the postbit, specifically user rank images. How can we make user rank images toggleable on or off so members who do not wish to view them can turn them off from the postbit? I know it's easy to just AdBlock but that's not the sort of solution they want to hear, haha.

Thank you!

Lynne 04-18-2015 08:25 PM

They want to block *everyone's* ranks (not just their own)? Create a user profile field (Do you wish to hide user ranks in threads - Yes or No) and then get the field id and put a condition around the area in the postbit (or postbit_legacy, whichever you use):

Code:

<if condition="$bbuserinfo[fieldx] == No">
Rank Code</if>

Change x to the profile field number.

Rlad78 04-19-2015 01:40 AM

Thank you, it worked! But now the user rank images are being hidden by default despite "No" being set as the first option. Is there any way to make them show by default?

blind-eddie 04-19-2015 12:13 PM

Try this.

Code:

<if condition="$post['rank'] AND $bbuserinfo['fieldxx'] != 'No' ">
Rank Code</if>

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

I see what the problem is, the code Lynn posted:

Code:

<if condition="$bbuserinfo[fieldx] == No">
Should have been:

Code:

<if condition="$bbuserinfo['fieldx'] == No">

Lynne 04-19-2015 10:55 PM

That works on my site in my postbit (I copied it from there), but perhaps I'm on a different version and it worked back then.


All times are GMT. The time now is 01:12 AM.

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.01419 seconds
  • Memory Usage 1,716KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete