summary refs log tree commit diff stats
path: root/admin/quotes.php
diff options
context:
space:
mode:
Diffstat (limited to 'admin/quotes.php')
-rw-r--r--admin/quotes.php116
1 files changed, 116 insertions, 0 deletions
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 @@
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/quotes.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 = 'quotes';
27
28if (isset($_GET['flagged']))
29{
30 $pageaid = 'flagged';
31} else {
32 $pageaid = 'quotes';
33}
34
35if (isset($_GET['action']))
36{
37 if ($_GET['action'] == 'delete')
38 {
39 if (is_numeric($_POST['id']))
40 {
41 $delpost = "DELETE FROM rash_quotes WHERE id = " . $_POST['id'];
42 $delpost2 = mysql_query($delpost);
43
44 $flashmsg = 'The selected quote has been deleted.';
45 }
46 } else if ($_GET['action'] == 'deletes')
47 {
48 $ids = explode(',', $_POST['ids']);
49
50 if (is_array($ids) && !empty($ids))
51 {
52 foreach ($ids as $id)
53 {
54 $delpost = "DELETE FROM rash_quotes WHERE id = " . $id;
55 $delpost2 = mysql_query($delpost);
56 }
57
58 $flashmsg = 'The selected quotes have been deleted.';
59 }
60 }
61}
62
63$template = new FITemplate('admin/quotes');
64
65if (isset($_GET['flagged']))
66{
67 $template->add('TITLE', 'Manage Flagged Quotes');
68 $template->add('FLAGGED', 'flagged=&amp;');
69
70 $getposts = "SELECT * FROM rash_quotes WHERE flag = 1 ORDER BY id DESC";
71} else {
72 $template->add('TITLE', 'Manage Quotes');
73 $template->add('FLAGGED', '');
74
75 $getposts = "SELECT * FROM rash_quotes ORDER BY id DESC";
76}
77
78$getposts2 = mysql_query($getposts);
79$i=0;
80while ($getposts3[$i] = mysql_fetch_array($getposts2))
81{
82 $i++;
83}
84
85if ($i != 0)
86{
87 $template->adds_block('AVAIL',array('exi'=>1));
88} else {
89 $template->adds_block('NOTAVAIL',array('exi'=>1));
90}
91
92$pager = &Pager::factory(array( 'mode' => 'Sliding',
93 'perPage' => 20,
94 'delta' => 2,
95 'itemData' => $getposts3));
96
97$j=0;
98
99foreach ($pager->getPageData() as $post)
100{
101 if (!empty($post))
102 {
103 $template->adds_block('QUOTE', array( 'EXCERPT' => htmlspecialchars(strpos($post['quote'],"\n") !== FALSE ? substr($post['quote'],0,strpos($post['quote'],"\n")) : $post['quote']),
104 'ID' => $post['id'],
105 'ODD' => ($j % 2 ? '' : ' class="odd"')));
106 }
107
108 $j++;
109}
110
111$template->add('PAGEID', $pager->getCurrentPageID());
112$template->add('PAGINATION', $pager->links);
113
114$template->display();
115
116?>