From aee267d82cce912dc520419682668490c767f674 Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Mon, 18 May 2009 09:35:13 -0400 Subject: Added poll comments to sidebar --- includes/footer.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'includes') diff --git a/includes/footer.php b/includes/footer.php index a37b438..04fe838 100755 --- a/includes/footer.php +++ b/includes/footer.php @@ -88,7 +88,7 @@ if (!isset($noRightbar)) $i++; } - $getcomments = "SELECT * FROM comments WHERE page_id LIKE \"updates-%\" OR page_id LIKE \"quote-%\" ORDER BY id DESC LIMIT 0,5"; + $getcomments = "SELECT * FROM comments ORDER BY id DESC LIMIT 0,5"; $getcomments2 = mysql_query($getcomments); $i=0; while ($getcomments3[$i] = mysql_fetch_array($getcomments2)) @@ -138,6 +138,19 @@ if (!isset($noRightbar)) 'TITLE' => 'Quote #' . $num, 'AUTHOR' => (($website != '') ? '' . $username . '' : $username))); $i++; + } else if (strpos($getcomments3[$i]['page_id'], 'polloftheweek') !== FALSE) + { + $getpotw = "SELECT * FROM polloftheweek WHERE id = " . substr($getcomments3[$i]['page_id'],strpos($getcomments3[$i]['page_id'],'-')+1); + $getpotw2 = mysql_query($getpotw); + $getpotw3 = mysql_fetch_array($getpotw2); + + $template->adds_block('COMMENTS', array( 'ID' => $getcomments3[$i]['id'], + 'AREA' => 'poll', + 'CODED' => $num, + 'ENDING' => '.php', + 'TITLE' => 'Poll "' . $getpotw3['question'] . '"', + 'AUTHOR' => (($website != '') ? '' . $username . '' : $username))); + $i++; } } -- cgit 1.4.1