Login     Sign up
adding friends of other members
arizon efendi (@arizon)
Join date: Aug 26th 2010
Community posts: 145
View Profile
Send Message

oke.. ty ..you are the master bro...

172 months ago
Eliz zeta (@eliz)
Join date: Nov 29th 2010
Community posts: 153
View Profile
Send Message

i dont have mutual friends neither add mutual in browse,
in the pro vesrion, it s the same thing ?

172 months ago
Jcow Master (@falcone)
Join date: Sep 2nd 2010
Community posts: 917
View Profile
Send Message

it is a modification of the original script

172 months ago
Roozbeh Jafari (@roozbeh)
Join date: Nov 4th 2010
Community posts: 92
View Profile
Send Message

falcon ,can you put u.module.php(new edit) in jcowmaster.net?

172 months ago
mysarah (@oracode)
Join date: Nov 18th 2010
Community posts: 7
View Profile
Send Message

whos the owner of jcowmaster.net?

171 months ago
Luppiz (@luppiz)
Join date: Dec 23rd 2010
Community posts: 11
View Profile
Send Message

[b]Thank You![/b]

But the code has problem, so I fix it. Paste it between // friends and // pager. Here's the code:

[code]$res = sql_query("SELECT u.* FROM ".tb()."friends as f left join ".tb()."accounts as u on u.id=f.fid where f.uid={$owner['id']} ".dbhold('f')." ORDER BY f.created DESC LIMIT 30");
$output = '';
while ($row = sql_fetch_array($res)) {
$f = 1;
$output .= avatar($row);
}
ass(array('title'=>t('Friends'), 'content' => '<div class="toolbar">'.url('u/'.$owner['username'] .'/friends',t('See all')).'</div>'.$output));

    ass($this->details($owner));
}

function friends($url = 0) {
    global $client, $apps, $uhome,$ubase, $current_sub_menu, $offset, $num_per_page, $page;
    $profile = $this->settabmenu($url, 1,'u');
    $current_sub_menu['href'] = 'u/'.$url.'/friends';

    // friends

$output = '<ul class="gallery">';

$res = sql_query("SELECT u.* FROM ".tb()."friends as f left join ".tb()."accounts as u on u.id=f.fid where f.uid={$profile['id']} ORDER BY f.created DESC LIMIT $offset, $num_per_page");
while ($row = sql_fetch_array($res)) {

$isfriend = 0;
if (($client['id']) && ($client['id'] != $row['id'])) {
$isfriend = sql_counts(sql_query("SELECT * FROM ".tb()."friends WHERE uid={$row['id']} and fid={$client['id']}"));
}

$on_offline = ((time()-$row['lastlogin']) > 60)? 'offline.gif':'online.gif';

if ($client['id']) {

$res2 = sql_query("select * from ".tb()."friend_reqs where uid='{$client['id']}' and fid='{$row['id']}'");
$row2 = sql_fetch_array($res2);
if ($row2['uid']) {
$row['is_waiting_friend_confirmation'] = 1;
}

$res2 = sql_query("select * from ".tb()."friend_reqs where uid='{$row['id']}' and fid='{$client['id']}'");
$row2 = sql_fetch_array($res2);
if ($row2['uid']) {
$row['is_waiting_friend_approval'] = 1;
}

if ($row['id'] != $client['id']) {
$mfs = sql_counts(sql_query("SELECT u.* FROM ".tb()."friends as f1 inner join ".tb()."friends as f2 on f1.fid = f2.fid left join ".tb()."accounts as u on f1.fid=u.id where f1.uid={$row['id']} and f2.uid={$client['id']}"));
$mfslink = "";
if ($mfs > 0) {
if ($mfs == 1) {
$mfslink = url('u/'.$row['username'] .'/mutualfriends',$mfs.t(' friend in common'));
}
else {
$mfslink = url('u/'.$row['username'] .'/mutualfriends',$mfs.t(' friends in common'));
}
}
}
}
$output .= '<li>';
$output .= '<img src="'.uhome().'/files/icons/'.$on_offline.'"><br>';
$output .= avatar($row);
$output .= '<div style="word-wrap: break-word;">'.url('u/'.$row['username'], $row['username']).'</div><br>';
$output .= $mfslink;
if ($row['is_waiting_friend_approval']){
$output .= '<br />'.url('friends/requests',t('+1 Confirm Friend'));
}
elseif ($row['is_waiting_friend_confirmation']){
$output .= '<br />'.t('Waiting for friend request approval');
}
elseif ((!$isfriend) && ($client['id'] != $row['id']) ) {
$output .= '<br />'.url('friends/add/'.$row['id'],t('+1 Add as Friend'));
}
$output .= '</li>';

}
$output .= '</ul>';
[/code]

171 months ago
Prev 1 2