image locking

This commit is contained in:
Shish
2010-02-17 14:16:20 +00:00
parent 6c85ed3ba0
commit 9c26f9efb4
4 changed files with 70 additions and 11 deletions

View File

@ -36,6 +36,7 @@ class Image {
var $owner_ip;
var $posted;
var $source;
var $locked;
/**
* One will very rarely construct an image directly, more common
@ -371,6 +372,19 @@ class Image {
$database->execute("UPDATE images SET source=? WHERE id=?", array($source, $this->id));
}
public function is_locked() {
return ($this->locked === true || $this->locked == "Y");
}
public function set_locked($tf) {
global $database;
$ln = $tf ? "Y" : "N";
$sln = $database->engine->scoreql_to_sql("SCORE_BOOL_$ln");
$sln = str_replace("'", "", $sln);
$sln = str_replace('"', "", $sln);
$database->execute("UPDATE images SET locked=? WHERE id=?", array($sln, $this->id));
}
/**
* Delete all tags from this image.
*