* ctdlprotocol.php: known room list fetch now sets subscript "hasnewmsgs"
authorArt Cancro <ajc@citadel.org>
Fri, 7 Nov 2003 15:56:13 +0000 (15:56 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 7 Nov 2003 15:56:13 +0000 (15:56 +0000)
* listrooms.php: render rooms with unseen messages in boldface

ctdlphp/ChangeLog
ctdlphp/ctdlprotocol.php
ctdlphp/listrooms.php

index d90b7c92604651885e962417f25c5cfd275be59d..f9976427ef4a42fe5af0f446f28cc523ecefa460 100644 (file)
@@ -1,4 +1,8 @@
  $Log$
+ Revision 1.14  2003/11/07 15:56:13  ajc
+ * ctdlprotocol.php: known room list fetch now sets subscript "hasnewmsgs"
+ * listrooms.php: render rooms with unseen messages in boldface
+
  Revision 1.13  2003/11/05 03:29:12  ajc
  * Added a room list function to the library
  * Threw together temporary room list and goto pages to demonstrate
@@ -57,4 +61,3 @@
 
  Revision 1.1  2003/10/31 03:47:13  ajc
  * Initial CVS import
-
index 0463ad5125e8accb647755c79e0ba2b855889936..a15686f3529ed4b6718579e610ea10a8620e4c20 100644 (file)
@@ -269,6 +269,13 @@ function ctdl_knrooms() {
                $tok = strtok("|");
                if ($tok) $thisline["access"] = $tok;
 
+               if ($thisline["access"] & 8) {
+                       $thisline["hasnewmsgs"] = TRUE;
+               }
+               else {
+                       $thisline["hasnewmsgs"] = FALSE;
+               }
+
                $num_lines = array_push($all_lines, $thisline);
        }
 
index 9920c4636e619d9f76bbf7aceee421483df966ab..37e5ac38a7f867289fa328a8d61e7d462d1d05a4 100644 (file)
        list($num_rooms, $roomlist) = ctdl_knrooms();
 
        if ($num_rooms > 0) foreach ($roomlist as $x) {
-               echo '<LI><A HREF="goto.php?towhere=' .
+               echo '<LI>';
+               if ($x["hasnewmsgs"]) echo '<B>';
+               echo '<A HREF="goto.php?towhere=' .
                        urlencode($x["name"]) . '">' .
-                       htmlspecialchars($x["name"]) . "</A></LI>\n" ;
+                       htmlspecialchars($x["name"]) . "</A>" ;
+               if ($x["hasnewmsgs"]) echo '</B>';
+               echo "</LI>\n" ;
        }
 ?>