From b5736e3ad3830fa732dcbd1a518ec3dd6ea7b98a Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Thu, 13 Aug 2009 17:46:09 -0400 Subject: Rewrote Admin panel The following database changes must be made: * A TEXT column called "text" must be added to the end of "polloftheweek" * The transferPollRss.php script must be run * The "pollrss" table must be dropped Closes #113 --- admin/quotes.php | 116 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 admin/quotes.php (limited to 'admin/quotes.php') diff --git a/admin/quotes.php b/admin/quotes.php new file mode 100644 index 0000000..e222b39 --- /dev/null +++ b/admin/quotes.php @@ -0,0 +1,116 @@ +add('TITLE', 'Manage Flagged Quotes'); + $template->add('FLAGGED', 'flagged=&'); + + $getposts = "SELECT * FROM rash_quotes WHERE flag = 1 ORDER BY id DESC"; +} else { + $template->add('TITLE', 'Manage Quotes'); + $template->add('FLAGGED', ''); + + $getposts = "SELECT * FROM rash_quotes ORDER BY id DESC"; +} + +$getposts2 = mysql_query($getposts); +$i=0; +while ($getposts3[$i] = mysql_fetch_array($getposts2)) +{ + $i++; +} + +if ($i != 0) +{ + $template->adds_block('AVAIL',array('exi'=>1)); +} else { + $template->adds_block('NOTAVAIL',array('exi'=>1)); +} + +$pager = &Pager::factory(array( 'mode' => 'Sliding', + 'perPage' => 20, + 'delta' => 2, + 'itemData' => $getposts3)); + +$j=0; + +foreach ($pager->getPageData() as $post) +{ + if (!empty($post)) + { + $template->adds_block('QUOTE', array( 'EXCERPT' => htmlspecialchars(strpos($post['quote'],"\n") !== FALSE ? substr($post['quote'],0,strpos($post['quote'],"\n")) : $post['quote']), + 'ID' => $post['id'], + 'ODD' => ($j % 2 ? '' : ' class="odd"'))); + } + + $j++; +} + +$template->add('PAGEID', $pager->getCurrentPageID()); +$template->add('PAGINATION', $pager->links); + +$template->display(); + +?> -- cgit 1.4.1