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