Added plugin-call to Photo
This commit is contained in:
parent
56eaac4a81
commit
b7ca72b817
@ -28,6 +28,9 @@ class Photo extends Module {
|
||||
|
||||
if (!isset($this->database, $this->photoIDs)) return false;
|
||||
|
||||
# Call plugins
|
||||
$this->plugins(__METHOD__, 0, func_get_args());
|
||||
|
||||
# Get photo
|
||||
$photos = $this->database->query("SELECT * FROM lychee_photos WHERE id = '$this->photoIDs' LIMIT 1;");
|
||||
$photo = $photos->fetch_assoc();
|
||||
@ -54,6 +57,9 @@ class Photo extends Module {
|
||||
|
||||
}
|
||||
|
||||
# Call plugins
|
||||
$this->plugins(__METHOD__, 1, func_get_args());
|
||||
|
||||
return $photo;
|
||||
|
||||
}
|
||||
@ -62,6 +68,9 @@ class Photo extends Module {
|
||||
|
||||
if (!isset($this->database, $this->photoIDs)) return false;
|
||||
|
||||
# Call plugins
|
||||
$this->plugins(__METHOD__, 0, func_get_args());
|
||||
|
||||
# Get photo
|
||||
$photos = $this->database->query("SELECT title, url FROM lychee_photos WHERE id = '$this->photoIDs' LIMIT 1;");
|
||||
$photo = $photos->fetch_object();
|
||||
@ -80,6 +89,9 @@ class Photo extends Module {
|
||||
# Send file
|
||||
readfile("../uploads/big/$photo->url");
|
||||
|
||||
# Call plugins
|
||||
$this->plugins(__METHOD__, 1, func_get_args());
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
@ -88,12 +100,18 @@ class Photo extends Module {
|
||||
|
||||
if (!isset($this->database, $this->photoIDs)) return false;
|
||||
|
||||
# Call plugins
|
||||
$this->plugins(__METHOD__, 0, func_get_args());
|
||||
|
||||
# Parse
|
||||
if (strlen($title)>50) $title = substr($title, 0, 50);
|
||||
|
||||
# Set title
|
||||
$result = $this->database->query("UPDATE lychee_photos SET title = '$title' WHERE id IN ($this->photoIDs);");
|
||||
|
||||
# Call plugins
|
||||
$this->plugins(__METHOD__, 1, func_get_args());
|
||||
|
||||
if (!$result) return false;
|
||||
return true;
|
||||
|
||||
@ -103,6 +121,9 @@ class Photo extends Module {
|
||||
|
||||
if (!isset($this->database, $this->photoIDs)) return false;
|
||||
|
||||
# Call plugins
|
||||
$this->plugins(__METHOD__, 0, func_get_args());
|
||||
|
||||
# Parse
|
||||
$description = htmlentities($description);
|
||||
if (strlen($description)>1000) $description = substr($description, 0, 1000);
|
||||
@ -110,6 +131,9 @@ class Photo extends Module {
|
||||
# Set description
|
||||
$result = $this->database->query("UPDATE lychee_photos SET description = '$description' WHERE id IN ('$this->photoIDs');");
|
||||
|
||||
# Call plugins
|
||||
$this->plugins(__METHOD__, 1, func_get_args());
|
||||
|
||||
if (!$result) return false;
|
||||
return true;
|
||||
|
||||
@ -119,6 +143,9 @@ class Photo extends Module {
|
||||
|
||||
if (!isset($this->database, $this->photoIDs)) return false;
|
||||
|
||||
# Call plugins
|
||||
$this->plugins(__METHOD__, 0, func_get_args());
|
||||
|
||||
# Init vars
|
||||
$error = false;
|
||||
|
||||
@ -137,6 +164,9 @@ class Photo extends Module {
|
||||
|
||||
}
|
||||
|
||||
# Call plugins
|
||||
$this->plugins(__METHOD__, 1, func_get_args());
|
||||
|
||||
if ($error) return false;
|
||||
return true;
|
||||
|
||||
@ -146,6 +176,9 @@ class Photo extends Module {
|
||||
|
||||
if (!isset($this->database, $this->photoIDs)) return false;
|
||||
|
||||
# Call plugins
|
||||
$this->plugins(__METHOD__, 0, func_get_args());
|
||||
|
||||
# Get photo
|
||||
$photos = $this->database->query("SELECT public, album FROM lychee_photos WHERE id = '$this->photoIDs' LIMIT 1;");
|
||||
$photo = $photos->fetch_object();
|
||||
@ -159,6 +192,9 @@ class Photo extends Module {
|
||||
if ($acP===true&&$agP===true) return true;
|
||||
}
|
||||
|
||||
# Call plugins
|
||||
$this->plugins(__METHOD__, 1, func_get_args());
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
@ -167,6 +203,9 @@ class Photo extends Module {
|
||||
|
||||
if (!isset($this->database, $this->photoIDs)) return false;
|
||||
|
||||
# Call plugins
|
||||
$this->plugins(__METHOD__, 0, func_get_args());
|
||||
|
||||
# Get public
|
||||
$photos = $this->database->query("SELECT public FROM lychee_photos WHERE id = '$this->photoIDs' LIMIT 1;");
|
||||
$photo = $photos->fetch_object();
|
||||
@ -177,6 +216,9 @@ class Photo extends Module {
|
||||
# Set public
|
||||
$result = $this->database->query("UPDATE lychee_photos SET public = '$public' WHERE id = '$this->photoIDs';");
|
||||
|
||||
# Call plugins
|
||||
$this->plugins(__METHOD__, 1, func_get_args());
|
||||
|
||||
if (!$result) return false;
|
||||
return true;
|
||||
|
||||
@ -186,9 +228,15 @@ class Photo extends Module {
|
||||
|
||||
if (!isset($this->database, $this->photoIDs)) return false;
|
||||
|
||||
# Call plugins
|
||||
$this->plugins(__METHOD__, 0, func_get_args());
|
||||
|
||||
# Set album
|
||||
$result = $this->database->query("UPDATE lychee_photos SET album = '$albumID' WHERE id IN ($this->photoIDs);");
|
||||
|
||||
# Call plugins
|
||||
$this->plugins(__METHOD__, 1, func_get_args());
|
||||
|
||||
if (!$result) return false;
|
||||
return true;
|
||||
|
||||
@ -198,6 +246,9 @@ class Photo extends Module {
|
||||
|
||||
if (!isset($this->database, $this->photoIDs)) return false;
|
||||
|
||||
# Call plugins
|
||||
$this->plugins(__METHOD__, 0, func_get_args());
|
||||
|
||||
# Parse tags
|
||||
$tags = preg_replace('/(\ ,\ )|(\ ,)|(,\ )|(,{1,}\ {0,})|(,$|^,)/', ',', $tags);
|
||||
$tags = preg_replace('/,$|^,/', ',', $tags);
|
||||
@ -206,6 +257,9 @@ class Photo extends Module {
|
||||
# Set tags
|
||||
$result = $this->database->query("UPDATE lychee_photos SET tags = '$tags' WHERE id IN ($this->photoIDs);");
|
||||
|
||||
# Call plugins
|
||||
$this->plugins(__METHOD__, 1, func_get_args());
|
||||
|
||||
if (!$result) return false;
|
||||
return true;
|
||||
|
||||
@ -215,6 +269,9 @@ class Photo extends Module {
|
||||
|
||||
if (!isset($this->database, $this->photoIDs)) return false;
|
||||
|
||||
# Call plugins
|
||||
$this->plugins(__METHOD__, 0, func_get_args());
|
||||
|
||||
# Get photos
|
||||
$photos = $this->database->query("SELECT id, url, thumbUrl FROM lychee_photos WHERE id IN ($this->photoIDs);");
|
||||
|
||||
@ -236,6 +293,9 @@ class Photo extends Module {
|
||||
|
||||
}
|
||||
|
||||
# Call plugins
|
||||
$this->plugins(__METHOD__, 1, func_get_args());
|
||||
|
||||
if (!$photos) return false;
|
||||
return true;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user