Gallery image system now works again. Fix #263

Changed the gallery image host from imgland.net to http://www.freeimagehosting.net/ (which uses imgur.com)
This commit is contained in:
Znote
2017-01-01 04:14:35 +01:00
parent deddeb462c
commit 43ae67f74e
3 changed files with 81 additions and 56 deletions

View File

@@ -16,7 +16,14 @@ function insertImage($account_id, $title, $desc, $image) {
$image = sanitize($image);
$account_id = (int)$account_id;
$time = time();
mysql_insert("INSERT INTO `znote_images` (`title`, `desc`, `date`, `status`, `image`, `account_id`) VALUES ('$title', '$desc', '$time', '1', '$image', '$account_id');");
// Insert only if image dosn't already exist there
$exist = mysql_select_single("SELECT `id` FROM `znote_images` WHERE `image`='$image' LIMIT 1;");
if ($exist === false) {
mysql_insert("INSERT INTO `znote_images` (`title`, `desc`, `date`, `status`, `image`, `account_id`) VALUES ('$title', '$desc', '$time', '1', '$image', '$account_id');");
return true;
}
return false;
}
function updateImage($id, $status) {