start to build out the apps

This commit is contained in:
friendica
2014-05-18 18:21:20 -07:00
parent 68ca4ef19e
commit 466fe725bc
2 changed files with 70 additions and 6 deletions

View File

@@ -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 '<img class="zrl" src="' . z_root() . '/photo/qr?f=&qr=' . urlencode($match[1]) . '" alt="' . t('QR code') . '" title="' . htmlspecialchars($match[1],ENT_QUOTES,'UTF-8') . '" />';
}
@@ -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);