wordpress-theme-cbsonline/wpforo/layouts/2/topic.php

64 lines
3.4 KiB
PHP

<?php
// Exit if accessed directly
if( !defined( 'ABSPATH' ) ) exit;
// NIU:
$topic_fields = cbsonline_wpforo_get_topic_fields_list();
?>
<div class="wpfl-2">
<div class="wpforo-topic-head">
<div class="head-title"><?php echo wpfval($topic_fields['title'], 'label'); ?></div>
<div class="head-stat-lastpost"><?php wpforo_phrase('Last Post') ?></div>
<div class="head-stat-views"><?php echo wpfval($topic_fields['seminar_date'], 'label').' / '.wpfval($topic_fields['seminar_time'], 'label'); ?></div>
<div class="head-stat-posts"></div>
<br class="wpf-clear">
</div>
<?php foreach($topics as $key => $topic) : ?>
<?php
$last_poster = array();
$last_post = array();
$member = wpforo_member($topic);
if(isset($topic['last_post']) && $topic['last_post'] != 0){
$last_post = wpforo_post($topic['last_post']);
$last_poster = wpforo_member($last_post);
}
$topic_url = wpforo_topic($topic['topicid'], 'url');
// NIU:
$topic_custom_fields = cbsonline_wpforo_get_topic_custom_fields($topic['first_postid']);
?>
<div class="topic-wrap <?php wpforo_unread($topic['topicid'], 'topic'); ?>">
<div class="wpforo-topic">
<div class="wpforo-topic-avatar"><div class="featured-image"><?php echo $topic_custom_fields['featured_image'] ?? ''; ?></div></div>
<div class="wpforo-topic-info">
<p class="wpforo-topic-title"><a href="<?php wpforo_unread_url( $topic['topicid'], $topic_url ) ?>"><?php wpforo_topic_icon($topic); ?><?php echo esc_html($topic['title']) ?></a> <?php wpforo_unread_button($topic['topicid'], $topic_url); ?> <?php wpforo_viewing( $topic ); ?></p>
<p class="wpforo-topic-custom_fields spearker">
<span class="label"><?php echo wpfval($topic_fields['speaker_name'], 'label'); ?></span><span class="value"><?php echo $topic_custom_fields['speaker_name'] ?? ''; ?>
</p>
<p class="wpforo-topic-custom_fields host">
<span class="label"><?php echo wpfval($topic_fields['host'], 'label'); ?></span><span class="value"><?php echo $topic_custom_fields['host'] ?? ''; ?>
</p>
<div class="wpforo-topic-badges"><?php wpforo_hook('wpforo_topic_info_end', $topic); ?></div>
</div>
<?php if(isset($topic['last_post']) && $topic['last_post'] != 0) : ?>
<div class="wpforo-topic-stat-lastpost"><span><?php wpforo_member_link($last_poster, 'by'); ?> <a href="<?php echo esc_url($last_post['url']) ?>" title="<?php wpforo_phrase('View the latest post') ?>"><i class="fas fa-chevron-right fa-sx wpfcl-a"></i></a></span><br> <?php wpforo_date($last_post['created']); ?></div>
<?php else: ?>
<div class="wpforo-topic-stat-lastpost"><?php wpforo_phrase('Replies not found') ?></div>
<?php endif; ?>
<div class="wpforo-topic-stat-views"><?php echo $topic_custom_fields['seminar_date']; ?><br /><?php echo $topic_custom_fields['seminar_time'] ?? ''; ?></div>
<div class="wpforo-topic-stat-posts"></div>
<br class="wpf-clear">
</div><!-- wpforo-topic -->
</div><!-- topic-wrap -->
<?php do_action( 'wpforo_loop_hook', $key ) ?>
<?php endforeach; ?>
</div><!-- wpfl-2 -->