<div class="forum_avatar"> <a href="<?php echo PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $created_by->login_name; ?> "> <?php echo uihelper_resize_mk_user_img($created_by->picture, $avatar_size['width'], $avatar_size['height'], 'alt="' . $created_by->login_name . '"'); ?> </a> </div> <div class="smallfont"> <div><?php echo __('Posts'); ?> : <?php echo PaForumPost::countPaForumPost("user_id = {$created_by->user_id}"); ?> </div> <div><?php echo __('Last login'); ?> : <?php echo PA::date($created_by->last_login, 'short'); ?> </div> <div><?php echo __('Status'); ?> : <?php echo PaForumsUsers::getStatusString($created_by->user_id); ?>
public function getThreadStatistics() { $statistic = array(); $posts = array(); $conditionalStatement = "thread_id = {$this->id} AND is_active = 1"; $orderby = "created_at"; $sort = "DESC"; $limit = 1; $posts = PaForumPost::listPaForumPost($conditionalStatement, $orderby, $sort, $limit); $nb_posts = PaForumPost::countPaForumPost($conditionalStatement); $user = new User(); $user->load((int) $this->get_user_id()); $statistics['user'] = $user; $statistics['posts'] = $nb_posts; $last_post = null; if (!empty($posts[0])) { $last_post = $posts[0]; $last_post->user = $last_post->getAuthor(); } $statistics['last_post'] = $last_post; // (!empty($posts[0])) ? $posts[0] : null; return $statistics; }
<div class="forum_avatar"> <a href="<?php echo PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $post->user->login_name; ?> "> <?php echo uihelper_resize_mk_user_img($post->user->picture, $avatar_size['width'], $avatar_size['height'], 'alt="' . $post->user->login_name . '"'); ?> </a> </div> <div class="smallfont"> <div><?php echo __('Posts'); ?> : <?php echo $post->user->user_id != -1 ? PaForumPost::countPaForumPost("user_id = " . $post->user->user_id) : ''; ?> </div> <div><?php echo __('Last login'); ?> : <?php echo $post->user->user_id != -1 ? PA::date($post->user->last_login, 'short') : ''; ?> </div> <div><?php echo __('Status'); ?> : <?php echo $post->user->user_id != -1 ? PaForumsUsers::getStatusString($post->user->user_id) : ''; ?>