| 1 |
<?php |
| 2 |
// Exit if accessed directly |
| 3 |
if( ! defined( 'ABSPATH' ) ) exit; |
| 4 |
|
| 5 |
/** |
| 6 |
* |
| 7 |
* @layout: Threaded |
| 8 |
* @url: http://gvectors.com/ |
| 9 |
* @version: 1.0.0 |
| 10 |
* @author: gVectors Team |
| 11 |
* @description: Threaded layout turns your forum to a threads list accented on discussion tree view. |
| 12 |
* |
| 13 |
*/ |
| 14 |
?> |
| 15 |
|
| 16 |
<?php |
| 17 |
$items_count = 0; |
| 18 |
$childs = WPF()->forum->get_childs( $cat['forumid'] ); |
| 19 |
$childs[] = $cat['forumid']; |
| 20 |
$args = [ 'row_count' => wpforo_setting( 'forums', 'layout_threaded_intro_topics_count' ), 'forumids' => $childs, 'orderby' => 'type, modified', 'order' => 'DESC' ]; |
| 21 |
$topics = WPF()->topic->get_topics( $args, $items_count ); |
| 22 |
$load_more = $items_count >= wpforo_setting( 'forums', 'layout_threaded_intro_topics_count' ); |
| 23 |
if( ! wpforo_setting( 'forums', 'layout_threaded_display_subforums' ) ) { |
| 24 |
$args = [ 'parentid' => $cat['forumid'] ]; |
| 25 |
$childs = WPF()->forum->get_child_forums( $cat['forumid'] ); |
| 26 |
} |
| 27 |
$childs = apply_filters( 'wpforo_forum_list_threaded_layout', $childs ); |
| 28 |
?> |
| 29 |
|
| 30 |
<div id="wpf-cat-<?php echo $cat['forumid'] ?>" class="wpfl-4 wpforo-section"> |
| 31 |
<div class="wpforo-category"> |
| 32 |
<div class="cat-title" title="<?php echo esc_attr( strip_tags( $cat['description'] ) ); ?>"><?php echo esc_html( $cat['title'] ); ?></div> |
| 33 |
</div> |
| 34 |
<div class="wpf-head-bar"> |
| 35 |
<div id="wpf-buttons-<?php echo $cat['forumid'] ?>" class="wpf-head-bar-left wpf-load-threads"> |
| 36 |
<span class="wpf-forums"><i class="fas <?php echo( wpforo_setting( 'forums', 'layout_threaded_intro_topics_toggle' ) ? 'fa-chevron-up' : 'fa-chevron-down' ) ?>"></i> <?php wpforo_phrase( |
| 37 |
'Forums' |
| 38 |
) ?></span> |
| 39 |
<?php if( wpforo_setting( 'forums', 'layout_threaded_filter_buttons' ) ): ?> |
| 40 |
<a class="wpf-threads-filter wpf-newest wpf-active" data-filter="newest" wpf-tooltip="<?php echo esc_attr( wpforo_phrase( 'Newest', false ) ) ?>" wpf-tooltip-position="top"><i |
| 41 |
class="fas fa-clock"></i></a> |
| 42 |
<a class="wpf-threads-filter wpf-hottest" data-filter="hottest" wpf-tooltip="<?php echo esc_attr( wpforo_phrase( 'Popular', false ) ) ?>" wpf-tooltip-position="top"><i |
| 43 |
class="fa-solid fa-fire-flame-curved"></i></a> |
| 44 |
<a class="wpf-threads-filter wpf-solved" data-filter="solved" wpf-tooltip="<?php echo esc_attr( wpforo_phrase( 'Resolved', false ) ) ?>" wpf-tooltip-position="top"><i |
| 45 |
class="fas fa-check-circle"></i></a> |
| 46 |
<a class="wpf-threads-filter wpf-unsolved" data-filter="unsolved" wpf-tooltip="<?php echo esc_attr( wpforo_phrase( 'Unsolved', false ) ) ?>" wpf-tooltip-position="top"><i |
| 47 |
class="fas fa-times-circle"></i></a> |
| 48 |
<?php endif; ?> |
| 49 |
</div> |
| 50 |
<?php wpforo_template_add_topic_button( $cat['forumid'] ); ?> |
| 51 |
<div class="wpf-clear"></div> |
| 52 |
</div> |
| 53 |
|
| 54 |
<?php wpforo_template_topic_portable_form( $cat['forumid'] ); ?> |
| 55 |
|
| 56 |
<div id="wpf-forums-<?php echo $cat['forumid'] ?>" class="wpf-cat-forums" style="display: <?php echo( wpforo_setting( 'forums', 'layout_threaded_intro_topics_toggle' ) ? 'block' : 'none' ) ?>;"> |
| 57 |
<div class="wpf-cat-forum-list"> |
| 58 |
<?php if( ! empty( $childs ) ): ?> |
| 59 |
<?php foreach( $childs as $child ) : ?> |
| 60 |
<?php if( $child == $cat['forumid'] || ! WPF()->perm->forum_can( 'vf', $child ) ) continue; |
| 61 |
$forum = wpforo_forum( $child ); ?> |
| 62 |
<div class="wpf-forum-item <?php wpforo_unread( $child, 'forum' ); ?>"> |
| 63 |
<span class="wpf-circle wpf-s" style="border: 1px dashed <?php echo $forum['color'] ?>; color: <?php echo $forum['color'] ?>; display: inline-flex;"> |
| 64 |
<i class="<?php echo $forum['icon'] ?>"></i> |
| 65 |
</span> |
| 66 |
<?php $forum_description = ( wpfval( $forum, 'description' ) ) ? 'wpf-tooltip="' . esc_attr( |
| 67 |
strip_tags( (string) $forum['description'] ) |
| 68 |
) . '" wpf-tooltip-size="long"' : ''; ?> |
| 69 |
<a href="<?php echo esc_url( (string) $forum['url'] ); ?>" <?php echo $forum_description ?>> |
| 70 |
<?php echo esc_html( $forum['title'] ); ?> |
| 71 |
</a> |
| 72 |
<span class="wpf-forum-item-stat"> <?php echo '<span wpf-tooltip="' . esc_attr( wpforo_phrase( 'Threads', false ) ) . '">' . wpforo_print_number( |
| 73 |
$forum['topics'] |
| 74 |
) . '</span> <sep>/</sep> <span wpf-tooltip="' . esc_attr( wpforo_phrase( 'Posts', false ) ) . '">' . wpforo_print_number( $forum['posts'] ) . '</span>' ?></span> |
| 75 |
</div> |
| 76 |
<?php endforeach; ?> |
| 77 |
<?php else: ?> |
| 78 |
<p><?php wpforo_phrase( 'No forum found in this category' ) ?></p> |
| 79 |
<?php endif; ?> |
| 80 |
</div> |
| 81 |
</div> |
| 82 |
<div class="wpf-threads"> |
| 83 |
<div class="wpf-threads-head"> |
| 84 |
<div class="wpf-head-box wpf-thead-status"><?php wpforo_phrase( 'Status' ) ?></div> |
| 85 |
<div class="wpf-head-box wpf-thead-title"><?php wpforo_phrase( 'Topics' ) ?></div> |
| 86 |
<div class="wpf-head-box wpf-thead-forum"><?php wpforo_phrase( 'Forum' ) ?></div> |
| 87 |
<div class="wpf-head-box wpf-thead-posts"><?php wpforo_phrase( 'Replies' ) ?></div> |
| 88 |
<div class="wpf-head-box wpf-thead-views"><?php wpforo_phrase( 'Views' ) ?></div> |
| 89 |
<div class="wpf-head-box wpf-thead-users"><?php wpforo_phrase( 'Users' ) ?></div> |
| 90 |
<div class="wpf-head-box wpf-thead-date"><?php wpforo_phrase( 'Date' ) ?> </div> |
| 91 |
</div> |
| 92 |
<div class="wpf-thread-list" data-forumid="<?php echo intval( $cat['forumid'] ) ?>" data-filter="newest" data-paged="1"> |
| 93 |
<?php foreach( $topics as $key => $topic ): ?> |
| 94 |
<?php wpforo_thread_forum_template( $topic['topicid'] ); ?> |
| 95 |
<?php do_action( 'wpforo_loop_hook', $key ) ?> |
| 96 |
<?php endforeach; ?> |
| 97 |
</div> |
| 98 |
</div> |
| 99 |
<div class="wpf-more-topics" style="text-align: center; margin-bottom: 17px; font-size: 13px; <?php echo( ! $load_more ? 'display: none;' : '' ) ?>"> |
| 100 |
<a> |
| 101 |
<i class="fas fa-angle-double-down" style="font-size: 12px; padding: 0 5px;"></i> |
| 102 |
<?php wpforo_phrase( 'Load More Topics' ) ?> |
| 103 |
</a> |
| 104 |
</div> |
| 105 |
</div> |
| 106 |
<!-- wpfl-4 --> |
| 107 |
|