summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rwxr-xr-xpages/admin.php65
-rwxr-xr-xpages/wiki.php179
-rwxr-xr-xtheme/admin/index.tpl6
-rwxr-xr-xtheme/admin/managePages.tpl23
-rwxr-xr-xtheme/admin/pageHistory.tpl23
-rwxr-xr-xtheme/admin/viewRevision.tpl5
-rwxr-xr-xtheme/wiki/create.tpl7
-rwxr-xr-xtheme/wiki/edit.tpl6
-rwxr-xr-xtheme/wiki/index.tpl6
-rwxr-xr-xtheme/wiki/page.tpl3
10 files changed, 0 insertions, 323 deletions
diff --git a/pages/admin.php b/pages/admin.php index 90b3d29..e0c8d3f 100755 --- a/pages/admin.php +++ b/pages/admin.php
@@ -502,71 +502,6 @@ if (isLoggedIn())
502 $template->add('BACK', 'the previous page'); 502 $template->add('BACK', 'the previous page');
503 $template->add('MSG', 'I\'m sorry, that comment doesn\'t exist.'); 503 $template->add('MSG', 'I\'m sorry, that comment doesn\'t exist.');
504 } 504 }
505 } else if ($_GET['page'] == 'managePages')
506 {
507 $template = new FITemplate('admin/managePages');
508
509 $getpages = "SELECT wiki_pages.*, wiki_revisions.author FROM wiki_pages, wiki_revisions WHERE wiki_revisions.id = wiki_pages.revision ORDER BY id ASC";
510 $getpages2 = mysql_query($getpages);
511 $i=0; $template = new FITemplate('msg');
512 $template->add('BACK', 'the previous page');
513 $template->add('MSG', 'I\'m sorry, but this page doesn\'t exist.');
514 while ($getpages3[$i] = mysql_fetch_array($getpages2))
515 {
516 $template->adds_block('PAGE', array( 'TITLE' => $getpages3[$i]['title'],
517 'AUTHOR' => $getpages3[$i]['author'],
518 'ID' => $getpages3[$i]['id'],
519 'CODED' => $getpages3[$i]['slug']));
520 $i++;
521 }
522 } else if ($_GET['page'] == 'pageHistory')
523 {
524 $getpage = "SELECT * FROM wiki_pages WHERE id = " . $_GET['id'] . " ORDER BY id ASC";
525 $getpage2 = mysql_query($getpage);
526 $getpage3 = mysql_fetch_array($getpage2);
527
528 if ($getpage3['id'] == $_GET['id'])
529 {
530 $template = new FITemplate('admin/pageHistory');
531
532 $getrev = "SELECT * FROM wiki_revisions WHERE id = " . $getpage3['revision'];
533 $getrev2 = mysql_query($getrev);
534 $getrev3 = mysql_fetch_array($getrev2);
535
536 $template->adds_block('REV', array( 'AUTHOR' => $getrev3['author'],
537 'DATE' => date("F dS Y \a\\t g:i:s a",strtotime($getrev3['pubDate'])),
538 'ID' => $getrev3['id']));
539
540 while ($getrev3['previous'] != 0)
541 {
542 $getrev = "SELECT * FROM wiki_revisions WHERE id = " . $getrev3['previous'];
543 $getrev2 = mysql_query($getrev);
544 $getrev3 = mysql_fetch_array($getrev2);
545
546 $template->adds_block('REV', array( 'AUTHOR' => $getrev3['author'],
547 'DATE' => date("F dS Y \a\\t g:i:s a",strtotime($getrev3['pubDate'])),
548 'ID' => $getrev3['id']));
549 }
550 } else {
551 $template = new FITemplate('msg');
552 $template->add('BACK', 'the previous page');
553 $template->add('MSG', 'I\'m sorry, but this page doesn\'t exist.');
554 }
555 } else if ($_GET['page'] == 'viewRevision')
556 {
557 $getrev = "SELECT * FROM wiki_revisions WHERE id = " . $_GET['id'];
558 $getrev2 = mysql_query($getrev);
559 $getrev3 = mysql_fetch_array($getrev2);
560
561 if ($getrev3['id'] == $_GET['id'])
562 {
563 $template = new FITemplate('admin/viewRevision');
564 $template->add('TEXT', $getrev3['text']);
565 } else {
566 $template = new FITemplate('msg');
567 $template->add('BACK', 'the previous page');
568 $template->add('MSG', 'I\'m sorry, but this revision doesn\'t exist.');
569 }
570 } else if ($_GET['page'] == 'pollProcess') 505 } else if ($_GET['page'] == 'pollProcess')
571 { 506 {
572 if (!isset($_GET['step'])) 507 if (!isset($_GET['step']))
diff --git a/pages/wiki.php b/pages/wiki.php deleted file mode 100755 index 3e5a410..0000000 --- a/pages/wiki.php +++ /dev/null
@@ -1,179 +0,0 @@
1<?php
2/*
3 444444444
4 4::::::::4
5 4:::::::::4
6 4::::44::::4
7 4::::4 4::::4 Four Island
8 4::::4 4::::4
9 4::::4 4::::4 Written and maintained by Starla Insigna
104::::444444::::444
114::::::::::::::::4 pages/wiki.php
124444444444:::::444
13 4::::4 Please do not use, reproduce or steal the
14 4::::4 contents of this file without explicit
15 4::::4 permission from Hatkirby.
16 44::::::44
17 4::::::::4
18 4444444444
19*/
20
21if (!defined('S_INCLUDE_FILE')) {define('S_INCLUDE_FILE',1);}
22
23require('headerproc.php');
24
25$pageCategory = 'wiki';
26
27$page = (isset($_GET['page']) ? $_GET['page'] : '');
28
29if (!isset($_GET['action']))
30{
31 $getpage = "SELECT * FROM wiki_pages WHERE slug = \"" . $page . "\"";
32 $getpage2 = mysql_query($getpage);
33 $getpage3 = mysql_fetch_array($getpage2);
34
35 if ($getpage3['slug'] == $page)
36 {
37 $getrev = "SELECT * FROM wiki_revisions WHERE id = " . $getpage3['revision'];
38 $getrev2 = mysql_query($getrev);
39 $getrev3 = mysql_fetch_array($getrev2);
40
41 $title = $getpage3['title'] . ' - Wiki';
42
43 $template = new FITemplate('wiki/page');
44 $template->add('TITLE', $getpage3['title']);
45 $template->add('CONTENT', parseBBCode($getrev3['text']));
46 $template->display();
47 } else {
48 if (isLoggedIn())
49 {
50 header('Location: ./?action=create');
51 exit;
52 } else {
53 $template = new FITemplate('msg');
54 $template->add('MSG', "The wiki page you are trying to access does not yet exist, and as you are not logged in, you cannot create it. If you would like to, why not log in and create this page?");
55 $template->add('BACK', "the previous page");
56 $template->display();
57 }
58 }
59} else if ($_GET['action'] == 'create')
60{
61 if (isLoggedIn())
62 {
63 $template = new FITemplate('wiki/create');
64 $template->display();
65 } else {
66 $template = new FITemplate('msg');
67 $template->add('MSG', "I'm sorry, but you are attempting to create a wiki page while you aren't logged in. Please log in and then return.");
68 $template->add('BACK', "the previous page");
69 $template->display();
70 }
71} else if ($_GET['action'] == 'edit')
72{
73 if (isLoggedIn())
74 {
75 $getpage = "SELECT * FROM wiki_pages WHERE slug = \"" . $page . "\"";
76 $getpage2 = mysql_query($getpage);
77 $getpage3 = mysql_fetch_array($getpage2);
78
79 if ($getpage3['slug'] == $page)
80 {
81 $getrev = "SELECT * FROM wiki_revisions WHERE id = " . $getpage3['revision'];
82 $getrev2 = mysql_query($getrev);
83 $getrev3 = mysql_fetch_array($getrev2);
84
85 $template = new FITemplate('wiki/edit');
86 $template->add('PAGENAME', $getpage3['title']);
87 $template->add('PAGETEXT', $getrev3['text']);
88 $template->display();
89 } else {
90 header('Location: ./?action=create');
91 exit;
92 }
93 } else {
94 $template = new FITemplate('msg');
95 $template->add('MSG', "I'm sorry, but you are attempting to edit a wiki page while you aren't logged in. Please log in and then return.");
96 $template->add('BACK', "the previous page");
97 $template->display();
98 }
99} else if ($_GET['action'] == 'submit')
100{
101 if (isLoggedIn())
102 {
103 if ($_GET['submit'] == 'create')
104 {
105 $insrev = "INSERT INTO wiki_revisions (author,text) VALUES (\"" . sess_get('uname') . "\",\"" . addslashes($_POST['text']) . "\")";
106 $insrev2 = mysql_query($insrev);
107
108 $getrev = "SELECT * FROM wiki_revisions WHERE author = \"" . sess_get('uname') . "\" AND text = \"" . addslashes($_POST['text']) . "\" ORDER BY id DESC LIMIT 0,1";
109 $getrev2 = mysql_query($getrev);
110 $getrev3 = mysql_fetch_array($getrev2);
111
112 $slug = generateSlug($_POST['title'],'wiki-pages');
113
114 $inspage = "INSERT INTO wiki_pages (title,slug,revision) VALUES (\"" . $_POST['title'] . "\",\"" . $slug . "\"," . $getrev3['id'] . ")";
115 $inspage2 = mysql_query($inspage);
116
117 $template = new FITemplate('msg2');
118 $template->add('MSG', 'YAY! You\'ve just created a page!');
119 $template->add('LINK', '/wiki/' . $slug . '/');
120 $template->add('BACK', 'View the page you just created');
121 $template->display();
122 } else if ($_GET['submit'] == 'edit')
123 {
124 $getpage = "SELECT * FROM wiki_pages WHERE slug = \"" . $_GET['page'] . "\"";
125 $getpage2 = mysql_query($getpage);
126 $getpage3 = mysql_fetch_array($getpage2);
127
128 $insrev = "INSERT INTO wiki_revisions (author,text,previous) VALUES (\"" . sess_get('uname') . "\",\"" . addslashes($_POST['text']) . "\"," . $getpage3['revision'] . ")";
129 $insrev2 = mysql_query($insrev);
130
131 $getrev4 = "SELECT * FROM wiki_revisions WHERE author = \"" . sess_get('uname') . "\" AND text = \"" . addslashes($_POST['text']) . "\" AND previous = " . $getpage3['revision'] . " ORDER BY id DESC LIMIT 0,1";
132 $getrev5 = mysql_query($getrev4);
133 $getrev6 = mysql_fetch_array($getrev5);
134
135 $setpage = "UPDATE wiki_pages SET revision = " . $getrev6['id'] . " WHERE revision = " . $getpage3['revision'];
136 $setpage2 = mysql_query($setpage);
137
138 $template = new FITemplate('msg2');
139 $template->add('MSG', 'YAY! You\'ve just edited a page!');
140 $template->add('LINK', './');
141 $template->add('BACK', 'View the page you just edited');
142 $template->display();
143 }
144 } else {
145 $template = new FITemplate('msg');
146 $template->add('MSG', "I'm sorry, but you are attempting to edit a wiki page while you aren't logged in. Please log in and then return.");
147 $template->add('BACK', "the previous page");
148 $template->display();
149 }
150} else if ($_GET['action'] == 'index')
151{
152 $template = new FITemplate('wiki/index');
153 $getpages = "SELECT * FROM wiki_pages, wiki_revisions WHERE wiki_revisions.id = wiki_pages.revision ORDER BY title ASC";
154 $getpages2 = mysql_query($getpages);
155 $i=0;
156 $lastLetter='';
157 while ($getpages3[$i] = mysql_fetch_array($getpages2))
158 {
159 if (substr($getpages3[$i]['title'],0,1) != $lastLetter)
160 {
161 if (!isset($curID))
162 {
163 $curID = 0;
164 } else {
165 $curID++;
166 }
167 $template->add_ref($curID, 'LETTER', array('TITLE' => substr($getpages3[$i]['title'],0,1)));
168 $lastLetter = substr($getpages3[$i]['title'],0,1);
169 }
170
171 $template->adds_ref_sub($curID, 'PAGE', array( 'TITLE' => $getpages3[$i]['title'],
172 'CODED' => ($getpages3[$i]['slug'] != '' ? $getpages3[$i]['slug'] . '/' : ''),
173 'DATE' => date('m-d-y',strtotime($getpages3[$i]['pubDate']))));
174 $i++;
175 }
176 $template->display();
177}
178
179?>
diff --git a/theme/admin/index.tpl b/theme/admin/index.tpl index f886f2d..c39a380 100755 --- a/theme/admin/index.tpl +++ b/theme/admin/index.tpl
@@ -12,12 +12,6 @@ Welcome to the ubiquitous administration panel!<P>
12 <LI><A HREF="/admin/moderateComments.php">Moderate Comments</A></LI> 12 <LI><A HREF="/admin/moderateComments.php">Moderate Comments</A></LI>
13</UL> 13</UL>
14 14
15<H3>Wiki</H3>
16
17<UL>
18 <LI><A HREF="/admin/managePages.php">Manage Pages</A></LI>
19</UL>
20
21<H3>Poll</H3> 15<H3>Poll</H3>
22 16
23<UL> 17<UL>
diff --git a/theme/admin/managePages.tpl b/theme/admin/managePages.tpl deleted file mode 100755 index eef8c75..0000000 --- a/theme/admin/managePages.tpl +++ /dev/null
@@ -1,23 +0,0 @@
1<H2>Manage Pages</H2>
2
3<TABLE WIDTH="100%" CLASS="webmail">
4 <TR>
5 <TH>Page Title</TH>
6 <TH>Revision Author</TH>
7 <TH>Actions</TH>
8 </TR>
9
10 <!--BEGIN PAGE-->
11 <TR>
12 <TD><!--PAGE.TITLE--></TD>
13 <TD><!--PAGE.AUTHOR--></TD>
14
15 <TD>
16 <A HREF="/admin/pageHistory.php?id=<!--PAGE.ID-->"><IMG SRC="/theme/images/icons/page_edit.png" ALT="View History"></A>
17 <A HREF="/wiki/<!--PAGE.CODED-->/"><IMG SRC="/theme/images/icons/page_go.png" ALT="View"></A>
18 </TD>
19 </TR>
20 <!--END PAGE-->
21</TABLE>
22
23<A HREF="/admin/">Back to Admin Panel</A>
diff --git a/theme/admin/pageHistory.tpl b/theme/admin/pageHistory.tpl deleted file mode 100755 index b5fd326..0000000 --- a/theme/admin/pageHistory.tpl +++ /dev/null
@@ -1,23 +0,0 @@
1<H2>Page History</H2>
2
3<TABLE WIDTH="100%" CLASS="webmail">
4 <TR>
5 <TH>Revision Author</TH>
6 <TH>Revision Date</TH>
7 <TH>Actions</TH>
8 </TR>
9
10 <!--BEGIN REV-->
11 <TR>
12 <TD><!--REV.AUTHOR--></TD>
13 <TD><!--REV.DATE--></TD>
14
15 <TD>
16 <A HREF="/admin/viewRevision.php?id=<!--REV.ID-->"><IMG SRC="/theme/images/icons/page_go.png" ALT="View"></A>
17 </TD>
18 </TR>
19 <!--END REV-->
20</TABLE>
21
22<A HREF="/admin/managePages.php">Back to Manage Pages</A><BR>
23<A HREF="/admin/">Back to Admin Panel</A>
diff --git a/theme/admin/viewRevision.tpl b/theme/admin/viewRevision.tpl deleted file mode 100755 index fc6fc83..0000000 --- a/theme/admin/viewRevision.tpl +++ /dev/null
@@ -1,5 +0,0 @@
1<!--TEXT-->
2<P>
3<A HREF="javascript:history.back()">Back to Page History</A>
4<A HREF="/admin/managePages.php">Back to Manage Pages</A><BR>
5<A HREF="/admin/">Back to Admin Panel</A>
diff --git a/theme/wiki/create.tpl b/theme/wiki/create.tpl deleted file mode 100755 index ecd2d6b..0000000 --- a/theme/wiki/create.tpl +++ /dev/null
@@ -1,7 +0,0 @@
1<H2>Create a page</H2><P>
2
3<FORM ACTION="./?action=submit&submit=create" METHOD="POST">
4 Page Title: <INPUT TYPE="text" NAME="title"><BR>
5 <TEXTAREA NAME="text" COLS="80" ROWS="20"></TEXTAREA><P>
6 <INPUT TYPE="submit" VALUE="Create page">
7</FORM>
diff --git a/theme/wiki/edit.tpl b/theme/wiki/edit.tpl deleted file mode 100755 index 12d2deb..0000000 --- a/theme/wiki/edit.tpl +++ /dev/null
@@ -1,6 +0,0 @@
1<H2>Edit <!--PAGENAME--></H2><P>
2
3<FORM ACTION="./?action=submit&submit=edit" METHOD="POST">
4 <TEXTAREA NAME="text" COLS="80" ROWS="20"><!--PAGETEXT--></TEXTAREA><P>
5 <INPUT TYPE="submit" VALUE="Edit page">
6</FORM>
diff --git a/theme/wiki/index.tpl b/theme/wiki/index.tpl deleted file mode 100755 index ed4e513..0000000 --- a/theme/wiki/index.tpl +++ /dev/null
@@ -1,6 +0,0 @@
1<!--BEGIN LETTER-->
2<H3 STYLE="clear: both; display: block; margin-bottom: 0"><!--LETTER.TITLE--></H2>
3 <!--BEGIN LETTER.PAGE-->
4 <SMALL><SPAN STYLE="margin-left: 50"><!--LETTER.PAGE.DATE--> | <A HREF="/wiki/<!--LETTER.PAGE.CODED-->"><!--LETTER.PAGE.TITLE--></A></SPAN></SMALL><BR>
5 <!--END LETTER.PAGE-->
6<!--END LETTER-->
diff --git a/theme/wiki/page.tpl b/theme/wiki/page.tpl deleted file mode 100755 index b021e95..0000000 --- a/theme/wiki/page.tpl +++ /dev/null
@@ -1,3 +0,0 @@
1<H2><!--TITLE--></H2><P>
2
3<!--CONTENT-->