- Timestamp:
- 06/19/2008 01:01:16 PM (3 months ago)
- Location:
- sandbox/modules/comment
- Files:
-
- 1 added
- 4 modified
-
comment.controller.php (modified) (1 diff)
-
queries/getCommentListItem.xml (modified) (1 diff)
-
queries/getCommentPageList.xml (modified) (1 diff)
-
queries/getCommentParentNextSibling.xml (added)
-
queries/updateCommentListArrange.xml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
sandbox/modules/comment/comment.controller.php
r4230 r4299 160 160 $list_args->head = $parent->head; 161 161 $list_args->depth = $parent->depth+1; 162 if($list_args->depth<2) $list_args->arrange = $obj->comment_srl; 163 else { 164 $list_args->arrange = $parent->arrange; 165 $output = executeQuery('comment.updateCommentListArrange', $list_args); 166 if(!$output->toBool()) return $output; 162 163 // depth가 2단계 미만이면 별도의 update문 없이 insert만으로 쓰레드 정리 164 if($list_args->depth<2) { 165 $list_args->arrange = $obj->comment_srl; 166 167 // depth가 2단계 이상이면 반업데이트 실행 168 } else { 169 // 부모 댓글과 같은 head를 가지고 depth가 같거나 작은 댓글중 제일 위 댓글을 구함 170 $p_args->head = $parent->head; 171 $p_args->arrange = $parent->arrange; 172 $p_args->depth = $parent->depth; 173 $output = executeQuery('comment.getCommentParentNextSibling', $p_args); 174 175 if($output->data->arrange) { 176 $list_args->arrange = $output->data->arrange; 177 $output = executeQuery('comment.updateCommentListArrange', $list_args); 178 } else { 179 $list_args->arrange = $obj->comment_srl; 180 } 181 167 182 } 168 183 } -
sandbox/modules/comment/queries/getCommentListItem.xml
r3757 r4299 1 1 <query id="getCommentListItem" action="select"> 2 2 <tables> 3 <table name="comments" /> 3 4 <table name="comments_list" /> 4 5 </tables> 5 6 <columns> 6 <column name="*" /> 7 <column name="comments.parent_srl" /> 8 <column name="comments_list.*" /> 7 9 </columns> 8 10 <conditions> 9 <condition operation="equal" column="comment_srl" var="comment_srl" notnull="notnull" /> 11 <condition operation="equal" column="comments.comment_srl" var="comment_srl" notnull="notnull" /> 12 <condition operation="equal" column="comments.comment_srl" default="comments_list.comment_srl" notnull="notnull" pipe="and" /> 10 13 </conditions> 11 14 </query> -
sandbox/modules/comment/queries/getCommentPageList.xml
r3919 r4299 6 6 <columns> 7 7 <column name="comments.*" /> 8 <column name=" depth" alias="depth" />8 <column name="comments_list.depth" alias="depth" /> 9 9 </columns> 10 10 <conditions> 11 11 <condition operation="equal" column="comments_list.document_srl" var="document_srl" notnull="notnull" pipe="and" /> 12 12 <condition operation="equal" column="comments_list.comment_srl" var="comments.comment_srl" filter="number" pipe="and" /> 13 <condition operation="more" column="comments_list.head" default="0" pipe="and" /> 14 <condition operation="more" column="comments_list.arrange" default="0" pipe="and" /> 13 15 </conditions> 14 16 <navigation> 15 <index var="sort_index" default="head" order="asc" />16 <index var="sort_index" default="arrange" order="asc" />17 <index var="sort_index" default="comment_srl" order="asc" />18 17 <list_count var="list_count" default="list_count" /> 19 18 <page_count var="page_count" default="10" /> -
sandbox/modules/comment/queries/updateCommentListArrange.xml
r3757 r4299 9 9 <condition operation="equal" column="document_srl" var="document_srl" filter="number" notnull="notnull" /> 10 10 <condition operation="equal" column="head" var="head" filter="number" notnull="notnull" pipe="and" /> 11 <condition operation=" excess" column="arrange" var="arrange" filter="number" notnull="notnull" pipe="and" />11 <condition operation="more" column="arrange" var="arrange" filter="number" notnull="notnull" pipe="and" /> 12 12 </conditions> 13 13 </query>