0) return TRUE; else return FALSE; } function list_messages($username) { /* Display list of messages in a users messagebox */ global $realm,$config,$forumsess; if ($forumsess[$realm][username]) { if (db_numrows($config[pmtable],"mto='$username'")>0) { $result = db_select("SELECT * FROM $config[pmtable] WHERE mto='$username' ORDER BY id DESC"); $i = 0; print "
"; print ""; while($row = db_getarray($result)) { $i = $i + 1; if ($i % 2) $bgcolor = $config['color_b']; else $bgcolor = $config['color_a']; if ($row[senttime]) { if ($config['24hour']) $format = "m-d-y H:i"; else $format = "m-d-y h:i a"; $datetext = date($format,sql_to_unix_time($row[senttime])); } else { $datetext = FALSE; } if ($row[status] == '0') $titletext = "".$row[subject].""; else $titletext = $row[subject]; print ""; } print "
Subject Sender Date Time
$titletext$row[mfrom]$datetext
"; } else { print "You have no messages in your Messagebox
"; } } else { print "You are not logged in. You must log in before viewing your inbox.
"; } } function read_message($username,$id) { /* Read the selected message */ global $config,$realm,$forumsess; if (!$config[icondir]) $config[icondir] = "art/icons"; $result = db_select("SELECT p.id AS id, p.message AS message, p.senttime AS senttime, p.status AS status, u.username AS mfrom, u.options AS useropts, u.gender AS gender, u.birthday AS birthday, u.sig AS sig, u.votes AS votes, u.rank AS rank, u.location AS location, p.subject AS subject, u.email AS email, u.homepage AS homepage, u.aim AS aim, u.yahoo AS yahoo, u.icq AS icq FROM $config[pmtable] p, $config[utable] u WHERE p.id='$id' AND u.username=p.mfrom"); $i = 0; print "
"; while($row = db_getarray($result)) { $i = $i + 1; $options = $row[useropts]; if ($i % 2) $bgcolor = $config['color_b']; else $bgcolor = $config['color_a']; if ($row[status] == 0) { $columns = array("status"); $values = array('1'); db_update($config[pmtable],"id='$id'",$columns,$values); } if (($row[rank])&&($row[votes])) { $score = $row[rank]/$row[votes]; $rank = round($score, 0); $score = round($score, 2); } else { $rank = FALSE; } if ($config['24hour']) $format = "l, F j Y H:i"; else $format = "l, F j Y h:i A"; $datetext = date($format,sql_to_unix_time($row[senttime])); ?>
SenderMessage