29 if(
$args->able_module ==
'Y')
32 if($config->able_module ==
'N')
38 $config->able_module =
'Y';
41 $config->point_name =
$args->point_name;
42 if(!$config->point_name) $config->point_name =
'point';
44 $config->signup_point = (int)
$args->signup_point;
45 $config->login_point = (
int)
$args->login_point;
46 $config->insert_document = (int)
$args->insert_document;
47 $config->read_document = (
int)
$args->read_document;
48 $config->insert_comment = (int)
$args->insert_comment;
49 $config->upload_file = (
int)
$args->upload_file;
50 $config->download_file = (int)
$args->download_file;
51 $config->voted = (
int)
$args->voted;
52 $config->blamed = (int)
$args->blamed;
54 $config->max_level =
$args->max_level;
55 if($config->max_level>1000) $config->max_level = 1000;
56 if($config->max_level<1) $config->max_level = 1;
58 $config->level_icon =
$args->level_icon;
60 if(
$args->disable_download ==
'Y') $config->disable_download =
'Y';
61 else $config->disable_download =
'N';
63 if(
$args->disable_read_document ==
'Y') $config->disable_read_document =
'Y';
64 else $config->disable_read_document =
'N';
67 $group_list = $oMemberModel->getGroups();
68 $config->point_group = array();
71 foreach($group_list as $group)
74 if($group->is_admin ==
'Y' || $group->is_default ==
'Y')
continue;
76 $group_srl = $group->group_srl;
78 if(isset(
$args->{
'point_group_'.$group_srl}))
81 if(
$args->{
'point_group_'.$group_srl} >
$args->max_level)
83 $args->{
'point_group_'.$group_srl} =
$args->max_level;
87 if(
$args->{
'point_group_'.$group_srl} < 1)
89 $args->{
'point_group_'.$group_srl} = 1;
91 $config->point_group[$group_srl] =
$args->{
'point_group_'.$group_srl};
95 $config->group_reset =
$args->group_reset;
97 unset($config->level_step);
98 for($i=1;$i<=$config->max_level;$i++)
100 $key =
"level_step_".$i;
101 $config->level_step[$i] = (int)
$args->{$key};
104 $config->expression =
$args->expression;
109 $config->able_module =
'N';
119 $this->setMessage(
'success_updated');
122 $this->setRedirectUrl($returnUrl);
132 $configTypeList = array(
'insert_document',
'insert_comment',
'upload_file',
'download_file',
'read_document',
'voted',
'blamed');
133 foreach($configTypeList AS $config)
135 if(is_array(
$args->{$config}))
137 foreach(
$args->{$config} AS $key=>$value)
139 $module_config[$key][$config] = $value;
145 if(count($module_config))
153 $this->setMessage(
'success_updated');
157 header(
'location:'.$returnUrl);
179 $config[
'insert_document'] = (int)
Context::get(
'insert_document');
180 $config[
'insert_comment'] = (int)
Context::get(
'insert_comment');
181 $config[
'upload_file'] = (int)
Context::get(
'upload_file');
182 $config[
'download_file'] = (int)
Context::get(
'download_file');
183 $config[
'read_document'] = (int)
Context::get(
'read_document');
190 $this->setMessage(
'success_updated',
'info');
193 $this->setRedirectUrl($returnUrl);
204 preg_match(
'/^(\+|-)?([1-9][0-9]*)$/', $point, $m);
222 $output = $oPointController->setPoint($member_srl, (
int)$point, $action);
225 $this->setMessage(
'success_updated',
'info');
228 return $this->setRedirectUrl($returnUrl,
$output);
241 $module_config =
$oModuleModel->getModulePartConfigs(
'point');
251 foreach(
$output->data as $key => $val)
253 if(!$val->member_srl)
continue;
254 $member[$val->member_srl] = 0;
264 foreach(
$output->data as $key => $val)
266 if($module_config[$val->module_srl][
'insert_document']) $insert_point = $module_config[$val->module_srl][
'insert_document'];
267 else $insert_point = $config->insert_document;
269 if(!$val->member_srl)
continue;
270 $point = $insert_point * $val->count;
271 $member[$val->member_srl] += $point;
282 foreach(
$output->data as $key => $val)
284 if($module_config[$val->module_srl][
'insert_comment']) $insert_point = $module_config[$val->module_srl][
'insert_comment'];
285 else $insert_point = $config->insert_comment;
287 if(!$val->member_srl)
continue;
288 $point = $insert_point * $val->count;
289 $member[$val->member_srl] += $point;
299 foreach(
$output->data as $key => $val)
301 if($module_config[$val->module_srl][
'upload_file']) $insert_point = $module_config[$val->module_srl][
'upload_file'];
302 else $insert_point = $config->upload_file;
304 if(!$val->member_srl)
continue;
305 $point = $insert_point * $val->count;
306 $member[$val->member_srl] += $point;
316 foreach($member as $key => $val)
318 $val += (int)$config->signup_point;
319 $str .= $key.
','.$val.
"\r\n";
322 @file_put_contents(
'./files/cache/pointRecal.txt', $str, LOCK_EX);
324 $this->add(
'total', count($member));
325 $this->add(
'position', 0);
326 $this->setMessage( sprintf(
Context::getLang(
'point_recal_message'), 0, $this->
get(
'total')) );
337 if(!file_exists(
'./files/cache/pointRecal.txt'))
return new BaseObject(-1,
'msg_invalid_request');
340 $f = fopen(
"./files/cache/pointRecal.txt",
"r");
343 $str = trim(fgets($f, 1024));
347 list($member_srl, $point) = explode(
',',$str);
349 $args =
new stdClass();
350 $args->member_srl = $member_srl;
351 $args->point = $point;
353 if($idx%5000==0)
break;
362 FileHandler::rename(
'./files/member_extra_info/point',
'./files/member_extra_info/point.old');
368 $this->add(
'total', $total);
369 $this->add(
'position', $idx);
370 $this->setMessage(sprintf(
Context::getLang(
'point_recal_message'), $idx, $total));
390 $args =
new stdClass();
391 $args->module =
'point';
392 $args->module_srl = $srl;
397 if($oCacheHandler->isSupport())
399 $oCacheHandler->invalidateGroupKey(
'site_and_module');
402 $this->setMessage(
'success_updated');
The admin controller class of the point module.
getController($module_name)
procPointAdminInsertConfig()
Save the default configurations.
& getInstance($target= 'object', $info=null, $always_use_file=false)
procPointAdminReset()
Reset points for each module.
procPointAdminUpdatePoint()
Change members points.
The parent class of the point module.
procPointAdminInsertPointModuleConfig()
Save individual points per module.
procPointAdminInsertModuleConfig()
Save per-module configurations.
procPointAdminApplyPoint()
Apply member points saved by file to units of 5,000 people.
cacheActList()
Save the cache files.
executeQueryArray($query_id, $args=NULL, $arg_columns=NULL)
executeQuery($query_id, $args=NULL, $arg_columns=NULL)
procPointAdminReCal()
Recalculate points based on the list/comment/attachment and registration information. Granted only once a first-time login score.
moduleUpdate()
Execute update.