Go through blocked list
Posted: Sun Mar 20, 2005 7:58 pm
I'm writing a mail service for my game, and I'm having trouble figuring out how not to show the mails sent by someone on the users blocked list. Here's what I have so far to show the mails:
Code: Select all
$i = 0;
print("<td>");
$q = mysql_query("SELECT * FROM `blocked` WHERE `by`='$userid' AND `who`='{$mail['from']}'");
while(($mail=mysql_fetch_assoc($query)) && ($i <= 30) && (mysql_num_rows($q) == "0")) {
if($mail['read'] == "0") {
$b = 'style=\"font-weight:bold\"';
}
$from = mysql_query("SELECT username FROM users WHERE userid='{$mail['from']}'");
$from = mysql_fetch_array($from);
$from = $from[0];
$datetime = explode(' ', $mail['datetime']);
$date = $datetime[0];
$time = $datetime[1];
$date = explode("-", $date);
$month = $date[1];
$day = $date[2];
$date = $month . '/' . $day;
$date = $date . ' ' . $time;
if($mail['read'] == "0") {
print("<tr><td class=\"bold\" colspan=1><b>{$date}</b></td>
<td class=\"bold\" colspan=1><b><a style=\"color:black\" href=\"game.php?where=messenger&stamp=$timestamp&do=read&read={$mail['id']}\" title=\"{$mail['message']}\">{$mail['subject']}</a></b></td>
<td class=\"bold\" colspan=1><b><a style=\"color:black\" href=\"game.php?where=profile&stamp=$timestamp&who={$mail['from']}\">{$from}</a></b></td></tr>");
} else {
print("<tr><td colspan=1>{$date}</td>
<td colspan=1><a style=\"color:black\" href=\"game.php?where=messenger&stamp=$timestamp&do=read&read={$mail['id']}\" title=\"{$mail['message']}\">{$mail['subject']}</a></td>
<td colspan=1><a style=\"color:black\" href=\"game.php?where=profile&stamp=$timestamp&who={$mail['from']}\">{$from}</a></td>
<td colspan=1><a style=\"color:black\" href=\"game.php?where=messenger&stamp=$timestamp&do=inbox&delete=yes&id={$mail['id']}\">DEL</a></td></tr>");
}
$i++;
}