PluginProbe
wpForo Forum / 3.1.6
wpForo Forum v3.1.6
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 1.4.11 1.4.12 1.4.13 All 138 releases
wpforo / themes / 2026 / layouts / 1 / topic.php

topic.php in wpForo Forum 3.1.6, at themes/2026/layouts/1/topic.php

83 lines 5.4 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 <div class="wpfl-1 wpforo-section">
7
8 <?php foreach($topics as $key => $topic) : ?>
9
10 <?php
11 $member = wpforo_member($topic);
12 if(isset($topic['last_post']) && $topic['last_post'] != 0){
13 $last_post = wpforo_post($topic['last_post']);
14 $last_poster = wpforo_member($last_post);
15 }
16 if(isset($topic['first_postid']) && $topic['first_postid'] != 0){
17 $first_post = wpforo_post($topic['first_postid']);
18 $intro_posts = wpforo_setting( 'topics', 'layout_extended_intro_posts_count' ); if( $intro_posts < 1 ){ $intro_posts = NULL; } else { $intro_posts = ($intro_posts > 1) ? ($intro_posts - 1) : $intro_posts = 0; }
19 $first_poster = wpforo_member($first_post);
20 $posts = WPF()->post->get_posts( array('topicid' => $topic['topicid'], 'exclude' => $topic['first_postid'], 'orderby' => '`is_first_post` ASC, `created` DESC, `postid` DESC', 'row_count' => $intro_posts) );
21 $posts = array_reverse($posts);
22 }
23 $topic_url = wpforo_topic($topic['topicid'], 'url');
24 $post_toglle = wpforo_setting( 'topics', 'layout_extended_intro_posts_toggle' );
25 ?>
26
27 <div class="topic-wrap <?php wpforo_topic_types( $topic ); wpforo_unread($topic['topicid'], 'topic'); ?>">
28 <div class="wpforo-topic">
29 <div class="wpforo-topic-icon">
30 <div style="border: 1px dotted #999; border-radius: 5px; width: 40px; height: 38px; display: flex; justify-content: center; align-items: center;">
31 <?php wpforo_topic_icon( $topic['topicid'], 'mixed' ); ?>
32 </div>
33 </div>
34 <div class="wpforo-topic-info">
35 <p class="wpforo-topic-title"><?php wpforo_topic_title($topic, $topic_url, '{p}{au}{t}{/a}{n}{v}') ?></p>
36 <p class="wpforo-topic-start-info wpfcl-1">
37 <?php if(isset($last_post) && !empty($last_post)) : ?>
38 <span class="wpf-last-post-by"><a href="<?php echo esc_url( (string) $last_post['url'] ) ?>"><?php echo sprintf( wpforo_phrase('Last post by %s', FALSE), $last_poster['display_name'] ) ?><span class="wpforo-date wpforo-date-ago">, <?php wpforo_date($last_post['created']); ?></span> <i class="fas fa-chevron-right fa-sx wpfcl-a"></i></a></span>
39 <?php endif; ?>
40 </p>
41 <div class="wpforo-topic-badges"><?php do_action('wpforo_topic_info_end', $topic); ?></div>
42 </div>
43 <div class="wpforo-topic-stat-combined">
44 <div class="stat-line"><?php wpforo_phrase('Posts') ?>: <?php echo intval($topic['posts']) ?></div>
45 <div class="stat-line"><?php wpforo_phrase('Views') ?>: <?php echo intval($topic['views']) ?></div>
46 </div>
47 <div class="wpforo-topic-toggle">
48 <i id="button-arrow-<?php echo intval($topic['topicid']) ?>" class="topictoggle wpfcl-0 fas fa-chevron-<?php echo ( $post_toglle == 1 ? 'up' : 'down' ) ?>" title="<?php wpforo_phrase('First post and replies') ?>"></i>
49 </div>
50 <br class="wpf-clear">
51 </div><!-- wpforo-topic -->
52 <div class="wpforo-last-posts-<?php echo intval($topic['topicid']) ?>" style="display: <?php echo ( $post_toglle == 1 ? 'block' : 'none' ); ?>">
53 <div class="wpforo-last-posts-list">
54 <ul>
55 <li>
56 <div class="wpforo-last-post-title"><i class="fas fa-feather-alt wpfsx" title="<?php echo esc_attr(wpforo_phrase('Topic Author', false)) ?>"></i> &nbsp; <a href="<?php echo esc_url((string) $first_post['url']) ?>"><?php echo esc_html( wpforo_text($first_post['body'], wpforo_setting( 'topics', 'layout_extended_intro_posts_length' ), false)) ?></a></div>
57 <div class="wpforo-last-post-user"><?php wpforo_member_link($first_poster, 'by %s', 9); ?> &nbsp; <?php wpforo_date($first_post['created']); ?></div>
58 <br class="wpf-clear">
59 </li>
60 <?php if(!empty($posts) && is_array($posts)) : ?>
61 <?php foreach($posts as $post) : ?>
62 <?php $poster = wpforo_member($post); ?>
63 <li>
64 <div class="wpforo-last-post-title"><i class="fas fa-reply fa-rotate-180 wpfsx wpfcl-0"></i> &nbsp; <a href="<?php echo esc_url( (string) wpforo_post($post['postid'], 'url') ); ?>" title="<?php wpforo_phrase('REPLY:') ?> <?php echo esc_html( wpforo_text($post['body'], 100, false)) ?>"><?php echo (( $post_body = esc_html(wpforo_text($post['body'], wpforo_setting( 'topics', 'layout_extended_intro_posts_length' ), FALSE)) ) ? $post_body : esc_html($post['title'])) ?></a></div>
65 <div class="wpforo-last-post-user"><?php wpforo_member_link($poster, 'by %s', 9); ?> &nbsp; <?php wpforo_date($post['created']); ?></div>
66 <br class="wpf-clear">
67 </li>
68 <?php endforeach ?>
69 <?php if(intval($topic['posts']) > ($intro_posts+1)): ?>
70 <li class="wpforo-last-post-more"><a href="<?php echo esc_url((string) $topic_url) ?>"><?php wpforo_phrase('view all posts', true, 'lower'); ?> <i class="fas fa-angle-right" aria-hidden="true"></i></a></li>
71 <?php endif ?>
72 <?php endif ?>
73 </ul>
74 </div><!-- wpforo-last-posts-list -->
75 <br class="wpf-clear">
76 </div><!-- wpforo-last-posts -->
77 </div>
78
79 <?php do_action( 'wpforo_loop_hook', $key ) ?>
80
81 <?php endforeach; ?>
82 </div> <!-- wpfl-1 -->
83