mcmuney Posted September 20, 2006 Share Posted September 20, 2006 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] Quote Link to comment Share on other sites More sharing options...
Jocka Posted September 20, 2006 Share Posted September 20, 2006 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.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.