| 1 |
<?php |
| 2 |
// Exit if accessed directly |
| 3 |
if( ! defined( 'ABSPATH' ) ) exit; |
| 4 |
?> |
| 5 |
|
| 6 |
<div class="wpfl-3"> |
| 7 |
<div class="wpforo-post-head"> |
| 8 |
<div class="wpf-left"> |
| 9 |
<a href="<?php echo esc_url( (string) wpforo_post( $topic['last_post'], 'url' ) ); ?>" class="wpfcl-2"><i class="far fa-caret-square-down wpfsx wpfcl-3"></i> <span class="wpfcl-3"><?php wpforo_phrase( 'Last Post' ); ?></span></a> |
| 10 |
<?php do_action( 'wpforo_topic_head_left', $forum, $topic ) ?> |
| 11 |
</div> |
| 12 |
<div class="wpf-right"> |
| 13 |
<?php do_action( 'wpforo_topic_head_right', $forum, $topic ) ?> |
| 14 |
<?php wpforo_post_buttons( 'icon-text', 'tools', $forum ); ?> |
| 15 |
<?php wpforo_feed_link(); ?> |
| 16 |
</div> |
| 17 |
<br class="wpf-clear"/> |
| 18 |
</div> |
| 19 |
|
| 20 |
<?php wpforo_moderation_tools(); ?> |
| 21 |
<?php wpforo_check_threads( $posts ); ?> |
| 22 |
|
| 23 |
<?php foreach( $posts as $key => $post ) : $is_topic = ! $key; ?> |
| 24 |
|
| 25 |
<div class="wpforo-qa-item-wrap"> |
| 26 |
<?php if( $post['parentid'] == 0 ): ?> |
| 27 |
<?php $member = wpforo_member( $post ); |
| 28 |
$wpf_is_anon = function_exists('wpforo_is_anonymous_mask_member') ? wpforo_is_anonymous_mask_member($member) : false; |
| 29 |
$post_url = wpforo_post( $post['postid'], 'url' ); ?> |
| 30 |
<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'] ) ) ?>" |
| 31 |
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;" ' : ''; ?>> |
| 32 |
<?php wpforo_share_toggle( $post_url, $post['body'] ); ?> |
| 33 |
<div class="wpforo-post wpfcl-1"> |
| 34 |
<div class="wpf-left"> |
| 35 |
<div class="wpforo-post-voting"> |
| 36 |
<div class="wpf-positive"> |
| 37 |
<?php wpforo_post_buttons( 'icon-text', 'positivevote', $forum, $topic, $post ); ?> |
| 38 |
</div> |
| 39 |
<div class="wpf-vote-number"> |
| 40 |
<?php WPF()->tpl->vote_count( $post ) ?> |
| 41 |
</div> |
| 42 |
<div class="wpf-negative"> |
| 43 |
<?php wpforo_post_buttons( 'icon-text', 'negativevote', $forum, $topic, $post ); ?> |
| 44 |
</div> |
| 45 |
|
| 46 |
<?php wpforo_post_buttons( 'icon-text', 'isanswer', $forum, $topic, $post ); ?> |
| 47 |
</div> |
| 48 |
</div><!-- left --> |
| 49 |
<div class="wpf-right"> |
| 50 |
<div class="wpforo-post-content-top"> |
| 51 |
<?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><?php endif; ?> |
| 52 |
<?php wpforo_share_toggle( $post_url, $post['body'], 'top' ); ?> |
| 53 |
<div class="wpforo-post-link wpf-post-link"> |
| 54 |
<?php wpforo_post_buttons( 'icon-text', 'link', $forum, $topic, $post ); ?> |
| 55 |
</div> |
| 56 |
<div class="wpforo-post-date"><?php wpforo_date( $post['created'], 'd/m/Y g:i a' ); ?></div> |
| 57 |
<?php wpforo_topic_starter( $topic, $post ) ?> |
| 58 |
<?php do_action( 'wpforo_post_content_top_left', $post ) ?> |
| 59 |
<div class="wpf-clear-right"></div> |
| 60 |
</div> |
| 61 |
<div class="wpforo-post-content"> |
| 62 |
<?php wpforo_content( $post ); ?> |
| 63 |
<?php wpforo_post_edited( $post ); ?> |
| 64 |
<?php do_action( 'wpforo_tpl_post_loop_after_content', $post, $member ) ?> |
| 65 |
<?php if( wpforo_setting( 'profiles', 'signature' ) ): ?> |
| 66 |
<?php if( trim( (string) $member['signature'] ) ): ?> |
| 67 |
<div class="wpforo-post-signature"><?php wpforo_signature( $member ) ?></div><?php endif ?> |
| 68 |
<?php endif; ?> |
| 69 |
</div> |
| 70 |
<div class="wpforo-post-author"> |
| 71 |
<div class="wpforo-post-lb-box"> |
| 72 |
<?php |
| 73 |
if( $post['is_first_post'] ) { |
| 74 |
$answer_button = wpforo_setting( 'posting', 'qa_display_answer_editor' ) ? 'style="display:none;"' : ''; |
| 75 |
echo '<div class="wpf-answer-button" ' . $answer_button . '>'; |
| 76 |
wpforo_post_buttons( 'icon-text', 'answer', $forum, $topic, $post ); |
| 77 |
echo '</div>'; |
| 78 |
} |
| 79 |
echo '<div class="wpf-add-comment-button" style="display:none;">'; |
| 80 |
wpforo_post_buttons( 'icon-text', 'comment', $forum, $topic, $post ); |
| 81 |
echo '</div>'; |
| 82 |
?> |
| 83 |
</div> |
| 84 |
<div class="wpforo-post-author-data"> |
| 85 |
<div class="wpforo-box-l3a-wrap wpforo-post-author-data-content"> |
| 86 |
<div class="wpforo-box-l3a-top"></div> |
| 87 |
<div class="wpforo-box-l3a-lr"> |
| 88 |
<?php if( WPF()->usergroup->can( 'va' ) && wpforo_setting( 'profiles', 'avatars' ) ): $rsz = ''; ?> |
| 89 |
<div class="wpforo-box-l3a-left"><?php echo wpforo_user_avatar( $member ) ?></div> |
| 90 |
<?php else: $rsz = 'style="margin-left:10px;"'; endif; ?> |
| 91 |
<div class="wpforo-box-l3a-right" <?php echo $rsz; //This is a HTML content// ?>> |
| 92 |
<span class="author-name"><?php wpforo_member_link( $member ); ?></span> <span><?php WPF()->member->show_online_indicator( $member['userid'] ) ?></span><br/> |
| 93 |
<?php if( empty($wpf_is_anon) ) { wpforo_member_nicename( $member, '@' ); } ?> |
| 94 |
<span class="author-title"> |
| 95 |
<?php wpforo_member_title( $member ) ?> |
| 96 |
</span><br/> |
| 97 |
<?php wpforo_member_badge( $member, ' | ' ) ?> |
| 98 |
<?php if( empty($wpf_is_anon) ): ?><span class="author-posts"><?php echo intval( $member['posts'] ) ?><?php wpforo_phrase( 'Posts' ) ?></span><br/><?php endif; ?> |
| 99 |
<?php if( empty($wpf_is_anon) ): ?> |
| 100 |
<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> |
| 101 |
<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> |
| 102 |
<span class="author-stat-item"><i class="fas fa-comment wpfcl-0" title="<?php wpforo_phrase( 'Comments' ) ?>"></i><?php echo intval( $member['comments'] ) ?></span> |
| 103 |
<?php endif; ?> |
| 104 |
</div> |
| 105 |
<div class="wpf-clear"></div> |
| 106 |
</div> |
| 107 |
</div> |
| 108 |
</div> |
| 109 |
</div><!-- wpforo-post-author --> |
| 110 |
<div class="wpforo-post-tool-bar"> |
| 111 |
<?php if( $post['is_first_post'] ) { |
| 112 |
$buttons = [ 'custom-bottom', 'sticky', 'private', 'close', 'approved', 'edit', 'delete', 'report' ]; |
| 113 |
} else { |
| 114 |
$buttons = [ 'custom-bottom', 'edit', 'approved', 'delete', 'report' ]; |
| 115 |
} |
| 116 |
wpforo_post_buttons( 'icon-text', $buttons, $forum, $topic, $post ); ?> |
| 117 |
</div> |
| 118 |
</div><!-- right --> |
| 119 |
<div class="wpf-clear"></div> |
| 120 |
</div><!-- wpforo-post --> |
| 121 |
</div><!-- post-wrap --> |
| 122 |
<?php |
| 123 |
$comment_count = 0; |
| 124 |
$row_count = ( wpforo_setting( 'topics', 'layout_qa_comments_limit_count' ) ?: null ); |
| 125 |
$args = [ |
| 126 |
'root' => $post['postid'], |
| 127 |
'row_count' => $row_count, |
| 128 |
]; |
| 129 |
$comments = WPF()->post->get_posts( $args, $comment_count ); |
| 130 |
if( is_array( $comments ) && ! empty( $comments ) ): ?> |
| 131 |
<div class="wpforo-qa-comments"> |
| 132 |
<?php foreach( $comments as $comment ) wpforo_qa_comment_template( $comment, $forum, $topic ); ?> |
| 133 |
</div> |
| 134 |
<?php endif; ?> |
| 135 |
|
| 136 |
<div class="wpforo-comment"> |
| 137 |
<div class="wpf-left"></div> |
| 138 |
<div class="wpf-right" style="background: none;"> |
| 139 |
<div class="wpforo-qa-comments-footer"> |
| 140 |
<div class="wpforo-qa-comment-loadrest"> |
| 141 |
<?php if( $comment_count > ( $count_comments = count( $comments ) ) ) : ?> |
| 142 |
<a class="wpforo-qa-show-rest-comments" title="<?php wpforo_phrase( 'expand to show all comments on this post' ) ?>"> |
| 143 |
<?php printf( wpforo_phrase( 'show %d more comments', false ), ( $comment_count - $count_comments ) ) ?> |
| 144 |
</a> |
| 145 |
<?php endif; ?> |
| 146 |
</div> |
| 147 |
<div class="wpf-add-comment-button"> |
| 148 |
<?php wpforo_post_buttons( 'icon-text', 'comment', $forum, $topic, $post ); ?> |
| 149 |
</div> |
| 150 |
</div> |
| 151 |
</div> |
| 152 |
<div class="wpf-clear"></div> |
| 153 |
</div> |
| 154 |
|
| 155 |
<div class="wpforo-comment"> |
| 156 |
<div class="wpf-left"></div> |
| 157 |
<div class="wpf-right" style="background: none;"> |
| 158 |
<div class="wpforo-portable-form-wrap"></div> |
| 159 |
</div> |
| 160 |
<div class="wpf-clear"></div> |
| 161 |
</div> |
| 162 |
|
| 163 |
<?php if( $post['is_first_post'] ): ?> |
| 164 |
<div class="wpforo-topic-meta"> |
| 165 |
<?php wpforo_tags( $topic ); ?> |
| 166 |
</div> |
| 167 |
<?php if( $topic['answers'] ): ?> |
| 168 |
<div class="wpf-answer-sep"> |
| 169 |
<div class="wpf-answer-title"> |
| 170 |
<?php ( $topic['answers'] > 1 ) ? printf( wpforo_phrase( '%d Answers', false ), $topic['answers'] ) : printf( wpforo_phrase( '%d Answer', false ), $topic['answers'] ); ?> |
| 171 |
</div> |
| 172 |
<div class="wpf-answer-filter"> |
| 173 |
<?php wpforo_posts_ordering_dropdown() ?> |
| 174 |
</div> |
| 175 |
</div> |
| 176 |
<?php endif; ?> |
| 177 |
<?php endif; ?> |
| 178 |
|
| 179 |
<?php do_action( 'wpforo_loop_hook', $key ) ?> |
| 180 |
<?php endif; ?> |
| 181 |
</div> |
| 182 |
<?php endforeach; ?> |
| 183 |
|
| 184 |
<?php if( $topic['answers'] && ! wpforo_setting( 'posting', 'qa_display_answer_editor' ) ): ?> |
| 185 |
<div class="wpf-bottom-bar"> |
| 186 |
<div class="wpf-answer-button"> |
| 187 |
<?php wpforo_post_buttons( 'icon-text', 'answer', $forum, $topic ); ?> |
| 188 |
</div> |
| 189 |
</div> |
| 190 |
<?php endif; ?> |
| 191 |
</div><!-- wpfl-3 --> |
| 192 |
|