/**
  * Get Thank You User by Message ID
  * @param int $pid
  * @return array usernames with profillink
  * @since 1.6
  */
 function getThankYouUser($pid)
 {
     if ($this->config->showthankyou) {
         $named = '';
         if (!$this->config->username) {
             $named = 'name';
         }
         $res = KunenaThankYou::getThankYouUsers($pid, $named);
         if (KunenaError::checkDatabaseError()) {
             return false;
         }
         $thank_string = array();
         foreach ($res as $k => $w) {
             $thank_string[$k] = CKunenaLink::GetProfileLink($w->id, $w->username);
         }
         return $thank_string;
     }
 }
Exemple #2
0
 function _getThankYouPosts($saidgot)
 {
     if ($saidgot == 'got') {
         $this->header = $this->title = JText::_('COM_KUNENA_THANKYOU_GOT');
     } else {
         $this->header = $this->title = JText::_('COM_KUNENA_THANKYOU_SAID');
     }
     // Only available to users
     if (!$this->user->id) {
         return;
     }
     kimport('thankyou');
     $this->total = 10;
     //$limit default is on 10 TODO make adjustable
     if (empty($this->threads_per_page)) {
         $this->threads_per_page = 10;
     }
     $idlist = KunenaThankYou::getThankYouPosts($this->user->id, $saidgot, $this->threads_per_page);
     $this->threadids = array();
     $this->loadids = array();
     foreach ($idlist as $item) {
         $this->threadids[$item->thread] = $item->thread;
         $this->loadids[$item->id] = $item->id;
     }
     $this->order = 'field(a.id,' . implode(",", $this->loadids) . ')';
     $this->_common();
 }
Exemple #3
0
			<thead>
			<tr>
				<th width="32%"><?php 
echo JText::_('COM_KUNENA_USERPROFILE_TOPICS');
?>
</th>
				<th></th>
				<th width="18%"><?php 
echo JText::_('COM_KUNENA_USRL_THANKYOUS');
?>
</th>
			</tr>
			</thead>
			<tbody>
			<?php 
$KUNENA_top_posts = KunenaThankYou::getTopThankYouTopics();
foreach ($KUNENA_top_posts as $KUNENA_post) {
    if ($KUNENA_post->countid == $KUNENA_top_posts[0]->countid) {
        $barwidth = 100;
    } else {
        $barwidth = round($KUNENA_post->countid * 100 / $KUNENA_top_posts[0]->countid);
    }
    $link = KUNENA_LIVEURL . '&amp;func=view&amp;id=' . $KUNENA_post->postid . '&amp;catid=' . $KUNENA_post->catid;
    ?>
			<tr>
				<td ><a href="<?php 
    echo $link;
    ?>
"><?php 
    echo $KUNENA_post->subject;
    ?>