fix issue where event items were parsed multiple times

This commit is contained in:
Mario
2024-06-21 10:18:40 +00:00
parent 0f02553d12
commit 1c34c354cf
3 changed files with 12 additions and 6 deletions

View File

@@ -362,7 +362,8 @@ class ThreadItem {
localize_item($item);
$body = prepare_body($item,true);
$opts = (($item['resource_type'] === 'event') ? ['is_event_item' => true] : []);
$body = prepare_body($item, true, $opts);
// $viewthread (below) is only valid in list mode. If this is a channel page, build the thread viewing link
// since we can't depend on llink or plink pointing to the right local location.

View File

@@ -2082,10 +2082,15 @@ function prepare_text($text, $content_type = 'text/bbcode', $opts = false) {
default:
require_once('include/bbcode.php');
if(stristr($text, '[nosmile]'))
$s = bbcode($text, ((is_array($opts)) ? $opts : [] ));
else
$s = smilies(bbcode($text, ((is_array($opts)) ? $opts : [] )));
// events are handled in format_event_obj()
if (empty($opts['is_event_item'])) {
if(stristr($text, '[nosmile]')) {
$s = bbcode($text, ((is_array($opts)) ? $opts : [] ));
}
else {
$s = smilies(bbcode($text, ((is_array($opts)) ? $opts : [] )));
}
}
$s = zidify_links($s);

View File

@@ -1008,7 +1008,7 @@ function liveUpdate(notify_id) {
in_progress = false;
liveRecurse ++;
if(liveRecurse < 10) {
liveUpdate();
liveUpdate(notify_id);
}
else {
console.log('Incomplete data. Too many attempts. Giving up.');