From 4ff23f52d7e8ec30e058d5ad5cc42254572ec2cf Mon Sep 17 00:00:00 2001 From: Guillaume Dott Date: Fri, 15 May 2015 10:41:20 +0200 Subject: [PATCH] Add thumbnail into article content --- init.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/init.php b/init.php index 15c97db..3195a98 100644 --- a/init.php +++ b/init.php @@ -1,12 +1,22 @@ add_hook($host::HOOK_ARTICLE_FILTER, $this); } function hook_article_filter($article) { + if(strpos($article["link"], "youtube.com") !== FALSE) { + $video_id = str_replace('http://www.youtube.com/watch?v=', '', $article["link"]); + $article["content"] = ''.$article['; + } + + return $article; } function api_version() { return 2; }