summary refs log tree commit diff stats
path: root/pages
diff options
context:
space:
mode:
authorStarla Insigna <hatkirby@fourisland.com>2008-12-14 09:39:10 -0500
committerStarla Insigna <hatkirby@fourisland.com>2008-12-14 09:39:10 -0500
commit9cb1fcba82027daa21eb457f1b2912ee02e5c7eb (patch)
treeb9ad822ca0f186f42da00e1a2c882ede77d2ee14 /pages
parentf037e1d6baa069b324b7a0fd6eaffbdfb5c6f4dc (diff)
downloadfourisland-9cb1fcba82027daa21eb457f1b2912ee02e5c7eb.tar.gz
fourisland-9cb1fcba82027daa21eb457f1b2912ee02e5c7eb.tar.bz2
fourisland-9cb1fcba82027daa21eb457f1b2912ee02e5c7eb.zip
Major design and code overhaul
I don't know, a lot of stuffses happened that I don't quite remember anymore. Goodness, that's not good.
Diffstat (limited to 'pages')
-rwxr-xr-xpages/blog.php49
-rwxr-xr-xpages/login.php2
-rwxr-xr-xpages/poll.php60
-rwxr-xr-xpages/quotes.php4
4 files changed, 59 insertions, 56 deletions
diff --git a/pages/blog.php b/pages/blog.php index f99ad17..d55f9a4 100755 --- a/pages/blog.php +++ b/pages/blog.php
@@ -106,27 +106,7 @@ if (isset($_GET['post']))
106 $page_id = 'updates-' . $getpost3['id']; 106 $page_id = 'updates-' . $getpost3['id'];
107 include('includes/comments.php'); 107 include('includes/comments.php');
108 108
109 $getrelated = "SELECT *, MATCH (title, text) AGAINST (\"" . addslashes($getpost3['title']) . "\") AS score FROM updates WHERE MATCH (title, text) AGAINST (\"" . addslashes($getpost3['title']) . "\") AND id <> " . $getpost3['id'] . " LIMIT 0,5"; 109 displayRelated($getpost3['title'], $getpost3['id']);
110 $getrelated2 = mysql_query($getrelated);
111 $i=0;
112 while ($getrelated3[$i] = mysql_fetch_array($getrelated2))
113 {
114 if ($i==0)
115 {
116 $template = new FITemplate('related');
117 }
118
119 $template->adds_block('POST', array( 'TITLE' => $getrelated3[$i]['title'],
120 'CODED' => $getrelated3[$i]['slug'],
121 'AUTHOR' => $getrelated3[$i]['author'],
122 'DATE' => date('F d<\S\U\P>S</\S\U\P> Y',strtotime($getrelated3[$i]['pubDate']))));
123 $i++;
124 }
125
126 if ($i > 0)
127 {
128 $template->display();
129 }
130 } else { 110 } else {
131 generateError('404'); 111 generateError('404');
132 } 112 }
@@ -135,6 +115,7 @@ if (isset($_GET['post']))
135 if (isset($_GET['author'])) 115 if (isset($_GET['author']))
136 { 116 {
137 $title = 'Author: ' . $_GET['author'] . ' - Blog Archive'; 117 $title = 'Author: ' . $_GET['author'] . ' - Blog Archive';
118 $template->add('HEADER', 'Posts by ' . $_GET['author']);
138 $getposts = "SELECT * FROM updates AS u WHERE author = \"" . $_GET['author'] . "\" ORDER BY id DESC"; 119 $getposts = "SELECT * FROM updates AS u WHERE author = \"" . $_GET['author'] . "\" ORDER BY id DESC";
139 $getbio = "SELECT * FROM bio WHERE username = \"" . $_GET['author'] . "\""; 120 $getbio = "SELECT * FROM bio WHERE username = \"" . $_GET['author'] . "\"";
140 $getbio2 = mysql_query($getbio); 121 $getbio2 = mysql_query($getbio);
@@ -148,9 +129,11 @@ if (isset($_GET['post']))
148 } elseif (isset($_GET['tag'])) 129 } elseif (isset($_GET['tag']))
149 { 130 {
150 $title = 'Tag: ' . $_GET['tag'] . ' - Blog Archive'; 131 $title = 'Tag: ' . $_GET['tag'] . ' - Blog Archive';
132 $template->add('HEADER', 'Posts tagged with ' . $_GET['tag']);
151 $getposts = "SELECT * FROM updates AS u, tags AS t WHERE u.id = t.post_id AND t.post_type = \"published\" AND t.tag = \"" . $_GET['tag'] . "\" ORDER BY u.id DESC"; 133 $getposts = "SELECT * FROM updates AS u, tags AS t WHERE u.id = t.post_id AND t.post_type = \"published\" AND t.tag = \"" . $_GET['tag'] . "\" ORDER BY u.id DESC";
152 } else { 134 } else {
153 $title = 'Blog Archive'; 135 $title = 'Blog Archive';
136 $template->add('HEADER', 'Blog Archive');
154 $getposts = "SELECT * FROM updates AS u ORDER BY id DESC"; 137 $getposts = "SELECT * FROM updates AS u ORDER BY id DESC";
155 } 138 }
156 $getposts2 = mysql_query($getposts); 139 $getposts2 = mysql_query($getposts);
@@ -166,10 +149,6 @@ if (isset($_GET['post']))
166 $curID++; 149 $curID++;
167 } 150 }
168 $template->add_ref($curID, 'MONTH', array('TITLE' => date('F Y',strtotime($getposts3[$i]['pubDate'])))); 151 $template->add_ref($curID, 'MONTH', array('TITLE' => date('F Y',strtotime($getposts3[$i]['pubDate']))));
169 if ($curID == 0)
170 {
171 $template->adds_ref_sub($curID, 'BIGEND',array('exi'=>1));
172 }
173 $lastmonth = date('m-Y',strtotime($getposts3[$i]['pubDate'])); 152 $lastmonth = date('m-Y',strtotime($getposts3[$i]['pubDate']));
174 } 153 }
175 154
@@ -195,23 +174,9 @@ if (isset($_GET['post']))
195 $comText = $total_post . ' Comments'; 174 $comText = $total_post . ' Comments';
196 } 175 }
197 176
198 if ($curID == 0) 177 $template->adds_ref_sub($curID, 'SMALL',array( 'DATE' => date('m-d-Y',strtotime($getposts3[$i]['pubDate'])),
199 { 178 'CODED' => $getposts3[$i]['slug'],
200 $template->adds_ref_sub($curID, 'BIG',array( 'DATE' => date('m-d-Y',strtotime($getposts3[$i]['pubDate'])), 179 'TITLE' => $getposts3[$i]['title']));
201 'CODED' => $getposts3[$i]['slug'],
202 'TITLE' => $getposts3[$i]['title'],
203 'ID' => $getposts3[$i]['id'],
204 'YEARID' => ((date('Y',strtotime($getposts3[$i]['pubDate']))-2006) % 4),
205 'MONTH' => date('M',strtotime($getposts3[$i]['pubDate'])),
206 'DAY' => date('d',strtotime($getposts3[$i]['pubDate'])),
207 'AUTHOR' => $getposts3[$i]['author'],
208 'PLURALCOMMENT' => (isset($plural) ? $plural : ''),
209 'COMMENTS' => $comText));
210 } else {
211 $template->adds_ref_sub($curID, 'SMALL',array( 'DATE' => date('m-d-Y',strtotime($getposts3[$i]['pubDate'])),
212 'CODED' => $getposts3[$i]['slug'],
213 'TITLE' => $getposts3[$i]['title']));
214 }
215 $i++; 180 $i++;
216 } 181 }
217 if ($i==0) 182 if ($i==0)
diff --git a/pages/login.php b/pages/login.php index 690a0e8..a787729 100755 --- a/pages/login.php +++ b/pages/login.php
@@ -22,7 +22,7 @@ if (!defined('S_INCLUDE_FILE')) {define('S_INCLUDE_FILE',1);}
22 22
23require('headerproc.php'); 23require('headerproc.php');
24 24
25$noMembers=1; 25$pageCategory = 'log';
26 26
27if (!isset($_GET['submit'])) 27if (!isset($_GET['submit']))
28{ 28{
diff --git a/pages/poll.php b/pages/poll.php index d871a7d..2dee559 100755 --- a/pages/poll.php +++ b/pages/poll.php
@@ -26,12 +26,12 @@ $pageCategory = 'poll';
26 26
27if (isset($_GET['submit'])) 27if (isset($_GET['submit']))
28{ 28{
29 $setip = "INSERT INTO didpollalready SET ip = \"" . $_SERVER['REMOTE_ADDR'] . "\""; 29 $setip = "INSERT INTO didpollalready SET ip = \"" . $_SERVER['REMOTE_ADDR'] . "\"";
30 $setip2 = mysql_query($setip); 30 $setip2 = mysql_query($setip);
31 $getpoll = "SELECT * FROM polloftheweek ORDER BY id DESC LIMIT 0,1"; 31 $getpoll = "SELECT * FROM polloftheweek ORDER BY id DESC LIMIT 0,1";
32 $getpoll2 = mysql_query($getpoll); 32 $getpoll2 = mysql_query($getpoll);
33 $getpoll3 = mysql_fetch_array($getpoll2); 33 $getpoll3 = mysql_fetch_array($getpoll2);
34 $setpoll = "UPDATE polloftheweek SET clicks" . $_POST['options'] . " = " . ($getpoll3['clicks' . $_POST['options']]+1) . " WHERE id = " . $getpoll3['id']; 34 $setpoll = "UPDATE polloftheweek SET clicks" . $_POST['options'] . " = " . ($getpoll3['clicks' . $_POST['options']]+1) . " WHERE id = " . $getpoll3['id'];
35 $setpoll2 = mysql_query($setpoll); 35 $setpoll2 = mysql_query($setpoll);
36 36
37 $template = new FITemplate('msg'); 37 $template = new FITemplate('msg');
@@ -43,17 +43,57 @@ if (isset($_GET['submit']))
43{ 43{
44 $template = new FITemplate('pollIndex'); 44 $template = new FITemplate('pollIndex');
45 45
46 $getpolls = "SELECT * FROM polloftheweek ORDER BY id DESC"; 46 if (isset($_GET['start']))
47 {
48 $start = $_GET['start'] * 10;
49 } else {
50 $start = 0;
51 }
52
53 $getpolls = "SELECT * FROM polloftheweek ORDER BY id DESC LIMIT " . $start . ",10";
47 $getpolls2 = mysql_query($getpolls); 54 $getpolls2 = mysql_query($getpolls);
48 $i=0; 55 $i=0;
49 while ($getpolls3[$i] = mysql_fetch_array($getpolls2)) 56 while ($getpolls3[$i] = mysql_fetch_array($getpolls2))
50 { 57 {
58 $question = strip_tags($getpolls3[$i]['question']);
59 if (strlen($question) > 50)
60 {
61 $question = substr($question, 0, 50);
62 while (substr($question, strlen($question)-1) != ' ')
63 {
64 $question = substr($question, 0, strlen($question)-1);
65 }
66
67 $question = substr($question, 0, strlen($question)-1);
68 $question .= '....';
69 }
51 $template->adds_block('POLL', array( 'ID' => $getpolls3[$i]['id'], 70 $template->adds_block('POLL', array( 'ID' => $getpolls3[$i]['id'],
52 'QUESTION' => $getpolls3[$i]['question'], 71 'QUESTION' => $question,
53 'WEEK' => date('F jS Y', strtotime($getpolls3[$i]['week'])))); 72 'WEEK' => date('F jS Y', strtotime($getpolls3[$i]['week'])),
73 'EVEN' => (($i % 2 == 1) ? ' CLASS="even"' : '')));
54 $i++; 74 $i++;
55 } 75 }
56 76
77 if ($i==0)
78 {
79 generateError('404');
80 exit;
81 }
82
83 $start /= 10;
84 if ($start > 0)
85 {
86 $template->adds_block('PREVIOUS', array('ID' => ($start-1)));
87 }
88
89 $cntpolls = "SELECT COUNT(*) FROM polloftheweek";
90 $cntpolls2 = mysql_query($cntpolls);
91 $cntpolls3 = mysql_fetch_array($cntpolls2);
92 if ($start < floor($cntpolls3['COUNT(*)'] / 10))
93 {
94 $template->adds_block('NEXT', array('ID' => ($start+1)));
95 }
96
57 include('pages/polloftheweek.php'); 97 include('pages/polloftheweek.php');
58 98
59 $template->display(); 99 $template->display();
@@ -95,6 +135,8 @@ if (isset($_GET['submit']))
95 135
96 $page_id = 'polloftheweek-' . $getpoll3['id']; 136 $page_id = 'polloftheweek-' . $getpoll3['id'];
97 include('includes/comments.php'); 137 include('includes/comments.php');
138
139 displayRelated($getpoll3['question']);
98} 140}
99 141
100?> 142?>
diff --git a/pages/quotes.php b/pages/quotes.php index b02875e..8aaa5db 100755 --- a/pages/quotes.php +++ b/pages/quotes.php
@@ -25,10 +25,6 @@ require('headerproc.php');
25include('includes/functions_quotes.php'); 25include('includes/functions_quotes.php');
26 26
27$pageCategory = 'quotes'; 27$pageCategory = 'quotes';
28$headtags = '<LINK REL="stylesheet" HREF="/theme/css/quotes.css" />';
29
30$template = new FITemplate('quotes/header');
31$template->display();
32 28
33if (isset($_GET['id'])) 29if (isset($_GET['id']))
34{ 30{