3 * Plain messagelist like GF uses
5 * @author Anthony Parsons (xmpp:ant@specialops.ath.cx)
6 * @license file://../COPYING
9 require_once 'lib/iface.messagedisplay.php';
11 class messagelist_flat
implements messagedisplay
16 public function display(mysqli_result
$rows)
20 while ( $m = $rows->fetch_assoc() ) {
22 'From: '.$user->namelink($m['userid'], $m['alias']),
23 'At: '.$user->fdate($m['mtime']),
24 sprintf('<a href="%s#m%d">#%2$d</a>', HERE
, $m['messageid']),
25 'Score: '.$m['score'],
26 '<a href="post?message='.$m['messageid'].'">Reply</a>');
28 if ( $user instanceof authuser
) {
29 if ( $user->has_priv('moderate') && $user->userid
!= $m['userid'] ) {
30 $params[3] .= sprintf(self
::MD_LINKS
, $m['messageid']);
33 $params[3] .= sprintf(self
::MD_VIEW
, $m['messageid']);
37 if ( $m['replyto'] ) {
38 $params[] = sprintf('Reply to <a href="#m%d">#%1$d</a>', $m['replyto']);
40 if ( $user->has_priv('admin') ) {
44 echo '<div class="info u',$m['userid'],'" id="m',$m['messageid'],'">',implode(' | ', $params),"</div>\n",
45 '<div class="content">',$m['mtext'],"</div>\n";
49 public function pagelist($posts, $page, $topicid, $totalposts)
51 if ( $totalposts < $posts ) {
56 for ( $i = 0; $i < $totalposts; $i +
= $posts ) {
57 if ( $i/$posts == $page ) {
58 $tmp .= '<dd>['.($i/$posts+
1).']</dd> ';
60 $tmp .= sprintf('<dd><a href="messagelist?topic=%d;page=%d;length=%d">%d</a></dd> ',
61 $topicid, ($i/$posts), $posts, ($i/$posts+
1));