当前位置: 首页>>代码示例>>PHP>>正文


PHP CKunenaLink::GetKarmaLink方法代码示例

本文整理汇总了PHP中CKunenaLink::GetKarmaLink方法的典型用法代码示例。如果您正苦于以下问题:PHP CKunenaLink::GetKarmaLink方法的具体用法?PHP CKunenaLink::GetKarmaLink怎么用?PHP CKunenaLink::GetKarmaLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CKunenaLink的用法示例。


在下文中一共展示了CKunenaLink::GetKarmaLink方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: displayKarma

 function displayKarma()
 {
     $userkarma = '';
     if ($this->config->showkarma && $this->profile->userid) {
         $userkarma = '<strong>' . JText::_('COM_KUNENA_KARMA') . "</strong>: " . $this->profile->karma;
         if ($this->my->id && $this->my->id != $this->profile->userid) {
             $userkarma .= ' ' . CKunenaLink::GetKarmaLink('decrease', '', '', $this->profile->userid, '<span class="kkarma-minus" title="' . JText::_('COM_KUNENA_KARMA_SMITE') . '"> </span>');
             $userkarma .= ' ' . CKunenaLink::GetKarmaLink('increase', '', '', $this->profile->userid, '<span class="kkarma-plus" title="' . JText::_('COM_KUNENA_KARMA_APPLAUD') . '"> </span>');
         }
     }
     return $userkarma;
 }
开发者ID:redigy,项目名称:Kunena-1.6,代码行数:12,代码来源:profile.php

示例2: getMessageProfileBox

 function getMessageProfileBox()
 {
     static $profiles = array();
     $key = $this->profile->userid . '.' . $this->profile->username;
     if (!isset($profiles[$key])) {
         // Run events
         if (version_compare(JVERSION, '1.6', '>')) {
             // Joomla 1.6+
             $params = new JRegistry();
         } else {
             // Joomla 1.5
             $params = new JParameter('');
         }
         // 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 = ' ' . CKunenaLink::GetKarmaLink('decrease', $this->topic->category_id, $this->message->id, $this->profile->userid, '<span class="kkarma-minus" alt="Karma-" border="0" title="' . JText::_('COM_KUNENA_KARMA_SMITE') . '"> </span>');
                 $this->userkarma_plus = ' ' . CKunenaLink::GetKarmaLink('increase', $this->topic->category_id, $this->message->id, $this->profile->userid, '<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) {
                 if ($this->config->userlist_usertype) {
                     $this->usertype = $this->profile->getType($this->topic->category_id);
                 } else {
                     $this->usertype = null;
                 }
                 $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->usertype = null;
                 $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 = $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];
 }
开发者ID:laiello,项目名称:senluonirvana,代码行数:79,代码来源:view.html.php

示例3: display

 function display($mode = '')
 {
     $message = $this->msg;
     $this->id = $message->id;
     $this->catid = $message->catid;
     $this->thread = $message->thread;
     // Link to individual message
     if ($this->config->ordering_system == 'replyid') {
         $this->numLink = CKunenaLink::GetSamePageAnkerLink($this->id, '#' . $this->replynum);
     } else {
         $this->numLink = CKunenaLink::GetSamePageAnkerLink($this->id, '#' . $this->id);
     }
     // New post suffix for class
     if ($message->new) {
         $this->msgsuffix = '-new';
     }
     // Add attachments
     if (!empty($message->attachments)) {
         $this->attachments = $message->attachments;
     }
     $subject = $message->subject;
     $this->resubject = JString::strtolower(JString::substr($subject, 0, JString::strlen(JText::_('COM_KUNENA_POST_RE')))) == JString::strtolower(JText::_('COM_KUNENA_POST_RE')) ? $subject : JText::_('COM_KUNENA_POST_RE') . ' ' . $subject;
     $this->subjectHtml = KunenaParser::parseText($subject);
     $this->messageHtml = KunenaParser::parseBBCode($message->message, $this);
     //Show admins the IP address of the user:
     if ($message->ip && (CKunenaTools::isAdmin() || CKunenaTools::isModerator($this->my->id, $this->catid) && !$this->config->hide_ip)) {
         $this->ipLink = CKunenaLink::GetMessageIPLink($message->ip);
     }
     $this->profile = KunenaFactory::getUser($message->userid);
     // Modify profile values by integration
     $triggerParams = array('userid' => $message->userid, 'userinfo' => &$this->profile);
     $integration = KunenaFactory::getProfile();
     $integration->trigger('profileIntegration', $triggerParams);
     // Choose username
     $this->userid = $this->profile->userid;
     $this->username = $this->config->username ? $this->profile->username : $this->profile->name;
     if ((!$this->username || !$message->userid || $this->config->changename) && $message->name) {
         $this->username = $message->name;
     }
     if ($this->params->get('avatarPosition') == 'left' || $this->params->get('avatarPosition') == 'right') {
         $avatar = $this->profile->getAvatarLink('kavatar', 'post');
     } else {
         $avatar = $this->profile->getAvatarLink('kavatar', 'welcome');
     }
     if ($avatar) {
         $this->avatar = '<span class="kavatar">' . $avatar . '</span>';
     }
     if ($this->config->showuserstats) {
         $activityIntegration = KunenaFactory::getActivityIntegration();
         if ($this->config->userlist_usertype) {
             $this->usertype = $this->profile->getType($this->catid);
         }
         $this->userrankimage = $this->profile->getRank($this->catid, 'image');
         $this->userranktitle = $this->profile->getRank($this->catid, 'title');
         $this->userposts = $this->profile->posts;
         $this->userpoints = $activityIntegration->getUserPoints($this->profile->userid);
         $this->usermedals = $activityIntegration->getUserMedals($this->profile->userid);
     }
     //karma points and buttons
     $this->userkarma_minus = $this->userkarma_plus = '';
     if ($this->config->showkarma && $this->profile->userid) {
         $this->userkarma = JText::_('COM_KUNENA_KARMA') . ": " . $this->profile->karma;
         if ($this->my->id && $this->my->id != $this->profile->userid) {
             $this->userkarma_minus = CKunenaLink::GetKarmaLink('decrease', $this->catid, $this->id, $this->userid, '<span class="kkarma-minus" alt="Karma-" border="0" title="' . JText::_('COM_KUNENA_KARMA_SMITE') . '"> </span>');
             $this->userkarma_plus = CKunenaLink::GetKarmaLink('increase', $this->catid, $this->id, $this->userid, '<span class="kkarma-plus" alt="Karma+" border="0" title="' . JText::_('COM_KUNENA_KARMA_APPLAUD') . '"> </span>');
         }
     }
     $this->profilelink = $this->profile->profileIcon('profile');
     $this->personaltext = $this->profile->personalText;
     $this->signatureHtml = KunenaParser::parseBBCode($this->profile->signature);
     //Thankyou info and buttons
     if ($this->config->showthankyou && $this->profile->userid && $mode != 'threaded') {
         require_once KPATH_SITE . '/lib/kunena.thankyou.php';
         $thankyou = new CKunenaThankyou();
         $this->total_thankyou = $thankyou->getThankYouUser($this->id);
         $this->thankyou = array_slice($this->total_thankyou, 0, $this->config->thankyou_max);
         if ($this->my->id && $this->my->id != $this->profile->userid) {
             $this->message_thankyou = CKunenaLink::GetThankYouLink($this->catid, $this->id, $this->userid, CKunenaTools::showButton('thankyou', JText::_('COM_KUNENA_BUTTON_THANKYOU')), JText::_('COM_KUNENA_BUTTON_THANKYOU_LONG'), 'kicon-button kbuttonuser btn-left');
         }
     }
     if (!$message->hold && (CKunenaTools::isModerator($this->my->id, $this->catid) || !$this->topicLocked)) {
         //user is allowed to reply/quote
         $this->captcha = KunenaSpamRecaptcha::getInstance();
         if ($this->my->id && (CKunenaTools::isModerator($this->my->id, $this->catid) || $this->me->posts >= $this->config->captcha_post_limit)) {
             $this->message_quickreply = CKunenaLink::GetTopicPostReplyLink('reply', $this->catid, $this->id, CKunenaTools::showButton('reply', JText::_('COM_KUNENA_BUTTON_QUICKREPLY')), 'nofollow', 'kicon-button kbuttoncomm btn-left kqreply', JText::_('COM_KUNENA_BUTTON_QUICKREPLY_LONG'), ' id="kreply' . $this->id . '"');
         }
         $this->message_reply = CKunenaLink::GetTopicPostReplyLink('reply', $this->catid, $this->id, CKunenaTools::showButton('reply', JText::_('COM_KUNENA_BUTTON_REPLY')), 'nofollow', 'kicon-button kbuttoncomm btn-left', JText::_('COM_KUNENA_BUTTON_REPLY_LONG'));
         $this->message_quote = CKunenaLink::GetTopicPostReplyLink('quote', $this->catid, $this->id, CKunenaTools::showButton('quote', JText::_('COM_KUNENA_BUTTON_QUOTE')), 'nofollow', 'kicon-button kbuttoncomm btn-left', JText::_('COM_KUNENA_BUTTON_QUOTE_LONG'));
     } else {
         //user is not allowed to write a post
         if ($this->topicLocked) {
             $this->message_closed = JText::_('COM_KUNENA_POST_LOCK_SET');
         } else {
             $this->message_closed = JText::_('COM_KUNENA_VIEW_DISABLED');
         }
     }
     $this->msgclass = 'kmsg';
     //Offer an moderator a few tools
     if (CKunenaTools::isModerator($this->my->id, $this->catid)) {
         unset($this->message_closed);
//.........这里部分代码省略.........
开发者ID:vuchannguyen,项目名称:hoctap,代码行数:101,代码来源:view.php

示例4: urlencode

     //height of the bar
     $myGraphAUP->SetBorderColor("#333333");
     $myGraphAUP->SetBarBorderWidth(0);
     $myGraphAUP->SetGraphWidth(64);
     //should match column width in the <TD> above -5 pixels
     $useGraph = 1;
 }
 // End Integration AlphaUserPoints
 //karma points and buttons
 if ($fbConfig->showkarma && $userinfo->userid != '0') {
     $karmaPoints = $userinfo->karma;
     $karmaPoints = (int) $karmaPoints;
     $msg_karma = "<strong>" . _KARMA . ":</strong> {$karmaPoints}";
     if ($kunena_my->id != '0' && $kunena_my->id != $userinfo->userid) {
         $msg_karmaminus = CKunenaLink::GetKarmaLink('decrease', $catid, $fmessage->id, $userinfo->userid, '<img src="' . (isset($fbIcons['karmaminus']) ? KUNENA_URLICONSPATH . $fbIcons['karmaminus'] : KUNENA_URLEMOTIONSPATH . "karmaminus.gif") . '" alt="Karma-" border="0" title="' . _KARMA_SMITE . '" align="middle" />');
         $msg_karmaplus = CKunenaLink::GetKarmaLink('increase', $catid, $fmessage->id, $userinfo->userid, '<img src="' . (isset($fbIcons['karmaplus']) ? KUNENA_URLICONSPATH . $fbIcons['karmaplus'] : KUNENA_URLEMOTIONSPATH . "karmaplus.gif") . '" alt="Karma+" border="0" title="' . _KARMA_APPLAUD . '" align="middle" />');
     }
 }
 /*let's see if we should use Missus integration */
 if ($fbConfig->pm_component == "missus" && $userinfo->userid && $kunena_my->id) {
     //we should offer the user a Missus link
     //first get the username of the user to contact
     $PMSName = $userinfo->username;
     $msg_pms = "<a href=\"" . JRoute::_('index.php?option=com_missus&amp;func=newmsg&amp;user=' . $userinfo->userid . '&amp;subject=' . _GEN_FORUM . ': ' . urlencode(utf8_encode($fmessage->subject))) . "\"><img src='";
     if ($fbIcons['pms']) {
         $msg_pms .= KUNENA_URLICONSPATH . $fbIcons['pms'];
     } else {
         $msg_pms .= KUNENA_URLICONSPATH . $fbIcons['pms'];
     }
     $msg_pms .= "' alt=\"" . _VIEW_PMS . "\" border=\"0\" title=\"" . _VIEW_PMS . "\" /></a>";
 }
开发者ID:kaantunc,项目名称:MYK-BOR,代码行数:31,代码来源:view.php

示例5: getMessageProfileBox

	function getMessageProfileBox() {
		static $profiles = array ();

		$key = $this->profile->userid.'.'.$this->profile->username;
		if (! isset ( $profiles [$key] )) {
			// Modify profile values by integration
			$triggerParams = array ('userid' => $this->profile->userid, 'userinfo' => &$this->profile );
			$integration = KunenaFactory::getProfile();
			$integration->trigger ( 'profileIntegration', $triggerParams );

			//karma points and buttons
			$me = KunenaUserHelper::getMyself();
			$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 ($me->userid && $me->userid != $this->profile->userid) {
					$this->userkarma_minus = ' ' . CKunenaLink::GetKarmaLink ( 'decrease', $this->topic->category_id, $this->message->id, $this->profile->userid, '<span class="kkarma-minus" alt="Karma-" border="0" title="' . JText::_ ( 'COM_KUNENA_KARMA_SMITE' ) . '"> </span>' );
					$this->userkarma_plus = ' ' . CKunenaLink::GetKarmaLink ( 'increase', $this->topic->category_id, $this->message->id, $this->profile->userid, '<span class="kkarma-plus" alt="Karma+" border="0" title="' . JText::_ ( 'COM_KUNENA_KARMA_APPLAUD' ) . '"> </span>' );
				}
			}

			// FIXME: we need to change how profilebox integration works
			/*
			$integration = KunenaFactory::getProfile();
			$triggerParams = array(
				'username' => &$this->username,
				'messageobject' => &$this->msg,
				'subject' => &$this->subjectHtml,
				'messagetext' => &$this->messageHtml,
				'signature' => &$this->signatureHtml,
				'karma' => &$this->userkarma_title,
				'karmaplus' => &$this->userkarma_plus,
				'karmaminus' => &$this->userkarma_minus,
				'layout' => $direction
			);

			$profileHtml = $integration->showProfile($this->msg->userid, $triggerParams);
			*/
			$profileHtml = '';
			if ($profileHtml) {
				// Use integration
				$profiles [$key] = $profileHtml;
			} else {
				$usertype = $this->profile->getType($this->category->id, true);
				if ($me->exists() && $this->message->userid == $me->userid) $usertype = 'me';

				// TODO: add context (options, template) to caching
				$cache = JFactory::getCache('com_kunena', 'output');
				$cachekey = "profile.{$this->getTemplateMD5()}.{$this->profile->userid}.{$usertype}";
				$cachegroup = 'com_kunena.messages';

				$contents = $cache->get($cachekey, $cachegroup);
				if (!$contents) {
					$this->userkarma = "{$this->userkarma_title} {$this->userkarma_minus} {$this->userkarma_plus}";
					// Use kunena profile
					if ($this->config->showuserstats) {
						if ($this->config->userlist_usertype) {
							$this->usertype = $this->profile->getType ( $this->topic->category_id );
						} else {
							$this->usertype = null;
						}
						$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->thankyou = $this->profile->thankyou;
						$this->userpoints = $activityIntegration->getUserPoints ( $this->profile->userid );
						$this->usermedals = $activityIntegration->getUserMedals ( $this->profile->userid );
					} else {
						$this->usertype = null;
						$this->userrankimage = null;
						$this->userranktitle = null;
						$this->userposts = null;
						$this->thankyou = null;
						$this->userpoints = null;
						$this->usermedals = null;
					}
					$this->personalText = KunenaHtmlParser::parseText ( $this->profile->personalText );

					$contents = $this->loadTemplate('profile');
					if ($this->cache) $cache->store($contents, $cachekey, $cachegroup);
				}
				$profiles [$key] = $contents;
			}
		}
		return $profiles [$key];
	}
开发者ID:GoremanX,项目名称:Kunena-2.0,代码行数:87,代码来源:view.html.php


注:本文中的CKunenaLink::GetKarmaLink方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。