48 $oCommentModel =
getModel(
'comment');
49 $columnList = array(
'comment_srl',
'module_srl',
'member_srl',
'ipaddress');
50 $oComment = $oCommentModel->getComment($comment_srl, FALSE, $columnList);
52 $member_srl = $oComment->get(
'member_srl');
57 if($comment_config->use_vote_up !=
'N' && $member_srl !=
$logged_info->member_srl)
60 $url = sprintf(
"doCallModuleAction('comment','procCommentVoteUp','%s')", $comment_srl);
61 $oCommentController->addCommentPopupMenu($url,
'cmd_vote',
'',
'javascript');
64 if($comment_config->use_vote_down !=
'N' && $member_srl !=
$logged_info->member_srl)
67 $url = sprintf(
"doCallModuleAction('comment','procCommentVoteDown','%s')", $comment_srl);
68 $oCommentController->addCommentPopupMenu($url,
'cmd_vote_down',
'',
'javascript');
72 $url = sprintf(
"doCallModuleAction('comment','procCommentDeclare','%s')", $comment_srl);
73 $oCommentController->addCommentPopupMenu($url,
'cmd_declare',
'',
'javascript');
79 if($this->grant->manager){
81 $url = sprintf(
"if(!confirm('%s')) return; var params = new Array(); params['comment_srl']='%s'; params['mid']=current_mid;params['cur_url']=current_url; exec_xml('comment', 'procCommentAdminMoveToTrash', params)", $str_confirm, $comment_srl);
82 $oCommentController->addCommentPopupMenu($url,
'cmd_trash',
'',
'javascript');
89 $oCommentModel =
getModel(
'comment');
90 $oComment = $oCommentModel->getComment($comment_srl);
92 if($oComment->isExists())
95 $url =
getUrl(
'',
'module',
'admin',
'act',
'dispCommentAdminList',
'search_target',
'ipaddress',
'search_keyword', $oComment->getIpAddress());
96 $oCommentController->addCommentPopupMenu($url,
'cmd_search_by_ipaddress', $icon_path,
'TraceByIpaddress');
98 $url = sprintf(
"var params = new Array(); params['ipaddress_list']='%s'; exec_xml('spamfilter', 'procSpamfilterAdminInsertDeniedIP', params, completeCallModuleAction)", $oComment->getIpAddress());
99 $oCommentController->addCommentPopupMenu($url,
'cmd_add_ip_to_spamfilter',
'',
'javascript');
105 $menus_count = count($menus);
107 for($i = 0; $i < $menus_count; $i++)
113 $this->
add(
'menus', $menus);
124 return $_SESSION[
'own_comment'][$comment_srl];
134 $args =
new stdClass();
135 $args->comment_srl = $comment_srl;
137 return (
int)
$output->data->count;
147 $args =
new stdClass();
148 $args->comment_srl = $comment_srl;
160 function getComment($comment_srl = 0, $is_admin = FALSE, $columnList = array())
162 $oComment =
new commentItem($comment_srl, $columnList);
165 $oComment->setGrant();
179 if(is_array($comment_srl_list))
181 $comment_srls = implode(
',', $comment_srl_list);
185 $args =
new stdClass();
186 $args->comment_srls = $comment_srls;
198 if(!is_array($comment_list))
200 $comment_list = array($comment_list);
203 $comment_count = count($comment_list);
204 foreach($comment_list as $key => $attribute)
206 if(!$attribute->comment_srl)
213 $oComment->setAttribute($attribute);
216 $oComment->setGrant();
219 $result[$attribute->comment_srl] = $oComment;
231 $args =
new stdClass();
236 $columnList = array(
'document_srl',
'module_srl');
241 if(!$oDocument->isExists())
252 $using_validation = $oCommentController->isModuleUsingPublishValidation(
$module_srl);
253 if($using_validation)
259 $total_count =
$output->data->count;
261 return (
int) $total_count;
274 $args->regDate = date(
'Ymd', strtotime($date));
277 if(count($moduleSrlList) > 0)
279 $args->module_srl = $moduleSrlList;
299 $args =
new stdClass();
302 if(is_null($published))
306 $is_using_validation = $oCommentController->isModuleUsingPublishValidation(
$module_srl);
307 if($is_using_validation)
325 $total_count =
$output->data->count;
327 return (
int) $total_count;
364 $args =
new stdClass();
368 $obj =
new stdClass();
379 if(is_array(
$obj->module_srl))
381 $args->module_srl = implode(
',',
$obj->module_srl);
388 $args->document_srl =
$obj->document_srl;
391 if(strpos(
$args->module_srl,
",") ===
false)
393 if(
$args->module_srl)
397 $is_using_validation = $oCommentController->isModuleUsingPublishValidation(
$obj->module_srl);
398 if($is_using_validation)
415 if(!is_array($comment_list))
417 $comment_list = array($comment_list);
420 $comment_count = count($comment_list);
422 foreach($comment_list as $key => $attribute)
424 if(!$attribute->comment_srl)
431 $oComment->setAttribute($attribute);
433 $result[$key] = $oComment;
458 $columnList = array(
'document_srl',
'module_srl',
'comment_count');
462 if(!$oDocument->isExists())
468 if($oDocument->getCommentCount() < 1)
479 $comment_count = $comment_config->comment_count;
487 $comment_count = $count;
493 $page = (int) ( ($oDocument->getCommentCount() - 1) / $comment_count) + 1;
497 $args =
new stdClass();
499 $args->list_count = $comment_count;
501 $args->page_count = 10;
505 $using_validation = $oCommentController->isModuleUsingPublishValidation(
$module_srl);
506 if($using_validation)
531 if(!$output->toBool())
541 return $trigger_output;
559 if(file_exists($lock_file) && filemtime($lock_file) + 60 * 60 * 10 < $_SERVER[
'REQUEST_TIME'])
567 $args =
new stdClass();
569 $args->list_order =
'list_order';
577 if(!is_array($source_list))
579 $source_list = array($source_list);
583 $comment_count = count($source_list);
585 $root =
new stdClass;
587 $comment_list = array();
593 for($i = $comment_count - 1; $i >= 0; $i--)
595 $comment_srl = $source_list[$i]->comment_srl;
596 $parent_srl = $source_list[$i]->parent_srl;
603 $list[$comment_srl] = $source_list[$i];
607 $list[$parent_srl]->child[] = &$list[$comment_srl];
611 $root->child[] = &$list[$comment_srl];
617 if(count($comment_list))
619 foreach($comment_list as $comment_srl => $item)
621 $comment_args =
new stdClass();
622 $comment_args->comment_srl = $comment_srl;
624 $comment_args->head = $item->head;
625 $comment_args->arrange = $item->arrange;
627 $comment_args->regdate = $item->regdate;
628 $comment_args->depth = $item->depth;
630 executeQuery(
'comment.insertCommentList', $comment_args);
653 foreach($list as $key => $val)
657 $val->head = $parent->head;
661 $val->head = $val->comment_srl;
664 $val->arrange = count($comment_list) + 1;
668 $val->depth = $depth;
669 $comment_list[$val->comment_srl] = $val;
675 $val->depth = $depth;
676 $comment_list[$val->comment_srl] = $val;
689 $query_id =
'comment.getTotalCommentList';
692 $args =
new stdClass();
693 $args->sort_index =
'list_order';
695 $args->list_count =
$obj->list_count ?
$obj->list_count : 20;
696 $args->page_count =
$obj->page_count ?
$obj->page_count : 10;
698 $args->exclude_module_srl =
$obj->exclude_module_srl;
702 $is_using_validation = $oCommentController->isModuleUsingPublishValidation(
$obj->module_srl);
703 if($is_using_validation)
705 $args->s_is_published = 1;
709 $search_target =
$obj->search_target ?
$obj->search_target : trim(
Context::get(
'search_target'));
710 $search_keyword =
$obj->search_keyword ?
$obj->search_keyword : trim(
Context::get(
'search_keyword'));
711 if($search_target && $search_keyword)
713 switch($search_target)
718 $search_keyword = str_replace(
' ',
'%', $search_keyword);
721 $args->s_content = $search_keyword;
727 $search_keyword = str_replace(
' ',
'%', $search_keyword);
730 $args->s_user_id = $search_keyword;
731 $query_id =
'comment.getTotalCommentListWithinMember';
732 $args->sort_index =
'comments.list_order';
738 $search_keyword = str_replace(
' ',
'%', $search_keyword);
741 $args->s_user_name = $search_keyword;
747 $search_keyword = str_replace(
' ',
'%', $search_keyword);
750 $args->s_nick_name = $search_keyword;
753 case 'email_address' :
756 $search_keyword = str_replace(
' ',
'%', $search_keyword);
759 $args->s_email_address = $search_keyword;
765 $search_keyword = str_replace(
' ',
'%', $search_keyword);
768 $args->s_homepage = $search_keyword;
772 $args->s_regdate = $search_keyword;
776 $args->s_last_upate = $search_keyword;
780 $args->s_ipaddress = $search_keyword;
784 $args->s_is_secret = $search_keyword;
787 case 'is_published' :
788 if($search_keyword ==
'Y')
790 $args->s_is_published = 1;
793 if($search_keyword ==
'N')
795 $args->s_is_published = 0;
801 $args->s_module_srl = (int) $search_keyword;
805 $args->{
"s_" . $search_target} = (int) $search_keyword;
819 foreach(
$output->data as $key => $val)
822 $_oComment =
new CommentItem(0);
823 $_oComment->setAttribute($val);
824 $output->data[$key] = $_oComment;
837 $query_id =
'comment.getTotalCommentCountByGroupStatus';
840 $args =
new stdClass();
842 $args->exclude_module_srl =
$obj->exclude_module_srl;
845 $search_target =
$obj->search_target ?
$obj->search_target : trim(
Context::get(
'search_target'));
846 $search_keyword =
$obj->search_keyword ?
$obj->search_keyword : trim(
Context::get(
'search_keyword'));
848 if($search_target && $search_keyword)
850 switch($search_target)
855 $search_keyword = str_replace(
' ',
'%', $search_keyword);
858 $args->s_content = $search_keyword;
864 $search_keyword = str_replace(
' ',
'%', $search_keyword);
867 $args->s_user_id = $search_keyword;
868 $query_id =
'comment.getTotalCommentCountWithinMemberByGroupStatus';
874 $search_keyword = str_replace(
' ',
'%', $search_keyword);
876 $args->s_user_name = $search_keyword;
883 $search_keyword = str_replace(
' ',
'%', $search_keyword);
886 $args->s_nick_name = $search_keyword;
889 case 'email_address' :
892 $search_keyword = str_replace(
' ',
'%', $search_keyword);
895 $args->s_email_address = $search_keyword;
901 $search_keyword = str_replace(
' ',
'%', $search_keyword);
904 $args->s_homepage = $search_keyword;
908 $args->s_regdate = $search_keyword;
912 $args->s_last_upate = $search_keyword;
916 $args->s_ipaddress = $search_keyword;
920 $args->s_is_secret = $search_keyword;
924 $args->{
"s_" . $search_target} = (int) $search_keyword;
949 if(!is_object($comment_config))
951 $comment_config =
new stdClass();
954 if(!isset($comment_config->comment_count))
956 $comment_config->comment_count = 50;
959 return $comment_config;
971 return new BaseObject(-1,
'msg_invalid_request');
980 $oCommentModel =
getModel(
'comment');
981 $oComment = $oCommentModel->getComment($comment_srl, FALSE, FALSE);
985 return new BaseObject(-1,
'msg_invalid_request');
991 $args =
new stdClass();
995 if($comment_config->use_vote_down !=
'S')
997 return new BaseObject(-1,
'msg_invalid_request');
1000 $args->below_point = 0;
1004 if($comment_config->use_vote_up !=
'S')
1006 return new BaseObject(-1,
'msg_invalid_request');
1009 $args->more_point = 0;
1012 $args->comment_srl = $comment_srl;
1019 $oMemberModel =
getModel(
'member');
1022 foreach(
$output->data as $k => $d)
1024 $profile_image = $oMemberModel->getProfileImage($d->member_srl);
1025 $output->data[$k]->src = $profile_image->src;
1029 $this->add(
'voted_member_list',
$output->data);
1040 if(!isset($lang->secret_name_list))
1042 return array(
'Y' =>
'Secret',
'N' =>
'Public');
1046 return $lang->secret_name_list;
1057 $args =
new stdClass();
1058 $args->member_srl = $member_srl;
1060 return (
int)
$output->data->count;
1075 $args =
new stdClass();
1076 $args->member_srl = $member_srl;
1077 $args->list_count = $count;
1079 $comment_list =
$output->data;
1081 if(!$comment_list)
return array();
1082 if(!is_array($comment_list)) $comment_list = array($comment_list);
1084 return $comment_list;
getController($module_name)
$act
a string value to contain the action name
writeFile($filename, $buff, $mode="w")
$module_srl
integer value to represent a run-time instance of Module (XE Module)
$mid
string to represent run-time instance of Module (XE Module)
executeQueryArray($query_id, $args=NULL, $arg_columns=NULL)
executeQuery($query_id, $args=NULL, $arg_columns=NULL)
triggerCall($trigger_name, $called_position, &$obj)
if(isset($_REQUEST['encode'])) if(isset($_REQUEST['decode'])) $lang