MyBB Community Forums

Full Version: Hide table in member profile?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So I have a how to question on hiding specific tables in member profiles with php conditions? I have the plugin php and template conditionals , and I am looking to hide empty tables in member profile areas. For example, if a member just signed up, then the "groups" table in profile should be hidden. If a user has 0 awards, then the "awards" table should be hidden.

Example image:
https://i.gyazo.com/012513b4a197994d07bd...3ba4e5.png <- these tables should be hidden if there is nothing to show.

Can anyone point me to the right direction to get this done? Or would this require further plugin/global php modifications instead of through templates?
see this reply related to empty profile fields. perhaps you can extend it to your requirement.
(2020-03-26, 07:06 AM).m. Wrote: [ -> ]see this reply related to empty profile fields. perhaps you can extend it to your requirement.

Don't think this guide helps much as Groups/Awards and some other sections aren't profile fields, but are plugins (aside from groups of course, but still isn't a custom profile field).

EDIT: For groups, I tried something like the code below, but was not success:
<if $memprofile['usergroup'] != 2 then>&nbsp;<else><table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}">........</table></if>
Hi,


I'd change the style of the DIV (or DIVs) you wanna show/hide. Something like:
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" <if CONDITION_TO_MAKE_IT_INVISIBLE then> style="visibility: hidden;"</if>>........</table>
(2020-03-26, 06:59 AM)makpaolo Wrote: [ -> ](...)

Or would this require further plugin/global php modifications instead of through templates?

Seems to me it's the proper way. "php and template conditionals" may have its inability in some template/HTML output circumstance, well just a guess.