Пример #1
0
 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);
 }
Пример #2
0
	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 ' ';
	}
Пример #3
0
 /**
  * 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;
     }
 }
Пример #4
0
	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 ' ';
	}
Пример #5
0
 /**
  * Render personal text.
  *
  * @return string
  *
  * @since  K4.0
  */
 public function getPersonalText()
 {
     if (!isset($this->_personalText)) {
         $this->_personalText = KunenaHtmlParser::parseText($this->personalText);
     }
     return $this->_personalText;
 }
Пример #6
0
					       id="radio_name<?php 
    echo (int) $key;
    ?>
"
					       value="<?php 
    echo (int) $poll_option->id;
    ?>
"
					<?php 
    if ($this->voted && $this->voted->lastvote == $poll_option->id) {
        echo 'checked="checked"';
    }
    ?>
 />
					<?php 
    echo KunenaHtmlParser::parseText($poll_option->text);
    ?>
				</label>
			</li>
			<?php 
}
?>

		</ul>

		<input id="kpoll-button-vote" class="btn btn-success" type="submit"
		       value="<?php 
echo $this->voted && $this->config->pollallowvoteone ? JText::_('COM_KUNENA_POLL_BUTTON_CHANGEVOTE') : JText::_('COM_KUNENA_POLL_BUTTON_VOTE');
?>
" />
		<input id="kpoll_go_results" type="button" class="btn btn-success" value="<?php 
Пример #7
0
 /**
  * @param string $field
  *
  * @return int|string
  */
 public function displayField($field, $html = true)
 {
     switch ($field) {
         case 'id':
             return intval($this->id);
         case 'subject':
             return KunenaHtmlParser::parseText($this->subject);
         case 'message':
             // FIXME: add context to BBCode parser (and fix logic in the parser)
             return $html ? KunenaHtmlParser::parseBBCode($this->message, $this) : KunenaHtmlParser::stripBBCode($this->message, $this->parent, $html);
     }
     return '';
 }
Пример #8
0
 /**
  * @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');
 }
Пример #9
0
										<span class="kcategory-views"> <?php echo JText::_('COM_KUNENA_MY_POSTS'); ?> </span>
									</td>
									<?php
									$last = $this->category->getLastPosted();
									if ($last->last_topic_id) : ?>
									<td class="kcategory-topic">
										<ul>
										<?php
										if ($this->config->avataroncat > 0) :
											$useravatar = KunenaFactory::getUser((int)$last->last_post_userid)->getAvatarImage('klist-avatar', 'list');
											if ($useravatar) : ?>
										<li class="klatest-avatar"> <?php echo CKunenaLink::GetProfileLink ( intval($last->last_post_userid), $useravatar ); ?></li>
										<?php endif; ?>
										<?php endif; ?>
										<li class="ktopic-title">
										<?php echo JText::_('COM_KUNENA_GEN_LAST_POST') . ': '. CKunenaLink::GetThreadPageLink ( 'view', intval($last->id), intval($last->last_topic_id), intval($last->getLastPostLocation()), intval($this->config->messages_per_page), KunenaHtmlParser::parseText($last->last_topic_subject, 30), intval($last->last_post_id) );?>
										</li>

										<li class="ktopic-details">
										<?php
											echo JText::_('COM_KUNENA_BY') . ' ';
											echo CKunenaLink::GetProfileLink ( intval($last->last_post_userid), $this->escape($last->last_post_guest_name) );
											echo KunenaDate::getInstance($last->last_post_time)->toSpan('config_post_dateformat','config_post_dateformat_hover');
										?>
										</li>
										</ul>
									</td>

									<?php else : ?>
									<td class="kcol-mid kcol-knoposts"><?php echo JText::_('COM_KUNENA_NO_POSTS'); ?></td>
									<?php endif ?>
Пример #10
0
        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 {
    ?>
Пример #11
0
?>
</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>
Пример #12
0
echo $this->getTopicClass('k', 'row');
?>
">
	<td class="kcol-first kcol-ktopicicon hidden-phone"> <?php 
echo $this->getTopicLink($this->topic, 'unread', $this->topic->getIcon());
?>
 </td>
	<td class="kcol-mid ktopictittle">
		<?php 
// FIXME:
/*if ($this->message->attachments) {
			echo $this->getIcon ( 'ktopicattach', JText::_('COM_KUNENA_ATTACH') );
		}*/
?>
		<div class="ktopic-title-cover"> <?php 
echo $this->getTopicLink($this->topic, $this->message, KunenaHtmlParser::parseText($this->message->subject, 30), KunenaHtmlParser::stripBBCode($this->message->message, 500), 'ktopic-title km');
?>
 </div>
	</td>
	<td class="kcol-mid ktopictittle">
		<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->topic->unread) {
    echo $this->getTopicLink($this->topic, 'unread', '<sup dir="ltr" class="knewchar">(' . $this->topic->unread . ' ' . JText::_('COM_KUNENA_A_GEN_NEWCHAR') . ')</sup>');
}
if ($this->topic->locked != 0) {
    echo $this->getIcon('ktopiclocked', JText::_('COM_KUNENA_LOCKED_TOPIC'));
Пример #13
0
 * 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 ();

$document = JFactory::getDocument();
$document->setTitle(JText::_('COM_KUNENA_ANN_ANNOUNCEMENTS') . ' - ' . $this->config->board_title);
?>
		<div id="kannounce">
			<h2 class="kheader">
				<a href="" title="<?php echo JText::_('COM_KUNENA_VIEW_COMMON_ANNOUNCE_LIST') ?>" rel="kannounce-detailsbox">
					<?php echo KunenaHtmlParser::parseText($this->announcement->title) ?>
				</a>
			</h2>
			<?php if ($this->canEdit) : ?>
			<div class="kactions">
				<?php echo CKunenaLink::GetAnnouncementLink( 'edit', $this->announcement->id, JText::_('COM_KUNENA_ANN_EDIT'), JText::_('COM_KUNENA_ANN_EDIT')); ?> |
				<?php echo CKunenaLink::GetAnnouncementLink( 'delete', $this->announcement->id, JText::_('COM_KUNENA_ANN_DELETE'), JText::_('COM_KUNENA_ANN_DELETE')); ?> |
				<?php echo CKunenaLink::GetAnnouncementLink( 'add',NULL, JText::_('COM_KUNENA_ANN_ADD'), JText::_('COM_KUNENA_ANN_ADD')); ?> |
				<?php echo CKunenaLink::GetAnnouncementLink( 'show', NULL, JText::_('COM_KUNENA_ANN_CPANEL'), JText::_('COM_KUNENA_ANN_CPANEL')); ?>
			</div>
			<?php endif; ?>
			<div class="kdetailsbox" id="kannounce-detailsbox">
				<ul class="kheader-desc">
					<?php if ($this->announcement->showdate > 0) : ?>
					<li class="kannounce-date"><?php echo KunenaDate::getInstance($this->announcement->created)->toKunena('date_today') ?></li>
					<?php endif; ?>
Пример #14
0
 /**
  * @param string	$field	Field to be displayed.
  *
  * @return int|string
  */
 public function displayField($field)
 {
     switch ($field) {
         case 'id':
             return intval($this->id);
         case 'name':
         case 'icon':
             return KunenaHtmlParser::parseText($this->name);
         case 'description':
         case 'headerdesc':
             return KunenaHtmlParser::parseBBCode($this->{$field});
     }
     return '';
 }
Пример #15
0
	public function loadTopPolls($limit=0) {
		$limit = $limit ? $limit : $this->_config->poppollscount;
		if (count($this->topPolls) < $limit) {
			$query = "SELECT m.*, poll.*, SUM(opt.votes) AS count
					FROM #__kunena_polls_options AS opt
					INNER JOIN #__kunena_polls AS poll ON poll.id=opt.pollid
					LEFT JOIN #__kunena_messages AS m ON poll.threadid=m.id
					GROUP BY pollid
					ORDER BY count DESC";
			$this->_db->setQuery($query, 0, $limit);
			$this->topPolls = $this->_db->loadObjectList();
			KunenaError::checkDatabaseError();
			$top = reset($this->topPolls);
			if (empty($top->count)){
				$this->topPolls = array();
				return;
			}
			foreach ($this->topPolls as $item) {
				$item->link = CKunenaLink::GetThreadLink( 'view', $item->catid, $item->id, KunenaHtmlParser::parseText ($item->subject), '' );
				$item->percent = round(100 * $item->count / $top->count);
			}
			$top->title = JText::_('COM_KUNENA_STAT_TOP') .' '. $limit .' '. JText::_('COM_KUNENA_STAT_POPULAR') .' '. JText::_('COM_KUNENA_STAT_POPULAR_POLLS_KGSG');
			$top->titleName = JText::_('COM_KUNENA_POLL_STATS_NAME');
			$top->titleCount =  JText::_('COM_KUNENA_USRL_VOTES');
		}
		return array_slice($this->topPolls, 0, $limit);
	}
Пример #16
0
 public function displayField($field, $mode = null)
 {
     switch ($field) {
         case 'id':
             return intval($this->id);
         case 'title':
             return KunenaHtmlParser::parseText($this->title);
         case 'sdescription':
             return KunenaHtmlParser::parseBBCode($this->sdescription);
         case 'description':
             return KunenaHtmlParser::parseBBCode($this->description ? $this->description : $this->sdescription);
         case 'created_by':
             return $this->getAuthor()->getLink();
         case 'created':
             if (!$mode) {
                 $mode = 'date_today';
             }
             return $this->getCreationDate()->toKunena($mode);
     }
 }
Пример #17
0
<div class="pull-right btn btn-small" data-toggle="collapse" data-target="#poll-results">&times;</div>
<h2>
	<?php echo JText::_('COM_KUNENA_POLL_NAME'); ?> <?php echo KunenaHtmlParser::parseText($this->poll->title); ?>
</h2>
<?php endif; ?>

<div class="collapse in" id="poll-results" <?php echo $this->show_title ? '': 'style="display:none;"'; ?>>
<table class="table table-striped table-bordered table-condensed">

	<?php
	foreach ($this->poll->getOptions() as $option) :
		$percentage = round(($option->votes * 100) / max($this->poll->getTotal(), 1), 1);
	?>
	<tr>
		<td>
			<?php echo KunenaHtmlParser::parseText($option->text); ?>
		</td>
		<td class="span8">
			<div class="progress progress-striped">
				<div class="bar" style="height:30px;width:<?php echo $percentage; ?>%;"></div>
			</div>
		</td>
		<td>
			<?php
			if (isset($option->votes) && $option->votes > 0)
			{
				echo $option->votes;
			} else {
				echo JText::_('COM_KUNENA_POLL_NO_VOTE');
			}
			?>
Пример #18
0
						<dt><?php echo JText::_('COM_KUNENA_POLL_NAME'); ?> <?php echo KunenaHtmlParser::parseText ($this->poll->title); ?></dt>
						<dd class="tk-toggler"><a class="ktoggler close" rel="kpolls-body"></a></dd>
					</dl>
				</li>
			</ul>

	<div class="kcontainer" id="kpolls-body">
		<div class="kbody">
			<table class="kblocktable" id="kpoll">
				<tr>
					<td>
						<div class="kpolldesc">
							<table class="kblocktable">
							<?php foreach ( $this->poll->getOptions() as $option ) : ?>
							<tr class="krow<?php echo (++$row)%2+1;?>">
								<td class="kcol-option"><?php echo KunenaHtmlParser::parseText ($option->text); ?></td>
								<td class="kcol-bar"><img class="jr-forum-stat-bar" src="<?php echo JURI::root(true)."/components/com_kunena/template/default/images/bar.png"; ?>" height="10" width="<?php echo intval(($option->votes*300)/max($this->poll->getTotal(),1))+3; ?>" /></td>
								<td class="kcol-number"><?php if(isset($option->votes) && ($option->votes > 0)) { echo $option->votes; } else { echo JText::_('COM_KUNENA_POLL_NO_VOTE'); } ?></td>
								<td class="kcol-percent"><?php echo round(($option->votes*100)/max($this->poll->getTotal(),1),1)."%"; ?></td>
							</tr>
							<?php endforeach; ?>
							<tr class="krow<?php echo (++$row)%2+1;?>">
								<td colspan="4">
									<?php
									echo JText::_('COM_KUNENA_POLL_VOTERS_TOTAL')." <strong>".$this->usercount."</strong> ";
									echo " ( ".implode(', ', $this->users_voted_list)." ) "; ?>
									<?php if ( $this->usercount > '5' ) : ?><a href="#" id="kpoll-moreusers"><?php echo JText::_('COM_KUNENA_POLLUSERS_MORE')?></a>
									<div style="display: none;" id="kpoll-moreusers-div"><?php echo implode(', ', $this->users_voted_morelist); ?></div>
									<?php endif; ?>
								</td>
							</tr>
Пример #19
0
 /**
  * @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 '';
 }
Пример #20
0
 public function getTopicLink(KunenaForumTopic $topic, $action = null, $content = null, $title = null, $class = null, KunenaForumCategory $category = NULL)
 {
     $uri = $topic->getUri($category ? $category : (isset($this->category) ? $this->category : $topic->category_id), $action);
     if (!$content) {
         $content = KunenaHtmlParser::parseText($topic->subject);
     }
     $rel = 'follow';
     if ($title === null) {
         $rel = 'nofollow';
         if ($action instanceof KunenaForumMessage) {
             $title = JText::sprintf('COM_KUNENA_TOPIC_MESSAGE_LINK_TITLE', $this->escape($topic->subject));
         } else {
             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, $rel);
 }
Пример #21
0
 function getMessageProfileBox()
 {
     static $profiles = array();
     $key = $this->profile->userid . '.' . $this->profile->username;
     if (!isset($profiles[$key])) {
         // Run events
         $params = new JRegistry();
         // Modify profile values by integration
         $params->set('ksource', 'kunena');
         $params->set('kunena_view', 'topic');
         $params->set('kunena_layout', $this->state->get('layout'));
         JPluginHelper::importPlugin('kunena');
         $dispatcher = JDispatcher::getInstance();
         $dispatcher->trigger('onKunenaPrepare', array('kunena.user', &$this->profile, &$params, 0));
         //karma points and buttons
         $this->userkarma_title = $this->userkarma_minus = $this->userkarma_plus = '';
         if ($this->config->showkarma && $this->profile->userid) {
             $this->userkarma_title = JText::_('COM_KUNENA_KARMA') . ": " . $this->profile->karma;
             if ($this->me->userid && $this->me->userid != $this->profile->userid) {
                 $this->userkarma_minus = ' ' . JHtml::_('kunenaforum.link', 'index.php?option=com_kunena&view=user&task=karmadown&userid=' . $this->profile->userid . '&' . JSession::getFormToken() . '=1', '<span class="kkarma-minus" alt="Karma-" border="0" title="' . JText::_('COM_KUNENA_KARMA_SMITE') . '"> </span>');
                 $this->userkarma_plus = ' ' . JHtml::_('kunenaforum.link', 'index.php?option=com_kunena&view=user&task=karmaup&userid=' . $this->profile->userid . '&' . JSession::getFormToken() . '=1', '<span class="kkarma-plus" alt="Karma+" border="0" title="' . JText::_('COM_KUNENA_KARMA_APPLAUD') . '"> </span>');
             }
         }
         if ($this->me->exists() && $this->message->userid == $this->me->userid) {
             $usertype = 'me';
         } else {
             $usertype = $this->profile->getType($this->category->id, true);
         }
         // TODO: add context (options) to caching
         $cache = JFactory::getCache('com_kunena', 'output');
         $cachekey = "profile.{$this->getTemplateMD5()}.{$this->profile->userid}.{$usertype}";
         $cachegroup = 'com_kunena.messages';
         // FIXME: enable caching after fixing the issues
         $contents = false;
         //$cache->get($cachekey, $cachegroup);
         if (!$contents) {
             $this->userkarma = "{$this->userkarma_title} {$this->userkarma_minus} {$this->userkarma_plus}";
             // Use kunena profile
             if ($this->config->showuserstats) {
                 $this->userrankimage = $this->profile->getRank($this->topic->category_id, 'image');
                 $this->userranktitle = $this->profile->getRank($this->topic->category_id, 'title');
                 $this->userposts = $this->profile->posts;
                 $activityIntegration = KunenaFactory::getActivityIntegration();
                 $this->userthankyou = $this->profile->thankyou;
                 $this->userpoints = $activityIntegration->getUserPoints($this->profile->userid);
                 $this->usermedals = $activityIntegration->getUserMedals($this->profile->userid);
             } else {
                 $this->userrankimage = null;
                 $this->userranktitle = null;
                 $this->userposts = null;
                 $this->userthankyou = null;
                 $this->userpoints = null;
                 $this->usermedals = null;
             }
             $this->personalText = KunenaHtmlParser::parseText($this->profile->personalText);
             $contents = trim(KunenaFactory::getProfile()->showProfile($this, $params));
             if (!$contents) {
                 $contents = (string) $this->loadTemplateFile('profile');
             }
             $contents .= implode(' ', $dispatcher->trigger('onKunenaDisplay', array('topic.profile', $this, $params)));
             // FIXME: enable caching after fixing the issues (also external profile stuff affects this)
             //if ($this->cache) $cache->store($contents, $cachekey, $cachegroup);
         }
         $profiles[$key] = $contents;
     }
     return $profiles[$key];
 }
Пример #22
0
								<?php echo $this->profile->socialButton('msn', $this->showUnusedSocial) ?>
							</div>
							<div class="kiconrow">
								<?php echo $this->profile->socialButton('blogspot', $this->showUnusedSocial) ?>
								<?php echo $this->profile->socialButton('flickr', $this->showUnusedSocial) ?>
								<?php echo $this->profile->socialButton('bebo', $this->showUnusedSocial) ?>
							</div>
						</div>
						<div class="kprofile-rightcol1">
							<ul>
								<li><span class="kicon-profile kicon-profile-location"></span><strong><?php echo JText::_('COM_KUNENA_MYPROFILE_LOCATION') ?>:</strong> <?php echo $this->locationlink ?></li>
								<li><span class="kicon-profile kicon-profile-gender-unknown"></span><strong><?php echo JText::_('COM_KUNENA_MYPROFILE_GENDER') ?>:</strong> <?php echo $this->gender ?></li>
								<li><span class="kicon-profile kicon-profile-birthdate"></span><strong><?php echo JText::_('COM_KUNENA_MYPROFILE_BIRTHDATE') ?>:</strong> <?php //echo KunenaDate::getInstance($this->profile->birthdate)->toKunena('date', 'ago', 'utc') ?></li>
							</ul>
						</div>
					</div>
					<div id="kprofile-leftcolbot">
						<div class="kprofile-leftcol2">
							<ul>
								<?php if ($this->config->showemail && (!$this->profile->hideEmail || $this->me->isModerator())) : ?><li><span class="kicon-profile kicon-profile-email"></span><?php echo JHTML::_('email.cloak', $this->user->email) ?></li><?php endif; ?>
								<?php if (!empty($this->profile->websiteurl)):?><li><span class="kicon-profile kicon-profile-website"></span><a href="http://<?php echo $this->escape($this->profile->websiteurl) ?>" target="_blank"><?php echo KunenaHtmlParser::parseText($this->profile->websitename) ?></a></li><?php endif ?>
								<?php if (!empty($this->registerdate)): ?><li><strong><?php echo JText::_('COM_KUNENA_MYPROFILE_REGISTERDATE') ?>:</strong> <?php echo KunenaDate::getInstance($this->registerdate)->toSpan('date_today', 'ago', 'utc') ?></li><?php endif; ?>
								<?php if (!empty($this->lastvisitdate)): ?><li><strong><?php echo JText::_('COM_KUNENA_MYPROFILE_LASTVISITDATE') ?>:</strong> <?php echo KunenaDate::getInstance($this->lastvisitdate)->toSpan('date_today', 'ago', 'utc') ?></li><?php endif; ?>
								<?php if (!empty($this->posts)): ?><li><strong><?php echo JText::_('COM_KUNENA_MYPROFILE_POSTS') ?>:</strong> <?php echo intval($this->posts) ?></li><?php endif; ?>
								<?php if (!empty($this->userpoints)): ?><li><strong><?php echo JText::_('COM_KUNENA_AUP_POINTS') ?></strong> <?php echo intval($this->userpoints) ?></li><?php endif; ?>
								<?php if (!empty($this->thankyou)): ?><li><strong><?php echo JText::_('COM_KUNENA_MYPROFILE_THANKYOU_RECEIVED') ?></strong> <?php echo intval($this->thankyou) ?></li><?php endif; ?>
								<?php if (!empty($this->pmLink)) : ?><li><?php echo $this->pmLink ?></li><?php endif ?>
								<?php if (!empty($this->usermedals)) : ?><li><?php foreach ( $this->usermedals as $medal ) : echo $medal,' '; endforeach ?></li><?php endif ?>
							</ul>
						</div>
					</div>
Пример #23
0
<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 
Пример #24
0
	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');
	}
Пример #25
0
 /**
  * @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);
 }
Пример #26
0
                ?>

				<tr class="krow2">

					<td colspan="2" class="kcol-first kcommentby-label"><b><?php 
                echo JText::sprintf('COM_KUNENA_BAN_COMMENT_BY', KunenaFactory::getUser(intval($comment->userid))->getLink());
                ?>
</b> :</td>

					<td colspan="1" class="kcol-mid kcommenttime-field"><?php 
                echo KunenaDate::getInstance($comment->time)->toKunena();
                ?>
</td>

					<td colspan="3" class="kcol-mid kcomment-field"><?php 
                echo KunenaHtmlParser::parseText($comment->comment);
                ?>
</td>

				</tr>

				<?php 
            }
        }
        ?>

				<?php 
    }
    ?>

				<?php 
Пример #27
0
						<?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'); ?>
Пример #28
0
 function getLastPostLink($category, $content = null, $title = null, $class = null)
 {
     $lastTopic = $category->getLastTopic();
     $channels = $category->getChannels();
     if (!isset($channels[$lastTopic->category_id])) {
         $category = $lastTopic->getCategory();
     }
     $uri = $lastTopic->getUri($category, 'last');
     if (!$content) {
         $content = KunenaHtmlParser::parseText($category->getLastTopic()->subject, 20);
     }
     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');
 }
Пример #29
0
	$PMlink = $private->getInboxLink($PMCount ? JText::sprintf('COM_KUNENA_PMS_INBOX_NEW', $PMCount) : JText::_('COM_KUNENA_PMS_INBOX'));
} else {
	$PMlink = $this->profile->profileIcon('private');
}
?>
<?php if ($this->avatarlink) : ?>
<div class="kavatar-lg"><?php echo $this->avatarlink; ?></div>
<?php endif; ?>
<div id="kprofile-stats">
<ul>
	<?php if ( !empty($this->banReason) ) { ?><li><strong><?php echo JText::_('COM_KUNENA_MYPROFILE_BANINFO'); ?>:</strong> <?php echo $this->escape($this->banReason); ?></li><?php } ?>
	<li><span class="kicon-button kbuttononline-<?php echo $this->profile->isOnline('yes', 'no') ?>"><span class="online-<?php echo $this->profile->isOnline('yes', 'no') ?>"><span><?php echo $this->profile->isOnline(JText::_('COM_KUNENA_ONLINE'), JText::_('COM_KUNENA_OFFLINE')); ?></span></span></span></li>
	<?php if (!empty($this->usertype)): ?><li class="usertype"><?php echo $this->escape($this->usertype); ?></li><?php endif; ?>
	<?php if (!empty($this->rank_title)): ?><li><strong><?php echo JText::_('COM_KUNENA_MYPROFILE_RANK'); ?>: </strong><?php echo $this->escape($this->rank_title); ?></li><?php endif; ?>
	<?php if (!empty($this->rank_image)): ?><li class="kprofile-rank"><?php echo $this->rank_image; ?></li><?php endif; ?>
	<?php if (!empty($this->registerdate)): ?><li><strong><?php echo JText::_('COM_KUNENA_MYPROFILE_REGISTERDATE'); ?>:</strong> <span title="<?php echo KunenaDate::getInstance($this->registerdate)->toKunena('ago'); ?>"><?php echo KunenaDate::getInstance($this->registerdate)->toKunena('date_today'); ?></span></li><?php endif; ?>
	<?php if (!empty($this->lastvisitdate)): ?><li><strong><?php echo JText::_('COM_KUNENA_MYPROFILE_LASTVISITDATE'); ?>:</strong> <span title="<?php echo KunenaDate::getInstance($this->lastvisitdate)->toKunena('ago'); ?>"><?php echo KunenaDate::getInstance($this->lastvisitdate)->toKunena('date_today'); ?></span></li><?php endif; ?>
	<li><strong><?php echo JText::_('COM_KUNENA_MYPROFILE_TIMEZONE'); ?>:</strong> GMT <?php echo $this->localtime->toTimezone(); ?></li>
	<li><strong><?php echo JText::_('COM_KUNENA_MYPROFILE_LOCAL_TIME'); ?>:</strong> <?php echo $this->localtime->toKunena('time'); ?></li>
	<?php if (!empty($this->posts)): ?><li><strong><?php echo JText::_('COM_KUNENA_MYPROFILE_POSTS'); ?>:</strong> <?php echo intval($this->posts); ?></li><?php endif; ?>
	<?php if (!empty($this->userpoints)): ?><li><strong><?php echo JText::_('COM_KUNENA_AUP_POINTS'); ?></strong> <?php echo intval($this->userpoints); ?></li><?php endif; ?>
	<?php if (!empty($this->usermedals)) : ?><li><?php foreach ( $this->usermedals as $medal ) : echo $medal,' '; endforeach ?></li><?php endif ?>
	<li><strong><?php echo JText::_('COM_KUNENA_MYPROFILE_PROFILEVIEW'); ?>:</strong> <?php echo intval($this->profile->uhits); ?></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>
Пример #30
0
					</dl>
				</li>
		<?php
		if (!empty($this->announcements))
			foreach ($this->announcements as $ann) :
		?>
				<li class="row tk-ann-show-body">
					<dl>
						<dt>
						 	<?php echo intval($ann->id); ?>
						</dt>
						<dd class="tk-ann-date">
						 	<?php echo KunenaDate::getInstance($ann->created)->toKunena('date_today'); ?>
						</dd>
						<dd class="tk-ann-title">
						 	<?php echo CKunenaLink::GetAnnouncementLink('read', intval($ann->id), KunenaHtmlParser::parseText ($ann->title), KunenaHtmlParser::parseText ($ann->title), 'follow'); ?>
						</dd>
						<dd class="tk-ann-publish">
							<?php
								if ($ann->published > 0) {
									echo JText::_('COM_KUNENA_ANN_PUBLISHED');
								} else {
									echo JText::_('COM_KUNENA_ANN_UNPUBLISHED');
								}
							?>
						</dd>
						<dd class="tk-ann-edit">
						 	<?php echo CKunenaLink::GetAnnouncementLink('edit', intval($ann->id), JText::_('COM_KUNENA_ANN_EDIT'),JText::_('COM_KUNENA_ANN_EDIT')); ?>
						</dd>
						<dd class="tk-ann-delete">
						 	<?php echo CKunenaLink::GetAnnouncementLink('delete', intval($ann->id), JText::_('COM_KUNENA_ANN_DELETE'), JText::_('COM_KUNENA_ANN_DELETE')); ?>