From 9f33314bbdefcb239a5f7b7ed44aa470f12fe78b Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sat, 21 Jan 2006 21:24:26 +0000 Subject: [PATCH] wiki --- webcit/messages.c | 2 +- webcit/webcit.c | 2 +- webcit/webcit.h | 2 +- webcit/wiki.c | 22 +++++++++++++++++----- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/webcit/messages.c b/webcit/messages.c index 0009f6b9c..b80520fd7 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -1861,7 +1861,7 @@ void readloop(char *oper) int bbs_reverse = 0; if (WC->wc_view == VIEW_WIKI) { - sprintf(buf, "wiki/%s/home", WC->wc_roomname); + sprintf(buf, "wiki?room=%s?page=home", WC->wc_roomname); http_redirect(buf); return; } diff --git a/webcit/webcit.c b/webcit/webcit.c index b702b3f62..566720800 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -1328,7 +1328,7 @@ void session_loop(struct httprequest *req) } else if (!strcasecmp(action, "msgheaders")) { display_headers(arg1); } else if (!strcasecmp(action, "wiki")) { - display_wiki_page(arg1, arg2); + display_wiki_page(); } else if (!strcasecmp(action, "display_enter")) { display_enter(); } else if (!strcasecmp(action, "post")) { diff --git a/webcit/webcit.h b/webcit/webcit.h index 06f1b820b..296cef730 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -658,7 +658,7 @@ void httplang_to_locale(char *LocaleString); void tabbed_dialog(int num_tabs, char *tabnames[]); void begin_tab(int tabnum, int num_tabs); void end_tab(int tabnum, int num_tabs); -void display_wiki_page(char *roomname, char *pagename); +void display_wiki_page(void); void embed_room_banner(char *, int); diff --git a/webcit/wiki.c b/webcit/wiki.c index dc72dba05..dd5f2138d 100644 --- a/webcit/wiki.c +++ b/webcit/wiki.c @@ -38,16 +38,28 @@ void str_wiki_index(char *s) /** * \brief Display a specific page from a wiki room - * - * \param roomname The name of the room containing the wiki - * \param pagename The index of the page being requested */ -void display_wiki_page(char *roomname, char *pagename) +void display_wiki_page(void) { - output_headers(1, 1, 1, 0, 0, 0); + char roomname[128]; + char pagename[128]; + + safestrncpy(roomname, bstr("room"), sizeof roomname); + safestrncpy(pagename, bstr("page"), sizeof pagename); + str_wiki_index(pagename); wprintf("roomname=%s
pagename=%s
\n", roomname, pagename); + if (strcasecmp(roomname, WC->roomname)) { + gotoroom(roomname); + } + + if (strcasecmp(roomname, WC->roomname)) { + /* can't find the room */ + convenience_page(char *titlebarcolor, char *titlebarmsg, char *messagetext); + } + + output_headers(1, 1, 1, 0, 0, 0); wDumpContent(1); } -- 2.30.2