| 1 |
<div class="wpforo-recent-content wpfr-topics"> |
| 2 |
<?php if( ! empty( WPF()->current_object['topics'] ) ): ?> |
| 3 |
<table style="width: 100%; border: 0; border-spacing: 0; border-collapse: collapse;"> |
| 4 |
<tr class="wpf-htr"> |
| 5 |
<td class="wpf-shead-title" colspan="3"><?php wpforo_phrase( 'Topics with their latest replies in reversed order' ) ?></td> |
| 6 |
</tr> |
| 7 |
<?php foreach( WPF()->current_object['topics'] as $key => $topic ) : ?> |
| 8 |
<tr class="wpf-ttr <?php wpforo_unread( $topic['topicid'], 'topic' ); ?>"> |
| 9 |
<td class="wpf-spost-avatar"> |
| 10 |
<?php if( WPF()->usergroup->can( 'va' ) && wpforo_setting( 'profiles', 'avatars' ) ): ?> |
| 11 |
<?php echo wpforo_user_avatar( $topic['member'], 30 ) ?> |
| 12 |
<?php endif; ?> |
| 13 |
</td> |
| 14 |
<td class="wpf-spost-title" colspan="2"> |
| 15 |
<?php wpforo_topic_title( $topic, $topic['topic_url'], '{i}{p}{au}{t}{/a}{n}{v}', true, 'wpf-spost-title-link' ) ?> |
| 16 |
<p style="font-size: 12px"><?php wpforo_member_link( $topic['member'], 'by' ); ?> <?php if( wpfkey( $topic, 'created' ) ) wpforo_date( $topic['created'] ); ?> |
| 17 |
| |
| 18 |
<span style="text-transform: lowercase;"><?php wpforo_phrase( 'Last post' ) ?>:</span> <?php if( wpfkey( $topic['last_post'], 'created' ) ) { |
| 19 |
wpforo_date( $topic['last_post']['created'] ); |
| 20 |
} ?> |
| 21 |
</p> |
| 22 |
<div class="wpf-spost-forum"> |
| 23 |
<span class="wpf-spost-forum-label"><?php wpforo_phrase( 'Forum' ) ?></span> |
| 24 |
<?php $forum_icon = ( isset( $topic['forum']['icon'] ) && $topic['forum']['icon'] ) ? $topic['forum']['icon'] : 'fas fa-comments'; ?> |
| 25 |
<i class="<?php echo esc_attr( $forum_icon ) ?>" style="color: <?php echo esc_attr( $topic['forum']['color'] ) ?>"></i> |
| 26 |
<a href="<?php echo $topic['forum']['url'] ?>"><?php echo esc_html( $topic['forum']['title'] ); ?></a> |
| 27 |
</div> |
| 28 |
</td> |
| 29 |
</tr> |
| 30 |
<?php if( ! empty( $topic['replies'] ) && is_array( $topic['replies'] ) ) : ?> |
| 31 |
<tr class="wpf-ptr"> |
| 32 |
<td class="wpf-spost-icon"> </td> |
| 33 |
<td colspan="2" class="wpf-stext"> |
| 34 |
<ul> |
| 35 |
<?php foreach( $topic['replies'] as $post ) : $poster = wpforo_member( $post ); ?> |
| 36 |
<li> |
| 37 |
<i class="fas fa-reply fa-rotate-180 wpfsx wpfcl-0"></i> |
| 38 |
<a href="<?php echo esc_url( wpforo_post( $post['postid'], 'url' ) ); ?>" |
| 39 |
title="<?php wpforo_phrase( 'REPLY:' ) ?> <?php echo esc_html( wpforo_text( $post['body'], 100, false ) ) ?>"><?php echo( ( $post_body = esc_html( |
| 40 |
wpforo_text( $post['body'], wpforo_setting( 'topics', 'layout_extended_intro_posts_length' ), false ) |
| 41 |
) ) ? $post_body : esc_html( $post['title'] ) ) ?></a> |
| 42 |
<div class="wpf-spost-topic-recent-posts"><?php wpforo_date( $post['created'] ); ?> <?php wpforo_member_link( $poster, 'by %s', 5 ); ?> </div> |
| 43 |
<br class="wpf-clear"> |
| 44 |
</li> |
| 45 |
<?php endforeach ?> |
| 46 |
<?php if( intval( $topic['posts'] ) > ( intval( wpfval( WPF()->current_object['args'], 'intro_posts' ) ) + 1 ) ): ?> |
| 47 |
<li style="text-align:right;"><a href="<?php echo esc_url( (string) $topic['topic_url'] ) ?>"><?php wpforo_phrase( 'view all posts', true, 'lower' ); ?> <i |
| 48 |
class="fas fa-angle-right" aria-hidden="true"></i></a></li> |
| 49 |
<?php endif ?> |
| 50 |
</ul> |
| 51 |
</td> |
| 52 |
</tr> |
| 53 |
<?php else: ?> |
| 54 |
<tr class="wpf-tr-sep"> |
| 55 |
<td colspan="3" style="height: 2px;"></td> |
| 56 |
</tr> |
| 57 |
<?php endif; ?> |
| 58 |
|
| 59 |
<?php do_action( 'wpforo_recent_loop_hook_topics', $key, $topic ) ?> |
| 60 |
<?php endforeach ?> |
| 61 |
</table> |
| 62 |
<?php else: ?> |
| 63 |
<?php if( wpfval( WPF()->current_object['args'], 'view' ) === 'unread' ): ?> |
| 64 |
<p class="wpf-p-error"><?php wpforo_phrase( 'No unread posts were found' ) ?> </p> |
| 65 |
<?php else: ?> |
| 66 |
<p class="wpf-p-error"><?php wpforo_phrase( 'No topics were found here' ) ?> </p> |
| 67 |
<?php endif; ?> |
| 68 |
<?php endif; ?> |
| 69 |
</div> |
| 70 |
|