diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/bbcode.php | 12 | ||||
-rwxr-xr-x | include/diaspora.php | 4 | ||||
-rw-r--r-- | include/message.php | 2 |
3 files changed, 15 insertions, 3 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) { diff --git a/include/diaspora.php b/include/diaspora.php index 0d4271cee..758f6e73c 100755 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -928,8 +928,8 @@ function get_diaspora_reshare_xml($url,$recurse = 0) { // see if it's a reshare of a reshare if($source_xml->root_diaspora_id && $source_xml->root_guid && $recurse < 15) { - $orig_author = notags(unxmlify($xml->root_diaspora_id)); - $orig_guid = notags(unxmlify($xml->root_guid)); + $orig_author = notags(unxmlify($source_xml->root_diaspora_id)); + $orig_guid = notags(unxmlify($source_xml->root_guid)); $source_url = 'https://' . substr($orig_author,strpos($orig_author,'@')+1) . '/p/' . $orig_guid . '.xml'; $y = get_diaspora_reshare_xml($source_url,$recurse+1); if($y) diff --git a/include/message.php b/include/message.php index 88cfb7ba2..b063530d6 100644 --- a/include/message.php +++ b/include/message.php @@ -50,7 +50,7 @@ function send_message($uid = 0, $recipient='', $body='', $subject='', $replyto=' // look for any existing conversation structure if(strlen($replyto)) { - $r = q("select convid from mail where uid = %d and ( mid = '%s' or parent_mid = '%s' ) limit 1", + $r = q("select convid from mail where channel_id = %d and ( mid = '%s' or parent_mid = '%s' ) limit 1", intval(local_user()), dbesc($replyto), dbesc($replyto) |