echo '<div id="my-topic-subject">'; echo stripslashes($topic->topic_subject); echo '</div>'; echo '<div id="my-topic-author">'; echo 'Started by '.$topic->display_name.' '.__wps__time_ago($topic->topic_started); echo '</div>'; echo '<div id="my-topic-first-post">'; $post_text = __wps__make_url(stripslashes($topic->topic_post)); $post_text = __wps__bbcode_replace($post_text); if (!WPS_WYSIWYG) $post_text = str_replace(chr(13), "<br />", $post_text); echo $post_text; echo '</div>'; echo '</div>'; // Show replies $replies = $wps_forum->get_replies($tid, 0, 9999, 'ASC'); if ($replies) { foreach ($replies as $reply) { // Show avatar echo '<div class="my-forum-reply">'; if ( ($reply->topic_owner == $current_user->ID || current_user_can('manage_options')) && (!$wps_forum->is_topic_locked($reply->tid)) ) { echo '<a href="'.$wps->get_forum_url().$wps->get_url_q($wps->get_forum_url()).'catid='.$catid.'&tid='.$tid.'&del_id='.$reply->tid.'" class="delete">Delete reply</a>'; } echo '<div class="my-reply-avatar">'; $wps_user = new wps_user($reply->topic_owner); echo $wps_user->get_avatar(60); echo '</div>'; echo '<div class="my-reply-author">'; echo 'Reply by '.$reply->display_name.' '.__wps__time_ago($reply->topic_started); echo '</div>'; $post_text = __wps__make_url(stripslashes($reply->topic_post));
echo '<strong>LAST REPLY</strong>'; echo '</div>'; echo '<div class="my-topics-title-replies">'; echo '<strong>REPLIES</strong>'; echo '</div>'; echo '</div>'; foreach ($topics as $topic) { echo '<div class="my-topic-row">'; // Topic subject echo '<div class="my-topic-row-title">'; $topic_subject = stripslashes($topic->topic_subject); if (strlen($topic_subject) > 60) $topic_subject = substr($topic_subject, 0, 60).'...'; echo $topic_subject; echo '</div>'; // Last reply $last_reply = $wps_forum->get_replies($topic->tid, 0, 1); echo '<div class="my-forum-row-last-topic">'; if ($last_reply) { $reply = stripslashes($last_reply->topic_post); $reply = str_replace('<br />', ' ', $reply); $reply = str_replace('<p>', '', $reply); $reply = str_replace('</p>', ' ', $reply); if (strlen($reply) > 60) $reply = substr(strip_tags($reply), 0, 60).'...'; echo '<div class="my-topic-row-last-topic-avatar">'; $wps_user = new wps_user($last_reply->topic_owner); echo '<a href="'.$wps->get_profile_url().'?uid='.$last_reply->topic_owner.'">'; echo $wps_user->get_avatar(48); echo '</a>'; echo '</div>'; echo '<span class="my-forum-row-last-topic-owner">'.$last_reply->display_name.',</span> '; echo '<span class="my-forum-row-last-topic-started">'.__wps__time_ago($last_reply->topic_started).'</span>';