當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Komento::addJomSocialPoint方法代碼示例

本文整理匯總了PHP中Komento::addJomSocialPoint方法的典型用法代碼示例。如果您正苦於以下問題:PHP Komento::addJomSocialPoint方法的具體用法?PHP Komento::addJomSocialPoint怎麽用?PHP Komento::addJomSocialPoint使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Komento的用法示例。


在下文中一共展示了Komento::addJomSocialPoint方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: process

	public function process( $action, $comment )
	{
		// process all activities and 3rd party integration here

		// Due to the possible conflict data of $comment->created containing lapsed time instead of raw date, we use the table object directly instead

		if( !( $comment instanceof KomentoTableComments ) )
		{
			$id = 0;

			if( is_int( $comment ) || is_string( $comment ) )
			{
				$id = $comment;
			}

			if( $comment instanceof KomentoComment )
			{
				$id = $comment->id;
			}

			$comment = Komento::getTable( 'comments' );
			$comment->load( $id );
		}

		if( $action != 'remove' && $comment->published != 1 )
		{
			return false;
		}

		$config = Komento::getConfig();
		$profile = Komento::getProfile();
		$application = Komento::loadApplication( $comment->component )->load( $comment->cid );

		if( $application === false)
		{
			$application = Komento::getErrorApplication( $comment->component, $comment->cid );
		}

		$pagelink = $application->getContentPermalink();
		$permalink = $pagelink . '#' . $comment->id;
		$author = $application->getAuthorId();
		$title = $application->getContentTitle();

		if( $profile->id == 0 )
		{
			return false;
		}

		// native activity
		if( ( $action == 'comment' && $config->get( 'activities_comment' ) ) || ( $action == 'reply' && $config->get( 'activities_reply' ) ) || ( $action == 'like' && $config->get( 'activities_like' ) ) )
		{
			$this->addActivity( $action, $comment->id, $comment->created_by );
		}

		// Add jomsocial activity
		if( $action == 'comment' && $config->get( 'jomsocial_enable_comment' ) )
		{
			$this->addJomSocialActivityComment( $comment );
		}
		if( $action == 'reply' && $config->get( 'jomsocial_enable_reply' ) )
		{
			$this->addJomSocialActivityReply( $comment );
		}
		if( $action == 'like' && $config->get( 'jomsocial_enable_like' ) )
		{
			$this->addJomSocialActivityLike( $comment, $profile->id );
		}

		// Add jomsocial userpoints
		if( $config->get( 'jomsocial_enable_userpoints' ) )
		{
			switch( $action )
			{
				case 'comment':
					Komento::addJomSocialPoint( 'com_komento.comment.add' );
					Komento::addJomSocialPoint( 'com_komento.comment.add.author', $author );
					break;

				case 'reply':
					Komento::addJomSocialPoint( 'com_komento.comment.reply' );
					break;

				case 'like':
					Komento::addJomSocialPoint( 'com_komento.comment.like' );
					Komento::addJomSocialPoint( 'com_komento.comment.liked', $comment->created_by );
					break;

				case 'unlike':
					Komento::addJomSocialPoint( 'com_komento.comment.unlike' );
					Komento::addJomSocialPoint( 'com_komento.comment.unliked', $comment->created_by );
					break;

				case 'report':
					Komento::addJomSocialPoint( 'com_komento.comment.report' );
					Komento::addJomSocialPoint( 'com_komento.comment.reported', $comment->created_by );
					break;

				case 'unreported':
					Komento::addJomSocialPoint( 'com_komento.comment.unreport' );
					Komento::addJomSocialPoint( 'com_komento.comment.unreported', $comment->created_by );
//.........這裏部分代碼省略.........
開發者ID:kosmosby,項目名稱:medicine-prof,代碼行數:101,代碼來源:activity.php


注:本文中的Komento::addJomSocialPoint方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。