diff options
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 | ?> | ||