MyBB Community Forums

Full Version: Restricting Views of a Custom Profile Field
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all,

I have looked through hundreds of pages for this but have not found an answer.
MyBB Version: 1.4.2
my site: http://www.4x4tx.com/forum/

I created a Custom Field and it is showing up fine in my postbit information however, I want this new profile view to be restricted to registered users only...Meaning I dont want guest to see this Custom Profile which is the users real name.

my custom field is
{$post['fid6']}<br />

here is the code from my postbit_classic page
<td class="{$altbg}" width="15%" valign="top" style="white-space: nowrap; text-align: center;"><a name="pid{$post['pid']}" id="pid{$post['pid']}"></a>
		<strong><span class="largetext">{$post['profilelink']}</span></strong> {$post['onlinestatus']}<br />
		<span class="smalltext">
			{$post['usertitle']}<br />
                        {$post['fid6']}<br />
			{$post['userstars']}
			{$post['groupimage']}
			{$post['useravatar']}<br />
			{$post['user_details']}
		</span>
	</td>

Thanks for Any and all help
Might I ask why not just disallow guests from viewing profiles?
Is it not worth altering the actual showthread.php file (and others that show the profile field)? For example

if($mybb->user['usergroup'] == 2 || $mybb->user['usergroup'] == 3){ $post['fid6'] = ""; }

Just list your groups in the if() function that you don't want to view the field... no idea whether this will work but could give it a try...

Smile
(2008-10-14, 02:58 AM)Schmarvin Wrote: [ -> ]Might I ask why not just disallow guests from viewing profiles?
I have the profile set to not allow guest to see it, but they can still see the postbit information.....the information that is displayed next to the thread, under the username, usertitle, postcount, etc.
http://www.4x4tx.com/forum/showthread.php?tid=21

Here is the information, below, which is displayed on the left of the thread i have posted that shows my real name.

Jdaw Online
Administrator
John Avara
Posts:40
Joined: Oct 2008

Currently we don't have any groups other than the default, Guest, registered, Super Mod. and etc.
In inc/functions_post.php, find:
eval("\$post['user_details'] = \"".$templates->get("postbit_author_user")."\";");
Before that line, add:
if(!$mybb->user['uid'])
{
  unset($post['fid6']);
}