rendered paste bodyfunction trace_PM() { global $db, $user, $config, $cache; $trace = $db->get_traced_pms($user->id); $i = ''; $j = ''; while ($t = $trace->row()) { $to = $cache->query("get_username_from_id", array($t->to_id)); $to = $to[0]; //$to = $db->get_username_from_id($t->to_id); //$to = $to->row(); $date = date($config->timestamp1, $t->date); if ($t->read == '0') { $delete = "Recall message"; $i .= "<tr><td>{$to->name}</td><td>{$t->title}</td><td>$date</td><td>$delete</td></tr>"; } else { $j .= "<tr><td>{$to->name}</td><td>{$t->title}</td>$date</td><td>{$status}</td></tr>"; } } echo "<h2>Unread messages</h2>"; echo "<table>"; echo "<tr><th>To</th><th>Title</th><th>Date</th><th>Recall</th></tr>"; echo $i; echo "</table>"; echo "<h2>Read Messages</h2>"; echo "<table>"; echo "<tr><th>To</th><th>Title</th><th>Date</th><th>Recall</th></tr>"; echo $j; echo "</table>"; return true; }