From 3d83a2415c96417b8be8ce1772de674f896bfce3 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sat, 20 Jul 2013 14:58:42 +0200 Subject: [PATCH] pumpio: Youtube- and vimeo videos have now a preview image. --- pumpio/pumpio.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index f85e8bd9..60d8e82f 100755 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -363,13 +363,24 @@ function pumpio_send(&$a,&$b) { if ($title != '') $title = "

".$title."

"; + $content = bbcode($b['body'], false, false); + + // Enhance the way, videos are displayed + $content = preg_replace('/(.*?)<\/a>/ism',"\n[url]$1[/url]\n",$content); + $content = preg_replace('/(.*?)<\/a>/ism',"\n$1\n",$content); + $content = preg_replace('/(.*?)<\/a>/ism',"\n$1\n",$content); + $content = preg_replace('/(.*?)<\/a>/ism',"\n$1\n",$content); + + $URLSearchString = "^\[\]"; + $content = preg_replace_callback("/\[url\]([$URLSearchString]*)\[\/url\]/ism",'tryoembed',$content); + $params = array(); $params["verb"] = "post"; $params["object"] = array( 'objectType' => "note", - 'content' => $title.bbcode($b['body'], false, false)); + 'content' => $title.$content); if ($public) $params["to"] = array(Array( -- 2.39.5