summaryrefslogtreecommitdiff
path: root/classes/article.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-09 08:24:46 +0300
committerAndrew Dolgov <[email protected]>2021-02-09 08:24:46 +0300
commitf6f0f216641c2e47f429a05f0d5e2c39d0cd8f89 (patch)
treeeab454f3430fad93d836f44e769803dc77157818 /classes/article.php
parent0871a51cb4ba81277d8ce898bbdbfc6f0ae0fcca (diff)
make ARTICLE_KIND_ constants class members
Diffstat (limited to 'classes/article.php')
-rwxr-xr-xclasses/article.php13
1 files changed, 6 insertions, 7 deletions
diff --git a/classes/article.php b/classes/article.php
index 6729443a1..305764ed3 100755
--- a/classes/article.php
+++ b/classes/article.php
@@ -1,5 +1,8 @@
<?php
class Article extends Handler_Protected {
+ const ARTICLE_KIND_ALBUM = 1;
+ const ARTICLE_KIND_VIDEO = 2;
+ const ARTICLE_KIND_YOUTUBE = 3;
function redirect() {
$id = clean($_REQUEST['id']);
@@ -727,10 +730,6 @@ class Article extends Handler_Protected {
$article_stream = "";
$article_kind = 0;
- define('ARTICLE_KIND_ALBUM', 1); /* TODO */
- define('ARTICLE_KIND_VIDEO', 2);
- define('ARTICLE_KIND_YOUTUBE', 3);
-
PluginHost::getInstance()->chain_hooks_callback(PluginHost::HOOK_ARTICLE_IMAGE,
function ($result) use (&$article_image, &$article_stream, &$content) {
list ($article_image, $article_stream, $content) = $result;
@@ -750,7 +749,7 @@ class Article extends Handler_Protected {
if ($rrr = preg_match("/\/embed\/([\w-]+)/", $e->getAttribute("src"), $matches)) {
$article_image = "https://img.youtube.com/vi/" . $matches[1] . "/hqdefault.jpg";
$article_stream = "https://youtu.be/" . $matches[1];
- $article_kind = ARTICLE_KIND_YOUTUBE;
+ $article_kind = Article::ARTICLE_KIND_YOUTUBE;
break;
}
} else if ($e->nodeName == "video") {
@@ -760,7 +759,7 @@ class Article extends Handler_Protected {
if ($src) {
$article_stream = $src->getAttribute("src");
- $article_kind = ARTICLE_KIND_VIDEO;
+ $article_kind = Article::ARTICLE_KIND_VIDEO;
}
break;
@@ -785,7 +784,7 @@ class Article extends Handler_Protected {
$article_image = rewrite_relative_url($site_url, $article_image);
if (!$article_kind && (count($enclosures) > 1 || (isset($elems) && $elems->length > 1)))
- $article_kind = ARTICLE_KIND_ALBUM;
+ $article_kind = Article::ARTICLE_KIND_ALBUM;
}
if ($article_stream)