summary refs log tree commit diff stats
path: root/admin/drafts.php
diff options
context:
space:
mode:
Diffstat (limited to 'admin/drafts.php')
-rw-r--r--admin/drafts.php100
1 files changed, 100 insertions, 0 deletions
diff --git a/admin/drafts.php b/admin/drafts.php new file mode 100644 index 0000000..22d8a09 --- /dev/null +++ b/admin/drafts.php
@@ -0,0 +1,100 @@
1<?php
2/*
3 444444444
4 4::::::::4
5 4:::::::::4
6 4::::44::::4
7 4::::4 4::::4 Four Island
8 4::::4 4::::4
9 4::::4 4::::4 Written and maintained by Starla Insigna
104::::444444::::444
114::::::::::::::::4 admin/drafts.php
124444444444:::::444
13 4::::4 Please do not use, reproduce or steal the
14 4::::4 contents of this file without explicit
15 4::::4 permission from Hatkirby.
16 44::::::44
17 4::::::::4
18 4444444444
19*/
20
21if (!defined('S_INCLUDE_FILE')) {define('S_INCLUDE_FILE',1);}
22
23require('headerproc.php');
24require_once('Pager.php');
25
26$category = 'posts';
27$pageaid = 'drafts';
28
29if (isset($_GET['action']))
30{
31 if ($_GET['action'] == 'delete')
32 {
33 if (is_numeric($_POST['id']))
34 {
35 $delpost = "DELETE FROM drafts WHERE id = " . $_POST['id'];
36 $delpost2 = mysql_query($delpost);
37
38 $flashmsg = 'The selected draft has been deleted.';
39 }
40 } else if ($_GET['action'] == 'deletes')
41 {
42 $ids = explode(',', $_POST['ids']);
43
44 if (is_array($ids) && !empty($ids))
45 {
46 foreach ($ids as $id)
47 {
48 $delpost = "DELETE FROM drafts WHERE id = " . $id;
49 $delpost2 = mysql_query($delpost);
50 }
51
52 $flashmsg = 'The selected drafts have been deleted.';
53 }
54 }
55}
56
57$template = new FITemplate('admin/drafts');
58
59$getposts = "SELECT * FROM drafts ORDER BY id ASC";
60$getposts2 = mysql_query($getposts);
61$i=0;
62while ($getposts3[$i] = mysql_fetch_array($getposts2))
63{
64 $i++;
65}
66
67if ($i != 0)
68{
69 $template->adds_block('AVAIL',array('exi'=>1));
70} else {
71 $template->adds_block('NOTAVAIL',array('exi'=>1));
72}
73
74$pager = &Pager::factory(array( 'mode' => 'Sliding',
75 'perPage' => 20,
76 'delta' => 2,
77 'itemData' => $getposts3));
78
79$j=0;
80
81foreach ($pager->getPageData() as $post)
82{
83 if (!empty($post))
84 {
85 $template->adds_block('POST', array( 'TITLE' => $post['title'],
86 'AUTHOR' => $post['author'],
87 'ID' => $post['id'],
88 'CODED' => $post['slug'],
89 'ODD' => ($j % 2 ? '' : ' class="odd"')));
90 }
91
92 $j++;
93}
94
95$template->add('PAGEID', $pager->getCurrentPageID());
96$template->add('PAGINATION', $pager->links);
97
98$template->display();
99
100?>