From 284226706885e3b40769dea5853a95e2b32efda8 Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Sat, 22 Nov 2008 18:01:52 -0500 Subject: Created the 6th layout --- pages/admin.php | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- pages/fourm.php | 4 ++++ pages/quotes.php | 35 ++++------------------------ 3 files changed, 77 insertions(+), 32 deletions(-) (limited to 'pages') diff --git a/pages/admin.php b/pages/admin.php index 195ac64..8534d91 100755 --- a/pages/admin.php +++ b/pages/admin.php @@ -333,6 +333,73 @@ if (isLoggedIn()) $template->add('BACK', 'the previous page'); $template->add('MSG', 'I\'m sorry, that pending post doesn\'t exist.'); } + } else if ($_GET['page'] == 'movePending') + { + $getpending = "SELECT * FROM pending WHERE id = " . $_GET['id']; + $getpending2 = mysql_query($getpending); + $getpending3 = mysql_fetch_array($getpending2); + + if ($getpending3['id'] == $_GET['id']) + { + if ($_GET['dir'] == 'up') + { + $get2pending = "SELECT * FROM pending WHERE id = " . ($_GET['id']-1); + $get2pending2 = mysql_query($get2pending); + $get2pending3 = mysql_fetch_array($get2pending2); + + if ($get2pending3['id'] == ($_GET['id']-1)) + { + $otherPending = $get2pending3; + } else { + $template = new FITemplate('msg'); + $template->add('BACK', 'the previous page'); + $template->add('MSG', 'I\'m sorry, that pending post is already the first.'); + } + } else if ($_GET['dir'] == 'down') + { + $get2pending = "SELECT * FROM pending WHERE id = " . ($_GET['id']+1); + $get2pending2 = mysql_query($get2pending); + $get2pending3 = mysql_fetch_array($get2pending2); + + if ($get2pending3['id'] == ($_GET['id']+1)) + { + $otherPending = $get2pending3; + } else { + $template = new FITemplate('msg'); + $template->add('BACK', 'the previous page'); + $template->add('MSG', 'I\'m sorry, that pending post is already the last.'); + } + } + + if (isset($otherPending)) + { + $delpending = "DELETE FROM pending WHERE id = " . $_GET['id'] . " OR id = " . $otherPending['id']; + $delpending2 = mysql_query($delpending); + + $inspending = "INSERT INTO pending (id, title, author, text, tag1, tag2, tag3, slug) VALUES (" . $_GET['id'] . ",\"" . $otherPending['title'] . "\",\"" . $otherPending['author'] . "\",\"" . $otherPending['text'] . "\",\"" . $otherPending['tag1'] . "\",\"" . $otherPending['tag2'] . "\",\"" . $otherPending['tag3'] . "\",\"" . $otherPending['slug'] . "\")"; + $inspending2 = mysql_query($inspending); + + $ins2pending = "INSERT INTO pending (id, title, author, text, tag1, tag2, tag3, slug) VALUES (" . $otherPending['id'] . ",\"" . $getpending3['title'] . "\",\"" . $getpending3['author'] . "\",\"" . $getpending3['text'] . "\",\"" . $getpending3['tag1'] . "\",\"" . $getpending3['tag2'] . "\",\"" . $getpending3['tag3'] . "\",\"" . $getpending3['slug'] . "\")"; + $ins2pending2 = mysql_query($ins2pending); + + $template = new FITemplate('admin/managePending'); + + $getpending = "SELECT * FROM pending ORDER BY id ASC"; + $getpending2 = mysql_query($getpending); + $i=0; + while ($getpending3[$i] = mysql_fetch_array($getpending2)) + { + $template->adds_block('PENDING', array( 'TITLE' => $getpending3[$i]['title'], + 'AUTHOR' => $getpending3[$i]['author'], + 'ID' => $getpending3[$i]['id'])); + $i++; + } + } + } else { + $template = new FITemplate('msg'); + $template->add('BACK', 'the previous page'); + $template->add('MSG', 'I\'m sorry, that pending post doesn\'t exist.'); + } } else if ($_GET['page'] == 'managePosts') { $template = new FITemplate('admin/managePosts'); @@ -561,7 +628,8 @@ if (isLoggedIn()) { if (isset($_GET['approve'])) { - $insquote = "INSERT INTO rash_quotes (quote) VALUES (\"" . addslashes($getpending3['quote']) . "\")"; + $today = mktime(date('G'),date('i'),date('s'),date('m'),date('d'),date('Y')); + $insquote = "INSERT INTO rash_quotes (quote,date) VALUES (\"" . addslashes($getpending3['quote']) . "\",\"" . $today . "\")"; $insquote2 = mysql_query($insquote); $delpending = "DELETE FROM rash_queue WHERE id = " . $_GET['id']; diff --git a/pages/fourm.php b/pages/fourm.php index 41ae0a1..ee8b0f7 100755 --- a/pages/fourm.php +++ b/pages/fourm.php @@ -22,6 +22,10 @@ if (!defined('S_INCLUDE_FILE')) {define('S_INCLUDE_FILE',1);} require('headerproc.php'); +echo('
'); + include('fourm/link.php'); +echo('
'); + ?> diff --git a/pages/quotes.php b/pages/quotes.php index f208f70..d557ca1 100755 --- a/pages/quotes.php +++ b/pages/quotes.php @@ -25,40 +25,17 @@ require('headerproc.php'); include('includes/functions_quotes.php'); $pageCategory = 'quotes'; +$headtags = ''; if (isset($_GET['id'])) { $quote_num = $_GET['id']; } -if (!isset($_GET['act'])) +if ((!isset($_GET['act'])) || ($_GET['act'] == 'latest')) { - $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'); + $query = "SELECT id, quote, rating, flag FROM rash_quotes ORDER BY id DESC LIMIT 50"; + quote_generation($query, "Latest", -1); } else if ($_GET['act'] == 'add') { $template = new FITemplate('quotes/add'); @@ -107,10 +84,6 @@ if (!isset($_GET['act'])) } $template->add('BACK','Quote #' . $quote_num); $template->display(); -} elseif ($_GET['act'] == 'latest') -{ - $query = "SELECT id, quote, rating, flag FROM rash_quotes ORDER BY id DESC LIMIT 50"; - quote_generation($query, "Latest", -1); } elseif ($_GET['act'] == 'random') { $query = "SELECT id, quote, rating, flag FROM rash_quotes ORDER BY rand() LIMIT 50"; -- cgit 1.4.1