diff options
author | Starla Insigna <hatkirby@fourisland.com> | 2008-12-14 09:39:10 -0500 |
---|---|---|
committer | Starla Insigna <hatkirby@fourisland.com> | 2008-12-14 09:39:10 -0500 |
commit | 9cb1fcba82027daa21eb457f1b2912ee02e5c7eb (patch) | |
tree | b9ad822ca0f186f42da00e1a2c882ede77d2ee14 /includes | |
parent | f037e1d6baa069b324b7a0fd6eaffbdfb5c6f4dc (diff) | |
download | fourisland-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 'includes')
-rwxr-xr-x | includes/bbcode.php | 5 | ||||
-rwxr-xr-x | includes/db.php | 9 | ||||
-rwxr-xr-x | includes/footer.php | 57 | ||||
-rwxr-xr-x | includes/functions.php | 25 | ||||
-rwxr-xr-x | includes/header.php | 3 |
5 files changed, 70 insertions, 29 deletions
diff --git a/includes/bbcode.php b/includes/bbcode.php index 40533a3..42ff8d0 100755 --- a/includes/bbcode.php +++ b/includes/bbcode.php | |||
@@ -32,6 +32,7 @@ class BBCode | |||
32 | { | 32 | { |
33 | $this->bbcodes['b'] = '<B>{CONTENT}</B>'; | 33 | $this->bbcodes['b'] = '<B>{CONTENT}</B>'; |
34 | $this->bbcodes['i'] = '<I>{CONTENT}</I>'; | 34 | $this->bbcodes['i'] = '<I>{CONTENT}</I>'; |
35 | $this->bbcodes['u'] = '<U>{CONTENT}</U>'; | ||
35 | $this->bbcodes['url'] = '<A HREF="{CONTENT}">{CONTENT}</A>'; | 36 | $this->bbcodes['url'] = '<A HREF="{CONTENT}">{CONTENT}</A>'; |
36 | $this->bbcodes2['url'] = '<A HREF="{PARAM}">{CONTENT}</A>'; | 37 | $this->bbcodes2['url'] = '<A HREF="{PARAM}">{CONTENT}</A>'; |
37 | $this->bbcodes['img'] = '<IMG SRC="{CONTENT}" />'; | 38 | $this->bbcodes['img'] = '<IMG SRC="{CONTENT}" />'; |
@@ -46,8 +47,8 @@ class BBCode | |||
46 | $this->bbcodes2['blog'] = '<A HREF="/blog/{PARAM}/">{CONTENT}</A>'; | 47 | $this->bbcodes2['blog'] = '<A HREF="/blog/{PARAM}/">{CONTENT}</A>'; |
47 | $this->bbcodes['ins'] = '<INS>{CONTENT}</INS>'; | 48 | $this->bbcodes['ins'] = '<INS>{CONTENT}</INS>'; |
48 | $this->bbcodes['del'] = '<DEL>{CONTENT}</DEL>'; | 49 | $this->bbcodes['del'] = '<DEL>{CONTENT}</DEL>'; |
49 | $this->bbcodes['bquote'] = '<P><DIV CLASS="autosize"><DIV CLASS="bubble"><DIV CLASS="bquote"><BLOCKQUOTE><DIV><NOBR>{CONTENT}</NOBR></DIV></BLOCKQUOTE></DIV><CITE><STRONG>Anonymous</STRONG></CITE></DIV></DIV><DIV CLASS="cleardiv"></DIV>'; | 50 | $this->bbcodes['bquote'] = '<P><DIV CLASS="autosize"><DIV CLASS="bubble"><DIV CLASS="bquote"><BLOCKQUOTE><DIV>{CONTENT}</DIV></BLOCKQUOTE></DIV><CITE><STRONG>Anonymous</STRONG></CITE></DIV></DIV><DIV CLASS="cleardiv"></DIV>'; |
50 | $this->bbcodes2['bquote'] = '<P><DIV CLASS="autosize"><DIV CLASS="bubble"><DIV CLASS="bquote"><BLOCKQUOTE><DIV><NOBR>{CONTENT}</NOBR></DIV></BLOCKQUOTE></DIV><CITE><STRONG>{PARAM}</STRONG></CITE></DIV></DIV><DIV CLASS="cleardiv"></DIV>'; | 51 | $this->bbcodes2['bquote'] = '<P><DIV CLASS="autosize"><DIV CLASS="bubble"><DIV CLASS="bquote"><BLOCKQUOTE><DIV>{CONTENT}</DIV></BLOCKQUOTE></DIV><CITE><STRONG>{PARAM}</STRONG></CITE></DIV></DIV><DIV CLASS="cleardiv"></DIV>'; |
51 | $this->bbcodes2['abbr'] = '<ABBR TITLE="{PARAM}">{CONTENT}</ABBR>'; | 52 | $this->bbcodes2['abbr'] = '<ABBR TITLE="{PARAM}">{CONTENT}</ABBR>'; |
52 | $this->bbcodes['hidden'] = '<DIV STYLE="display: none">{CONTENT}</DIV>'; | 53 | $this->bbcodes['hidden'] = '<DIV STYLE="display: none">{CONTENT}</DIV>'; |
53 | 54 | ||
diff --git a/includes/db.php b/includes/db.php index 8cc5449..8f305e7 100755 --- a/includes/db.php +++ b/includes/db.php | |||
@@ -46,4 +46,13 @@ function db_multi_select($query, $callback) | |||
46 | } | 46 | } |
47 | } | 47 | } |
48 | 48 | ||
49 | function db_count($query) | ||
50 | { | ||
51 | $cntitem = $query; | ||
52 | $cntitem2 = mysql_query($cntitem) or die($cntitem); | ||
53 | $cntitem3 = mysql_fetch_array($cntitem2); | ||
54 | |||
55 | return $cntitem3['COUNT(*)']; | ||
56 | } | ||
57 | |||
49 | ?> | 58 | ?> |
diff --git a/includes/footer.php b/includes/footer.php index be8dd1b..4daf35e 100755 --- a/includes/footer.php +++ b/includes/footer.php | |||
@@ -37,32 +37,38 @@ if (!isset($noRightbar)) | |||
37 | 37 | ||
38 | if (!isset($noHatNav)) | 38 | if (!isset($noHatNav)) |
39 | { | 39 | { |
40 | $template->adds_block('USEHATNAV', array('exi'=>1)); | 40 | $cnthatnav = "SELECT COUNT(*) FROM hatnav WHERE category = \"" . $pageCategory . "\""; |
41 | if (!isset($genHatNav)) | 41 | $cnthatnav2 = mysql_query($cnthatnav); |
42 | $cnthatnav3 = mysql_fetch_array($cnthatnav2); | ||
43 | |||
44 | if ($cnthatnav3['COUNT(*)'] > 0) | ||
42 | { | 45 | { |
43 | $gethnis = 'SELECT * FROM hatnav WHERE category = "' . | 46 | $template->adds_block('USEHATNAV', array('exi'=>1)); |
44 | $pageCategory . '"'; | 47 | if (!isset($genHatNav)) |
45 | $gethnis2 = mysql_query($gethnis); | ||
46 | $i=0; | ||
47 | while ($gethnis3[$i] = mysql_fetch_array($gethnis2)) | ||
48 | { | 48 | { |
49 | $template->adds_block('HATNAV', array( 'AID' => $gethnis3[$i]['AID'], | 49 | $gethnis = 'SELECT * FROM hatnav WHERE category = "' . $pageCategory . '"'; |
50 | 'HREF' => $gethnis3[$i]['href'], | 50 | $gethnis2 = mysql_query($gethnis); |
51 | 'IMAGE' => '/theme/images/icons/' . $gethnis3[$i]['image'] . '.png', | 51 | $i=0; |
52 | 'TEXT' => $gethnis3[$i]['text'], | 52 | while ($gethnis3[$i] = mysql_fetch_array($gethnis2)) |
53 | 'NEW' => dispIfNotOld($gethnis3[$i]['lastEdit']))); | 53 | { |
54 | $i++; | 54 | $template->adds_block('HATNAV', array( 'AID' => $gethnis3[$i]['AID'], |
55 | } | 55 | 'HREF' => $gethnis3[$i]['href'], |
56 | } else { | 56 | 'IMAGE' => '/theme/images/icons/' . $gethnis3[$i]['image'] . '.png', |
57 | $i=0; | 57 | 'TEXT' => $gethnis3[$i]['text'], |
58 | while ($i < $genHatNavNum) | 58 | 'NEW' => dispIfNotOld($gethnis3[$i]['lastEdit']))); |
59 | { | 59 | $i++; |
60 | $template->adds_block('HATNAV', array( 'AID' => 'post', | 60 | } |
61 | 'HREF' => $genHatNav[$i]['href'], | 61 | } else { |
62 | 'IMAGE' => '/theme/images/blue.PNG', | 62 | $i=0; |
63 | 'TEXT' => $genHatNav[$i]['text'], | 63 | while ($i < $genHatNavNum) |
64 | 'NEW' => '')); | 64 | { |
65 | $i++; | 65 | $template->adds_block('HATNAV', array( 'AID' => 'post', |
66 | 'HREF' => $genHatNav[$i]['href'], | ||
67 | 'IMAGE' => '/theme/images/blue.PNG', | ||
68 | 'TEXT' => $genHatNav[$i]['text'], | ||
69 | 'NEW' => '')); | ||
70 | $i++; | ||
71 | } | ||
66 | } | 72 | } |
67 | } | 73 | } |
68 | } | 74 | } |
@@ -235,9 +241,6 @@ if (!isset($noRightbar)) | |||
235 | } | 241 | } |
236 | } | 242 | } |
237 | 243 | ||
238 | $template->add('REDIRPAGE',rawurlencode($_SERVER['REQUEST_URI'])); | ||
239 | $template->add('LOGDATA',echoLogData()); | ||
240 | |||
241 | $template->display(); | 244 | $template->display(); |
242 | 245 | ||
243 | ?> | 246 | ?> |
diff --git a/includes/functions.php b/includes/functions.php index 7f85f96..1caef59 100755 --- a/includes/functions.php +++ b/includes/functions.php | |||
@@ -282,4 +282,29 @@ if (!function_exists('unique_id')) | |||
282 | } | 282 | } |
283 | } | 283 | } |
284 | 284 | ||
285 | function displayRelated($title, $avoid = 0) | ||
286 | { | ||
287 | $getrelated = "SELECT *, MATCH (title, text) AGAINST (\"" . addslashes($title) . "\") AS score FROM updates WHERE MATCH (title, text) AGAINST (\"" . addslashes($title) . "\") AND id <> " . $avoid . " LIMIT 0,5"; | ||
288 | $getrelated2 = mysql_query($getrelated); | ||
289 | $i=0; | ||
290 | while ($getrelated3[$i] = mysql_fetch_array($getrelated2)) | ||
291 | { | ||
292 | if ($i==0) | ||
293 | { | ||
294 | $template = new FITemplate('related'); | ||
295 | } | ||
296 | |||
297 | $template->adds_block('POST', array( 'TITLE' => $getrelated3[$i]['title'], | ||
298 | 'CODED' => $getrelated3[$i]['slug'], | ||
299 | 'AUTHOR' => $getrelated3[$i]['author'], | ||
300 | 'DATE' => date('F d<\S\U\P>S</\S\U\P> Y',strtotime($getrelated3[$i]['pubDate'])))); | ||
301 | $i++; | ||
302 | } | ||
303 | |||
304 | if ($i > 0) | ||
305 | { | ||
306 | $template->display(); | ||
307 | } | ||
308 | } | ||
309 | |||
285 | ?> | 310 | ?> |
diff --git a/includes/header.php b/includes/header.php index e9f31f6..6018179 100755 --- a/includes/header.php +++ b/includes/header.php | |||
@@ -44,6 +44,9 @@ $headerTemp->add('BODYTAGS',(isset($bodyTags)) ? $bodyTags : ''); | |||
44 | $headerTemp->add('HEADTAGS',isset($headtags) ? $headtags : ''); | 44 | $headerTemp->add('HEADTAGS',isset($headtags) ? $headtags : ''); |
45 | $headerTemp->add('EXTRATITLE',isset($title) ? ($title . ' - ') : ''); | 45 | $headerTemp->add('EXTRATITLE',isset($title) ? ($title . ' - ') : ''); |
46 | $headerTemp->add('PAGEID',(isset($pageID)) ? $pageID : 'none'); | 46 | $headerTemp->add('PAGEID',(isset($pageID)) ? $pageID : 'none'); |
47 | $headerTemp->add(strtoupper($pageCategory) . 'ACTIVE', ' CLASS="active"'); | ||
48 | $headerTemp->add('REDIRPAGE',rawurlencode($_SERVER['REQUEST_URI'])); | ||
49 | $headerTemp->add('LOGDATA',echoLogData()); | ||
47 | 50 | ||
48 | if (isset($_POST['message'])) | 51 | if (isset($_POST['message'])) |
49 | { | 52 | { |