PluginProbe
wpForo Forum / 3.2.0
wpForo Forum v3.2.0
3.2.1 3.2.0 3.1.7 3.1.6 3.1.5 3.1.4 3.1.2 3.1.1 3.1.0 3.0.9 3.0.8 3.0.7 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.1.1 1.1.2 1.2.0 1.3.0 1.3.1 1.4.0 1.4.1 1.4.10 All 141 releases
wpforo / themes / 2026 / layouts / 1 / forum.php

forum.php in wpForo Forum 3.2.0, at themes/2026/layouts/1/forum.php

163 lines 8.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // Exit if accessed directly
3 if( ! defined( 'ABSPATH' ) ) exit;
4
5 /**
6 *
7 * @layout: Extended
8 * @url: http://gvectors.com/
9 * @version: 1.0.0
10 * @author: gVectors Team
11 * @description: Extended layout displays one level deeper information in advance.
12 *
13 */
14
15 $cover_styles = wpforo_get_forum_cover_styles( $cat );
16 ?>
17
18 <div class="wpfl-1 wpforo-section">
19 <div class="wpforo-category" <?php echo $cover_styles['cover'] ?>>
20 <div class="wpforo-cat-panel" <?php echo $cover_styles['blur'] ?>>
21 <div class="cat-title" title="<?php echo esc_attr( strip_tags( $cat['description'] ) ); ?>">
22 <span class="cat-name" <?php echo $cover_styles['title'] ?>><?php echo esc_html( $cat['title'] ); ?></span>
23 </div>
24 <?php if( WPF()->current_object['template'] === 'forum' ) wpforo_template_add_topic_button( $cat['forumid'] ); ?>
25 </div>
26 </div><!-- wpforo-category -->
27
28 <?php if( WPF()->current_object['template'] === 'forum' ) wpforo_template_topic_portable_form( $cat['forumid'] ); ?>
29
30 <?php
31 $forum_list = false;
32 foreach( $forums as $key => $forum ) :
33 if( ! WPF()->perm->forum_can( 'vf', $forum['forumid'] ) ) continue;
34
35 $forum_list = true;
36
37 $sub_forums = WPF()->forum->get_forums( [ "parentid" => $forum['forumid'], "type" => 'forum' ] );
38 $has_sub_forums = is_array( $sub_forums ) && ! empty( $sub_forums );
39
40 $data = wpforo_forum( $forum['forumid'], 'childs' );
41 $counts = wpforo_forum( $forum['forumid'], 'counts' );
42 $topics = WPF()->topic->get_topics( [ "forumids" => $data, "orderby" => "type, modified", "order" => "DESC", "row_count" => wpforo_setting( 'forums', 'layout_extended_intro_topics_count' ) ]
43 );
44
45 $has_topics = is_array( $topics ) && ! empty( $topics );
46
47 $forum_url = wpforo_forum( $forum['forumid'], 'url' );
48 $topic_toglle = wpforo_setting( 'forums', 'layout_extended_intro_topics_toggle' );
49
50 if( ! empty( $forum['icon'] ) ) {
51 $forum['icon'] = trim( (string) $forum['icon'] );
52 if( strpos( (string) $forum['icon'], ' ' ) === false ) $forum['icon'] = 'fas ' . $forum['icon'];
53 }
54 $forum_icon = ( ! empty( $forum['icon'] ) ) ? $forum['icon'] : 'fas fa-comments';
55 ?>
56 <div id="wpf-forum-<?php echo $forum['forumid'] ?>" class="forum-wrap <?php wpforo_unread( $forum['forumid'], 'forum' ) ?>">
57 <div class="wpforo-forum">
58 <div class="wpforo-forum-icon">
59 <div style="border: 2px solid <?php echo esc_attr( $forum['color'] ) ?>; border-radius: 50%; width: 44px; height: 44px; display: flex; justify-content: center; align-items: center;">
60 <i class="<?php echo esc_attr( $forum_icon ) ?>" style="color: <?php echo esc_attr( $forum['color'] ) ?>;"></i>
61 </div>
62 </div>
63 <div class="wpforo-forum-info">
64 <h3 class="wpforo-forum-title"><a href="<?php echo esc_url( (string) $forum_url ) ?>"><?php echo esc_html( $forum['title'] ); ?></a> <?php wpforo_viewing( $forum ); ?></h3>
65 <div class="wpforo-forum-description"><?php echo wp_kses_post( $forum['description'] ); ?></div>
66 <div style="padding: 5px 0 0 0; font-size: 12px; color: #555;">
67 <?php wpforo_phrase( 'Topics:' ); ?> <?php echo wpforo_print_number( $counts['topics'] ) ?> &nbsp; / &nbsp;
68 <?php wpforo_phrase( 'Posts:' ); ?> <?php echo wpforo_print_number( $counts['posts'] ) ?>
69 </div>
70 <?php if( $has_sub_forums ) : ?>
71 <div class="wpforo-subforum">
72 <ul>
73 <li class="first" style="margin-top:1px;"><?php wpforo_phrase( 'Subforums' ); ?>:</li>
74 <?php foreach( $sub_forums as $sub_forum ) :
75 if( ! WPF()->perm->forum_can( 'vf', $sub_forum['forumid'] ) ) continue;
76 $sub_forum_icon = ( isset( $sub_forum['icon'] ) && $sub_forum['icon'] ) ? $sub_forum['icon'] : 'fas fa-comments'; ?>
77 <li class="<?php wpforo_unread( $sub_forum['forumid'], 'forum' ) ?>">
78 <a href="<?php echo esc_url( (string) wpforo_forum( $sub_forum['forumid'], 'url' ) ) ?>" style="border-bottom: 2px solid <?php echo esc_attr( $sub_forum['color'] ) ?>; vertical-align: middle; text-decoration: none; padding-left: 1px;"><?php echo esc_html( $sub_forum['title'] ); ?>&nbsp;&nbsp;</a> <?php wpforo_viewing( $sub_forum ); ?>
79 </li>
80 <?php endforeach; ?>
81 </ul>
82 <br class="wpf-clear"/>
83 </div><!-- wpforo-subforum -->
84 <?php endif; ?>
85 </div><!-- wpforo-forum-info -->
86
87 <div class="wpforo-forum-topic-toggle">
88 <?php if( $has_topics ) : ?>
89 <i id="img-arrow-<?php echo intval( $forum['forumid'] ) ?>" class="topictoggle fas fa-chevron-<?php echo( $topic_toglle == 1 ? 'up' : 'down' ) ?> wpfcl-0" style="font-size: 20px; cursor: pointer;"></i>
90 <?php endif ?>
91 </div>
92
93 </div><!-- wpforo-forum -->
94
95 <?php if( $has_topics ) : ?>
96
97 <div class="wpforo-last-topics-<?php echo intval( $forum['forumid'] ) ?>" style="display: <?php echo( $topic_toglle == 1 ? 'block' : 'none' ) ?>;">
98 <div style="padding:6px 0; display: flex; justify-content: space-between; align-items: stretch;">
99 <div style="width: 8%; max-width: 100px; min-width: 80px; padding: 0 10px 0 0px;"></div>
100 <div style="width: 92%; border-top: 1px dashed #ccc; color: #999;"></div>
101 </div>
102 <div class="wpforo-last-topics-list">
103 <ul>
104 <?php foreach( $topics as $topic ) : ?>
105 <?php $last_post = wpforo_post( $topic['last_post'] ) ?>
106 <?php $member = wpforo_member( $last_post ); ?>
107 <?php if( ! empty( $last_post ) && ! empty( $member ) ): ?>
108 <li class="<?php wpforo_topic_types( $topic ); wpforo_unread( $topic['topicid'], 'topic' ) ?>">
109 <div class="wpforo-forum-icon"></div>
110 <div class="wpforo-last-topic-icon">
111 <div style="border: 1px dotted #999; border-radius: 3px; width: 44px; height: 38px; display: flex; justify-content: center; align-items: center;">
112 <?php wpforo_topic_icon( $topic['topicid'], 'mixed' ); ?>
113 </div>
114 </div>
115 <div class="wpforo-last-topic-title">
116 <?php wpforo_topic_title(
117 $topic,
118 $last_post['url'],
119 '{p}{au}{tc}{/a}{n}',
120 true,
121 '',
122 wpforo_setting( 'forums', 'layout_extended_intro_topics_length' )
123 ) ?>
124 <div style="font-size:12px;"><?php wpforo_phrase( 'Replies:' ) ?> <?php echo (intval($topic['posts']) - 1) ?></div>
125 </div>
126 <div class="wpforo-last-topic-avatar">
127 <?php echo wpforo_user_avatar( $member, 30 ) ?>
128 </div>
129 <div class="wpforo-last-topic-user" title="<?php echo esc_attr( $member['display_name'] ) ?>">
130 <?php wpforo_member_link( $member, 'by', 12 ); ?><br>
131 <span class="wpforo-last-topic-date wpforo-date-ago"><?php wpforo_date( $topic['modified'] ); ?></span>
132 </div>
133 </li>
134 <?php endif; ?>
135 <?php endforeach; ?>
136 <?php if( intval( $forum['topics'] ) > wpforo_setting( 'forums', 'layout_extended_intro_topics_count' ) ): ?>
137 <li>
138 <div class="wpf-vat">
139 <a href="<?php echo esc_url( (string) $forum_url ) ?>"><?php wpforo_phrase( 'view all topics', true, 'lower' ); ?> <i class="fas fa-angle-right"
140 aria-hidden="true"></i></a>
141 </div>
142 <br class="wpf-clear"/>
143 </li>
144 <?php endif ?>
145 </ul>
146 </div>
147 <br class="wpf-clear"/>
148 </div><!-- wpforo-last-topics -->
149
150 <?php endif; ?>
151
152 </div><!-- forum-wrap -->
153
154 <?php do_action( 'wpforo_loop_hook', $key, $forum ) ?>
155
156 <?php endforeach; ?> <!-- $forums as $forum -->
157
158 <?php if( ! $forum_list ): ?>
159 <?php do_action( 'wpforo_forum_loop_no_forums', $cat ); ?>
160 <?php endif; ?>
161
162 </div><!-- wpfl-1 -->
163