diff options
author | Starla Insigna <hatkirby@fourisland.com> | 2009-08-13 17:46:09 -0400 |
---|---|---|
committer | Starla Insigna <hatkirby@fourisland.com> | 2009-08-13 17:46:09 -0400 |
commit | b5736e3ad3830fa732dcbd1a518ec3dd6ea7b98a (patch) | |
tree | 0449277e94a42aa155995a90fd8a89cb3309e7ab /admin/editQuote.php | |
parent | 6a1d5b60e6ec541a36727b84b71168f62221f7d7 (diff) | |
download | fourisland-b5736e3ad3830fa732dcbd1a518ec3dd6ea7b98a.tar.gz fourisland-b5736e3ad3830fa732dcbd1a518ec3dd6ea7b98a.tar.bz2 fourisland-b5736e3ad3830fa732dcbd1a518ec3dd6ea7b98a.zip |
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
Diffstat (limited to 'admin/editQuote.php')
-rw-r--r-- | admin/editQuote.php | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/admin/editQuote.php b/admin/editQuote.php new file mode 100644 index 0000000..b250ece --- /dev/null +++ b/admin/editQuote.php | |||
@@ -0,0 +1,69 @@ | |||
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 | ||
10 | 4::::444444::::444 | ||
11 | 4::::::::::::::::4 admin/editQuote.php | ||
12 | 4444444444:::::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 | |||
21 | if (!defined('S_INCLUDE_FILE')) {define('S_INCLUDE_FILE',1);} | ||
22 | |||
23 | require('headerproc.php'); | ||
24 | |||
25 | $category = 'quotes'; | ||
26 | $pageaid = 'quotes'; | ||
27 | |||
28 | $template = new FITemplate('admin/writeQuote'); | ||
29 | $template->add('TITLE', 'Edit Quote'); | ||
30 | $template->add('ACTION', '/admin/editQuote.php?id=' . $_GET['id'] . '&submit='); | ||
31 | |||
32 | if (isset($_GET['submit'])) | ||
33 | { | ||
34 | if (isset($errors)) | ||
35 | { | ||
36 | $template->adds_block('ISERROR',array('exi'=>1)); | ||
37 | |||
38 | $eid = 0; | ||
39 | foreach ($errors as $error) | ||
40 | { | ||
41 | $template->adds_block('ERROR', array( 'ID' => $eid, | ||
42 | 'TEXT' => $error['text'])); | ||
43 | $template->add('IS' . strtoupper($error['field']) . 'ERROR', ' error'); | ||
44 | $template->adds_block(strtoupper($error['field']) . 'ERROR', array( 'ID' => $eid, | ||
45 | 'TEXT' => $error['text'])); | ||
46 | |||
47 | $eid++; | ||
48 | } | ||
49 | |||
50 | $template->add('QUOTEVALUE', $_POST['quote']); | ||
51 | } else { | ||
52 | $insquote = "UPDATE rash_quotes SET quote = \"" . mysql_real_escape_string($_POST['quote']) . "\" WHERE id = " . $_GET['id']; | ||
53 | $insquote2 = mysql_query($insquote); | ||
54 | |||
55 | $template->add('QUOTEVALUE', $_POST['quote']); | ||
56 | |||
57 | $template->adds_block('FLASH', array('TEXT' => 'Your quote has been sucessfully edited. <a href="/quotes/' . $_GET['id'] . '.php">View quote</a>.')); | ||
58 | } | ||
59 | } else { | ||
60 | $getquote = "SELECT * FROM rash_quotes WHERE id = " . $_GET['id']; | ||
61 | $getquote2 = mysql_query($getquote); | ||
62 | $getquote3 = mysql_fetch_array($getquote2); | ||
63 | |||
64 | $template->add('QUOTEVALUE', $getquote3['quote']); | ||
65 | } | ||
66 | |||
67 | $template->display(); | ||
68 | |||
69 | ?> | ||