| 1 |
<?php |
| 2 |
// Exit if accessed directly |
| 3 |
if( ! defined( 'ABSPATH' ) ) exit; |
| 4 |
|
| 5 |
$activities = (array) wpfval( WPF()->current_object, 'activities' ); |
| 6 |
?> |
| 7 |
|
| 8 |
<div class="wpforo-activity-content"> |
| 9 |
<?php if( $activities ) : ?> |
| 10 |
<table> |
| 11 |
<?php $bg = false; |
| 12 |
foreach( $activities as $activity ) : ?> |
| 13 |
<tr<?php echo( $bg ? ' class="wpfbg-9"' : '' ) ?>> |
| 14 |
<td class="activity-icon"><?php wpforo_topic_icon( $activity['topicid'], 'mixed' ); ?></td> |
| 15 |
<td class="activity-title"> |
| 16 |
<?php |
| 17 |
if( $activity['is_first_post'] ) { |
| 18 |
$href = esc_url( WPF()->topic->get_url( $activity['topicid'] ) ); |
| 19 |
$link_text = wpforo_text( $activity['title'], 60, false ); |
| 20 |
} else { |
| 21 |
$href = esc_url( WPF()->post->get_url( $activity['postid'] ) ); |
| 22 |
if( ! $link_text = wpforo_text( $activity['body'], 60, false ) ) { |
| 23 |
$link_text = wpforo_text( $activity['title'], 60, false ); |
| 24 |
} |
| 25 |
} |
| 26 |
if( ! $href ) $href = '#'; |
| 27 |
if( ! $link_text ) $link_text = wpforo_phrase( 'post link', false ); |
| 28 |
|
| 29 |
printf( '<a style="font-size: 17px;" href="%s">%s</a>', $href, $link_text ); |
| 30 |
|
| 31 |
if( $activity['forumid'] ) { |
| 32 |
$href = wpforo_forum( $activity['forumid'], 'url' ); |
| 33 |
$link_text = wpforo_forum( $activity['forumid'], 'title' ); |
| 34 |
|
| 35 |
if( ! $href ) $href = '#'; |
| 36 |
if( ! $link_text ) $link_text = wpforo_phrase( 'forum link', false ); |
| 37 |
|
| 38 |
printf( '<p style="font-style: italic"><span>%s</span> <a href="%s">%s</a></p>', wpforo_phrase( 'in forum', false ), $href, $link_text ); |
| 39 |
} |
| 40 |
?> |
| 41 |
</td> |
| 42 |
<td class="activity-date"><?php wpforo_date( $activity['created'] ); ?></td> |
| 43 |
</tr> |
| 44 |
<?php $bg = ( $bg ? false : true ); endforeach ?> |
| 45 |
</table> |
| 46 |
<div class="activity-foot"> |
| 47 |
<?php wpforo_template_pagenavi() ?> |
| 48 |
</div> |
| 49 |
<?php else : ?> |
| 50 |
<p class="wpf-p-error"> <?php wpforo_phrase( 'No activity found for this member.' ) ?> </p> |
| 51 |
<?php endif ?> |
| 52 |
</div> |
| 53 |
|