mirror of
https://framagit.org/hubzilla/core.git
synced 2026-06-21 00:52:33 -04:00
implement bdi tags via bbcode where possible
This commit is contained in:
@@ -803,18 +803,18 @@ class Enotify {
|
||||
localize_item($item);
|
||||
|
||||
if($item['shortlocalize']) {
|
||||
$itemem_text = strip_tags($item['shortlocalize']);
|
||||
$itemem_text = $item['shortlocalize'];
|
||||
}
|
||||
elseif($item['localize']) {
|
||||
$itemem_text = strip_tags($item['localize']);
|
||||
$itemem_text = $item['localize'];
|
||||
}
|
||||
else {
|
||||
$itemem_text = (($item['item_thread_top'])
|
||||
? t('created a new post')
|
||||
: sprintf( t('commented on %s\'s post'), '<bdi>' . strip_tags($item['owner']['xchan_name']) . '</bdi>'));
|
||||
: sprintf( t('commented on %s\'s post'), '[bdi]' . $item['owner']['xchan_name'] . '[/bdi]'));
|
||||
|
||||
if($item['verb'] === ACTIVITY_SHARE) {
|
||||
$itemem_text = sprintf( t('repeated %s\'s post'), '<bdi>' . strip_tags($item['author']['xchan_name']) . '</bdi>');
|
||||
$itemem_text = sprintf( t('repeated %s\'s post'), '[bdi]' . $item['author']['xchan_name'] . '[/bdi]');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -849,7 +849,7 @@ class Enotify {
|
||||
//'b64mid' => ((in_array($item['verb'], [ACTIVITY_LIKE, ACTIVITY_DISLIKE])) ? 'b64.' . base64url_encode($item['thr_parent']) : 'b64.' . base64url_encode($item['mid'])),
|
||||
'notify_id' => 'undefined',
|
||||
'thread_top' => (($item['item_thread_top']) ? true : false),
|
||||
'message' => $itemem_text,
|
||||
'message' => bbcode(strip_tags($itemem_text)),
|
||||
// these are for the superblock addon
|
||||
'hash' => $item[$who]['xchan_hash'],
|
||||
'uid' => $item['uid'],
|
||||
|
||||
@@ -382,7 +382,7 @@ function bb_ShareAttributes($match) {
|
||||
// Bob Smith wrote the following post 2 hours ago
|
||||
|
||||
$fmt = sprintf( t('%1$s wrote the following %2$s %3$s'),
|
||||
'<a href="' . (($auth) ? zid($profile) : $profile) . '" >' . $author . '</a>',
|
||||
'<a href="' . (($auth) ? zid($profile) : $profile) . '" ><bdi>' . $author . '</bdi></a>',
|
||||
'<a href="' . (($auth) ? zid($link) : $link) . '" >' . $type . '</a>',
|
||||
$reldate
|
||||
);
|
||||
@@ -1111,6 +1111,12 @@ function bbcode($Text, $options = []) {
|
||||
if (strpos($Text,'[/footer]') !== false) {
|
||||
$Text = preg_replace("(\[footer\](.*?)\[\/footer\])ism", "<div class=\"wall-item-footer\">$1</div>", $Text);
|
||||
}
|
||||
|
||||
// Check for bdi
|
||||
if (strpos($Text,'[/bdi]') !== false) {
|
||||
$Text = preg_replace("(\[bdi\](.*?)\[\/bdi\])ism", "<bdi>$1</bdi>", $Text);
|
||||
}
|
||||
|
||||
// Check for list text
|
||||
|
||||
$Text = preg_replace("/<br \/>\[\*\]/ism",'[*]',$Text);
|
||||
|
||||
@@ -172,9 +172,9 @@ function localize_item(&$item){
|
||||
$shortbodyverb = t('doesn\'t like %1$s\'s %2$s');
|
||||
}
|
||||
|
||||
$item['shortlocalize'] = sprintf($shortbodyverb, $objauthor, $plink);
|
||||
$item['shortlocalize'] = sprintf($shortbodyverb, '[bdi]' . $objauthor . '[/bdi]', $plink);
|
||||
|
||||
$item['body'] = $item['localize'] = sprintf($bodyverb, $author, $objauthor, $plink);
|
||||
$item['body'] = $item['localize'] = sprintf($bodyverb, '[bdi]' . $author . '[/bdi]', '[bdi]' . $objauthor . '[/bdi]', $plink);
|
||||
if($Bphoto != "")
|
||||
$item['body'] .= "\n\n\n" . '[zrl=' . chanlink_url($author_link) . '][zmg=80x80]' . $Bphoto . '[/zmg][/zrl]';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user