diff options
author | habeascodice <habeascodice@federated.social> | 2014-10-07 16:13:22 -0700 |
---|---|---|
committer | habeascodice <habeascodice@federated.social> | 2014-10-07 16:13:22 -0700 |
commit | c01a9839577a5fc3a8965713e206616edc586c74 (patch) | |
tree | c9aa6cf42c2146bf5cee0a11a37ba6c93ef401d3 /include/bbcode.php | |
parent | 6b40c2cd090d1c406b3e1cd7ad135baff21bfd54 (diff) | |
parent | d94f6f7c53fbb01a76a6d3beb14968d02ebb3afa (diff) | |
download | volse-hubzilla-c01a9839577a5fc3a8965713e206616edc586c74.tar.gz volse-hubzilla-c01a9839577a5fc3a8965713e206616edc586c74.tar.bz2 volse-hubzilla-c01a9839577a5fc3a8965713e206616edc586c74.zip |
Merge remote branch 'upstream/master'
Diffstat (limited to 'include/bbcode.php')
-rw-r--r-- | include/bbcode.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/bbcode.php b/include/bbcode.php index 0803ed365..d7a5ac457 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -159,6 +159,14 @@ function bb_parse_app($match) { } +function bb_parse_element($match) { + $j = json_decode(base64url_decode($match[1]),true); + if($j) { + $o = EOL . '<a href="' . z_root() . '" foo="baz" onclick="importElement(\'' . $match[1] . '\'); return false;" >' . t('Install design element: ') . $j['pagetitle'] . '</a>' . EOL; + } + return $o; +} + 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') . '" />'; } @@ -700,6 +708,10 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) { $Text = preg_replace_callback("/\[app\](.*?)\[\/app\]/ism",'bb_parse_app', $Text); } + if(strpos($Text,'[/element]') !== false) { + $Text = preg_replace_callback("/\[element\](.*?)\[\/element\]/ism",'bb_parse_element', $Text); + } + // html5 video and audio if (strpos($Text,'[/video]') !== false) { |