$helper = new WallHelper(); if ($unread) { ?> <li class="unread_notification admin_notification"> <?php } else { ?> <li class="read_notification admin_notification"> <?php } ?> <a href="<?php echo $url; ?> "> <div class="notification"> <div class="msg-title"><?php echo $helper->shortenText($title, WallNotificationsController::NOTIFICATION_TITLE_LIMIT); ?> </div> <?php echo wfMessage('wall-notifications-notifyeveryone', $authors[0])->text(); ?> <div class="timeago" title="<?php echo $iso_timestamp; ?> "></div> </div> </a> </li>
public function getArticlesRelatedMessgesSnippet($pageId, $messageCount, $replyCount) { $messages = $this->getArticlesRelatedMessgesIds($pageId, 'last_update desc', $messageCount); $out = array(); $update = array(0); $helper = new WallHelper(); foreach ($messages as $value) { $wallThread = WallThread::newFromId($value['comment_id']); if (empty($wallThread)) { continue; } $wallMessage = $wallThread->getThreadMainMsg(); if (empty($wallMessage)) { continue; } $wallMessage->load(); $update[] = $wallMessage->getCreateTime(TS_UNIX); $row = array(); $row['metaTitle'] = $wallMessage->getMetaTitle(); $row['threadUrl'] = $wallMessage->getMessagePageUrl(); $row['totalReplies'] = $wallThread->getRepliesCount(); $row['displayName'] = $wallMessage->getUserDisplayName(); $row['userName'] = $wallMessage->getUser()->getName(); $row['userUrl'] = $wallMessage->getUserWallUrl(); $strippedText = $helper->strip_wikitext($wallMessage->getRawText(), $wallMessage->getTitle()); $row['messageBody'] = $helper->shortenText($strippedText); $row['timeStamp'] = $wallMessage->getCreateTime(); $row['replies'] = array(); $replies = array_reverse($wallThread->getRepliesWallMessages(2, "DESC")); foreach ($replies as $reply) { /** @var WallMessage $reply */ $reply->load(); $update[] = $reply->getCreateTime(TS_UNIX); if (!$reply->isRemove() && !$reply->isAdminDelete()) { $strippedText = $helper->strip_wikitext($reply->getRawText(), $reply->getTitle()); $replyRow = array('displayName' => $reply->getUserDisplayName(), 'userName' => $reply->getUser()->getName(), 'userUrl' => $reply->getUserWallUrl(), 'messageBody' => $helper->shortenText($strippedText), 'timeStamp' => $reply->getCreateTime()); $row['replies'][] = $replyRow; } } $out[] = $row; } $out['lastupdate'] = max($update); return $out; }