create a block called: friends_block.php
If you want to display avatars use this code
if ($site_config["MEMBERSONLY"] && !$CURUSER) {
echo "<BR><BR><b><CENTER>Vous n'
<?php
begin_block("My Friends");
if ($site_config["MEMBERSONLY"] && !$CURUSER) {
echo "<BR><BR><b><CENTER>You are not logged in<br>Only registered users can vieuw this block.</CENTER><BR><BR>";
} else {
$sql = "SELECT id, friendid FROM friends WHERE userid = '$CURUSER[id]'";
$mysql_result=mysql_query($sql) or die (mysql_error());
$dt = get_date_time(gmtime() - 180);
echo"<table width=100% cellspacing=0 align=center>";
echo"<tr>";
while ($row=mysql_fetch_array($mysql_result)){
$id = $row['friendid'];
$sql2 = mysql_query("SELECT id, username, last_access FROM users WHERE id = '$id'");
$res2= mysql_fetch_array($sql2) or die (mysql_error());
$ami = $res2['username'];
echo "<tr><td><a href=account-details.php?id=$id><font color=blue>".$ami."</a></td><td><img src=images/button_o".($res2[last_access]>$dt?"n":"ff")."line.gif></td><td><a href=mailbox.php?compose&id=$res2[id]>". "<img src=images/button_pm.gif border=0></a></center></td></tr>";
}
echo"</tr>";
echo "</table>";
}
end_block();
?>If you want to display avatars use this code
<?phpbegin_block("Mes Amis");if ($site_config["MEMBERSONLY"] && !$CURUSER) {
echo "<BR><BR><b><CENTER>Vous n'

