function displayDefault($tpl = null) { $params = $this->app->getParams('com_kunena'); $this->header = $params->get('page_title'); $this->body = $params->get('body'); $this->_prepareDocument(); $format = $params->get('body_format'); $this->header = $this->escape($this->header); if ($format == 'html') { $this->body = trim($this->body); } elseif ($format == 'text') { $this->body = $this->escape($this->body); } else { $this->body = KunenaHtmlParser::parseBBCode($this->body); } $this->render('Widget/Custom', $tpl); }
function displayAnnouncement($tpl = null) { if (KunenaFactory::getConfig()->showannouncement > 0) { $moderator = intval($this->me->isModerator('global')); $cache = JFactory::getCache('com_kunena', 'output'); if ($cache->start("{$this->template->name}.common.announcement.{$moderator}", 'com_kunena.template')) return; // User needs to be global moderator to edit announcements if ($moderator) { $this->canEdit = true; } else { $this->canEdit = false; } $this->announcement = $this->get('Announcement'); if ($this->announcement) { $this->annTitle = KunenaHtmlParser::parseText($this->announcement->title); $this->annDescription = $this->announcement->sdescription ? KunenaHtmlParser::parseBBCode($this->announcement->sdescription) : KunenaHtmlParser::parseBBCode($this->announcement->description, 300); $this->annDate = KunenaDate::getInstance($this->announcement->created); $this->annListURL = KunenaRoute::_("index.php?option=com_kunena&view=announcement&layout=list"); $this->annMoreURL = !empty($this->announcement->description) ? KunenaRoute::_("index.php?option=com_kunena&view=announcement&id={$this->announcement->id}") : null; $result = $this->loadTemplate($tpl); if (JError::isError($result)) { return $result; } echo $result; } else { echo ' '; } $cache->end(); } else echo ' '; }
function createItem($title, $url, $description, $category, $date, $userid, $username) { if ($this->config->rss_author_in_title) { // We want author in item titles $title .= ' - ' . JText::_('COM_KUNENA_BY') . ': ' . $username; } $description = preg_replace('/\\[confidential\\](.*?)\\[\\/confidential\\]/s', '', $description); $description = preg_replace('/\\[hide\\](.*?)\\[\\/hide\\]/s', '', $description); $description = preg_replace('/\\[spoiler\\](.*?)\\[\\/spoiler\\]/s', '', $description); $description = preg_replace('/\\[code\\](.*?)\\[\\/code]/s', '', $description); if ((bool) $this->config->rss_allow_html) { $description = KunenaHtmlParser::parseBBCode($description, null, (int) $this->config->rss_word_count); } else { $description = KunenaHtmlParser::parseText($description, (int) $this->config->rss_word_count); } // Assign values to feed item $item = new JFeedItem(); $item->title = $title; $item->link = $url; $item->description = $description; $item->date = $date->toSql(); $item->author = $username; // FIXME: inefficient to load users one by one -- also vulnerable to J! 2.5 user is NULL bug if ($this->config->rss_author_format != 'name') { $item->authorEmail = JFactory::getUser($userid)->email; } $item->category = $category; // Finally add item to feed $this->document->addItem($item); }
public function onAfterReply($message) { if (JString::strlen($message->message) > $this->params->get('activity_points_limit', 0)) { CFactory::load('libraries', 'userpoints'); CUserPoints::assignPoint('com_kunena.thread.reply'); } $content = KunenaHtmlParser::plainBBCode($message->message, $this->params->get('activity_stream_limit', 0)); // Add readmore permalink $content .= '<br /><a rel="nofollow" href="' . $message->getTopic()->getPermaUrl() . '" class="small profile-newsfeed-item-action">' . JText::_('COM_KUNENA_READMORE') . '</a>'; $act = new stdClass(); $act->cmd = 'wall.write'; $act->actor = $message->userid; $act->target = 0; // no target $act->title = JText::_('{single}{actor}{/single}{multiple}{actors}{/multiple} ' . JText::sprintf('PLG_KUNENA_COMMUNITY_ACTIVITY_REPLY_TITLE', '<a href="' . $message->getTopic()->getUrl() . '">' . $message->subject . '</a>')); $act->content = $content; $act->app = 'kunena.post'; $act->cid = $message->thread; $act->access = $this->getAccess($message->getCategory()); // Comments and like support $act->comment_id = $message->thread; $act->comment_type = 'kunena.post'; $act->like_id = $message->thread; $act->like_type = 'kunena.post'; // Do not add private activities if ($act->access > 20) { return; } CFactory::load('libraries', 'activities'); CActivityStream::add($act); }
public function onAfterReply($message) { $content = KunenaHtmlParser::plainBBCode($message->message, $this->params->get('activity_stream_limit', 0)); // Add readmore permalink $content .= '<br /><a rel="nofollow" href="'.$message->getTopic()->getPermaUrl().'" class="small profile-newsfeed-item-action">'.JText::_('COM_KUNENA_READMORE').'</a>'; $msg = AwdwallHelperUser::formatUrlInMsg($msg); $wall =& JTable::getInstance('Wall', 'Table'); $wall->user_id = $message->userid; $wall->group_id = NULL; $wall->type = 'text'; $wall->commenter_id = $message->userid; $wall->user_name = ''; $wall->avatar = ''; $wall->message = JText::sprintf ( 'PLG_KUNENA_JOMWALL_ACTIVITY_REPLY_TITLE', '<a href="' . $message->getTopic()->getUrl() . '">' . $message->subject . '</a>' ).'<br>'.$content; $wall->reply = 0; $wall->is_read = 0; $wall->is_pm = 0; $wall->is_reply = 0; $wall->posted_id = NULL; $wall->wall_date = time(); if (!$wall->store()){ } }
/** * Method to display the layout of search results * * @return void */ public function displayRows() { // Run events $params = new JRegistry(); $params->set('ksource', 'kunena'); $params->set('kunena_view', 'search'); $params->set('kunena_layout', 'default'); $dispatcher = JDispatcher::getInstance(); JPluginHelper::importPlugin('kunena'); $dispatcher->trigger('onKunenaPrepare', array('kunena.messages', &$this->results, &$params, 0)); foreach ($this->results as $this->message) { $this->topic = $this->message->getTopic(); $this->category = $this->message->getCategory(); $this->categoryLink = $this->getCategoryLink($this->category->getParent()) . ' / ' . $this->getCategoryLink($this->category); $ressubject = KunenaHtmlParser::parseText($this->message->subject); $resmessage = KunenaHtmlParser::parseBBCode($this->message->message, 500); $profile = KunenaFactory::getUser((int) $this->message->userid); $this->useravatar = $profile->getAvatarImage('kavatar', 'post'); foreach ($this->searchwords as $searchword) { if (empty($searchword)) { continue; } $ressubject = preg_replace("/" . preg_quote($searchword, '/') . "/iu", '<span class="searchword" >' . $searchword . '</span>', $ressubject); // FIXME: enable highlighting, but only after we can be sure that we do not break html // $resmessage = preg_replace ( "/" . preg_quote ( $searchword, '/' ) . "/iu", '<span class="searchword" >' . $searchword . '</span>', $resmessage ); } $this->author = $this->message->getAuthor(); $this->topicAuthor = $this->topic->getAuthor(); $this->topicTime = $this->topic->first_post_time; $this->subjectHtml = $ressubject; $this->messageHtml = $resmessage; $contents = $this->subLayout('Search/Results/Row')->setProperties($this->getProperties()); echo $contents; } }
function displayAnnouncement($tpl = null) { if (KunenaFactory::getConfig()->showannouncement > 0) { $moderator = intval($this->me->isModerator('global')); $cache = JFactory::getCache('com_kunena', 'output'); if ($cache->start("{$this->template->name}.common.announcement.{$moderator}", 'com_kunena.template')) return; // User needs to be global moderator to edit announcements if ($moderator) { $this->canEdit = true; } else { $this->canEdit = false; } // FIXME: move into model $db = JFactory::getDBO(); $query = "SELECT * FROM #__kunena_announcement WHERE published='1' ORDER BY created DESC"; $db->setQuery ( $query, 0, 1 ); $this->announcement = $db->loadObject (); if (KunenaError::checkDatabaseError()) return; if ($this->announcement) { $this->annTitle = KunenaHtmlParser::parseText($this->announcement->title); $this->annDescription = $this->announcement->sdescription ? KunenaHtmlParser::parseBBCode($this->announcement->sdescription) : KunenaHtmlParser::parseBBCode($this->announcement->description, 300); $this->annDate = KunenaDate::getInstance($this->announcement->created); $this->annListURL = KunenaRoute::_("index.php?option=com_kunena&view=announcement&layout=list"); $this->annMoreURL = !empty($this->announcement->description) ? KunenaRoute::_("index.php?option=com_kunena&view=announcement&id={$this->announcement->id}") : null; $result = $this->loadTemplate($tpl); if (JError::isError($result)) { return $result; } echo $result; } else { echo ' '; } $cache->end(); } else echo ' '; }
function displayDefault($tpl = null) { $this->header = $this->escape($this->header); if (empty($this->html)) { $this->body = KunenaHtmlParser::parseBBCode($this->body); } $result = $this->loadTemplateFile($tpl); if (JError::isError($result)) { return $result; } echo $result; }
function displayEdit($tpl = null) { $body = JRequest::getVar('body', '', 'post', 'string', JREQUEST_ALLOWRAW); $response = array(); if ($this->me->exists()) { $msgbody = KunenaHtmlParser::parseBBCode($body, $this); $response['preview'] = $msgbody; } // Set the MIME type and header for JSON output. $this->document->setMimeEncoding('application/json'); JResponse::setHeader('Content-Disposition', 'attachment; filename="' . $this->getName() . '.' . $this->getLayout() . '.json"'); echo json_encode($response); }
/** * @param null $tpl * * @throws Exception */ function displayEdit($tpl = null) { $body = JFactory::getApplication()->input->get('body', '', 'post', 'string', 'raw'); // RAW input $response = array(); if ($this->me->exists() || $this->config->pubwrite) { $msgbody = KunenaHtmlParser::parseBBCode($body, $this); $response['preview'] = $msgbody; } // Set the MIME type and header for JSON output. $this->document->setMimeEncoding('application/json'); JFactory::getApplication()->sendHeaders('Content-Disposition', 'attachment; filename="' . $this->getName() . '.' . $this->getLayout() . '.json"'); echo json_encode($response); }
public function onAfterReply($message) { CFactory::load ( 'libraries', 'userpoints' ); CUserPoints::assignPoint ( 'com_kunena.thread.reply' ); // Check for permisions of the current category - activity only if public or registered if ($message->getCategory()->pub_access <= 0) { //activity stream - reply post require_once KPATH_SITE.'/lib/kunena.link.class.php'; $JSPostLink = CKunenaLink::GetThreadPageURL ( 'view', $message->catid, $message->thread, 0 ); kimport('kunena.html.parser'); $content = KunenaHtmlParser::plainBBCode($message->message, $this->_config->activity_limit); // Add readmore link $content .= '<br /><a href="'. CKunenaLink::GetMessageURL($message->id, $message->catid). '" class="small profile-newsfeed-item-action">'.JText::sprintf('Read more...').'</a>'; $act = new stdClass (); $act->cmd = 'wall.write'; $act->actor = $message->userid; $act->target = 0; // no target $act->title = JText::_ ( '{single}{actor}{/single}{multiple}{actors}{/multiple} ' . JText::_ ( 'COM_KUNENA_JS_ACTIVITYSTREAM_REPLY_MSG1' ) . ' <a href="' . $JSPostLink . '">' . $message->subject . '</a> ' . JText::_ ( 'COM_KUNENA_JS_ACTIVITYSTREAM_REPLY_MSG2' ) ); $act->content = $content; $act->app = 'kunena.post'; $act->cid = $message->thread; // jomsocial 0 = public, 20 = registered members if ($message->getCategory()->pub_access == 0) { $act->access = 0; } else { $act->access = 20; } CFactory::load ( 'libraries', 'activities' ); CActivityStream::add ( $act ); } }
public function onAfterReply($message) { CFactory::load ( 'libraries', 'userpoints' ); CUserPoints::assignPoint ( 'com_kunena.thread.reply' ); $content = KunenaHtmlParser::plainBBCode($message->message, $this->_config->activity_limit); // Add readmore permalink $content .= '<br /><a rel="nofollow" href="'. KunenaRoute::_($message->getPermaUrl()). '" class="small profile-newsfeed-item-action">'.JText::_('COM_KUNENA_READMORE').'</a>'; $act = new stdClass (); $act->cmd = 'wall.write'; $act->actor = $message->userid; $act->target = 0; // no target $act->title = JText::_ ( '{single}{actor}{/single}{multiple}{actors}{/multiple} ' . JText::_ ( 'COM_KUNENA_JS_ACTIVITYSTREAM_REPLY_MSG1' ) . ' <a href="' . $message->getTopic()->getUrl() . '">' . $message->subject . '</a> ' . JText::_ ( 'COM_KUNENA_JS_ACTIVITYSTREAM_REPLY_MSG2' ) ); $act->content = $content; $act->app = 'kunena.post'; $act->cid = $message->thread; $act->access = $this->getAccess($message->getCategory()); CFactory::load ( 'libraries', 'activities' ); CActivityStream::add ( $act ); }
<?php endif; ?> <?php if ($this->config->userlist_posts) : ?> <li class="kdetails-posts"><span><?php echo JText::_('COM_KUNENA_USRL_POSTS') ?>:</span> <?php echo intval($this->user->posts); ?></li> <?php endif; ?> <?php if ($this->config->userlist_userhits) : ?> <li class="kdetails-posts"><span><?php echo JText::_('COM_KUNENA_USRL_HITS') ?>:</span> <?php echo intval($this->user->uhits) ?></li> <?php endif; ?> <?php if ($this->config->userlist_karma) : ?> <li class="kdetails-karma"><span><?php echo JText::_('COM_KUNENA_USRL_KARMA') ?>:</span> <?php echo intval($this->user->karma); ?></li> <?php endif; ?> <?php if (!empty($this->user->websiteurl)):?> <li class="kdetails-website"><span><?php echo JText::_('COM_KUNENA_MYPROFILE_WEBSITE') ?>:</span> <a href="http://<?php echo $this->escape($this->user->websiteurl); ?>" target="_blank"><?php echo KunenaHtmlParser::parseText($this->user->websitename ? $this->user->websitename : $this->user->websiteurl); ?></a></li> <?php endif;?> <?php if (!empty($this->rank_title)) : ?> <li class="kdetails-rank"><span><?php echo JText::_('COM_KUNENA_MYPROFILE_RANK') ?>:</span> <?php echo $this->rank_title ?></li> <?php endif ?> <?php if (!empty($this->rank_image)) : ?> <li class="kdetails-rankimg"><?php echo $this->rank_image ?></li> <?php endif ?> <li> <ul class="kdetails-links"> <?php echo $this->user->socialButton('twitter'); ?> <?php echo $this->user->socialButton('facebook'); ?> <?php echo $this->user->socialButton('myspace'); ?>
value="<?php echo JText::_('COM_KUNENA_EDITOR_VIDEO_INSERT'); ?>" onmouseover="javascript:document.id('helpbox').set('value', '<?php echo KunenaHtmlParser::JSText('COM_KUNENA_EDITOR_HELPLINE_VIDEOAPPLY2'); ?>')" /> </div> </td> </tr> <?php } if (!$this->config->disemoticons) : ?> <tr> <td class="kpostbuttons"> <div id="smilie"><?php $emoticons = KunenaHtmlParser::getEmoticons(0, 1); foreach ( $emoticons as $emo_code=>$emo_url ) { echo '<img class="btnImage" src="' . $emo_url . '" border="0" alt="' . $emo_code . ' " title="' . $emo_code . ' " onclick="kbbcode.insert(\' '. $emo_code .' \', \'after\', true);" style="cursor:pointer"/> '; } ?> </div> </td> </tr> <?php endif; ?> <!-- end of extendable secondary toolbar --> <tr> <td class="kposthint"><input type="text" name="helpbox" id="helpbox" size="45" class="kinputbox" disabled="disabled" maxlength="100" value="<?php echo (JText::_('COM_KUNENA_EDITOR_HELPLINE_HINT')); ?>" /></td> </tr> </table>
/** * @param $category * @param null $content * @param null $title * @param null $class * @param int $length * * @return mixed */ public function getLastPostLink($category, $content = null, $title = null, $class = null, $length = 30) { $lastTopic = $category->getLastTopic(); $channels = $category->getChannels(); if (!isset($channels[$lastTopic->category_id])) { $category = $lastTopic->getCategory(); } $uri = $lastTopic->getUrl($category, true, 'last'); if (!$content) { $content = $lastTopic->first_post_id != $lastTopic->last_post_id ? JText::_('COM_KUNENA_RE') . ' ' : ''; $content .= KunenaHtmlParser::parseText($lastTopic->subject, $length); } if ($title === null) { $title = JText::sprintf('COM_KUNENA_TOPIC_LAST_LINK_TITLE', $this->escape($category->getLastTopic()->subject)); } return JHtml::_('kunenaforum.link', $uri, $content, $title, $class, 'nofollow'); }
/** * @param int $limit * * @return array */ public function loadTopPolls($limit = 0) { $limit = $limit ? $limit : $this->_config->poppollscount; if (count($this->topPolls) < $limit) { $query = "SELECT poll.threadid AS id, SUM(opt.votes) AS count\n\t\t\t\t\tFROM #__kunena_polls_options AS opt\n\t\t\t\t\tINNER JOIN #__kunena_polls AS poll ON poll.id=opt.pollid\n\t\t\t\t\tGROUP BY pollid\n\t\t\t\t\tHAVING count > 0\n\t\t\t\t\tORDER BY count DESC"; $this->_db->setQuery($query, 0, $limit); $polls = (array) $this->_db->loadObjectList('id'); KunenaError::checkDatabaseError(); $this->topPolls = KunenaForumTopicHelper::getTopics(array_keys($polls)); $top = reset($this->topPolls); if (!$top) { return array(); } $top->title = JText::_('COM_KUNENA_LIB_STAT_TOP_POLLS'); $top->titleName = JText::_('COM_KUNENA_POLL_STATS_NAME'); $top->titleCount = JText::_('COM_KUNENA_USRL_VOTES'); $top->count = $polls[$top->id]->count; foreach ($this->topPolls as &$item) { $item = clone $item; $item->count = $polls[$item->id]->count; $item->link = JHtml::_('kunenaforum.link', $item->getUri(), KunenaHtmlParser::parseText($item->subject)); $item->percent = round(100 * $item->count / $top->count); } } return array_slice($this->topPolls, 0, $limit); }
<?php /** * @version $Id$ * Kunena Component * @package Kunena * * @Copyright (C) 2008 - 2011 Kunena Team. All rights reserved. * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL * @link http://www.kunena.org **/ defined ( '_JEXEC' ) or die (); ?> <div class="kblock kdefault"> <div class="kheader"> <h2><?php echo $this->escape($this->header); ?></h2> </div> <div class="kcontainer"> <div class="kbody"> <div class="kcontent"> <?php if (!empty($this->html)) : echo $this->body; else : echo KunenaHtmlParser::parseBBCode($this->body); endif; ?> </div> </div> </div> </div>
protected function _prepareDocument($type) { if ($type == 'default') { $this->headerText = JText::_('COM_KUNENA_MENU_LATEST_DESC'); $this->title = JText::_('COM_KUNENA_ALL_DISCUSSIONS'); $page = intval($this->state->get('list.start') / $this->state->get('list.limit')) + 1; $pages = intval(($this->total - 1) / $this->state->get('list.limit')) + 1; $title = JText::sprintf($this->topic->subject) . " ({$page}/{$pages})"; $this->setTitle($title); // TODO: use real keywords, too $keywords = $this->escape("{$this->topic->subject}, {$this->category->name}, {$this->category->getParent()->name}, {$this->config->board_title}"); $this->setKeywords($keywords); // Create Meta Description form the content of the first message // better for search results display but NOT for search ranking! $description = KunenaHtmlParser::stripBBCode($this->topic->first_post_message, 182); $description = preg_replace('/\\s+/', ' ', $description); // remove newlines $description = trim($description); // Remove trailing spaces and beginning if ($page) { $description .= " ({$page}/{$pages})"; //avoid the "duplicate meta description" error in google webmaster tools } $this->setDescription($description); } elseif ($type == 'create') { $this->title = JText::_('COM_KUNENA_POST_NEW_TOPIC'); $this->setTitle($this->title); // TODO: set keywords and description } elseif ($type == 'reply') { $this->title = JText::_('COM_KUNENA_POST_REPLY_TOPIC') . ' ' . $this->topic->subject; $this->setTitle($this->title); // TODO: set keywords and description } elseif ($type == 'edit') { $this->title = JText::_('COM_KUNENA_POST_EDIT') . ' ' . $this->topic->subject; $this->setTitle($this->title); // TODO: set keywords and description } }
<td class="kcol-mid kcol-ktopictitle"> <div class="ktopic-details"> <?php if ($this->topic->attachments) { echo $this->getIcon('ktopicattach', JText::_('COM_KUNENA_ATTACH')); } ?> <?php if ($this->topic->poll_id) { echo $this->getIcon('ktopicpoll', JText::_('COM_KUNENA_ADMIN_POLLS')); } ?> <div class="ktopic-title-cover"> <?php echo $this->getTopicLink($this->topic, null, null, KunenaHtmlParser::stripBBCode($this->topic->first_post_message, 500), 'ktopic-title km'); if ($this->topic->getUserTopic()->favorite) { echo $this->getIcon('kfavoritestar', JText::_('COM_KUNENA_FAVORITE')); } if ($this->me->exists() && $this->topic->getUserTopic()->posts) { echo $this->getIcon('ktopicmy', JText::_('COM_KUNENA_MYPOSTS')); } if ($this->topic->unread) { echo $this->getTopicLink($this->topic, 'unread', '<sup dir="ltr" class="knewchar">(' . $this->topic->unread . ' ' . JText::_('COM_KUNENA_A_GEN_NEWCHAR') . ')</sup>'); } ?> </div> <div class="ktopic-details-kcategory"> <?php if (!isset($this->category) || $this->category->id != $this->topic->getCategory()->id) { ?>
?> </li> <li><?php echo $this->displayKarma(); ?> </li> <?php if ($PMlink) { ?> <li><?php echo $PMlink; ?> </li> <?php } ?> <?php if (!empty($this->personalText)) { ?> <li><strong><?php echo JText::_('COM_KUNENA_MYPROFILE_ABOUTME'); ?> :</strong> <?php echo KunenaHtmlParser::parseText($this->personalText); ?> </li><?php } ?> </ul> </div>
<?php echo JText::_('COM_KUNENA_BY') . ' ' . $this->message->getAuthor()->getLink(); ?> </span> </div> <div class="kmessage-avatar"><?php echo $this->user->getAvatarImage('', 'list'); ?> </div> <div class="kmessage-msgtext"><?php echo KunenaHtmlParser::stripBBCode($this->message->message, 300); ?> </div> </div> <div> <?php if ($this->userLink) { echo JText::_('COM_KUNENA_MODERATE_THIS_USER'); ?> : <strong>
<div class="clear-fix"></div> <div class="horizontal-message"> <div class="profile-horizontal-top"> <?php echo $this->subLayout('User/Profile')->set('user', $this->profile)->setLayout('horizontal')->set('topic_starter', $topicStarter)->set('category_id', $this->category->id); ?> </div> <div class="horizontal-message-top badger-info <?php if ($message->getAuthor()->isModerator()) { ?> badger-moderator <?php } ?> " data-badger="<?php echo !$isReply ? $this->escape($avatarname) . ' ' . JText::_('COM_KUNENA_MESSAGE_CREATED') : $this->escape($avatarname) . ' ' . JText::_('COM_KUNENA_MESSAGE_REPLIED') . ' ' . KunenaHtmlParser::parseText($message->displayField('subject'), $subjectlengthmessage); ?> "> <div class="kmessage"> <div class="horizontal-message-text"> <p class="kmsg"> <?php echo $message->displayField('message'); ?> </p> </div> <?php if (!empty($attachments)) { ?> <div class="kattach"> <h5> <?php
?> </p> <p><?php $profile = KunenaFactory::getUser(intval($this->message->userid)); $useravatar = $profile->getAvatarImage('', '', 'profile'); if ($useravatar) { echo $this->message->getAuthor()->getLink($useravatar); } ?> </p> </td> <td class="kmessage-left khistorymsg"> <div class="kmsgbody"> <div class="kmsgtext"> <?php echo KunenaHtmlParser::parseBBCode($this->message->message, $this); ?> </div> </div> <?php $this->attachments = $this->message->getAttachments(); if (!empty($this->attachments)) { ?> <div class="kmsgattach"> <?php echo JText::_('COM_KUNENA_ATTACHMENTS'); ?> <ul class="kfile-attach"> <?php foreach ($this->attachments as $attachment) { ?>
echo $this->getIcon('ktopicsticky', JText::_('MOD_KUNENALATEST_STICKY_TOPIC')); } if ($this->params->get('sh_locked') && $this->topic->locked) { echo $this->getIcon('ktopiclocked', JText::_('COM_KUNENA_GEN_LOCKED_TOPIC')); } if ($this->params->get('sh_favorite') && $this->topic->getUserTopic()->favorite) { echo $this->getIcon('kfavoritestar', JText::_('COM_KUNENA_FAVORITE')); } ?> </li> <?php if ($this->params->get('sh_firstcontentcharacter')) { ?> <li class="klatest-preview-content"><?php echo KunenaHtmlParser::stripBBCode($this->topic->last_post_message, $this->params->get('lengthcontentcharacters')); ?> </li> <?php } ?> <?php if ($this->params->get('sh_category')) { ?> <li class="klatest-cat"><?php echo JText::_('MOD_KUNENALATEST_IN_CATEGORY') . ' ' . $this->categoryLink; ?> </li> <?php }
<div class="kblock"> <div class="kheader clearfix"> <span class="ktoggler"><a class="ktoggler close" title="<?php echo JText::_('COM_KUNENA_TOGGLER_COLLAPSE'); ?> " rel="frontstats_tbody"></a></span> <h2><span><?php echo JText::_('COM_KUNENA_FORUM_HEADER'); ?> </span></h2> </div> <div class="kcontainer" id="frontstats_tbody"> <div class="kbody"> <div class="kfheadercontent"> <?php echo KunenaHtmlParser::parseBBCode($this->category->headerdesc); ?> </div> </div> </div> </div> <?php } ?> <?php if (!$this->category->isSection()) { ?> <table class="klist-actions"> <tr> <td class="klist-actions-goto">
if ($useravatar) { ?> <span class="klatest-avatar"> <?php echo $last->getLastPostAuthor()->getLink($useravatar, null, 'nofollow', '', null, $this->category->id); ?> </span> <?php } ?> <!-- /Avatar --> <?php } ?> <div class="klatest-subject ks"> <?php echo JText::_('COM_KUNENA_GEN_LAST_POST') . ': ' . $this->getTopicLink($last, 'last', KunenaHtmlParser::parseText($last->subject, 30)); ?> </div> <div class="klatest-subject-by ks"> <?php echo JText::_('COM_KUNENA_BY') . ' '; echo $last->getLastPostAuthor()->getLink(null, null, 'nofollow', '', null, $this->category->id); echo '<br /><span class="nowrap" title="' . KunenaDate::getInstance($last->last_post_time)->toKunena('config_post_dateformat_hover') . '">' . KunenaDate::getInstance($last->last_post_time)->toKunena('config_post_dateformat') . '</span>'; ?> </div> </td> <?php } else { ?>
public function getTopicLink($topic, $action = null, $content = null, $title = null, $class = null) { $uri = $this->getTopicUrl($topic, $action, true); if (!$content) $content = KunenaHtmlParser::parseText($topic->subject); if ($title === null) { switch ($action) { case 'first': $title = JText::sprintf('COM_KUNENA_TOPIC_FIRST_LINK_TITLE', $this->escape($topic->subject)); break; case 'last': $title = JText::sprintf('COM_KUNENA_TOPIC_LAST_LINK_TITLE', $this->escape($topic->subject)); break; case 'unread': $title = JText::sprintf('COM_KUNENA_TOPIC_UNREAD_LINK_TITLE', $this->escape($topic->subject)); break; default: $title = JText::sprintf('COM_KUNENA_TOPIC_LINK_TITLE', $this->escape($topic->subject)); } } return JHTML::_('kunenaforum.link', $uri, $content, $title, $class, 'nofollow'); }
echo '<sup class="knewchar">(' . $category->getNewCount() . ' ' . JText::_('COM_KUNENA_A_GEN_NEWCHAR') . ")</sup>"; } if ($category->locked) { echo $this->getIcon('kforumlocked', JText::_('COM_KUNENA_LOCKED_CATEGORY')); } if ($category->review) { echo $this->getIcon('kforummoderated', JText::_('COM_KUNENA_GEN_MODERATED')); } ?> </div> <?php if (!empty($category->description)) { ?> <div class="kthead-desc km hidden-phone"><?php echo KunenaHtmlParser::parseBBCode($category->description); ?> </div> <?php } ?> <?php // Display subcategories if (!empty($this->categories[$category->id])) { ?> <div class="kthead-child"> <div class="kcc-table"> <?php foreach ($this->categories[$category->id] as $childforum) { ?> <div class="kcc-subcat km">
/** * @param null $tpl * * @throws Exception */ protected function displayCommon($tpl = null) { $userid = JFactory::getApplication()->input->getInt('userid'); $this->_db = JFactory::getDBO(); $this->do = JFactory::getApplication()->input->getWord('layout'); if (!$userid) { $this->user = JFactory::getUser(); } else { $this->user = JFactory::getUser($userid); } if ($this->user->id == 0 || $this->me->userid == 0 && !$this->config->pubprofile) { $this->app->enqueueMessage(JText::_('COM_KUNENA_PROFILEPAGE_NOT_ALLOWED_FOR_GUESTS'), 'notice'); return; } $integration = KunenaFactory::getProfile(); $activityIntegration = KunenaFactory::getActivityIntegration(); $template = KunenaFactory::getTemplate(); $this->params = $template->params; if (get_class($integration) == 'KunenaProfileNone') { $this->app->enqueueMessage(JText::_('COM_KUNENA_PROFILE_DISABLED'), 'notice'); return; } $this->allow = true; $this->profile = KunenaFactory::getUser($this->user->id); if (!$this->profile->exists()) { $this->profile->save(); } if ($this->profile->userid == $this->me->userid) { if ($this->do != 'edit') { $this->editlink = $this->profile->getLink(JText::_('COM_KUNENA_EDIT') . ' »', JText::_('COM_KUNENA_EDIT') . ' »', 'nofollow', 'edit', ''); } else { $this->editlink = $this->profile->getLink(JText::_('COM_KUNENA_BACK') . ' »', JText::_('COM_KUNENA_BACK') . ' »', 'nofollow', '', ''); } } $this->name = $this->user->username; if ($this->config->showuserstats) { $this->rank_image = $this->profile->getRank(0, 'image'); $this->rank_title = $this->profile->getRank(0, 'title'); $this->posts = $this->profile->posts; $this->thankyou = $this->profile->thankyou; $this->userpoints = $activityIntegration->getUserPoints($this->profile->userid); $this->usermedals = $activityIntegration->getUserMedals($this->profile->userid); } if ($this->config->userlist_joindate || $this->me->isModerator()) { $this->registerdate = $this->user->registerDate; } if ($this->config->userlist_lastvisitdate || $this->me->isModerator()) { $this->lastvisitdate = $this->user->lastvisitDate; } if (!isset($this->lastvisitdate) || $this->lastvisitdate == "0000-00-00 00:00:00") { $this->lastvisitdate = null; } $this->avatarlink = $this->profile->getAvatarImage('kavatar', 'profile'); $this->personalText = $this->profile->personalText; $this->signature = $this->profile->signature; $this->signatureHtml = KunenaHtmlParser::parseBBCode($this->signature, null, $this->config->maxsig); $this->localtime = KunenaDate::getInstance('now', $this->user->getParam('timezone', $this->app->get('offset', null))); try { $offset = new DateTimeZone($this->user->getParam('timezone', $this->app->get('offset', null))); } catch (Exception $e) { $offset = null; } $this->localtime->setTimezone($offset); $this->moderator = KunenaAccess::getInstance()->getModeratorStatus($this->profile); $this->admin = $this->profile->isAdmin(); switch ($this->profile->gender) { case 1: $this->genderclass = 'male'; $this->gender = JText::_('COM_KUNENA_MYPROFILE_GENDER_MALE'); break; case 2: $this->genderclass = 'female'; $this->gender = JText::_('COM_KUNENA_MYPROFILE_GENDER_FEMALE'); break; default: $this->genderclass = 'unknown'; $this->gender = JText::_('COM_KUNENA_MYPROFILE_GENDER_UNKNOWN'); } if ($this->profile->location) { $this->locationlink = '<a href="http://maps.google.com?q=' . $this->escape($this->profile->location) . '" target="_blank">' . $this->escape($this->profile->location) . '</a>'; } else { $this->locationlink = JText::_('COM_KUNENA_LOCATION_UNKNOWN'); } $this->online = $this->profile->isOnline(); $this->showUnusedSocial = true; if (!preg_match("~^(?:f|ht)tps?://~i", $this->profile->websiteurl)) { $this->websiteurl = 'http://' . $this->profile->websiteurl; } else { $this->websiteurl = $this->profile->websiteurl; } $avatar = KunenaFactory::getAvatarIntegration(); $this->editavatar = $avatar instanceof KunenaAvatarKunena ? true : false; $this->banInfo = KunenaUserBan::getInstanceByUserid($userid, true); $this->canBan = $this->banInfo->canBan(); if ($this->config->showbannedreason) { $this->banReason = $this->banInfo->reason_public; } // Which tabs to show? $this->showUserPosts = true; $this->showSubscriptions = $this->config->allowsubscriptions && $this->me->userid == $this->profile->userid; $this->showFavorites = $this->config->allowfavorites && $this->me->userid == $this->profile->userid; $this->showThankyou = $this->config->showthankyou && $this->me->exists(); $this->showUnapprovedPosts = $this->me->isAdmin() || KunenaAccess::getInstance()->getModeratorStatus(); // || $this->me->userid == $this->profile->userid; $this->showAttachments = $this->canManageAttachments() && ($this->me->isModerator() || $this->me->userid == $this->profile->userid); $this->showBanManager = $this->me->isModerator() && $this->me->userid == $this->profile->userid; $this->showBanHistory = $this->me->isModerator() && $this->me->userid != $this->profile->userid; $this->showBanUser = $this->canBan; if ($this->me->userid != $this->profile->userid) { $this->profile->uhits++; $this->profile->save(); } $private = KunenaFactory::getPrivateMessaging(); if ($this->me->userid == $this->user->id) { $this->pmCount = $private->getUnreadCount($this->me->userid); $this->pmLink = $private->getInboxLink($this->pmCount ? JText::sprintf('COM_KUNENA_PMS_INBOX_NEW', $this->pmCount) : JText::_('COM_KUNENA_PMS_INBOX')); } else { $this->pmLink = $this->profile->profileIcon('private'); } $this->_prepareDocument('common'); $layout = $this->getLayout() != 'default' ? "User/{$this->getLayout()}" : 'User/Item'; $this->render($layout, $tpl); }
/** * @param string $field * * @return int|string */ public function displayField($field) { switch ($field) { case 'id': return intval($this->id); case 'subject': return KunenaHtmlParser::parseText($this->subject); } return ''; }