summary refs log tree commit diff stats
path: root/admin/add.php
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2009-02-21 18:05:42 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2009-02-21 18:05:42 -0500
commitd0601a55010cd9fe2f2587ce157ce059e5da732e (patch)
tree6c56f73f6d2dfa1bbaab5c053321458014709377 /admin/add.php
parent877fa5a38fefe2bdd0e00768b6ec4b52a81d7a69 (diff)
downloadpillowcase-d0601a55010cd9fe2f2587ce157ce059e5da732e.tar.gz
pillowcase-d0601a55010cd9fe2f2587ce157ce059e5da732e.tar.bz2
pillowcase-d0601a55010cd9fe2f2587ce157ce059e5da732e.zip
Started admin panel
Diffstat (limited to 'admin/add.php')
-rw-r--r--admin/add.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/admin/add.php b/admin/add.php new file mode 100644 index 0000000..96a9219 --- /dev/null +++ b/admin/add.php
@@ -0,0 +1,30 @@
1<?php
2
3$getimage = "SELECT * FROM moderation WHERE id = " . $_GET['id'];
4$getimage2 = mysql_query($getimage);
5$getimage3 = mysql_fetch_array($getimage2);
6
7$title = $getimage3['title'];
8$title = preg_replace('/[^A-Za-z0-9 ]/','',$title);
9$title = str_replace(' ', '-', $title);
10$title = preg_replace('/-{2,}/','-',$title);
11if (substr($title,0,1) == '-')
12{
13 $title = substr($title,1);
14}
15if (substr($title,strlen($title)-1,1) == '-')
16{
17 $title = substr($title,0,strlen($title)-1);
18}
19$title = strtolower($title);
20rename($_SERVER['DOCUMENT_ROOT'] . '/moderation/' . $getimage3['id'] . '.png', $_SERVER['DOCUMENT_ROOT'] . '/images/' . $title . '.png');
21
22$insimage = "INSERT INTO pending (title,filename,text,author) VALUES (\"" . $getimage3['title'] . "\",\"" . $title . "\",\"" . $getimage3['text'] . "\",\"" . $getimage3['author'] . "\")";
23$insimage2 = mysql_query($insimage);
24
25$delimage = "DELETE FROM moderation WHERE id = " . $_GET['id'];
26$delimage2 = mysql_query($delimage);
27
28?>
29
30Added comic <?php echo($getimage3['title']); ?>!