/** * displayParticipation * * @return void */ function displayParticipation() { $memberId = (int) $_GET['member']; $this->displayHeader($memberId); $statsData = $this->fcmsProfile->getStats($memberId); $points = getUserParticipationPoints($memberId); $level = getUserParticipationLevel($points); echo ' <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/easy-pie-chart/2.1.4/jquery.easypiechart.min.js"></script> <div> <b>' . T_('Participation Points') . '</b><br/> <span style="float:left; padding-right: 10px;">' . $points . '</span> ' . $level . ' </div><br/> <p><b>' . T_('Stats') . '</b></p> <div id="stats">'; foreach ($statsData as $stats) { echo $stats; } echo ' </div> <script type="text/javascript"> $(function() { $(".stat").easyPieChart({ animate : false, scaleColor : false, barColor : "#99CEF0", lineWidth : 6, size : 150 }); }); </script>'; $this->displayFooter($memberId); }
/** * showPosts * * @param int $thread_id * @param int $page * @return void */ function showPosts($thread_id, $page = 1) { $thread_id = (int) $thread_id; $page = (int) $page; $from = $page * 15 - 15; $total = $this->getNumberOfPosts($thread_id); if ($total < 1) { echo ' <p class="error-alert">' . T_('Thread does not exist.') . '</p>'; return; } $sql = "UPDATE `fcms_board_threads` \n SET `views` = (`views` + 1) \n WHERE `id` = ?"; if (!$this->fcmsDatabase->update($sql, $thread_id)) { $this->fcmsError->displayError(); return; } $this->displayMessageBoardMenu($thread_id); $this->displayPages($page, $thread_id); $sort = $this->getSortOrder($this->fcmsUser->id); $sql = "SELECT p.`id`, `thread`, `post`, `subject`, p.`date`, `user`, `avatar` \n FROM `fcms_board_posts` AS p, `fcms_board_threads` AS t, \n `fcms_users` AS u \n WHERE `thread` = ?\n AND t.`id` = `thread` \n AND `user` = u.`id` \n ORDER BY p.`id` {$sort}\n LIMIT {$from}, 15"; $rows = $this->fcmsDatabase->getRows($sql, $thread_id); if ($rows === false) { $this->fcmsError->displayError(); return; } $alt = 0; $first = true; foreach ($rows as $row) { // display the table header if ($first) { echo ' <table id="postlist" cellpadding="0" cellspacing="0"> <tbody>'; $first = false; } // Shrink long subjects $subject = $row['subject']; if (strlen($subject) > 40) { $subject = substr($subject, 0, 37) . "..."; } // Remove #ANOUNCE# $isThreadAnnouncement = false; $pos = strpos($subject, '#ANOUNCE#'); if ($pos !== false) { $isThreadAnnouncement = true; $subject = substr($subject, 9, strlen($subject) - 9); } // Add RE: to replies if ($sort == 'ASC') { if ($alt > 0) { $subject = "RE: " . $subject; } } else { if ($alt !== $total - 1) { $subject = "RE: " . $subject; } } $displayname = getUserDisplayName($row['user']); $date = fixDate(T_('n/d/y g:ia'), $this->fcmsUser->tzOffset, $row['date']); if ($alt % 2 == 0) { $tr_class = ''; } else { $tr_class = 'alt'; } // Participation Level $points = getUserParticipationPoints($row['user']); $level = getUserParticipationLevel($points); // Avatar $avatar = "<img src=\"" . getCurrentAvatar($row['user']) . "\" alt=\"{$displayname}\"/><br/><br/>"; // Post Count $posts_count = $this->getUserPostCountById($row['user']); $actions = ''; // quote if ($this->fcmsUser->access < 8 && $this->fcmsUser->access != 5) { $actions .= '<form method="post" action="messageboard.php?reply=' . $thread_id . '"> <div> <input type="hidden" name="id" value="' . (int) $row['id'] . '"/> <input type="submit" class="quotebtn" value="' . T_('Quote') . '" name="quotepost" title="' . T_('Quote this message') . '"/> </div> </form>'; } // edit if ($this->fcmsUser->id == $row['user'] || $this->fcmsUser->access < 3) { $actions .= ' <form method="post" action="messageboard.php"> <div> <input type="hidden" name="id" value="' . (int) $row['id'] . '"/> <input type="submit" name="editpost" value="' . T_('Edit') . '" class="editbtn" title="' . T_('Edit this message') . '"/> </div> </form>'; } // delete if ($this->fcmsUser->access < 2) { $actions .= ' <form class="delpost" method="post" action="messageboard.php"> <div> <input type="hidden" name="id" value="' . (int) $row['id'] . '"/> <input type="hidden" name="thread" value="' . $thread_id . '"/> <input type="submit" name="delpost" value="' . T_('Delete') . '" class="delbtn" title="' . T_('Delete this message') . '"/> </div> </form>'; } // Display the posts rows echo ' <tr class="' . $tr_class . '"> <td class="side"> <b><a href="profile.php?member=' . $row['user'] . '">' . $displayname . '</a></b> ' . $level . ' ' . $avatar . ' <b>' . T_('Posts') . '</b> ' . $posts_count . ' </td> <td class="posts"> <div class="header"> <div class="subject"><b>' . cleanOutput($subject, 'html') . '</b> - ' . $date . '</div> <div class="actions"> ' . $actions . ' </div> </div> <div class="msg"> ' . parse($row['post']) . ' </div> </td> </tr>'; $alt++; } if (!$first) { echo ' </tbody> </table>'; } $this->displayMessageBoardMenu($thread_id); $this->displayPages($page, $thread_id); $this->displayAdminMenu($thread_id, $isThreadAnnouncement); echo ' <div class="top"><a href="#top">' . T_('Back to Top') . '</a></div>'; }