summary refs log tree commit diff stats
path: root/pages
diff options
context:
space:
mode:
authorStarla Insigna <hatkirby@fourisland.com>2008-11-19 20:46:07 -0500
committerStarla Insigna <hatkirby@fourisland.com>2008-11-19 20:46:07 -0500
commit51337807124d7f57d6cff6656d41b5fd57010c6b (patch)
tree1e620e6e10c6deed4715d1f0615b81f71f53280c /pages
parentc8551e2509fe68c77b0efe9b22f4dbadff981473 (diff)
downloadfourisland-51337807124d7f57d6cff6656d41b5fd57010c6b.tar.gz
fourisland-51337807124d7f57d6cff6656d41b5fd57010c6b.tar.bz2
fourisland-51337807124d7f57d6cff6656d41b5fd57010c6b.zip
Removed 'wiki' module
Since MediaWiki was introduced to Four Island, the old wiki module hasn't been used, so it is not necessary to be present.
Diffstat (limited to 'pages')
-rwxr-xr-xpages/admin.php65
-rwxr-xr-xpages/wiki.php179
2 files changed, 0 insertions, 244 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?>