| @@ 668-692 (lines=25) @@ | ||
| 665 | $list_args->module_srl = $tobj->module_srl; |
|
| 666 | $list_args->regdate = $tobj->regdate; |
|
| 667 | // Set data directly if parent comment doesn't exist |
|
| 668 | if(!$tobj->parent_srl) |
|
| 669 | { |
|
| 670 | $list_args->head = $list_args->arrange = $tobj->comment_srl; |
|
| 671 | $list_args->depth = 0; |
|
| 672 | // Get parent_srl if parent comment exists |
|
| 673 | } |
|
| 674 | else |
|
| 675 | { |
|
| 676 | // Get parent_srl |
|
| 677 | $parent_args->comment_srl = $tobj->parent_srl; |
|
| 678 | $parent_output = executeQuery('comment.getCommentListItem', $parent_args); |
|
| 679 | // Return if parent comment doesn't exist |
|
| 680 | if(!$parent_output->toBool() || !$parent_output->data) return false; |
|
| 681 | $parent = $parent_output->data; |
|
| 682 | ||
| 683 | $list_args->head = $parent->head; |
|
| 684 | $list_args->depth = $parent->depth+1; |
|
| 685 | if($list_args->depth<2) $list_args->arrange = $tobj->comment_srl; |
|
| 686 | else |
|
| 687 | { |
|
| 688 | $list_args->arrange = $parent->arrange; |
|
| 689 | $output = executeQuery('comment.updateCommentListArrange', $list_args); |
|
| 690 | if(!$output->toBool()) return $output; |
|
| 691 | } |
|
| 692 | } |
|
| 693 | ||
| 694 | $output = executeQuery('comment.insertCommentList', $list_args); |
|
| 695 | if($output->toBool()) |
|
| @@ 1017-1041 (lines=25) @@ | ||
| 1014 | $list_args->module_srl = $obj->module_srl; |
|
| 1015 | $list_args->regdate = $obj->regdate; |
|
| 1016 | // Set data directly if parent comment doesn't exist |
|
| 1017 | if(!$obj->parent_srl) |
|
| 1018 | { |
|
| 1019 | $list_args->head = $list_args->arrange = $obj->comment_srl; |
|
| 1020 | $list_args->depth = 0; |
|
| 1021 | // Get parent_srl if parent comment exists |
|
| 1022 | } |
|
| 1023 | else |
|
| 1024 | { |
|
| 1025 | // Get parent comment infomation |
|
| 1026 | $parent_args->comment_srl = $obj->parent_srl; |
|
| 1027 | $parent_output = executeQuery('comment.getCommentListItem', $parent_args); |
|
| 1028 | // Return if parent comment doesn't exist |
|
| 1029 | if(!$parent_output->toBool() || !$parent_output->data) continue; |
|
| 1030 | $parent = $parent_output->data; |
|
| 1031 | ||
| 1032 | $list_args->head = $parent->head; |
|
| 1033 | $list_args->depth = $parent->depth+1; |
|
| 1034 | if($list_args->depth<2) $list_args->arrange = $obj->comment_srl; |
|
| 1035 | else |
|
| 1036 | { |
|
| 1037 | $list_args->arrange = $parent->arrange; |
|
| 1038 | $output = executeQuery('comment.updateCommentListArrange', $list_args); |
|
| 1039 | if(!$output->toBool()) return $output; |
|
| 1040 | } |
|
| 1041 | } |
|
| 1042 | ||
| 1043 | $output = executeQuery('comment.insertCommentList', $list_args); |
|
| 1044 | if($output->toBool()) |
|