Custom Profile Fields Permissions

Started by IvaliceAlliance, March 20, 2012, 12:03:57 AM

Previous topic - Next topic

IvaliceAlliance

I'm trying to figure out how I can make my custom profile fields invisible to guests. I want the fields to be visible in Topic View only to members logged in, similar to how the AIM/MSN/ICQ/YIM fields work. I tried to use php code to do it in the "Show Enclosed Within Text (Optional)" field, but it does not let me run php code.

This would do exactly what I want, but it won't run. Instead when I look at the HTML source, the php code is in there and the server did not run it.

<?php
if (
allowedTo('profile_view_any'))
               echo 
"{INPUT}";
?>


Is there any way I can achieve this?

Kermit

There is actually privacy option on new field creation 

+

when you would restrict guests to view the profiles on your site,they would not be able to see it
My Mods
Please don't PM/mail me for support,unless i invite you
Formerly known as Duncan85
Quote
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."

A. Einstein

Illori

the default fields dont have the privacy option and the advanced profile fields dont have an option to hide them from guests anyway.

yourtheme[or default]/profile.template.php
Code (find) Select
<li class="custom_field">', $field['output_html'], '</li>';
}


Code (add after) Select
if (!$context['user']['is_guest'])

yourtheme[or default]/display.template.php

Code (find) Select

if ($message['member']['has_messenger'] && $message['member']['can_view_profile'])


Code (replace with) Select
if ($message['member']['has_messenger'] && $message['member']['can_view_profile'] &&( !$context['user']['is_guest']))

if you have other custom fields you would need to apply that to those areas in those templates as well.

i believe that code should work, i am not 100% sure.

IvaliceAlliance

I was really hoping there could be a more simple way. I don't really like editing the default template (which is what I use) because I assume I'll lose my changes when I update SMF. I'll try it out though. I should be able to figure it out based on your guidance. I hope something like this gets improved in 2.1 or 3.0.

Thanks.

Advertisement: