summary refs log tree commit diff stats
path: root/pages/comic.php
diff options
context:
space:
mode:
Diffstat (limited to 'pages/comic.php')
-rwxr-xr-xpages/comic.php177
1 files changed, 0 insertions, 177 deletions
diff --git a/pages/comic.php b/pages/comic.php deleted file mode 100755 index 103cb17..0000000 --- a/pages/comic.php +++ /dev/null
@@ -1,177 +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/comic.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
27if (isset($_GET['comic']))
28{
29 $template = new FITemplate('comic');
30 $template->adds_block('INTERNAL',array('exi'=>1));
31
32 $getcomic = "SELECT * FROM comic WHERE slug = \"" . urldecode($_GET['comic']) . "\"";
33 $getcomic2 = mysql_query($getcomic);
34 $getcomic3 = mysql_fetch_array($getcomic2);
35
36 if ($getcomic3['slug'] == urldecode($_GET['comic']))
37 {
38 $title = stripslashes($getcomic3['title']) . ' - Kirby Fan Mail';
39
40 $getback = "SELECT * FROM comic WHERE id = " . ($getcomic3['id']-1);
41 $getback2 = mysql_query($getback);
42 $getback3 = mysql_fetch_array($getback2);
43 if (isset($getback3['title']))
44 {
45 $template->adds_block('BACK', array( 'CODED' => $getback3['slug'],
46 'TITLE' => $getback3['title']));
47 }
48
49 $getnext = "SELECT * FROM comic WHERE id = " . ($getcomic3['id']+1);
50 $getnext2 = mysql_query($getnext);
51 $getnext3 = mysql_fetch_array($getnext2);
52 if (isset($getnext3['title']))
53 {
54 $template->adds_block('NEXT', array( 'CODED' => $getnext3['slug'],
55 'TITLE' => $getnext3['title']));
56 }
57
58 if (stripos($getcomic3['image'], 'gif') !== FALSE)
59 {
60 $mode = 'scalegif';
61 } else {
62 $mode = 'scale';
63 }
64
65 $template->adds_block('COMIC', array( 'ID' => $getcomic3['id'],
66 'YEARID' => ((date('Y',strtotime($getcomic3['pubDate']))-2006) % 4),
67 'DATE' => date('F dS Y \a\\t g:i:s a',strtotime($getcomic3['pubDate'])),
68 'MONTH' => date('M',strtotime($getcomic3['pubDate'])),
69 'DAY' => date('d',strtotime($getcomic3['pubDate'])),
70 'CODED' => $getcomic3['slug'],
71 'TITLE' => $getcomic3['title'],
72 'RATING' => $getcomic3['rating'],
73 'TEXT' => parseBBCode($getcomic3['text']),
74 'IMAGE' => $getcomic3['image'],
75 'MODE' => $mode));
76
77 $template->display();
78 $page_id = 'kfm-' . $getcomic3['id'];
79 include('includes/comments.php');
80
81 $getrelated = "SELECT *, MATCH (title, text) AGAINST (\"" . addslashes($getcomic3['title']) . "\") AS score FROM comic WHERE MATCH (title, text) AGAINST (\"" . addslashes($getcomic3['title']) . "\") AND id <> " . $getcomic3['id'] . " LIMIT 0,5";
82 $getrelated2 = mysql_query($getrelated);
83 $i=0;
84 while ($getrelated3[$i] = mysql_fetch_array($getrelated2))
85 {
86 if ($i==0)
87 {
88 $template = new FITemplate('related');
89 }
90
91 $template->adds_block('POST', array( 'TITLE' => $getrelated3[$i]['title'],
92 'CODED' => $getrelated3[$i]['slug'],
93 'AUTHOR' => 'Hatkirby',
94 'DATE' => date('F d<\S\U\P>S</\S\U\P> Y',strtotime($getrelated3[$i]['pubDate']))));
95 $i++;
96 }
97
98 if ($i > 0)
99 {
100 $template->display();
101 }
102 } else {
103 generateError('404');
104 }
105} else {
106 $template = new FITemplate('comicarchive');
107 $title = 'Kirby Fan Mail';
108 $getcomics = "SELECT * FROM comic ORDER BY id DESC";
109 $getcomics2 = mysql_query($getcomics);
110 $i=0;
111 while ($getcomics3[$i] = mysql_fetch_array($getcomics2))
112 {
113 if ((!isset($lastmonth)) || ($lastmonth != date('m-Y',strtotime($getcomics3[$i]['pubDate']))))
114 {
115 if (!isset($curID))
116 {
117 $curID = 0;
118 } else {
119 $curID++;
120 }
121 $template->add_ref($curID, 'MONTH', array('TITLE' => date('F Y',strtotime($getcomics3[$i]['pubDate']))));
122 if ($curID == 0)
123 {
124 $template->adds_ref_sub($curID, 'BIGEND',array('exi'=>1));
125 }
126 $lastmonth = date('m-Y',strtotime($getcomics3[$i]['pubDate']));
127 }
128
129 $page_id = 'kfm-' . $getcomics3[$i]['id'];
130 $getcomments = "SELECT * FROM comments WHERE page_id = \"" . $page_id . "\" ORDER BY posttime";
131 $getcomments2 = mysql_query($getcomments);
132 $total_post=0;
133 while ($getcomments3[$total_post] = mysql_fetch_array($getcomments2))
134 {
135 $total_post++;
136 }
137 if ($total_post >= 2)
138 {
139 $plural = 's';
140 }
141 if ($total_post == 0)
142 {
143 $comText = 'No Comments';
144 } elseif ($total_post == 1)
145 {
146 $comText = '1 Comment';
147 } else {
148 $comText = $total_post . ' Comments';
149 }
150
151 if ($curID == 0)
152 {
153 $template->adds_ref_sub($curID, 'BIG',array( 'DATE' => date('m-d-Y',strtotime($getcomics3[$i]['pubDate'])),
154 'CODED' => $getcomics3[$i]['slug'],
155 'TITLE' => $getcomics3[$i]['title'],
156 'ID' => $getcomics3[$i]['id'],
157 'YEARID' => ((date('Y',strtotime($getcomics3[$i]['pubDate']))-2006) % 4),
158 'MONTH' => date('M',strtotime($getcomics3[$i]['pubDate'])),
159 'DAY' => date('d',strtotime($getcomics3[$i]['pubDate'])),
160 'AUTHOR' => 'Hatkirby',
161 'PLURALCOMMENT' => (isset($plural) ? $plural : ''),
162 'COMMENTS' => $comText));
163 } else {
164 $template->adds_ref_sub($curID, 'SMALL',array( 'DATE' => date('m-d-Y',strtotime($getcomics3[$i]['pubDate'])),
165 'CODED' => $getcomics3[$i]['slug'],
166 'TITLE' => $getcomics3[$i]['title']));
167 }
168 $i++;
169 }
170 if ($i==0)
171 {
172 generateError('404');
173 }
174 $template->display();
175}
176
177?>