* Minor TOS change
[specialops2.git] / lib / class.Messagestyle_IRC.php
blobce4557f8af01edbfef31ccf348cdca7ba0d83b85
1 <?php
2 /**
3 * IRC-style messagelist
5 * @author Anthony Parsons (xmpp:ant@specialops.ath.cx)
6 * @license file://../COPYING
7 * @version $Id$
8 */
9 require_once 'lib/iface.Messagestyle.php';
11 class Messagestyle_IRC implements Messagestyle
13 const ID = 2;
14 const Name = 'IRC';
16 public function display($msg)
18 global $user;
20 // opening tags, msgid link,
21 echo '<div id="m',$msg['messageid'],'" class="message u',$msg['userid'],'">',"\n",
22 '<div class="info">',
23 '<a href="',HERE,'#m',$msg['messageid'],'">#',$msg['messageid'],'</a>';
25 // user info,
26 echo '&nbsp;&lt;',$user->namelink($msg['userid'], $msg['alias']),'&gt;';
27 echo "<br/>\n";
29 // moderation links,
30 if ( $user->has_priv('moderate') && $user->userid != $msg['userid'] ) {
31 echo '<form action="detail?',$msg['messageid'],'" method="post" class="msgmod">'.
32 '<button type="submit" name="action" value="add">+</button>'.
33 '<button type="submit" name="action" value="sub">-</button>'.
34 "</form><br/>\n";
37 echo '(Score: ',$msg['score'],')';
38 if ( $user->userid != $msg['userid'] ) {
39 echo "<br/>\n",'(<a href="post?message=',$msg['messageid'],'">Reply</a>)';
42 echo
43 "</div>\n", //info
44 '<div class="content">',$msg['mtext'],"</div>\n",
45 "</div>\n"; //message