diff options
author | Starla Insigna <hatkirby@fourisland.com> | 2009-08-09 09:14:58 -0400 |
---|---|---|
committer | Starla Insigna <hatkirby@fourisland.com> | 2009-08-09 09:14:58 -0400 |
commit | 893957c41481a0cd5eb624096337762ffa54ff28 (patch) | |
tree | 09d2487f8add5a6281e3482a471abf21faa4f819 /includes/functions.php | |
parent | d27a3784c81f0c582e43655509e806978b7e65e4 (diff) | |
download | fourisland-893957c41481a0cd5eb624096337762ffa54ff28.tar.gz fourisland-893957c41481a0cd5eb624096337762ffa54ff28.tar.bz2 fourisland-893957c41481a0cd5eb624096337762ffa54ff28.zip |
Created layout 7
The following changes were also made in this revision: * All HTML was changed to XHTML and a !DOCTYPE was included to reflect this * Rewrote quotes tracking system to be much less complicated and actually working * Changed quotes rendering to look more like Chirpy than Rash * Fixed comment textarea bug * Rewrote a ton of CSS so it's not as bloated * Added a JavaScript confirmation when deleting a comment * AJAXified voting on the POTW * AJAXified voting and flagging quotes * AJAXified commenting * AJAXified voting on posts * Added DateFinder back after it was accidentally deleted in Layout 4.5 The following database changes must be performed as soon as possible: * Fix title of NO <!DOCTYPE> post (the < is missing the semicolon) * Restore post Frasty Tha Snaman from a backup * Reset "flag" field of all rows in "rash_quotes" to 0 * Remove the "vote" and "flag" columns of "rash_tracking" * Rename the "quote_id" column of "rash_tracking" to "vote" The following external code changes must also be performed as soon as possible: * Add the following line to the end of the // Four Island block in The Fourm's functions.php: require('/svr/www/hatkirby/fourisland/main/includes/specialdates.php');
Diffstat (limited to 'includes/functions.php')
-rwxr-xr-x | includes/functions.php | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/includes/functions.php b/includes/functions.php index 9eb1634..090e9d0 100755 --- a/includes/functions.php +++ b/includes/functions.php | |||
@@ -272,7 +272,7 @@ function displayRelated($title, $avoid = 0) | |||
272 | $template->adds_block('POST', array( 'TITLE' => $getrelated3[$i]['title'], | 272 | $template->adds_block('POST', array( 'TITLE' => $getrelated3[$i]['title'], |
273 | 'CODED' => $getrelated3[$i]['slug'], | 273 | 'CODED' => $getrelated3[$i]['slug'], |
274 | 'AUTHOR' => $getrelated3[$i]['author'], | 274 | 'AUTHOR' => $getrelated3[$i]['author'], |
275 | 'DATE' => date('F d<\S\U\P>S</\S\U\P> Y',strtotime($getrelated3[$i]['pubDate'])))); | 275 | 'DATE' => date('F jS Y',strtotime($getrelated3[$i]['pubDate'])))); |
276 | $i++; | 276 | $i++; |
277 | } | 277 | } |
278 | 278 | ||
@@ -304,4 +304,50 @@ function getCommentUrl($getcomment3) | |||
304 | } | 304 | } |
305 | } | 305 | } |
306 | 306 | ||
307 | function getPollOfTheWeek($id = -1) | ||
308 | { | ||
309 | static $showed_form = false; | ||
310 | |||
311 | $potw = new FITemplate('polloftheweek'); | ||
312 | |||
313 | if ($id == -1) | ||
314 | { | ||
315 | $getpoll = "SELECT * FROM polloftheweek ORDER BY id DESC LIMIT 0,1"; | ||
316 | } else { | ||
317 | $getpoll = "SELECT * FROM polloftheweek WHERE id = " . $id; | ||
318 | } | ||
319 | $getpoll2 = mysql_query($getpoll); | ||
320 | $getpoll3 = mysql_fetch_array($getpoll2); | ||
321 | |||
322 | $potw->add('QUESTION', $getpoll3['question']); | ||
323 | $potw->add('OPTION1', $getpoll3['option1']); | ||
324 | $potw->add('OPTION2', $getpoll3['option2']); | ||
325 | $potw->add('OPTION3', $getpoll3['option3']); | ||
326 | $potw->add('OPTION4', $getpoll3['option4']); | ||
327 | |||
328 | $getip = "SELECT * FROM didpollalready WHERE ip = \"" . $_SERVER['REMOTE_ADDR'] . "\""; | ||
329 | $getip2 = mysql_query($getip); | ||
330 | $getip3 = mysql_fetch_array($getip2); | ||
331 | |||
332 | if (($getip3['ip'] != $_SERVER['REMOTE_ADDR']) && ($id == -1) && ($showed_form == false)) | ||
333 | { | ||
334 | $potw->adds_block('FORM',array('exi'=>1)); | ||
335 | $showed_form = true; | ||
336 | } else { | ||
337 | $potw->adds_block('DISPLAY',array('exi'=>1)); | ||
338 | |||
339 | $potw->add('PERCENT1', getpercent($getpoll3,'1')); | ||
340 | $potw->add('PERCENT2', getpercent($getpoll3,'2')); | ||
341 | $potw->add('PERCENT3', getpercent($getpoll3,'3')); | ||
342 | $potw->add('PERCENT4', getpercent($getpoll3,'4')); | ||
343 | } | ||
344 | |||
345 | ob_start(); | ||
346 | $potw->display(); | ||
347 | $result = ob_get_contents(); | ||
348 | ob_end_clean(); | ||
349 | |||
350 | return $result; | ||
351 | } | ||
352 | |||
307 | ?> | 353 | ?> |