summaryrefslogtreecommitdiff
path: root/init.php
diff options
context:
space:
mode:
Diffstat (limited to 'init.php')
-rw-r--r--init.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/init.php b/init.php
index 7a05506..8178107 100644
--- a/init.php
+++ b/init.php
@@ -29,6 +29,7 @@ class Api_Resize_Media extends Plugin {
$host->add_hook($host::HOOK_PREFS_TAB, $this);
$host->add_hook($host::HOOK_RENDER_ARTICLE_CDM, $this, 999);
$host->add_hook($host::HOOK_RENDER_ARTICLE, $this, 999);
+ $host->add_hook($host::HOOK_ENCLOSURE_ENTRY, $this, 999);
}
private function make_thumbnail($input_filename, $output_filename, $dim_max_x = 600, $dim_max_y = 600,
@@ -320,6 +321,15 @@ class Api_Resize_Media extends Plugin {
}
/** @noinspection PhpUnused */
+ function hook_enclosure_entry($enc) {
+ $force_width = (int) $this->host->get($this, "force_width", 0);
+
+ $enc["content_url"] = $this->rewrite_url_if_needed($enc["content_url"], $force_width);
+
+ return $enc;
+ }
+
+ /** @noinspection PhpUnused */
function hook_render_article_cdm($row) {
$force_width = (int) $this->host->get($this, "force_width", 0);