diff --git a/core/image.class.php b/core/image.class.php index 28d609c4..bbe9d86b 100644 --- a/core/image.class.php +++ b/core/image.class.php @@ -9,12 +9,12 @@ class Image { var $posted; var $source; - public function Image($a=false, $b=false, $c=false) { - if($b == false && $c == false) { + public function Image($a=false, $b=false, $c=array(), $d="") { + if($b == false) { $this->create_from_row($a); } else { - $this->create_from_data($a, $b, $c); + $this->create_from_data($a, $b, $c, $d); } } @@ -42,7 +42,7 @@ class Image { } } - private function create_from_data($tmp, $filename, $tags) { + private function create_from_data($tmp, $filename, $tags, $source) { global $config; $this->ok = false; @@ -60,8 +60,8 @@ class Image { $this->ext = $this->mime_to_ext($info['mime']); $this->hash = md5_file($tmp); $this->temp_filename = $tmp; - $this->tag_array = tag_explode($tags); + $this->source = $source; $this->ok = true; } diff --git a/ext/image/main.php b/ext/image/main.php index d2eea187..116f8037 100644 --- a/ext/image/main.php +++ b/ext/image/main.php @@ -176,10 +176,12 @@ class ImageIO extends Extension { // actually insert the info $database->Execute( - "INSERT INTO images(owner_id, owner_ip, filename, filesize, hash, ext, width, height, posted) ". - "VALUES (?, ?, ?, ?, ?, ?, ?, ?, now())", + "INSERT INTO images( + owner_id, owner_ip, filename, filesize, + hash, ext, width, height, posted, source) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, now(), ?)", array($user->id, $_SERVER['REMOTE_ADDR'], $image->filename, $image->filesize, - $image->hash, $image->ext, $image->width, $image->height)); + $image->hash, $image->ext, $image->width, $image->height, $image->source)); $image->id = $database->db->Insert_ID(); /*