From 466fe725bc056ad7ed2c3bf24783b65565293472 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 18 May 2014 18:21:20 -0700 Subject: start to build out the apps --- include/bbcode.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include/bbcode.php') diff --git a/include/bbcode.php b/include/bbcode.php index a4e7560d6..674b5f45a 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -166,6 +166,15 @@ function bb_parse_crypt($match) { } +function bb_parse_app($match) { + require_once('include/apps.php'); + + $app = app_decode($match[1]); + if($app) + return app_render($app); + +} + function bb_qr($match) { return '' . t('QR code') . ''; } @@ -684,6 +693,11 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) { $Text = preg_replace_callback("/\[crypt (.*?)\](.*?)\[\/crypt\]/ism", 'bb_parse_crypt', $Text); } + if(strpos($Text,'[/app]') !== false) { + $Text = preg_replace_callback("/\[app\](.*?)\[\/app\]/ism",'bb_parse_app', $Text); + } + + // html5 video and audio if (strpos($Text,'[/video]') !== false) { $Text = preg_replace_callback("/\[video\](.*?\.(ogg|ogv|oga|ogm|webm|mp4))\[\/video\]/ism", 'tryzrlvideo', $Text); -- cgit v1.2.3