summary refs log tree commit diff stats
path: root/pages/admin.php
diff options
context:
space:
mode:
Diffstat (limited to 'pages/admin.php')
-rwxr-xr-xpages/admin.php70
1 files changed, 69 insertions, 1 deletions
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())
333 $template->add('BACK', 'the previous page'); 333 $template->add('BACK', 'the previous page');
334 $template->add('MSG', 'I\'m sorry, that pending post doesn\'t exist.'); 334 $template->add('MSG', 'I\'m sorry, that pending post doesn\'t exist.');
335 } 335 }
336 } else if ($_GET['page'] == 'movePending')
337 {
338 $getpending = "SELECT * FROM pending WHERE id = " . $_GET['id'];
339 $getpending2 = mysql_query($getpending);
340 $getpending3 = mysql_fetch_array($getpending2);
341
342 if ($getpending3['id'] == $_GET['id'])
343 {
344 if ($_GET['dir'] == 'up')
345 {
346 $get2pending = "SELECT * FROM pending WHERE id = " . ($_GET['id']-1);
347 $get2pending2 = mysql_query($get2pending);
348 $get2pending3 = mysql_fetch_array($get2pending2);
349
350 if ($get2pending3['id'] == ($_GET['id']-1))
351 {
352 $otherPending = $get2pending3;
353 } else {
354 $template = new FITemplate('msg');
355 $template->add('BACK', 'the previous page');
356 $template->add('MSG', 'I\'m sorry, that pending post is already the first.');
357 }
358 } else if ($_GET['dir'] == 'down')
359 {
360 $get2pending = "SELECT * FROM pending WHERE id = " . ($_GET['id']+1);
361 $get2pending2 = mysql_query($get2pending);
362 $get2pending3 = mysql_fetch_array($get2pending2);
363
364 if ($get2pending3['id'] == ($_GET['id']+1))
365 {
366 $otherPending = $get2pending3;
367 } else {
368 $template = new FITemplate('msg');
369 $template->add('BACK', 'the previous page');
370 $template->add('MSG', 'I\'m sorry, that pending post is already the last.');
371 }
372 }
373
374 if (isset($otherPending))
375 {
376 $delpending = "DELETE FROM pending WHERE id = " . $_GET['id'] . " OR id = " . $otherPending['id'];
377 $delpending2 = mysql_query($delpending);
378
379 $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'] . "\")";
380 $inspending2 = mysql_query($inspending);
381
382 $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'] . "\")";
383 $ins2pending2 = mysql_query($ins2pending);
384
385 $template = new FITemplate('admin/managePending');
386
387 $getpending = "SELECT * FROM pending ORDER BY id ASC";
388 $getpending2 = mysql_query($getpending);
389 $i=0;
390 while ($getpending3[$i] = mysql_fetch_array($getpending2))
391 {
392 $template->adds_block('PENDING', array( 'TITLE' => $getpending3[$i]['title'],
393 'AUTHOR' => $getpending3[$i]['author'],
394 'ID' => $getpending3[$i]['id']));
395 $i++;
396 }
397 }
398 } else {
399 $template = new FITemplate('msg');
400 $template->add('BACK', 'the previous page');
401 $template->add('MSG', 'I\'m sorry, that pending post doesn\'t exist.');
402 }
336 } else if ($_GET['page'] == 'managePosts') 403 } else if ($_GET['page'] == 'managePosts')
337 { 404 {
338 $template = new FITemplate('admin/managePosts'); 405 $template = new FITemplate('admin/managePosts');
@@ -561,7 +628,8 @@ if (isLoggedIn())
561 { 628 {
562 if (isset($_GET['approve'])) 629 if (isset($_GET['approve']))
563 { 630 {
564 $insquote = "INSERT INTO rash_quotes (quote) VALUES (\"" . addslashes($getpending3['quote']) . "\")"; 631 $today = mktime(date('G'),date('i'),date('s'),date('m'),date('d'),date('Y'));
632 $insquote = "INSERT INTO rash_quotes (quote,date) VALUES (\"" . addslashes($getpending3['quote']) . "\",\"" . $today . "\")";
565 $insquote2 = mysql_query($insquote); 633 $insquote2 = mysql_query($insquote);
566 634
567 $delpending = "DELETE FROM rash_queue WHERE id = " . $_GET['id']; 635 $delpending = "DELETE FROM rash_queue WHERE id = " . $_GET['id'];