image locking
This commit is contained in:
@ -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.
|
||||
*
|
||||
|
Reference in New Issue
Block a user