here if you are sure."); if ($type == 'friend') { do_mysql_query("DELETE FROM friends WHERE userid=$userid AND friendid=$targetid") or sqlerr(__FILE__, __LINE__); if (mysql_affected_rows() == 0) stderr( _("Error"), "No friend found with ID"); $frag = "friends"; } elseif ($type == 'block') { do_mysql_query("DELETE FROM blocks WHERE userid=$userid AND blockid=$targetid") or sqlerr(__FILE__, __LINE__); if (mysql_affected_rows() == 0) stderr( _("Error"), "No block found with ID"); $frag = "blocks"; } else stderr( _("Error"), "Unknown type"); header("Location: friends.php?id=$userid#$frag"); die; } // main body ----------------------------------------------------------------- stdhead("Personal lists for " . $user['username']); if ($user["donor"] == "yes") $donor = "Donor"; if ($user["warned"] == "yes") $warned = "Warned"; print("

". "

\n"); print("

". "

Personal lists for $user[username]

$donor$warned$country

\n"); print("
"); print("
"); print("

Friends list

\n"); print("\n"); $i++; } if ($i % 2 == 1) print("
"); $i = 0; $res = do_mysql_query("SELECT f.friendid as id, u.username AS name, u.class, u.avatar, u.title, u.donor, u.warned, u.enabled, u.last_access, UNIX_TIMESTAMP(u.last_access) as utadded FROM friends AS f LEFT JOIN users as u ON f.friendid = u.id WHERE userid=$userid ORDER BY name") or sqlerr(__FILE__, __LINE__); if(mysql_num_rows($res) == 0) $friends = "Your friends list is empty."; else while ($friend = mysql_fetch_assoc($res)) { $title = $friend["title"]; if (!$title) $title = get_user_class_name($friend["class"]); $body1 = "" . $friend['name'] . "" . get_user_icons($friend) . " ($title)

last seen on " . $friend['last_access'] . "
(" . get_elapsed_time(($friend['utadded'])) . " ago)"; $body2 = "
Remove" . "

Send PM"; $avatar = ($CURUSER["avatars"] == "yes" ? htmlspecialchars($friend["avatar"]) : ""); if (!$avatar) $avatar = $GLOBALS['pic_base_url']."/default_avatar.gif"; if ($i % 2 == 0) print("
"); else print(""); print(""); print(""); print("
" . ($avatar ? "
" : ""). "
\n"); print(""); print("\n"); print("\n"); print("
$body1$body2
"); print("
\n"); if ($i % 2 == 1) print("
\n"); else print("
 
\n"); print($friends); print("
\n"); /* Added you to friends list */ $i = 0; $res = do_mysql_query("SELECT f.userid as id, u.username AS name, u.class, u.avatar, u.title, u.donor, u.warned, u.enabled, u.last_access, UNIX_TIMESTAMP(u.last_access) as utadded FROM friends AS f LEFT JOIN users as u ON f.userid = u.id WHERE f.friendid=$userid ORDER BY username") or sqlerr(__FILE__, __LINE__); print("
"); print("

Added you to friends list(".mysql_num_rows($res).")

\n"); print("\n"); $i++; } if ($i % 2 == 1) print("
"); if(mysql_num_rows($res) == 0) $friends = "Nobody added you as a friend :(."; else while ($friend = mysql_fetch_assoc($res)) { $title = $friend["title"]; if (!$title) $title = get_user_class_name($friend["class"]); $body1 = "" . $friend['name'] . "" . get_user_icons($friend) . " ($title)

last seen on " . $friend['last_access'] . "
(" . get_elapsed_time($friend['utadded']) . " ago)"; $body2 = "
Remove" . "

Send PM"; $avatar = ($CURUSER["avatars"] == "yes" ? htmlspecialchars($friend["avatar"]) : ""); if (!$avatar) $avatar = $GLOBALS['pic_base_url']."/default_avatar.gif"; if ($i % 2 == 0) print("
"); else print(""); print(""); print(""); print("
" . ($avatar ? "
" : ""). "
\n"); print(""); print("\n"); print("\n"); print("
$body1$body2
"); print("
\n"); if ($i % 2 == 1) print("
\n"); else print("
 
\n"); print($friends); print("\n"); /* ============= */ $res = do_mysql_query("SELECT b.blockid as id, u.username AS name, u.donor, u.warned, u.enabled, u.last_access FROM blocks AS b LEFT JOIN users as u ON b.blockid = u.id WHERE userid=$userid ORDER BY name") or sqlerr(__FILE__, __LINE__); if(mysql_num_rows($res) == 0) $blocks = "Your blocked users list is empty."; else { $i = 0; $blocks = ""; while ($block = mysql_fetch_assoc($res)) { if ($i % 6 == 0) $blocks .= ""; $blocks .= ""; if ($i % 6 == 5) $blocks .= ""; $i++; } print("
[D] " . $block['name'] . "" . get_user_icons($block) . "
\n"); } print("

"); print(""); print("
"); print("

Blocked users list

"); print("$blocks\n"); print("
\n"); print("\n"); print("

Find User/Browse User List

"); stdfoot(); ?>