Page 1 of 1

[Solved] Help on how to show or hide Email in FEU Listing

Posted: Sat May 31, 2008 4:01 am
by Trevix
I need away to make is so in the FEU Listing it will show or hide a members email depending on there preference.  I created a check box property and played with custom content for a while.

A line i created that kinda works

Code: Select all

{if $ccuser->property('hide_email') < 1}
{$entry.email|escape:"hexentity"}
{else}
*hidden*
{/if}
But the problem with this is that it shows everyones email or no ones, any ideas to make it work?

-- 0:) Trevix >:D

Re: Help on how to show or hide Email in FEU Listing

Posted: Sat May 31, 2008 3:56 pm
by sjmann
This is written purely off the top of my head but something like this may work for you.

Code: Select all

{foreach from=$items item=entry}
<tr>

<td>{$entry.name}</td>

{if $entry.view_email == 1}
<td>{$entry.email}</td>
{/if}

....
You basically want the script to check each user's email preferences each time. Therefore it is best to place the code within the {foreach} section of your template and call the $entry (user's) preferences.


I hope this helps.

Re: Help on how to show or hide Email in FEU Listing

Posted: Sat May 31, 2008 4:10 pm
by Trevix
thank you, i feel kinda stupid now for that simple fix lol.  :P