Jump to content


Photo

Private Profile


  • Please log in to reply
1 reply to this topic

#1 mcmuney

mcmuney
  • Members
  • PipPipPip
  • Advanced Member
  • 358 posts

Posted 20 September 2006 - 11:05 PM

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:

<?
								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]!="")
							{
							?>


#2 Jocka

Jocka
  • Members
  • PipPipPip
  • Advanced Member
  • 344 posts
  • LocationDallas, Texas

Posted 20 September 2006 - 11:34 PM

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..




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users