summary refs log tree commit diff stats
path: root/admin/add.php
blob: 96a92194a90dc0e79d92de6b921ae9706f81bea5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php

$getimage = "SELECT * FROM moderation WHERE id = " . $_GET['id'];
$getimage2 = mysql_query($getimage);
$getimage3 = mysql_fetch_array($getimage2);

$title = $getimage3['title'];
$title = preg_replace('/[^A-Za-z0-9 ]/','',$title);
$title = str_replace(' ', '-', $title);
$title = preg_replace('/-{2,}/','-',$title);
if (substr($title,0,1) == '-')
{
	$title = substr($title,1);
}
if (substr($title,strlen($title)-1,1) == '-')
{
	$title = substr($title,0,strlen($title)-1);
}
$title = strtolower($title);
rename($_SERVER['DOCUMENT_ROOT'] . '/moderation/' . $getimage3['id'] . '.png', $_SERVER['DOCUMENT_ROOT'] . '/images/' . $title . '.png');

$insimage = "INSERT INTO pending (title,filename,text,author) VALUES (\"" . $getimage3['title'] . "\",\"" . $title . "\",\"" . $getimage3['text'] . "\",\"" . $getimage3['author'] . "\")";
$insimage2 = mysql_query($insimage);

$delimage = "DELETE FROM moderation WHERE id = " . $_GET['id'];
$delimage2 = mysql_query($delimage);

?>

Added comic <?php echo($getimage3['title']); ?>!