Jump to content

Private Profile


mcmuney

Recommended Posts

I'm trying to build a function, like in myspace, where members can set their profile private. I got the restricted view part working, but not sure how to put together the code to allow their friends to see the full profile.

This partial code below is used to display all friends the member has. What I need is, based on the code below, a if/then statement to see if visitor is a friend or non-friend:

[code]
<?
if($view_all=="All")
{
$arr_frd = getfriends($scm_mem_id,1,1);
}
else
{
$arr_frd = getfriends($scm_mem_id,0,1);

for($i=$i_arr;$i<$i_arr2&&$i<count($arr_frd);$i++){
if ($arr_frd[$i][mem_id]==$scm_mem_id)
{
if($i%3==0)
echo "</tr><tr>";
continue;
}

if($i%3==0)
echo "</tr><tr>";

if($arr_frd[$i][mem_id]!="")
{
?>
[/code]
Link to comment
Share on other sites

you could do one of 2 things, as i see it (what i would do anyway)

1. Create a new table just for friends and have entires with both id's on it, or something.

Or.

2. Set an area in the users table with something like "friends" and list the id's in this like so "1,2,5,36,40" etc. (those being user id's) then do an explode(',' $friends); or something..
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.