From 893957c41481a0cd5eb624096337762ffa54ff28 Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Sun, 9 Aug 2009 09:14:58 -0400 Subject: 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 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'); --- includes/functions.php | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) (limited to 'includes/functions.php') 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) $template->adds_block('POST', array( 'TITLE' => $getrelated3[$i]['title'], 'CODED' => $getrelated3[$i]['slug'], 'AUTHOR' => $getrelated3[$i]['author'], - 'DATE' => date('F d<\S\U\P>S Y',strtotime($getrelated3[$i]['pubDate'])))); + 'DATE' => date('F jS Y',strtotime($getrelated3[$i]['pubDate'])))); $i++; } @@ -304,4 +304,50 @@ function getCommentUrl($getcomment3) } } +function getPollOfTheWeek($id = -1) +{ + static $showed_form = false; + + $potw = new FITemplate('polloftheweek'); + + if ($id == -1) + { + $getpoll = "SELECT * FROM polloftheweek ORDER BY id DESC LIMIT 0,1"; + } else { + $getpoll = "SELECT * FROM polloftheweek WHERE id = " . $id; + } + $getpoll2 = mysql_query($getpoll); + $getpoll3 = mysql_fetch_array($getpoll2); + + $potw->add('QUESTION', $getpoll3['question']); + $potw->add('OPTION1', $getpoll3['option1']); + $potw->add('OPTION2', $getpoll3['option2']); + $potw->add('OPTION3', $getpoll3['option3']); + $potw->add('OPTION4', $getpoll3['option4']); + + $getip = "SELECT * FROM didpollalready WHERE ip = \"" . $_SERVER['REMOTE_ADDR'] . "\""; + $getip2 = mysql_query($getip); + $getip3 = mysql_fetch_array($getip2); + + if (($getip3['ip'] != $_SERVER['REMOTE_ADDR']) && ($id == -1) && ($showed_form == false)) + { + $potw->adds_block('FORM',array('exi'=>1)); + $showed_form = true; + } else { + $potw->adds_block('DISPLAY',array('exi'=>1)); + + $potw->add('PERCENT1', getpercent($getpoll3,'1')); + $potw->add('PERCENT2', getpercent($getpoll3,'2')); + $potw->add('PERCENT3', getpercent($getpoll3,'3')); + $potw->add('PERCENT4', getpercent($getpoll3,'4')); + } + + ob_start(); + $potw->display(); + $result = ob_get_contents(); + ob_end_clean(); + + return $result; +} + ?> -- cgit 1.4.1