ChrPtr(Wikipage),
ChrPtr(my_email_addr),
ChrPtr(references));
+ FreeStrBuf(&references);
lprintf(9, "%s\n", CmdBuf);
serv_puts(ChrPtr(CmdBuf));
wprintf("<FORM METHOD=\"POST\" action=\"page_user\">\n");
wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%d\">\n", WC->nonce);
+ wprintf("<input type=\"hidden\" name=\"template\" value=\"who\">\n");
wprintf("<TABLE border=0 width=100%%><TR><TD>\n");
}
}
- who();
+ url_do_template();
}
<div id="content" class="fix_scrollbar_bug who_is_online">
<?DOBOXED("wholiststatic", "wholiststatic_header")>
</div>
+<script type="text/javascript">
+ new Ajax.PeriodicalUpdater('do_template', 'template=wholiststatic',
+ { method: 'get', frequency: 30 } );
+</script>
<?=trailing>
<img align="middle" src="static/citadelchat_16x.gif" alt="(p)" border="0">
<?_("to send an instant message to that user.")>
</div>
-<script type="text/javascript">
- new Ajax.PeriodicalUpdater('who_inner', 'who_inner_html',
- { method: 'get', frequency: 30 } );
-</script>
--- /dev/null
+<table class="altern">
+ <tr>
+ <th></th>
+ <th></th>
+ <th><?_("User name")></th>
+ <th><?_("Room")></th>
+</tr>
+<?ITERATE("WHOLIST", "whosummarysection")>
+</table>
<tr class="<?ITERATE:ODDEVEN>">
<td class="edit_col">
<?!("COND:AIDE", 1)><??("COND:SUBST", 2, "WHO:ISME")>
- <a href="terminate_session?which_session=<?WHO:SESSION>" onClick="return ConfirmKill();"><?_("(kill)")</a>
+ <a href="terminate_session?which_session=<?WHO:SESSION>&template=who" onClick="return ConfirmKill();"><?_("(kill)")</a>
<??("X", 2)><??("X", 1)>
<?!("COND:SUBST", 3, "WHO:ISME")> <a href="edit_me">(<?_("edit")>)</a> <?!("X", 3)>
</td>
-<li class="<?!("COND:SUBST", 4, "WHO:IDLE")>activeuser<?!("X", 4)><??("COND:SUBST", 5, "WHO:IDLE")>inactiveuser<?!("X", 5)>"><a href="showuser?who=<?WHO:NAME("U")>"><?WHO:NAME("U")</a></li>
+<li class="<??("COND:SUBST", 4, "WHO:IDLE")>activeuser<?!("X", 4)><?!("COND:SUBST", 5, "WHO:IDLE")>inactiveuser<?!("X", 5)>"><a href="showuser?who=<?WHO:NAME("U")>"><?WHO:NAME("U")</a></li>
--- /dev/null
+<tr class="<?ITERATE:ODDEVEN>">
+<!-- link to page this user -->
+<td width="5%%"><a href="display_page?recp=<?WHO:NAME("X")>">
+ <img align="middle" src="static/citadelchat_24x.gif" alt="(p)" border="0" /></a>
+</td>
+<!-- idle flag --->
+<td width="5%%">
+<?!("COND:SUBST", 4, "WHO:IDLE")> <img align="middle" src="static/inactiveuser_24x.gif" alt="(<?_("idle since")>s <?WHO:IDLESINCE> <?_("Minutes")>)" border="0" /> <?!("X", 4)>
+<??("COND:SUBST", 5, "WHO:IDLE")> <img align="middle" src="static/activeuser_24x.gif" alt="(<?_("active")>)" border="0" /> <?!("X", 5)>
+</td>
+<td>
+<!-- username (link to user bio/photo page) -->
+<a href="showuser?who=<?WHO:NAME("U")>"> <?WHO:NAME("U")></a>
+<?!("COND:SUBST", 6, "WHO:NSESSIONS", 1)>[<?WHO:NSESSIONS>] </a><?!("X", 6)>
+<!-- room -->
+</td><td>
+<?WHO:ROOM>
+<?!("WHO:REALROOM", 7> <br /><i> <?WHO:REALROOM("X")> </i> <?!("X", 7)>
+</td>
+</tr>
wprintf(_("Who's online now"));
wprintf("</div><div class=\"boxcontent\">");
wprintf("<div id=\"who_inner\">");
- who_inner_div();
+ do_template("wholistsummarysection", NULL);
wprintf("</div></div></div>");
wprintf("</td>");
" { method: 'get', frequency: 120 } ); "
" new Ajax.PeriodicalUpdater('calendar_inner', 'calendar_inner_html', "
" { method: 'get', frequency: 90 } ); "
- " new Ajax.PeriodicalUpdater('who_inner', 'who_inner_html', "
+ " new Ajax.PeriodicalUpdater('do_template', 'template=wholistsummarysection', "
" { method: 'get', frequency: 30 } ); "
"</script> \n"
);
char buf[256];
off_t bytes;
char content_type[256];
- char *content = NULL;
serv_printf("OPNA %s|%s", msgnum, partnum);
serv_getln(buf, sizeof buf);
if (buf[0] == '2') {
bytes = extract_long(&buf[4], 0);
- content = malloc(bytes + 2);
if (force_download) {
strcpy(content_type, "application/octet-stream");
}
wprintf(_("An error occurred while retrieving this part: %s\n"), &buf[4]);
end_burst();
}
-
}
else {
return(NULL);
}
-
}
void pullquote_fmout(void);
void wDumpContent(int);
-
/* These may return NULL if not foud */
#define sbstr(a) SBstr(a, sizeof(a) - 1)
const StrBuf *SBSTR(const char *key);
void DoTemplate(const char *templatename, long len, void *Context, StrBuf *Target);
#define do_template(a, b) DoTemplate(a, sizeof(a) -1, b, NULL);
+void url_do_template(void);
int lingering_close(int fd);
/*
* Display inner div of Wholist
- */
+ * /
void who_inner_div(void) {
UserStateStruct *User;
void *VUser;
char buf[SIZ];
- struct wcsession *WCC = WC; /* This is done to make it run faster; WC is a function */
+ struct wcsession *WCC = WC;
HashList *List;
HashPos *it;
const char *UserName;
long len;
time_t now;
int bg = 0;
-
wprintf("<table class=\"altern\">"
"<tr>\n");
wprintf("<th class=\"edit_col\"> </th>\n");
}
wprintf("</td>");
- /* (link to page this user) */
+ / * (link to page this user) * /
wprintf("<td width=\"5%%\"><a href=\"display_page?recp=");
UrlescPutStrBuf(User->UserName);
wprintf("\">"
" border=\"0\" /></a> ");
wprintf("</td>");
- /* (idle flag) */
+ / * (idle flag) * /
wprintf("<td width=\"5%%\">");
if (User->Idle) {
wprintf(" "
}
wprintf("</td>\n<td>");
- /* username (link to user bio/photo page) */
+ / * username (link to user bio/photo page) * /
wprintf("<a href=\"showuser?who=");
UrlescPutStrBuf(User->UserName);
wprintf("\">");
wprintf(" [%d] ", User->SessionCount);
wprintf("</a>");
- /* room */
+ / * room * /
wprintf("</td>\n\t<td>");
StrEscPuts(User->Room);
if (StrLength(User->RealRoom) > 0) {
}
wprintf("</td>\n\t<td class=\"host_col\">");
- /* hostname */
+ / * hostname * /
StrEscPuts(User->Host);
if (StrLength(User->RealHost) > 0) {
wprintf("<br /><i>");
}
wprintf("</table>");
DeleteHash(&List);
-
}
+*/
/*
* Display a list of users currently logged in to the system
- */
+ * /
void who(void)
{
char title[256];
);
wprintf("</div></div>\n");
- /*
+ / *
* JavaScript to make the ajax refresh happen:
* See http://www.sergiopereira.com/articles/prototype.js.html for info on Ajax.PeriodicalUpdater
* It wants: 1. The div being updated
* 2. The URL of the update source
* 3. Other flags (such as the HTTP method and the refresh frequency)
- */
+ * /
wprintf(
"<script type=\"text/javascript\"> "
" new Ajax.PeriodicalUpdater('who_inner', 'who_inner_html', "
);
wDumpContent(1);
}
+*/
/*
* end session
serv_printf("TERM %s", bstr("which_session"));
serv_getln(buf, sizeof buf);
- who();
+ ///who();
+ url_do_template();
}
/*
* Wholist section
- */
+ * /
void wholist_section(void) {
UserStateStruct *User;
void *VUser;
}
DeleteHash(&List);
}
+*/
void _terminate_session(void) {
slrp_highest();
InitModule_WHO
(void)
{
- WebcitAddUrlHandler(HKEY("who"), who, 0);
- WebcitAddUrlHandler(HKEY("who_inner_html"), who_inner_div, AJAX);
- WebcitAddUrlHandler(HKEY("wholist_section"), wholist_section, AJAX);
+/// WebcitAddUrlHandler(HKEY("who"), who, 0);
+// WebcitAddUrlHandler(HKEY("who_inner_html"), who_inner_div, AJAX);
+// WebcitAddUrlHandler(HKEY("wholist_section"), wholist_section, AJAX);
WebcitAddUrlHandler(HKEY("terminate_session"), _terminate_session, 0);
WebcitAddUrlHandler(HKEY("edit_me"), edit_me, 0);