Jump to content

Archived

This topic is now archived and is closed to further replies.

mcmuney

Private Profile

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]

Share this post


Link to post
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..

Share this post


Link to post
Share on other sites

×

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.