| 1 |
<?php |
| 2 |
if( ( ( $topic = WPF()->current_object['topic'] ) && wpforo_is_owner( $topic['userid'], $topic['email'] ) ) || ( WPF()->perm->forum_can( 'vt' ) && WPF()->perm->forum_can( 'ent' ) ) ): |
| 3 |
|
| 4 |
if( ( $forum = WPF()->current_object['forum'] ) && ( $topic = WPF()->current_object['topic'] ) && ( $posts = WPF()->current_object['posts'] ) ) : |
| 5 |
if( ! ( $topic['private'] && ! wpforo_is_owner( $topic['userid'], $topic['email'] ) && ! WPF()->perm->forum_can( 'vp' ) ) ): ?> |
| 6 |
|
| 7 |
<div class="wpf-head-bar"> |
| 8 |
<?php wpforo_single_title( 'post', $topic, '<h1 id="wpforo-title">', '</h1>' ); ?> |
| 9 |
<div class="wpf-action-link"> |
| 10 |
<?php do_action( 'wpforo_template_post_head_bar_action_links', $forum, $topic, $posts ); ?> |
| 11 |
</div> |
| 12 |
</div> |
| 13 |
<?php do_action( 'wpforo_template_post_head_bar', $forum, $topic, $posts ); ?> |
| 14 |
|
| 15 |
<?php |
| 16 |
wpforo_template_pagenavi( 'wpf-navi-post-top' ); |
| 17 |
if( $forum['layout'] == 3 ) include_once( wpftpl( 'layouts/3/comment.php' ) ); |
| 18 |
$template_path = wpftpl( 'layouts/' . $forum['layout'] . '/post.php' ); |
| 19 |
if( file_exists( $template_path ) ) { |
| 20 |
include( $template_path ); |
| 21 |
} |
| 22 |
wpforo_template_pagenavi( 'wpf-navi-post-bottom' ); |
| 23 |
|
| 24 |
if( WPF()->perm->forum_can( 'cr' ) || ( wpforo_is_owner( $topic['userid'], $topic['email'] ) && WPF()->perm->forum_can( 'ocr' ) ) ) { |
| 25 |
WPF()->tpl->reply_form( $topic ); |
| 26 |
} elseif( ! WPF()->current_userid ) { |
| 27 |
WPF()->tpl->please_login(); |
| 28 |
} |
| 29 |
do_action( 'wpforo_post_list_footer' ); |
| 30 |
|
| 31 |
else: ?> |
| 32 |
<p class="wpf-p-error"> |
| 33 |
<?php wpforo_phrase( 'Topic are private, please register or login for further information' ) ?> |
| 34 |
</p> |
| 35 |
<?php endif; |
| 36 |
endif; |
| 37 |
|
| 38 |
else : ?> |
| 39 |
<p class="wpf-p-error"> |
| 40 |
<?php if( WPF()->current_userid ): ?> |
| 41 |
<?php echo apply_filters( 'wpforo_no_topic_access_message_for_users', wpforo_phrase( "Your user level does not have appropriate permission to view the content", false ) ); ?> |
| 42 |
<?php else: ?> |
| 43 |
<?php echo apply_filters( |
| 44 |
'wpforo_no_topic_access_message_for_guests', |
| 45 |
wpforo_phrase( "You do not have permission to view the content", false ) . '<br>' . wpforo_get_login_or_register_notice_text() |
| 46 |
); ?> |
| 47 |
<?php endif; ?> |
| 48 |
</p> |
| 49 |
<?php endif; |
| 50 |
|