* Started writing wiki code. It completely does not work. :)
[citadel.git] / webcit / wiki.c
1 /*
2  * $Id:  $
3  */
4 /**
5  *
6  * \defgroup Wiki Wiki; Functions pertaining to rooms with a wiki view
7  *
8  */
9
10 /*@{*/
11 #include "webcit.h"
12
13
14
15 /** 
16  * \brief Convert a string to something suitable as a wiki index
17  *
18  * \param s The string to be converted.
19  */
20 void str_wiki_index(char *s)
21 {
22         int i;
23
24         if (s == NULL) return;
25
26         /* First remove all non-alphanumeric characters */
27         for (i=0; i<strlen(s); ++i) {
28                 if (!isalnum(s[i])) {
29                         strcpy(&s[i], &s[i+1]);
30                 }
31         }
32
33         /* Then make everything lower case */
34         for (i=0; i<strlen(s); ++i) {
35                 s[i] = tolower(s[i]);
36         }
37 }
38
39 /**
40  * \brief Display a specific page from a wiki room
41  *
42  * \param roomname The name of the room containing the wiki
43  * \param pagename The index of the page being requested
44  */
45 void display_wiki_page(char *roomname, char *pagename)
46 {
47         output_headers(1, 1, 1, 0, 0, 0);
48
49         wprintf("roomname=%s<br>pagename=%s<br>\n", roomname, pagename);
50
51         wDumpContent(1);
52 }
53
54
55 /** @} */