本文整理汇总了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 );
//.........这里部分代码省略.........