ah yeah... and such
authorpaulr <me@pjr.cc>
Wed, 20 Apr 2011 18:31:46 +0000 (04:31 +1000)
committerpaulr <me@pjr.cc>
Wed, 20 Apr 2011 18:31:46 +0000 (04:31 +1000)
plus stuff..

lib/plugins/messages.php
lib/plugins/www.php

index d7a268f..e735e90 100644 (file)
@@ -1,6 +1,33 @@
 <?php
+$BASE_URLS["msg"]["base"] = "msg";
+$BASE_URLS["msg"]["function"] = "msg_pageResponder";
 
 
+function msg_pageResponder()
+{
+       $calls["needs_base_page"] = false;
+       $calls["page_builder"] = "msg_makePages";
+       
+       return $calls;
+}
+
+function msg_makePages()
+{
+       global $URL_COMPONENTS;
+       $call = $URL_COMPONENTS[1];
+       
+       switch($call) {
+               case "acknowledge":
+                       $msgid = $URL_COMPONENTS[2];
+                       msg_acknowledge($msgid);
+       }
+               
+       $loc = urlCreate("/");
+       header("Location: $loc");
+       
+       return 0;
+}
+
 function msg_haveMessages($acked = false)
 {
        msg_createTable();
index 2c59349..3d5b9d1 100644 (file)
@@ -115,15 +115,17 @@ function www_top()
        
        echo "</tr></table>";
        if(function_exists("msg_haveMessages")) if(msg_haveMessages()) {
-               echo "<table>";
+               echo "<table bgcolor=\"#ddddff\">";
                $msgs = msg_getMessages();
                
                foreach($msgs as $msg) {
                        $msgtime = msg_toDate($msg["msgdate"]);
                        $msgcol = $msg["msgcolour"];
                        $msgtxt = $msg["msgtext"];
+                       $msgid = $msg["messages_id"];
                        
-                       echo "<tr><td><font color=\"$msgcol\">$msgtime - $msgtxt</font>";
+                       echo "<tr><td><font color=\"$msgcol\">$msgtime - $msgtxt</font></td>";
+                       echo "<td><a href=\"".urlCreate("/msg/acknowledge/$msgid")."\">Acknowledge</a></td></tr>";
                }
                echo "</table>";
        }