/*
function friends_show() {
global $user;
$getfriends = "select f.uid as user, f.status as status, f.fid as friend, u.uid, u.picture, group_concat( p.value separator ' ' ) as name from {friends} f inner join {users} u on f.fid = u.uid inner join {profile_values} p on f.fid = p.uid WHERE f.uid =%d AND f.status = %d AND p.fid <=%d group by user, friend, u.picture, name, status";
$friendrs = db_query($getfriends, $user->uid, 1 , 2);
$cnt=0;
while($friendrc = db_fetch_object($friendrs)) {
$cnt++;
  if ($friendrc->picture == null) {
    $friendrc->picture = './files/profilepics/nopicture.jpg" width="60" hieght="80"alt="No Picture Available!"';
} 
      $output .=  '<div id="friends_show_box">
                          <div id="friends_show_box_picture"><img src="'. $friendrc->picture .'" /></div>
                          <div id="friend_show_box_data"><strong>'. $friendrc->name .'</strong> is doing whatever<br /> <br />Timestamp</div>
                          <div id="friend_show_box_options"><a href="#" title="Delete Friend" onclick="friendsoptions(\'?q=friends/remove&friend='. $friendrc->friend .'\', \'friends_show_box\')">x</a></div></div>';
  }
if ($cnt == 0) {
         $nofriends .=  '<div id="friends_show_box"><br><br><center><strong>You Haven\'t made Any friends yet...</strong></center><br><br></div>';
         return $nofriends;
   }
else {
  $friends .= $output;
  return $friends;
  }
}

function whos_online() {
global $user;
$interval = time() - variable_get('user_block_seconds_online', 900);
$onlinequery = "select s.uid as sessionuid, f.uid AS user, f.fid as friend, u.uid, u.picture, group_concat( p.value SEPARATOR ' ' ) AS name from {sessions} s inner join {friends} f on f.fid = s.uid inner join users u on u.uid = s.uid inner join profile_values p on s.uid = p.uid where s.uid <>%d and s.timestamp >=%d and p.fid <=%d group by session, user, friend, u.picture, name";
$onlinerc = db_query($onlinequery, $user->uid, $interval, 2);
$onlinecounter=0;
while($onliners = db_fetch_object($onlinerc)) {
      $onlinecounter++;
  if ($onliners->picture == null) {
    $friendrc->picture = './files/profilepics/nopicture.jpg" width="60" hieght="80"alt="No Picture Available!"';
  } 
      $output .=  '<div id="friends_show_box">
                          <div id="friends_show_box_picture"><img src="'. $onliners->picture .'" width="60" /></div>
                          <div id="friend_show_box_data"><strong>'. $onliners->name .'</strong> is online now<br /> <br />Timestamp</div>
                          <div id="friend_show_box_options"><a href="#" title="Delete Friend" onclick="friendsoptions(\'?q=friends/remove&friend='. $onliners->friend .'\', \'friends_show_box\')">x</a></div><br /><br />';
  }
  if ($onlinecounter == 0) {
    $offline .= '<div id="friends_show_box"><br><br><center><strong>You Have No Friends Online...</strong></center><br><br></div>';
   return t($offline);
  }
  else{
         return t($online);
  }

}

/*
* Removes friend from friends

function friends_removefriends($friend){
global $user;
  $rfquery = "delete from {friends} where uid=%d and fid=%d";
  $rfrs = db_query($rfquery, $user->uid, $friend);
  $rfrs = db_query($rfquery, $friend, $user->uid);
  if ($rfrs){
  print '<center><p><strong>Friend Removed...</strong></p><center>';
  }
else{
   print '<center><p><strong>Friend Removed..</strong></p><center>';
	}
}



function friends_statusapi(){

}

function friends_requests_recieved() {
}

function friends_requests_sent() {
}

validate multiple Email Address

function multiEmail(email_field) {
var email = email_field.split(',');
for (var i = 0; i < email.length; i++) {
if (!validateEmail(email[i], 1, 0)) {
alert('one or more email addresses entered is invalid');
return false;
}
}
return true;
}

*/


