iconbar : mark active/inactive user with CSS
authorThierry Pasqualier <thierry@uncensored.citadel.org>
Mon, 9 Jul 2007 06:54:50 +0000 (06:54 +0000)
committerThierry Pasqualier <thierry@uncensored.citadel.org>
Mon, 9 Jul 2007 06:54:50 +0000 (06:54 +0000)
webcit/summary.c

index adc70ec5b1f20ded33e34402e6ad5489f76e722d..3809a822c6043c57b941a19f68c7c83616c223c4 100644 (file)
@@ -80,13 +80,23 @@ void new_messages_section(void) {
 void wholist_section(void) {
        char buf[SIZ];
        char user[SIZ];
+        time_t last_activity;
+        time_t now;
 
        serv_puts("RWHO");
        serv_getln(buf, sizeof buf);
        if (buf[0] == '1') while(serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
                extract_token(user, buf, 1, '|', sizeof user);
+                last_activity = extract_long(buf, 5);
                if (strcmp(user, NLI)) {
-                       wprintf("<li><a href=\"showuser?who=");
+                       wprintf("<li span=\"");
+                        if ((now - last_activity) > 900L) {
+                                wprintf("inactiveuser");
+                        }
+                        else {
+                                wprintf("activeuser");
+                        }
+                       wprintf("\"><a href=\"showuser?who=");
                        urlescputs(user);
                        wprintf("\">");
                        escputs(user);