mirror of
https://github.com/c0de-archive/GAMA-Site.git
synced 2024-12-22 09:42:39 +00:00
Finished Version one of Recent Uploaded Pictures V2 to follow
This commit is contained in:
parent
d139d74445
commit
5769d729d3
@ -199,14 +199,40 @@
|
|||||||
echo $name." is not allowed, sorry about that...";
|
echo $name." is not allowed, sorry about that...";
|
||||||
}else{
|
}else{
|
||||||
// Somehow bump one of the images from the recently upload table and add new image in its place
|
// Somehow bump one of the images from the recently upload table and add new image in its place
|
||||||
$sql="INSERT INTO `share` (name, location, type, size, time, comment, username, tags) VALUES ('$name', '$location', '$type', '$size', '$time', '$upcomment', '$upusername', '$tags')";
|
$sql = "SELECT `name` FROM `recentpics` WHERE `id` = '1'";
|
||||||
if($result = $db->query($sql)){
|
if($result = $db->query($sql)){
|
||||||
move_uploaded_file($_FILES["file"]["tmp_name"], "Pictures/" . $name);
|
$row = $result->fetch_assoc();
|
||||||
$donefile = 'Pictures/'.$name;
|
if ($row){
|
||||||
genthumb($name);
|
$rpics = explode('-', $row['name']);
|
||||||
echo "Stored at: <a href='?img=$name'>". $name."</a>";
|
$rpics = $rpics[1].'-'.$name;
|
||||||
|
$sql = "DELETE FROM `recentpics` WHERE `id` = 1";
|
||||||
|
if($result = $db->query($sql)){
|
||||||
|
$sql = "INSERT INTO `recentpics` (id, name) VALUES ('1', '$rpics')";
|
||||||
|
if($result = $db->query($sql)){
|
||||||
|
$sql="INSERT INTO `share` (name, location, type, size, time, comment, username, tags) VALUES ('$name', '$location', '$type', '$size', '$time', '$upcomment', '$upusername', '$tags')";
|
||||||
|
if($result = $db->query($sql)){
|
||||||
|
move_uploaded_file($_FILES["file"]["tmp_name"], "Pictures/" . $name);
|
||||||
|
$donefile = 'Pictures/'.$name;
|
||||||
|
genthumb($name);
|
||||||
|
echo "Stored at: <a href='?img=$name'>". $name."</a>";
|
||||||
|
}elseif(!$result = $db->query($sql)){
|
||||||
|
echo 'There was a problem trying to upload your file - [' . $db->error . ']';
|
||||||
|
}else{
|
||||||
|
echo "There was a problem trying to upload your file - Could be a server error";
|
||||||
|
}
|
||||||
|
}elseif(!$result = $db->query($sql)){
|
||||||
|
echo 'There was a problem trying to upload your file - [ '.$db->error.' ]';
|
||||||
|
}else{
|
||||||
|
echo "There was a problem trying to upload your file - Could be a server error";
|
||||||
|
}
|
||||||
|
}elseif(!$result = $db->query($sql)){
|
||||||
|
echo 'There was a problem trying to upload your file - [ '.$db->error.' ]';
|
||||||
|
}else{
|
||||||
|
echo "There was a problem trying to upload your file - Could be a server error";
|
||||||
|
}
|
||||||
|
}
|
||||||
}elseif(!$result = $db->query($sql)){
|
}elseif(!$result = $db->query($sql)){
|
||||||
die('There was a problem trying to upload your file - [' . $db->error . ']');
|
echo 'There was a problem trying to upload your file - [ '.$db->error.' ]';
|
||||||
}else{
|
}else{
|
||||||
echo "There was a problem trying to upload your file - Could be a server error";
|
echo "There was a problem trying to upload your file - Could be a server error";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user