Location: PHPKode > projects > Jcow SNS > includes/libs/friends.module.php
<?php
/* ############################################################ *\
 ----------------------------------------------------------------
Jcow Software (http://www.jcow.net)
IS NOT FREE SOFTWARE
http://www.jcow.net/commercial_license
Copyright (C) 2009 - 2010 jcow.net.  All Rights Reserved.
 ----------------------------------------------------------------
\* ############################################################ */

class friends{
	
	function friends() {
		global $tab_menu, $client, $menuon;
		$menuon = 'friends';
		if (!$client['id']) {
			redirect('member/login/1');
		}
		set_title(t('Friends'));
	}
	
	function index() {
		global $db, $client, $offset, $num_per_page, $page, $ubase, $nav, $current_sub_menu;
		$uid = $client['id'];
		c('<h3>'.t('Your mutual followers').'</h3>');
		$current_sub_menu['href'] = 'friends';
		$nav[] = t('My friends');
		$res = sql_query("SELECT u.* FROM `".tb()."followers` as f left join `".tb()."accounts` as u on u.id=f.fid where f.uid='{$client['id']}' and f.fid in
			(select uid from ".tb()."followers where fid='{$client['id']}' and uid!='{$client['id']}')
		ORDER BY u.lastlogin DESC");
		c('<div style="width:100%;clear:both"></div>');
		while ($row = sql_fetch_array($res)) {
			c('<div style="width:70px;height:90px;float:left;margin:5px;padding:3px 0 0 3px;border:#ccc 1px solid;">');
			c(avatar($row).'<br /><span>'.url('u/'.$row['username'], $row['username']).'</span>');
			c('</div>');
		}
		c('<div style="width:100%;clear:both"></div>');

	}
	function requests() {
		redirect('friends');
	}

}
Return current item: Jcow SNS