Location: PHPKode > projects > H-tracker > friend.php
<?
//
//  H-Tracker v0.2
//    http://h-tracker.org
//    Based on TorrentTrader (http://www.torrenttrader.org)
//
//

require_once("backend/functions.php");

dbconn(false);

loggedinonly();

$id = (int)$_GET["id"];

$res = mysql_query("SELECT username FROM users WHERE id = ".$CURUSER['id']."") or die (mysql_error());
$arr = mysql_fetch_array($res);

$dt = get_date_time(gmtime() - 180);
$username = htmlspecialchars($arr['username'], ENT_QUOTES);

stdhead("friends for " . $username);

$res = mysql_query("SELECT friendid FROM friends WHERE userid = ".$CURUSER['id']." ORDER BY id") or die (mysql_error());

$i = "1";

begin_frame("My friends", "center");

while ($arr = mysql_fetch_assoc($res))
    {
$res1 = mysql_query("SELECT avatar, username, last_access, class FROM users WHERE id = '$arr[friendid]'") or die (mysql_error());
$arr1 = mysql_fetch_assoc($res1);

$class = get_user_class_name($arr1['class']);

$avatar = htmlspecialchars($arr1['avatar'], ENT_QUOTES);
if (!$avatar)
$avatar = "themes/$THEME/images/avatars/default_avatar.gif";

$fname = htmlspecialchars($arr1['username'], ENT_QUOTES);

$content1 = "<table style=\"padding: 0px;\" width=\"100%\"><tbody><tr><td class=\"ttable_col1\" style=\"padding: 5px;\" 
align=\"center\" width=\"50%\"><table class=\"main\" height=\"75\" width=\"100%\"><tbody><tr valign=\"top\"><td 
style=\"padding: 0px;\" align=\"center\" width=\"75\"><div style=\"overflow: hidden; width: 75px; height: 75px;\"><img 
src=\"$avatar\" width=\"75\"></div></td><td>
	<table class=\"main\"><tbody><tr><td class=\"embedded\" style=\"padding: 5px;\" width=\"80%\"><a 
href=\"account-details.php?id=$arr[friendid]\"><b>$arr1[username]</b></a> <img 
src=images/users/o".($arr1[last_access]>$dt?"n":"ff")."line.png><br> ($class)<br><br>Last seen on 
$arr1[last_access]<br>&nbsp;</td>
	<td class=\"embedded\" style=\"padding: 5px;\" width=\"20%\"><br><a 
href=\"takedelfriend.php?delid=$arr[friendid]\">Delete Friend</a><br><br><a 
href=mailbox.php?compose&id=".$arr[friendid].">Send PM</a><BR></td></tr>
	</tbody></table></td></tr></tbody></table>
	</td>";

$content2 = "<td class=\"bottom\" style=\"padding: 5px;\" align=\"center\" width=\"50%\"><table class=\"main\" height=\"75\" 
width=\"100%\"><tbody><tr valign=\"top\"><td style=\"padding: 0px;\" align=\"center\" width=\"75\"><div style=\"overflow: 
hidden; width: 75px; height: 75px;\"><img src=\"$avatar\" width=\"75\"></div></td><td>
	<table class=\"main\"><tbody><tr><td class=\"embedded\" style=\"padding: 5px;\" width=\"80%\"><a 
href=\"account-details.php?id=$arr[friendid]\"><b>$arr1[username]</b></a> <img 
src=images/users/o".($arr1[last_access]>$dt?"n":"ff")."line.png><br> ($class)<br><br>Last seen on 
$arr1[last_access]<br>&nbsp;</td>
	<td class=\"embedded\" style=\"padding: 5px;\" width=\"20%\"><br>
	<a href=\"takedelfriend.php?delid=$arr[friendid]\">Delete Friend</a><br><br>
	<a href=mailbox.php?compose&id=".$arr[friendid].">Send PM</a></td></tr>
	</tbody></table></td></tr></tbody></table></td></tr></tbody></table>";

if ($i == "1") {
echo $content1;
$i = "2";
}else {
echo $content2;
$i = "1";
}

}

if ($i == "2") {
echo "<td class=\"bottom\" width=\"50%\">&nbsp;</td></tr></tbody></table>";
end_frame();
}else {
end_frame();
}

stdfoot();

?>
Return current item: H-tracker