26 $member_srl =
$obj->member_srl;
29 $cur_point = $oPointModel->getPoint($member_srl,
true);
31 $point = $config->signup_point;
34 $this->
setPoint($member_srl,$cur_point,
'signup');
44 $member_srl =
$obj->member_srl;
47 if(substr(
$obj->last_login,0,8)==date(
"Ymd"))
return new BaseObject();
53 $cur_point = $oPointModel->getPoint($member_srl,
true);
55 $point = $config->login_point;
58 $this->
setPoint($member_srl,$cur_point);
72 $member_srl =
$obj->member_srl;
82 $cur_point = $oPointModel->getPoint($member_srl,
true);
85 if(strlen($point) == 0 && !is_int($point)) $point = $config->insert_document;
89 if(strlen($point) == 0 && !is_int($point)) $point = $config->upload_file;
90 if(
$obj->uploaded_count) $cur_point += $point *
$obj->uploaded_count;
92 $this->
setPoint($member_srl,$cur_point);
118 $cur_point = $oPointModel->getPoint($oDocument->get(
'member_srl'),
true);
121 if(strlen($point) == 0 && !is_int($point)) $point = $config->insert_document;
122 $cur_point += $point;
125 if(strlen($point) == 0 && !is_int($point)) $point = $config->upload_file;
126 if(
$obj->uploaded_count) $cur_point += $point *
$obj->uploaded_count;
128 $this->
setPoint($oDocument->get(
'member_srl'), $cur_point);
140 $member_srl =
$obj->member_srl;
144 if(!$oDocument->isExists())
return new BaseObject();
151 if(strlen($comment_point) == 0 && !is_int($comment_point)) $comment_point = $config->insert_comment;
155 $cp_args =
new stdClass();
161 $member_srls = array();
163 for($i=0;$i<$cnt;$i++)
165 if(
$output->data[$i]->member_srl<1)
continue;
166 $member_srls[abs(
$output->data[$i]->member_srl)] =
$output->data[$i]->count;
169 if($member_srl) unset($member_srls[abs($member_srl)]);
170 if(!count($member_srls))
return new BaseObject();
175 foreach($member_srls as $member_srl => $cnt)
177 $cur_point = $oPointModel->getPoint($member_srl,
true);
178 $cur_point -= $cnt * $comment_point;
179 $this->
setPoint($member_srl,$cur_point);
195 $member_srl =
$obj->member_srl;
203 $cur_point = $oPointModel->getPoint($member_srl,
true);
210 if(strlen($point) == 0 && !is_int($point)) $point = $config->insert_document;
213 $cur_point -= $point;
215 $this->
setPoint($member_srl,$cur_point);
227 $member_srl =
$obj->member_srl;
233 if(!$oDocument->isExists() || abs($oDocument->get(
'member_srl'))==abs($member_srl))
return new BaseObject();
240 $cur_point = $oPointModel->getPoint($member_srl,
true);
243 if(strlen($point) == 0 && !is_int($point)) $point = $config->insert_comment;
245 $cur_point += $point;
246 $this->
setPoint($member_srl,$cur_point);
261 $member_srl = abs(
$obj->member_srl);
266 if(!$oDocument->isExists())
return new BaseObject();
267 if($oDocument->get(
'member_srl')==$member_srl)
return new BaseObject();
272 $cur_point = $oPointModel->getPoint($member_srl,
true);
275 if(strlen($point) == 0 && !is_int($point)) $point = $config->insert_comment;
279 $cur_point -= $point;
280 $this->
setPoint($member_srl,$cur_point);
303 $member_srl =
$obj->member_srl;
311 $cur_point = $oPointModel->getPoint($member_srl,
true);
314 if(strlen($point) == 0 && !is_int($point)) $point = $config->upload_file;
316 $cur_point -= $point;
317 $this->
setPoint($member_srl,$cur_point);
333 if($member_srl && abs(
$obj->member_srl) == $member_srl)
return new BaseObject();
343 $point = intval($config->download_file);
349 if($config->disable_download ==
'Y' && $point)
351 return new BaseObject(-1,
'msg_not_permitted_download');
361 $cur_point = $oPointModel->getPoint($member_srl,
true);
364 if ($config->disable_download ==
'Y' && $cur_point + $point < 0)
366 return new BaseObject(-1,
'msg_cannot_download');
386 if($member_srl && abs(
$obj->member_srl) == $member_srl)
return new BaseObject();
398 $point = intval($config->download_file);
403 $cur_point = $oPointModel->getPoint($member_srl,
true);
408 $this->
setPoint($member_srl, $cur_point += $point);
425 $target_member_srl = abs(
$obj->get(
'member_srl'));
427 if($target_member_srl == $member_srl)
return new BaseObject();
433 if(strlen($point) == 0 && !is_int($point)) $point = $config->read_document;
439 $args->member_srl = $member_srl;
440 $args->document_srl =
$obj->document_srl;
443 $cur_point = $oPointModel->getPoint($member_srl,
true);
452 $_SESSION[
'banned_document'][
$obj->document_srl] =
false;
453 if($config->disable_read_document ==
'Y' && $point < 0 && abs($point)>$cur_point)
457 $_SESSION[
'banned_document'][
$obj->document_srl] =
true;
467 $cur_point += $point;
468 $this->
setPoint($member_srl,$cur_point);
479 $member_srl =
$obj->member_srl;
487 $cur_point = $oPointModel->getPoint($member_srl,
true);
489 if(
$obj->point > 0 )
492 if(strlen($point) == 0 && !is_int($point)) $point = $config->voted;
497 if(strlen($point) == 0 && !is_int($point)) $point = $config->blamed;
502 $cur_point += $point;
503 $this->
setPoint($member_srl,$cur_point);
511 function setPoint($member_srl, $point, $mode = null)
513 $member_srl = abs($member_srl);
514 $mode_arr = array(
'add',
'minus',
'update',
'signup');
515 if(!$mode || !in_array($mode,$mode_arr)) $mode =
'update';
524 $current_point = $oPointModel->getPoint($member_srl,
true);
525 $current_level = $oPointModel->getLevel($current_point, $config->level_step);
528 $args =
new stdClass();
529 $args->member_srl = $member_srl;
530 $args->point = $current_point;
535 $args->point += $point;
538 $args->point -= $point;
542 $args->point = $point;
546 $point =
$args->point;
549 $trigger_obj =
new stdClass();
550 $trigger_obj->member_srl =
$args->member_srl;
551 $trigger_obj->mode = $mode;
552 $trigger_obj->current_point = $current_point;
553 $trigger_obj->current_level = $current_level;
554 $trigger_obj->set_point = $point;
556 if(!$trigger_output->toBool())
558 return $trigger_output;
566 if($current_point > 0)
587 $level = $oPointModel->getLevel($point, $config->level_step);
590 if($level != $current_level)
593 $point_group = $config->point_group;
595 if($point_group && is_array($point_group) && count($point_group) )
598 $default_group = $oMemberModel->getDefaultGroup();
600 $del_group_list = array();
601 $new_group_list = array();
605 if($config->group_reset !=
'N')
608 if(in_array($level, $point_group))
611 foreach($point_group as $group_srl => $target_level)
613 $del_group_list[] = $group_srl;
614 if($target_level == $level) $new_group_list[] = $group_srl;
623 if(in_array($i, $point_group))
625 foreach($point_group as $group_srl => $target_level)
627 if($target_level == $i)
629 $new_group_list[] = $group_srl;
638 foreach($point_group as $group_srl => $target_level)
640 if($target_level > $level) $del_group_list[] = $group_srl;
642 $del_group_list[] = $default_group->group_srl;
648 foreach($point_group as $group_srl => $target_level)
650 $del_group_list[] = $group_srl;
651 if($target_level <= $level) $new_group_list[] = $group_srl;
655 if(!$new_group_list[0]) $new_group_list[0] = $default_group->group_srl;
657 if($del_group_list && count($del_group_list))
659 $del_group_args =
new stdClass;
660 $del_group_args->member_srl = $member_srl;
661 $del_group_args->group_srl = implode(
',', $del_group_list);
662 $del_group_output =
executeQuery(
'point.deleteMemberGroup', $del_group_args);
665 foreach($new_group_list as $group_srl)
667 $new_group_args =
new stdClass;
668 $new_group_args->member_srl = $member_srl;
669 $new_group_args->group_srl = $group_srl;
670 executeQuery(
'member.addMemberToGroup', $new_group_args);
676 $trigger_obj->new_group_list = $new_group_list;
677 $trigger_obj->del_group_list = $del_group_list;
678 $trigger_obj->new_level = $level;
680 if(!$trigger_output->toBool())
683 return $trigger_output;
692 $cache_filename = sprintf(
'%s%d.cache.txt',
$cache_path, $member_srl);
696 if($new_group_list && $del_group_list && $oCacheHandler->isSupport())
698 $object_key =
'member_groups:' .
getNumberingPath($member_srl) . $member_srl .
'_0';
699 $cache_key = $oCacheHandler->getGroupKey(
'member', $object_key);
700 $oCacheHandler->delete($cache_key);
704 if($new_group_list && $del_group_list && $oCacheHandler->isSupport())
707 $cache_key = $oCacheHandler->getGroupKey(
'member', $object_key);
708 $oCacheHandler->delete($cache_key);
717 $pointConfig =
$oModuleModel->getModulePartConfig(
'point',
$obj->originModuleSrl);
720 if(is_array(
$obj->moduleSrlList))
722 foreach(
$obj->moduleSrlList AS $key=>$moduleSrl)
getController($module_name)
triggerInsertMember(&$obj)
Membership point application trigger.
getNumberingPath($no, $size=3)
triggerInsertFile(&$obj)
Add the file registration trigger To prevent taking points for invalid file registration this method ...
& getInstance($target= 'object', $info=null, $always_use_file=false)
triggerInsertComment(&$obj)
A trigger which gives points for entering a comment.
writeFile($filename, $buff, $mode="w")
triggerInsertDocument(&$obj)
A trigger to add points to the member for creating a post.
triggerUpdateVotedCount(&$obj)
Points for voting up or down.
$module_srl
integer value to represent a run-time instance of Module (XE Module)
The parent class of the point module.
triggerDownloadFile(&$obj)
The trigger to give or take points for downloading the file.
triggerDeleteDocument(&$obj)
A trigger to give points for deleting the post.
triggerUpdateReadedCount(&$obj)
Give points for hits increase Run it even if there are no points.
Controller class of point modules.
setPoint($member_srl, $point, $mode=null)
Set points.
getInstance($db_type=NULL)
triggerAfterLogin(&$obj)
A trigger to add points to the member for login.
triggerUpdateDocument(&$obj)
The trigger to give points for normal saving the temporarily saved document Temporary storage at the ...
triggerDeleteFile(&$obj)
A trigger to give points for deleting a file Remove points only in case an invalid file is being dele...
triggerDeleteComment(&$obj)
A trigger which gives points for deleting a comment.
executeQueryArray($query_id, $args=NULL, $arg_columns=NULL)
triggerBeforeDownloadFile(&$obj)
The trigger called before a file is downloaded.
triggerBeforeDeleteDocument(&$obj)
The trigger which deducts the points related to post comments before deleting the post itself...
executeQuery($query_id, $args=NULL, $arg_columns=NULL)
triggerCall($trigger_name, $called_position, &$obj)