From c8551e2509fe68c77b0efe9b22f4dbadff981473 Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Wed, 19 Nov 2008 20:39:26 -0500 Subject: Improved Quotes Admin module Fixed the Quotes Management module in the admin panel so that comments with line breaks in them would actually show up on individual lines. Also, the quotes can be distinguished from one another by every other row in the table being shaded differently. --- pages/admin.php | 11 +++++++++-- pages/quotes.php | 56 ++++++++++++++++++++++++++++++-------------------------- 2 files changed, 39 insertions(+), 28 deletions(-) (limited to 'pages') diff --git a/pages/admin.php b/pages/admin.php index ca7a7fa..90b3d29 100755 --- a/pages/admin.php +++ b/pages/admin.php @@ -604,8 +604,15 @@ if (isLoggedIn()) $i=0; while ($getpending3[$i] = mysql_fetch_array($getpending2)) { - $template->adds_block('QUOTE', array( 'ID' => $getpending3[$i]['id'], - 'TEXT' => $getpending3[$i]['quote'])); + if ($i % 2 == 1) + { + $template->adds_block('QUOTE', array( 'ID' => $getpending3[$i]['id'], + 'TEXT' => nl2br($getpending3[$i]['quote']), + 'EVEN' => 'even')); + } else { + $template->adds_block('QUOTE', array( 'ID' => $getpending3[$i]['id'], + 'TEXT' => nl2br($getpending3[$i]['quote']))); + } $i++; } } else if ($_GET['page'] == 'actionPendingQuotes') diff --git a/pages/quotes.php b/pages/quotes.php index 78cd543..e6eb9f6 100755 --- a/pages/quotes.php +++ b/pages/quotes.php @@ -31,7 +31,35 @@ if (isset($_GET['id'])) $quote_num = $_GET['id']; } -if ($_GET['act'] == 'add') +if (!isset($_GET['act'])) +{ + $template = new FITemplate('post'); + $template->adds_block('INTERNAL',array('exi'=>1)); + + $getpost = "SELECT * FROM updates WHERE tag1 = \"quotes\" OR tag2 = \"tag2\" OR tag3 = \"tag3\" ORDER BY id DESC LIMIT 0,1"; + $getpost2 = mysql_query($getpost); + $getpost3 = mysql_fetch_array($getpost2); + + $title = $getpost3['title'] . ' - Blog Archive'; + + $template->adds_block('POST', array( 'ID' => $getpost3['id'], + 'YEARID' => ((date('Y',strtotime($getpost3['pubDate']))-2006) % 4), + 'DATE' => date('F dS Y \a\\t g:i:s a',strtotime($getpost3['pubDate'])), + 'MONTH' => date('M',strtotime($getpost3['pubDate'])), + 'DAY' => date('d',strtotime($getpost3['pubDate'])), + 'CODED' => urlencode($getpost3['title']), + 'TITLE' => $getpost3['title'], + 'AUTHOR' => $getpost3['author'], + 'TAG1' => $getpost3['tag1'], + 'TAG2' => $getpost3['tag2'], + 'TAG3' => $getpost3['tag3'], + 'TEXT' => parseBBCode($getpost3['text']))); + + $template->display(); + $page_id = 'updates-' . $getpost3['id']; + + include('includes/comments.php'); +} else if ($_GET['act'] == 'add') { $template = new FITemplate('quotes/add'); if (isset($_GET['submit'])) @@ -135,32 +163,8 @@ if ($_GET['act'] == 'add') quote_generation($query, "#" . $_GET['act'], -1); $page_id = 'quote-' . $_GET['act']; } else { - $template = new FITemplate('post'); - $template->adds_block('INTERNAL',array('exi'=>1)); - - $getpost = "SELECT * FROM updates WHERE tag1 = \"quotes\" OR tag2 = \"tag2\" OR tag3 = \"tag3\" ORDER BY id DESC LIMIT 0,1"; - $getpost2 = mysql_query($getpost); - $getpost3 = mysql_fetch_array($getpost2); - - $title = $getpost3['title'] . ' - Blog Archive'; - - $template->adds_block('POST', array( 'ID' => $getpost3['id'], - 'YEARID' => ((date('Y',strtotime($getpost3['pubDate']))-2006) % 4), - 'DATE' => date('F dS Y \a\\t g:i:s a',strtotime($getpost3['pubDate'])), - 'MONTH' => date('M',strtotime($getpost3['pubDate'])), - 'DAY' => date('d',strtotime($getpost3['pubDate'])), - 'CODED' => urlencode($getpost3['title']), - 'TITLE' => $getpost3['title'], - 'AUTHOR' => $getpost3['author'], - 'TAG1' => $getpost3['tag1'], - 'TAG2' => $getpost3['tag2'], - 'TAG3' => $getpost3['tag3'], - 'TEXT' => parseBBCode($getpost3['text']))); - - $template->display(); - $page_id = 'updates-' . $getpost3['id']; + generateError('404'); } - include('includes/comments.php'); } ?> -- cgit 1.4.1