| 1 |
<?php |
| 2 |
// Exit if accessed directly |
| 3 |
if( !defined( 'ABSPATH' ) ) exit; |
| 4 |
?> |
| 5 |
|
| 6 |
<div class="wpfl-3 wpforo-section"> |
| 7 |
<div class="wpforo-post-head"> |
| 8 |
<?php wpforo_topic_head($forum, $topic); ?> |
| 9 |
</div> |
| 10 |
<?php wpforo_moderation_tools(); ?> |
| 11 |
<?php wpforo_check_threads($posts); ?> |
| 12 |
|
| 13 |
<?php foreach($posts as $key => $post ) : $is_topic = !$key; ?> |
| 14 |
|
| 15 |
<div class="wpforo-qa-item-wrap"> |
| 16 |
<?php if($post['parentid'] == 0): ?> |
| 17 |
<?php $member = wpforo_member($post); $wpf_is_anon = function_exists('wpforo_is_anonymous_mask_member') ? wpforo_is_anonymous_mask_member($member) : false; $post_url = wpforo_post($post['postid'],'url'); ?> |
| 18 |
<div id="post-<?php echo wpforo_bigintval($post['postid']) ?>" data-postid="<?php echo wpforo_bigintval($post['postid']) ?>" data-userid="<?php echo wpforo_bigintval($member['userid']) ?>" data-mention="<?php echo esc_attr( ( wpforo_setting( 'profiles', 'mention_nicknames' ) ? $member['user_nicename'] : '') ) ?>" data-isowner="<?php echo esc_attr( (int) (bool) wpforo_is_owner($member['userid']) ) ?>" class="post-wrap wpfn-<?php echo ($key+1); ?><?php if( !$post['is_first_post'] ) echo ' wpf-answer-wrap'; else echo ' wpfp-first'; ?>" <?php echo ($key == 1) ? ' style="border-top:none;" ' : ''; ?>> |
| 19 |
<?php wpforo_share_toggle($post_url, $post['body']); ?> |
| 20 |
<div class="wpforo-post wpfcl-1"> |
| 21 |
<div class="wpf-left"> |
| 22 |
<div class="wpforo-post-voting"> |
| 23 |
<div class="wpf-positive"> |
| 24 |
<?php wpforo_post_buttons( 'icon-text', 'positivevote', $forum, $topic, $post ); ?> |
| 25 |
</div> |
| 26 |
<div class="wpf-vote-number"> |
| 27 |
<?php WPF()->tpl->vote_count($post) ?> |
| 28 |
</div> |
| 29 |
<div class="wpf-negative"> |
| 30 |
<?php wpforo_post_buttons( 'icon-text', 'negativevote', $forum, $topic, $post ); ?> |
| 31 |
</div> |
| 32 |
<?php wpforo_post_buttons( 'icon-text', 'isanswer', $forum, $topic, $post ); ?> |
| 33 |
</div> |
| 34 |
</div><!-- left --> |
| 35 |
<div class="wpf-right"> |
| 36 |
<div class="wpforo-post-content-top"> |
| 37 |
<?php if($post['status']): ?> |
| 38 |
<span class="wpf-mod-message"> |
| 39 |
<i class="fas fa-exclamation-circle" aria-hidden="true"></i> <?php wpforo_phrase('Awaiting moderation') ?></span> |
| 40 |
<?php endif; ?> |
| 41 |
<?php wpforo_share_toggle($post_url, $post['body'], 'top'); ?> |
| 42 |
<div class="wpforo-post-link wpf-post-link"> |
| 43 |
<?php wpforo_post_buttons( 'icon', ['custom-top', 'bookmark', 'report', 'link'], $forum, $topic, $post ); ?> |
| 44 |
</div> |
| 45 |
<div class="wpforo-post-date"><?php wpforo_date($post['created'], 'd/m/Y g:i a'); ?></div> |
| 46 |
<?php wpforo_topic_starter($topic, $post) ?> |
| 47 |
<?php do_action( 'wpforo_post_content_top_left', $post ) ?> |
| 48 |
<div class="wpf-clear-right"></div> |
| 49 |
</div> |
| 50 |
<div class="wpforo-post-author"> |
| 51 |
<?php if( WPF()->usergroup->can('va') && wpforo_setting( 'profiles', 'avatars' ) ) : ?> |
| 52 |
<div class="wpforo-post-avatar"><?php echo wpforo_user_avatar($member) ?></div> |
| 53 |
<?php endif; ?> |
| 54 |
<div class="wpforo-post-author-details"> |
| 55 |
<div class="wpforo-post-author-name"> |
| 56 |
<?php wpforo_member_link($member, '', 0, 'wpf-pa-name'); ?> <span class="wpf-pa-online"><?php WPF()->member->show_online_indicator($member['userid']) ?></span> |
| 57 |
<?php if( empty($wpf_is_anon) ) { wpforo_member_nicename($member, '@'); } ?> |
| 58 |
</div> |
| 59 |
<div class="wpforo-post-author-data"> |
| 60 |
<div> |
| 61 |
<?php wpforo_member_title($member, true,'', '', ['custom-fields', 'rating-title', 'custom-title']) ?> |
| 62 |
</div> |
| 63 |
<div> |
| 64 |
<?php wpforo_member_badge($member, ' ') ?> |
| 65 |
<?php wpforo_member_title($member, true,'', ', ', ['usergroup']) ?> |
| 66 |
</div> |
| 67 |
</div> |
| 68 |
<div class="wpforo-post-author-stat"> |
| 69 |
<?php if( empty($wpf_is_anon) ): ?><span class="author-posts"><?php echo intval($member['posts']) ?> <?php wpforo_phrase('Posts') ?></span><br /><?php endif; ?> |
| 70 |
<?php if( empty($wpf_is_anon) ): ?> |
| 71 |
<span class="author-stat-item"><i class="fas fa-question-circle wpfcl-6" title="<?php wpforo_phrase('Questions') ?>"></i><?php echo intval($member['questions']) ?></span> |
| 72 |
<span class="author-stat-item"><i class="fas fa-check-square wpfcl-5" title="<?php wpforo_phrase('Answers') ?>"></i><?php echo intval($member['answers']) ?></span> |
| 73 |
<span class="author-stat-item"><i class="fas fa-comment wpfcl-0" title="<?php wpforo_phrase('Comments') ?>"></i><?php echo intval($member['comments']) ?></span> |
| 74 |
<?php endif; ?> |
| 75 |
</div> |
| 76 |
</div> |
| 77 |
</div> |
| 78 |
<div class="wpforo-post-content"> |
| 79 |
<?php wpforo_content($post); ?> |
| 80 |
<?php wpforo_post_edited($post); ?> |
| 81 |
<?php do_action( 'wpforo_tpl_post_loop_after_content', $post, $member ) ?> |
| 82 |
<?php if( wpforo_setting( 'profiles', 'signature' ) ): ?> |
| 83 |
<?php if( trim((string) $member['signature'])): ?><div class="wpforo-post-signature"><?php wpforo_signature( $member ) ?></div><?php endif ?> |
| 84 |
<?php endif; ?> |
| 85 |
<?php do_action( 'wpforo_post_content_footer', $post, $topic, $forum, 3 ) ?> |
| 86 |
</div> |
| 87 |
<div class="wpforo-post-author"> |
| 88 |
<div class="wpforo-post-lb-box"> |
| 89 |
<?php |
| 90 |
if( $post['is_first_post'] ){ |
| 91 |
$answer_button = wpforo_setting( 'posting', 'qa_display_answer_editor' ) ? 'style="display:none;"' : ''; |
| 92 |
echo '<div class="wpf-answer-button" ' . $answer_button . '>'; |
| 93 |
wpforo_post_buttons( 'icon-text', 'answer', $forum, $topic, $post ); |
| 94 |
echo '</div>'; |
| 95 |
} |
| 96 |
echo '<div class="wpf-add-comment-button" style="display:none;">'; |
| 97 |
wpforo_post_buttons( 'icon-text', 'comment', $forum, $topic, $post ); |
| 98 |
echo '</div>'; |
| 99 |
?> |
| 100 |
</div> |
| 101 |
</div><!-- wpforo-post-author --> |
| 102 |
<div class="wpforo-post-tool-bar"> |
| 103 |
<?php |
| 104 |
$buttons = [ 'custom-bottom', 'edit', 'approved', 'delete' ]; |
| 105 |
wpforo_post_buttons( 'icon-text', $buttons, $forum, $topic, $post ); |
| 106 |
?> |
| 107 |
</div> |
| 108 |
</div><!-- right --> |
| 109 |
<div class="wpf-clear"></div> |
| 110 |
</div><!-- wpforo-post --> |
| 111 |
</div><!-- post-wrap --> |
| 112 |
<?php |
| 113 |
$comment_count = 0; |
| 114 |
$row_count = ( wpforo_setting( 'topics', 'layout_qa_comments_limit_count' ) ?: null ); |
| 115 |
$args = array( |
| 116 |
'root' => $post['postid'], |
| 117 |
'row_count' => $row_count |
| 118 |
); |
| 119 |
$comments = WPF()->post->get_posts( $args, $comment_count ); |
| 120 |
if(is_array($comments) && !empty($comments)): ?> |
| 121 |
<div class="wpforo-qa-comments"> |
| 122 |
<?php foreach($comments as $comment) wpforo_qa_comment_template($comment, $forum, $topic); ?> |
| 123 |
</div> |
| 124 |
<?php endif; ?> |
| 125 |
|
| 126 |
<div class="wpforo-comment"> |
| 127 |
<div class="wpf-left"></div> |
| 128 |
<div class="wpf-right" style="background: none;"> |
| 129 |
<div class="wpforo-qa-comments-footer"> |
| 130 |
<div class="wpforo-qa-comment-loadrest"> |
| 131 |
<?php if( $comment_count > ($count_comments = count($comments)) ) : ?> |
| 132 |
<a class="wpforo-qa-show-rest-comments" title="<?php wpforo_phrase('expand to show all comments on this post') ?>"> |
| 133 |
<?php printf( wpforo_phrase('show %d more comments', false), ($comment_count - $count_comments ) ) ?> |
| 134 |
</a> |
| 135 |
<?php endif; ?> |
| 136 |
</div> |
| 137 |
<div class="wpf-add-comment-button"> |
| 138 |
<?php wpforo_post_buttons( 'icon-text', 'comment', $forum, $topic, $post ); ?> |
| 139 |
</div> |
| 140 |
</div> |
| 141 |
</div> |
| 142 |
<div class="wpf-clear"></div> |
| 143 |
</div> |
| 144 |
|
| 145 |
<div class="wpforo-comment"> |
| 146 |
<div class="wpf-left"></div> |
| 147 |
<div class="wpf-right" style="background: none;"> |
| 148 |
<div class="wpforo-portable-form-wrap"></div> |
| 149 |
</div> |
| 150 |
<div class="wpf-clear"></div> |
| 151 |
</div> |
| 152 |
|
| 153 |
<?php if( $post['is_first_post'] ): ?> |
| 154 |
<div class="wpforo-topic-meta"> |
| 155 |
<?php wpforo_tags( $topic ); ?> |
| 156 |
</div> |
| 157 |
<?php if($topic['answers']): ?> |
| 158 |
<div class="wpf-answer-sep"> |
| 159 |
<div class="wpf-answer-title"> |
| 160 |
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12.0867962,18 L6,21.8042476 L6,18 L4,18 C2.8954305,18 2,17.1045695 2,16 L2,4 C2,2.8954305 2.8954305,2 4,2 L20,2 C21.1045695,2 22,2.8954305 22,4 L22,16 C22,17.1045695 21.1045695,18 20,18 L12.0867962,18 Z M8,18.1957524 L11.5132038,16 L20,16 L20,4 L4,4 L4,16 L8,16 L8,18.1957524 Z M11,10.5857864 L15.2928932,6.29289322 L16.7071068,7.70710678 L11,13.4142136 L7.29289322,9.70710678 L8.70710678,8.29289322 L11,10.5857864 Z" fill-rule="evenodd"/></svg> |
| 161 |
<?php ( $topic['answers'] > 1 ) ? printf( wpforo_phrase('%d Answers', false), $topic['answers'] ) : printf( wpforo_phrase('%d Answer', false), $topic['answers'] ) ; ?> |
| 162 |
</div> |
| 163 |
<div class="wpf-answer-filter"> |
| 164 |
<?php wpforo_posts_ordering_dropdown() ?> |
| 165 |
</div> |
| 166 |
</div> |
| 167 |
<?php endif; ?> |
| 168 |
<?php endif; ?> |
| 169 |
|
| 170 |
<?php do_action( 'wpforo_loop_hook', $key ) ?> |
| 171 |
<?php endif; ?> |
| 172 |
</div> |
| 173 |
<?php endforeach; ?> |
| 174 |
|
| 175 |
<?php if( $topic['answers'] && ! wpforo_setting( 'posting', 'qa_display_answer_editor' ) ): ?> |
| 176 |
<div class="wpf-bottom-bar"> |
| 177 |
<div class="wpf-answer-button"> |
| 178 |
<?php wpforo_post_buttons( 'icon-text', 'answer', $forum, $topic ); ?> |
| 179 |
</div> |
| 180 |
</div> |
| 181 |
<?php endif; ?> |
| 182 |
</div><!-- wpfl-3 --> |
| 183 |
|