allow to edit topics by anonymous users.
This commit is contained in:
@ -35,6 +35,7 @@
|
||||
}else{
|
||||
$buttons = array( 'report', 'delete', 'link' );
|
||||
}
|
||||
wpforo_post_buttons( 'icon-text', $buttons, $forum, $topic, $post );
|
||||
if (!is_user_logged_in()) {
|
||||
$forumid = (isset($forum['forumid'])) ? $forum['forumid'] : 0;
|
||||
$topicid = (isset($topic['topicid'])) ? $topic['topicid'] : 0;
|
||||
@ -48,7 +49,6 @@
|
||||
echo '<span wpf-tooltip="'.esc_attr(wpforo_phrase('Delete', false)).'" id="'.esc_attr($a.$b).'" class="wpf-action wpforo-delete"><i class="fas fa-trash-alt wpfsx"></i><span class="wpf-button-text">'.wpforo_phrase('Delete', false).'</span></span>';
|
||||
}
|
||||
}
|
||||
wpforo_post_buttons( 'icon-text', $buttons, $forum, $topic, $post );
|
||||
?>
|
||||
</div>
|
||||
<?php wpforo_share_toggle($post_url, $post['body'], 'top'); ?>
|
||||
@ -64,6 +64,18 @@
|
||||
<?php
|
||||
$buttons = array( 'reply', 'quote', 'approved', 'edit', 'like' );
|
||||
wpforo_post_buttons( 'icon-text', $buttons, $forum, $topic, $post );
|
||||
if (!is_user_logged_in() && isset($post['email']) && !wpforo_is_owner($post['userid'], $post['email'])) {
|
||||
$forumid = (isset($forum['forumid'])) ? $forum['forumid'] : 0;
|
||||
$topicid = (isset($topic['topicid'])) ? $topic['topicid'] : 0;
|
||||
$is_topic = (bool) wpfval($post, 'is_first_post');
|
||||
$diff = current_time( 'timestamp', 1 ) - strtotime($post['created']);
|
||||
if (WPF()->perm->forum_can(($is_topic ? 'eot' : 'eor' ), $forumid)
|
||||
&& $diff < WPF()->post->options[($is_topic ? 'eot' : 'eor').'_durr']) {
|
||||
$a = ( $is_topic ) ? 'wpfedittopicpid' : '';
|
||||
$b = ( $is_topic ) ? $topicid : $postid;
|
||||
echo '<span wpf-tooltip="'.esc_attr(wpforo_phrase('Edit', false)).'" id="'.esc_attr($a.$b).'" class="wpforo-edit wpf-action"><i class="fas fa-edit wpfsx"></i><span class="wpf-button-text">'.wpforo_phrase('Edit', false).'</span></span>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php if($post['status']): ?>
|
||||
<span class="wpf-mod-message"><i class="fas fa-exclamation-circle" aria-hidden="true"></i> <?php wpforo_phrase('Awaiting moderation') ?></span>
|
||||
|
Reference in New Issue
Block a user