}
}
+ $forumtype = get_field('forum', 'type', 'id', $post->forum);
+
$age = time() - $post->created;
/// Hack for allow to edit news posts those are not displayed yet until they are displayed
if (!$post->parent
- && get_field('forum', 'type', 'id', $post->forum) == 'news'
+ && $forumtype == 'news'
&& get_field_sql("SELECT id FROM {$CFG->prefix}forum_discussions WHERE id = $post->discussion AND timestart > ".time())) {
$age = 0;
}
}
}
- if (has_capability('mod/forum:splitdiscussions', $modcontext) and $post->parent) {
+ if (has_capability('mod/forum:splitdiscussions', $modcontext)
+ && $post->parent && $forumtype != 'single') {
+
$commands[] = '<a href="'.$CFG->wwwroot.'/mod/forum/post.php?prune='.$post->id.
'" title="'.$strpruneheading.'">'.$strprune.'</a>';
}
}
$post->forum = $forum->id; // Add the forum id to the post object, later used by forum_print_post
+ $post->forumtype = $forum->type;
$post->subject = format_string($post->subject);