@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | |
10 | 10 | class board extends ModuleObject |
11 | 11 | { |
12 | - var $search_option = array('title_content','title','content','comment','user_name','nick_name','user_id','tag'); ///< 검색 옵션 |
|
12 | + var $search_option = array('title_content', 'title', 'content', 'comment', 'user_name', 'nick_name', 'user_id', 'tag'); ///< 검색 옵션 |
|
13 | 13 | |
14 | 14 | var $order_target = array('list_order', 'update_order', 'regdate', 'voted_count', 'blamed_count', 'readed_count', 'comment_count', 'title', 'nick_name', 'user_name', 'user_id'); // 정렬 옵션 |
15 | 15 | |
@@ -25,9 +25,9 @@ discard block |
||
25 | 25 | */ |
26 | 26 | function board() |
27 | 27 | { |
28 | - if(!Context::isInstalled()) return; |
|
28 | + if (!Context::isInstalled()) return; |
|
29 | 29 | |
30 | - if(!Context::isExistsSSLAction('dispBoardWrite') && Context::getSslStatus() == 'optional') |
|
30 | + if (!Context::isExistsSSLAction('dispBoardWrite') && Context::getSslStatus() == 'optional') |
|
31 | 31 | { |
32 | 32 | $ssl_actions = array('dispBoardWrite', 'dispBoardWriteComment', 'dispBoardReplyComment', 'dispBoardModifyComment', 'dispBoardDelete', 'dispBoardDeleteComment', 'procBoardInsertDocument', 'procBoardDeleteDocument', 'procBoardInsertComment', 'procBoardDeleteComment', 'procBoardVerificationPassword'); |
33 | 33 | Context::addSSLActions($ssl_actions); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $args = new stdClass; |
51 | 51 | $args->site_srl = 0; |
52 | 52 | $output = executeQuery('module.getSite', $args); |
53 | - if(!$output->data->index_module_srl) |
|
53 | + if (!$output->data->index_module_srl) |
|
54 | 54 | { |
55 | 55 | $args->mid = 'board'; |
56 | 56 | $args->module = 'board'; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $args->site_srl = 0; |
60 | 60 | $output = $oModuleController->insertModule($args); |
61 | 61 | |
62 | - if($output->toBool()) |
|
62 | + if ($output->toBool()) |
|
63 | 63 | { |
64 | 64 | $module_srl = $output->get('module_srl'); |
65 | 65 | |
@@ -83,10 +83,10 @@ discard block |
||
83 | 83 | $oModuleModel = getModel('module'); |
84 | 84 | |
85 | 85 | // 2007. 10. 17 get the member menu trigger |
86 | - if(!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) return true; |
|
86 | + if (!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) return true; |
|
87 | 87 | |
88 | 88 | // 2011. 09. 20 when add new menu in sitemap, custom menu add |
89 | - if(!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) return true; |
|
89 | + if (!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) return true; |
|
90 | 90 | return false; |
91 | 91 | } |
92 | 92 | |
@@ -99,13 +99,13 @@ discard block |
||
99 | 99 | $oModuleController = getController('module'); |
100 | 100 | |
101 | 101 | // 2007. 10. 17 check the member menu trigger, if it is not existed then insert |
102 | - if(!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) |
|
102 | + if (!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) |
|
103 | 103 | { |
104 | 104 | $oModuleController->insertTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after'); |
105 | 105 | } |
106 | 106 | |
107 | 107 | // 2011. 09. 20 when add new menu in sitemap, custom menu add |
108 | - if(!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) |
|
108 | + if (!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) |
|
109 | 109 | { |
110 | 110 | $oModuleController->insertTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after'); |
111 | 111 | } |
@@ -116,12 +116,12 @@ discard block |
||
116 | 116 | function moduleUninstall() |
117 | 117 | { |
118 | 118 | $output = executeQueryArray("board.getAllBoard"); |
119 | - if(!$output->data) return new Object(); |
|
119 | + if (!$output->data) return new Object(); |
|
120 | 120 | @set_time_limit(0); |
121 | 121 | |
122 | 122 | $oModuleController = getController('module'); |
123 | 123 | |
124 | - foreach($output->data as $board) |
|
124 | + foreach ($output->data as $board) |
|
125 | 125 | { |
126 | 126 | $oModuleController->deleteModule($board->module_srl); |
127 | 127 | } |
@@ -25,7 +25,9 @@ discard block |
||
25 | 25 | */ |
26 | 26 | function board() |
27 | 27 | { |
28 | - if(!Context::isInstalled()) return; |
|
28 | + if(!Context::isInstalled()) { |
|
29 | + return; |
|
30 | + } |
|
29 | 31 | |
30 | 32 | if(!Context::isExistsSSLAction('dispBoardWrite') && Context::getSslStatus() == 'optional') |
31 | 33 | { |
@@ -83,10 +85,14 @@ discard block |
||
83 | 85 | $oModuleModel = getModel('module'); |
84 | 86 | |
85 | 87 | // 2007. 10. 17 get the member menu trigger |
86 | - if(!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) return true; |
|
88 | + if(!$oModuleModel->getTrigger('member.getMemberMenu', 'board', 'controller', 'triggerMemberMenu', 'after')) { |
|
89 | + return true; |
|
90 | + } |
|
87 | 91 | |
88 | 92 | // 2011. 09. 20 when add new menu in sitemap, custom menu add |
89 | - if(!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) return true; |
|
93 | + if(!$oModuleModel->getTrigger('menu.getModuleListInSitemap', 'board', 'model', 'triggerModuleListInSitemap', 'after')) { |
|
94 | + return true; |
|
95 | + } |
|
90 | 96 | return false; |
91 | 97 | } |
92 | 98 | |
@@ -116,7 +122,9 @@ discard block |
||
116 | 122 | function moduleUninstall() |
117 | 123 | { |
118 | 124 | $output = executeQueryArray("board.getAllBoard"); |
119 | - if(!$output->data) return new Object(); |
|
125 | + if(!$output->data) { |
|
126 | + return new Object(); |
|
127 | + } |
|
120 | 128 | @set_time_limit(0); |
121 | 129 | |
122 | 130 | $oModuleController = getController('module'); |
@@ -23,11 +23,11 @@ discard block |
||
23 | 23 | function procBoardInsertDocument() |
24 | 24 | { |
25 | 25 | // check grant |
26 | - if($this->module_info->module != "board") |
|
26 | + if ($this->module_info->module != "board") |
|
27 | 27 | { |
28 | 28 | return new Object(-1, "msg_invalid_request"); |
29 | 29 | } |
30 | - if(!$this->grant->write_document) |
|
30 | + if (!$this->grant->write_document) |
|
31 | 31 | { |
32 | 32 | return new Object(-1, 'msg_not_permitted'); |
33 | 33 | } |
@@ -36,16 +36,16 @@ discard block |
||
36 | 36 | // setup variables |
37 | 37 | $obj = Context::getRequestVars(); |
38 | 38 | $obj->module_srl = $this->module_srl; |
39 | - if($obj->is_notice!='Y'||!$this->grant->manager) $obj->is_notice = 'N'; |
|
39 | + if ($obj->is_notice != 'Y' || !$this->grant->manager) $obj->is_notice = 'N'; |
|
40 | 40 | $obj->commentStatus = $obj->comment_status; |
41 | 41 | |
42 | 42 | settype($obj->title, "string"); |
43 | - if($obj->title == '') $obj->title = cut_str(trim(strip_tags(nl2br($obj->content))),20,'...'); |
|
43 | + if ($obj->title == '') $obj->title = cut_str(trim(strip_tags(nl2br($obj->content))), 20, '...'); |
|
44 | 44 | //setup dpcument title tp 'Untitled' |
45 | - if($obj->title == '') $obj->title = 'Untitled'; |
|
45 | + if ($obj->title == '') $obj->title = 'Untitled'; |
|
46 | 46 | |
47 | 47 | // unset document style if the user is not the document manager |
48 | - if(!$this->grant->manager) |
|
48 | + if (!$this->grant->manager) |
|
49 | 49 | { |
50 | 50 | unset($obj->title_color); |
51 | 51 | unset($obj->title_bold); |
@@ -62,24 +62,24 @@ discard block |
||
62 | 62 | |
63 | 63 | // update the document if it is existed |
64 | 64 | $is_update = false; |
65 | - if($oDocument->isExists() && $oDocument->document_srl == $obj->document_srl) |
|
65 | + if ($oDocument->isExists() && $oDocument->document_srl == $obj->document_srl) |
|
66 | 66 | { |
67 | 67 | $is_update = true; |
68 | 68 | } |
69 | 69 | |
70 | 70 | // if use anonymous is true |
71 | - if($this->module_info->use_anonymous == 'Y') |
|
71 | + if ($this->module_info->use_anonymous == 'Y') |
|
72 | 72 | { |
73 | 73 | $this->module_info->admin_mail = ''; |
74 | 74 | $obj->notify_message = 'N'; |
75 | - if($is_update===false) |
|
75 | + if ($is_update === false) |
|
76 | 76 | { |
77 | - $obj->member_srl = -1*$logged_info->member_srl; |
|
77 | + $obj->member_srl = -1 * $logged_info->member_srl; |
|
78 | 78 | } |
79 | 79 | $obj->email_address = $obj->homepage = $obj->user_id = ''; |
80 | 80 | $obj->user_name = $obj->nick_name = 'anonymous'; |
81 | 81 | $bAnonymous = true; |
82 | - if($is_update===false) |
|
82 | + if ($is_update === false) |
|
83 | 83 | { |
84 | 84 | $oDocument->add('member_srl', $obj->member_srl); |
85 | 85 | } |
@@ -89,10 +89,10 @@ discard block |
||
89 | 89 | $bAnonymous = false; |
90 | 90 | } |
91 | 91 | |
92 | - if($obj->is_secret == 'Y' || strtoupper($obj->status == 'SECRET')) |
|
92 | + if ($obj->is_secret == 'Y' || strtoupper($obj->status == 'SECRET')) |
|
93 | 93 | { |
94 | 94 | $use_status = explode('|@|', $this->module_info->use_status); |
95 | - if(!is_array($use_status) || !in_array('SECRET', $use_status)) |
|
95 | + if (!is_array($use_status) || !in_array('SECRET', $use_status)) |
|
96 | 96 | { |
97 | 97 | unset($obj->is_secret); |
98 | 98 | $obj->status = 'PUBLIC'; |
@@ -100,19 +100,19 @@ discard block |
||
100 | 100 | } |
101 | 101 | |
102 | 102 | // update the document if it is existed |
103 | - if($is_update) |
|
103 | + if ($is_update) |
|
104 | 104 | { |
105 | - if(!$oDocument->isGranted()) |
|
105 | + if (!$oDocument->isGranted()) |
|
106 | 106 | { |
107 | - return new Object(-1,'msg_not_permitted'); |
|
107 | + return new Object(-1, 'msg_not_permitted'); |
|
108 | 108 | } |
109 | 109 | |
110 | - if($this->module_info->protect_content=="Y" && $oDocument->get('comment_count')>0 && $this->grant->manager==false) |
|
110 | + if ($this->module_info->protect_content == "Y" && $oDocument->get('comment_count') > 0 && $this->grant->manager == false) |
|
111 | 111 | { |
112 | - return new Object(-1,'msg_protect_content'); |
|
112 | + return new Object(-1, 'msg_protect_content'); |
|
113 | 113 | } |
114 | 114 | |
115 | - if(!$this->grant->manager) |
|
115 | + if (!$this->grant->manager) |
|
116 | 116 | { |
117 | 117 | // notice & document style same as before if not manager |
118 | 118 | $obj->is_notice = $oDocument->get('is_notice'); |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | } |
122 | 122 | |
123 | 123 | // modify list_order if document status is temp |
124 | - if($oDocument->get('status') == 'TEMP') |
|
124 | + if ($oDocument->get('status') == 'TEMP') |
|
125 | 125 | { |
126 | 126 | $obj->last_update = $obj->regdate = date('YmdHis'); |
127 | 127 | $obj->update_order = $obj->list_order = (getNextSequence() * -1); |
@@ -137,18 +137,18 @@ discard block |
||
137 | 137 | $obj->document_srl = $output->get('document_srl'); |
138 | 138 | |
139 | 139 | // send an email to admin user |
140 | - if($output->toBool() && $this->module_info->admin_mail) |
|
140 | + if ($output->toBool() && $this->module_info->admin_mail) |
|
141 | 141 | { |
142 | 142 | $oMail = new Mail(); |
143 | 143 | $oMail->setTitle($obj->title); |
144 | - $oMail->setContent( sprintf("From : <a href=\"%s\">%s</a><br/>\r\n%s", getFullUrl('','document_srl',$obj->document_srl), getFullUrl('','document_srl',$obj->document_srl), $obj->content)); |
|
144 | + $oMail->setContent(sprintf("From : <a href=\"%s\">%s</a><br/>\r\n%s", getFullUrl('', 'document_srl', $obj->document_srl), getFullUrl('', 'document_srl', $obj->document_srl), $obj->content)); |
|
145 | 145 | $oMail->setSender($obj->user_name, $obj->email_address); |
146 | 146 | |
147 | - $target_mail = explode(',',$this->module_info->admin_mail); |
|
148 | - for($i=0;$i<count($target_mail);$i++) |
|
147 | + $target_mail = explode(',', $this->module_info->admin_mail); |
|
148 | + for ($i = 0; $i < count($target_mail); $i++) |
|
149 | 149 | { |
150 | 150 | $email_address = trim($target_mail[$i]); |
151 | - if(!$email_address) continue; |
|
151 | + if (!$email_address) continue; |
|
152 | 152 | $oMail->setReceiptor($email_address, $email_address); |
153 | 153 | $oMail->send(); |
154 | 154 | } |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | } |
157 | 157 | |
158 | 158 | // if there is an error |
159 | - if(!$output->toBool()) |
|
159 | + if (!$output->toBool()) |
|
160 | 160 | { |
161 | 161 | return $output; |
162 | 162 | } |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $document_srl = Context::get('document_srl'); |
179 | 179 | |
180 | 180 | // if the document is not existed |
181 | - if(!$document_srl) |
|
181 | + if (!$document_srl) |
|
182 | 182 | { |
183 | 183 | return $this->doError('msg_invalid_document'); |
184 | 184 | } |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | $oDocumentModel = &getModel('document'); |
187 | 187 | $oDocument = $oDocumentModel->getDocument($document_srl); |
188 | 188 | // check protect content |
189 | - if($this->module_info->protect_content=="Y" && $oDocument->get('comment_count')>0 && $this->grant->manager==false) |
|
189 | + if ($this->module_info->protect_content == "Y" && $oDocument->get('comment_count') > 0 && $this->grant->manager == false) |
|
190 | 190 | { |
191 | 191 | return new Object(-1, 'msg_protect_content'); |
192 | 192 | } |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | |
197 | 197 | // delete the document |
198 | 198 | $output = $oDocumentController->deleteDocument($document_srl, $this->grant->manager); |
199 | - if(!$output->toBool()) |
|
199 | + if (!$output->toBool()) |
|
200 | 200 | { |
201 | 201 | return $output; |
202 | 202 | } |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | function procBoardInsertComment() |
227 | 227 | { |
228 | 228 | // check grant |
229 | - if(!$this->grant->write_comment) |
|
229 | + if (!$this->grant->write_comment) |
|
230 | 230 | { |
231 | 231 | return new Object(-1, 'msg_not_permitted'); |
232 | 232 | } |
@@ -236,13 +236,13 @@ discard block |
||
236 | 236 | $obj = Context::getRequestVars(); |
237 | 237 | $obj->module_srl = $this->module_srl; |
238 | 238 | |
239 | - if(!$this->module_info->use_status) $this->module_info->use_status = 'PUBLIC'; |
|
240 | - if(!is_array($this->module_info->use_status)) |
|
239 | + if (!$this->module_info->use_status) $this->module_info->use_status = 'PUBLIC'; |
|
240 | + if (!is_array($this->module_info->use_status)) |
|
241 | 241 | { |
242 | 242 | $this->module_info->use_status = explode('|@|', $this->module_info->use_status); |
243 | 243 | } |
244 | 244 | |
245 | - if(in_array('SECRET', $this->module_info->use_status)) |
|
245 | + if (in_array('SECRET', $this->module_info->use_status)) |
|
246 | 246 | { |
247 | 247 | $this->module_info->secret = 'Y'; |
248 | 248 | } |
@@ -255,17 +255,17 @@ discard block |
||
255 | 255 | // check if the doument is existed |
256 | 256 | $oDocumentModel = getModel('document'); |
257 | 257 | $oDocument = $oDocumentModel->getDocument($obj->document_srl); |
258 | - if(!$oDocument->isExists()) |
|
258 | + if (!$oDocument->isExists()) |
|
259 | 259 | { |
260 | - return new Object(-1,'msg_not_founded'); |
|
260 | + return new Object(-1, 'msg_not_founded'); |
|
261 | 261 | } |
262 | 262 | |
263 | 263 | // For anonymous use, remove writer's information and notifying information |
264 | - if($this->module_info->use_anonymous == 'Y') |
|
264 | + if ($this->module_info->use_anonymous == 'Y') |
|
265 | 265 | { |
266 | 266 | $this->module_info->admin_mail = ''; |
267 | 267 | $obj->notify_message = 'N'; |
268 | - $obj->member_srl = -1*$logged_info->member_srl; |
|
268 | + $obj->member_srl = -1 * $logged_info->member_srl; |
|
269 | 269 | $obj->email_address = $obj->homepage = $obj->user_id = ''; |
270 | 270 | $obj->user_name = $obj->nick_name = 'anonymous'; |
271 | 271 | $bAnonymous = true; |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | |
284 | 284 | // check the comment is existed |
285 | 285 | // if the comment is not existed, then generate a new sequence |
286 | - if(!$obj->comment_srl) |
|
286 | + if (!$obj->comment_srl) |
|
287 | 287 | { |
288 | 288 | $obj->comment_srl = getNextSequence(); |
289 | 289 | } else { |
@@ -291,14 +291,14 @@ discard block |
||
291 | 291 | } |
292 | 292 | |
293 | 293 | // if comment_srl is not existed, then insert the comment |
294 | - if($comment->comment_srl != $obj->comment_srl) |
|
294 | + if ($comment->comment_srl != $obj->comment_srl) |
|
295 | 295 | { |
296 | 296 | |
297 | 297 | // parent_srl is existed |
298 | - if($obj->parent_srl) |
|
298 | + if ($obj->parent_srl) |
|
299 | 299 | { |
300 | 300 | $parent_comment = $oCommentModel->getComment($obj->parent_srl); |
301 | - if(!$parent_comment->comment_srl) |
|
301 | + if (!$parent_comment->comment_srl) |
|
302 | 302 | { |
303 | 303 | return new Object(-1, 'msg_invalid_request'); |
304 | 304 | } |
@@ -312,9 +312,9 @@ discard block |
||
312 | 312 | // update the comment if it is not existed |
313 | 313 | } else { |
314 | 314 | // check the grant |
315 | - if(!$comment->isGranted()) |
|
315 | + if (!$comment->isGranted()) |
|
316 | 316 | { |
317 | - return new Object(-1,'msg_not_permitted'); |
|
317 | + return new Object(-1, 'msg_not_permitted'); |
|
318 | 318 | } |
319 | 319 | |
320 | 320 | $obj->parent_srl = $comment->parent_srl; |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | $comment_srl = $obj->comment_srl; |
323 | 323 | } |
324 | 324 | |
325 | - if(!$output->toBool()) |
|
325 | + if (!$output->toBool()) |
|
326 | 326 | { |
327 | 327 | return $output; |
328 | 328 | } |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | { |
341 | 341 | // get the comment_srl |
342 | 342 | $comment_srl = Context::get('comment_srl'); |
343 | - if(!$comment_srl) |
|
343 | + if (!$comment_srl) |
|
344 | 344 | { |
345 | 345 | return $this->doError('msg_invalid_request'); |
346 | 346 | } |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | $oCommentController = getController('comment'); |
350 | 350 | |
351 | 351 | $output = $oCommentController->deleteComment($comment_srl, $this->grant->manager); |
352 | - if(!$output->toBool()) |
|
352 | + if (!$output->toBool()) |
|
353 | 353 | { |
354 | 354 | return $output; |
355 | 355 | } |
@@ -370,10 +370,10 @@ discard block |
||
370 | 370 | // generate trackback module controller object |
371 | 371 | $oTrackbackController = getController('trackback'); |
372 | 372 | |
373 | - if(!$oTrackbackController) return; |
|
373 | + if (!$oTrackbackController) return; |
|
374 | 374 | |
375 | 375 | $output = $oTrackbackController->deleteTrackback($trackback_srl, $this->grant->manager); |
376 | - if(!$output->toBool()) |
|
376 | + if (!$output->toBool()) |
|
377 | 377 | { |
378 | 378 | return $output; |
379 | 379 | } |
@@ -397,18 +397,18 @@ discard block |
||
397 | 397 | $oMemberModel = getModel('member'); |
398 | 398 | |
399 | 399 | // if the comment exists |
400 | - if($comment_srl) |
|
400 | + if ($comment_srl) |
|
401 | 401 | { |
402 | 402 | // get the comment information |
403 | 403 | $oCommentModel = getModel('comment'); |
404 | 404 | $oComment = $oCommentModel->getComment($comment_srl); |
405 | - if(!$oComment->isExists()) |
|
405 | + if (!$oComment->isExists()) |
|
406 | 406 | { |
407 | 407 | return new Object(-1, 'msg_invalid_request'); |
408 | 408 | } |
409 | 409 | |
410 | 410 | // compare the comment password and the user input password |
411 | - if(!$oMemberModel->isValidPassword($oComment->get('password'),$password)) |
|
411 | + if (!$oMemberModel->isValidPassword($oComment->get('password'), $password)) |
|
412 | 412 | { |
413 | 413 | return new Object(-1, 'msg_invalid_password'); |
414 | 414 | } |
@@ -418,13 +418,13 @@ discard block |
||
418 | 418 | // get the document information |
419 | 419 | $oDocumentModel = getModel('document'); |
420 | 420 | $oDocument = $oDocumentModel->getDocument($document_srl); |
421 | - if(!$oDocument->isExists()) |
|
421 | + if (!$oDocument->isExists()) |
|
422 | 422 | { |
423 | 423 | return new Object(-1, 'msg_invalid_request'); |
424 | 424 | } |
425 | 425 | |
426 | 426 | // compare the document password and the user input password |
427 | - if(!$oMemberModel->isValidPassword($oDocument->get('password'),$password)) |
|
427 | + if (!$oMemberModel->isValidPassword($oDocument->get('password'), $password)) |
|
428 | 428 | { |
429 | 429 | return new Object(-1, 'msg_invalid_password'); |
430 | 430 | } |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | $member_srl = Context::get('target_srl'); |
442 | 442 | $mid = Context::get('cur_mid'); |
443 | 443 | |
444 | - if(!$member_srl || !$mid) |
|
444 | + if (!$member_srl || !$mid) |
|
445 | 445 | { |
446 | 446 | return new Object(); |
447 | 447 | } |
@@ -453,13 +453,13 @@ discard block |
||
453 | 453 | $columnList = array('module'); |
454 | 454 | $cur_module_info = $oModuleModel->getModuleInfoByMid($mid, 0, $columnList); |
455 | 455 | |
456 | - if($cur_module_info->module != 'board') |
|
456 | + if ($cur_module_info->module != 'board') |
|
457 | 457 | { |
458 | 458 | return new Object(); |
459 | 459 | } |
460 | 460 | |
461 | 461 | // get the member information |
462 | - if($member_srl == $logged_info->member_srl) |
|
462 | + if ($member_srl == $logged_info->member_srl) |
|
463 | 463 | { |
464 | 464 | $member_info = $logged_info; |
465 | 465 | } else { |
@@ -467,13 +467,13 @@ discard block |
||
467 | 467 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); |
468 | 468 | } |
469 | 469 | |
470 | - if(!$member_info->user_id) |
|
470 | + if (!$member_info->user_id) |
|
471 | 471 | { |
472 | 472 | return new Object(); |
473 | 473 | } |
474 | 474 | |
475 | 475 | //search |
476 | - $url = getUrl('','mid',$mid,'search_target','nick_name','search_keyword',$member_info->nick_name); |
|
476 | + $url = getUrl('', 'mid', $mid, 'search_target', 'nick_name', 'search_keyword', $member_info->nick_name); |
|
477 | 477 | $oMemberController = getController('member'); |
478 | 478 | $oMemberController->addMemberPopupMenu($url, 'cmd_view_own_document', ''); |
479 | 479 |
@@ -36,13 +36,19 @@ discard block |
||
36 | 36 | // setup variables |
37 | 37 | $obj = Context::getRequestVars(); |
38 | 38 | $obj->module_srl = $this->module_srl; |
39 | - if($obj->is_notice!='Y'||!$this->grant->manager) $obj->is_notice = 'N'; |
|
39 | + if($obj->is_notice!='Y'||!$this->grant->manager) { |
|
40 | + $obj->is_notice = 'N'; |
|
41 | + } |
|
40 | 42 | $obj->commentStatus = $obj->comment_status; |
41 | 43 | |
42 | 44 | settype($obj->title, "string"); |
43 | - if($obj->title == '') $obj->title = cut_str(trim(strip_tags(nl2br($obj->content))),20,'...'); |
|
45 | + if($obj->title == '') { |
|
46 | + $obj->title = cut_str(trim(strip_tags(nl2br($obj->content))),20,'...'); |
|
47 | + } |
|
44 | 48 | //setup dpcument title tp 'Untitled' |
45 | - if($obj->title == '') $obj->title = 'Untitled'; |
|
49 | + if($obj->title == '') { |
|
50 | + $obj->title = 'Untitled'; |
|
51 | + } |
|
46 | 52 | |
47 | 53 | // unset document style if the user is not the document manager |
48 | 54 | if(!$this->grant->manager) |
@@ -83,8 +89,7 @@ discard block |
||
83 | 89 | { |
84 | 90 | $oDocument->add('member_srl', $obj->member_srl); |
85 | 91 | } |
86 | - } |
|
87 | - else |
|
92 | + } else |
|
88 | 93 | { |
89 | 94 | $bAnonymous = false; |
90 | 95 | } |
@@ -148,7 +153,9 @@ discard block |
||
148 | 153 | for($i=0;$i<count($target_mail);$i++) |
149 | 154 | { |
150 | 155 | $email_address = trim($target_mail[$i]); |
151 | - if(!$email_address) continue; |
|
156 | + if(!$email_address) { |
|
157 | + continue; |
|
158 | + } |
|
152 | 159 | $oMail->setReceiptor($email_address, $email_address); |
153 | 160 | $oMail->send(); |
154 | 161 | } |
@@ -236,7 +243,9 @@ discard block |
||
236 | 243 | $obj = Context::getRequestVars(); |
237 | 244 | $obj->module_srl = $this->module_srl; |
238 | 245 | |
239 | - if(!$this->module_info->use_status) $this->module_info->use_status = 'PUBLIC'; |
|
246 | + if(!$this->module_info->use_status) { |
|
247 | + $this->module_info->use_status = 'PUBLIC'; |
|
248 | + } |
|
240 | 249 | if(!is_array($this->module_info->use_status)) |
241 | 250 | { |
242 | 251 | $this->module_info->use_status = explode('|@|', $this->module_info->use_status); |
@@ -245,8 +254,7 @@ discard block |
||
245 | 254 | if(in_array('SECRET', $this->module_info->use_status)) |
246 | 255 | { |
247 | 256 | $this->module_info->secret = 'Y'; |
248 | - } |
|
249 | - else |
|
257 | + } else |
|
250 | 258 | { |
251 | 259 | unset($obj->is_secret); |
252 | 260 | $this->module_info->secret = 'N'; |
@@ -269,8 +277,7 @@ discard block |
||
269 | 277 | $obj->email_address = $obj->homepage = $obj->user_id = ''; |
270 | 278 | $obj->user_name = $obj->nick_name = 'anonymous'; |
271 | 279 | $bAnonymous = true; |
272 | - } |
|
273 | - else |
|
280 | + } else |
|
274 | 281 | { |
275 | 282 | $bAnonymous = false; |
276 | 283 | } |
@@ -370,7 +377,9 @@ discard block |
||
370 | 377 | // generate trackback module controller object |
371 | 378 | $oTrackbackController = getController('trackback'); |
372 | 379 | |
373 | - if(!$oTrackbackController) return; |
|
380 | + if(!$oTrackbackController) { |
|
381 | + return; |
|
382 | + } |
|
374 | 383 | |
375 | 384 | $output = $oTrackbackController->deleteTrackback($trackback_srl, $this->grant->manager); |
376 | 385 | if(!$output->toBool()) |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /* Copyright (C) NAVER <http://www.navercorp.com> */ |
3 | 3 | |
4 | -require_once(_XE_PATH_.'modules/board/board.view.php'); |
|
4 | +require_once(_XE_PATH_ . 'modules/board/board.view.php'); |
|
5 | 5 | |
6 | 6 | class boardMobile extends boardView |
7 | 7 | { |
@@ -10,32 +10,32 @@ discard block |
||
10 | 10 | $oSecurity = new Security(); |
11 | 11 | $oSecurity->encodeHTML('document_srl', 'comment_srl', 'vid', 'mid', 'page', 'category', 'search_target', 'search_keyword', 'sort_index', 'order_type', 'trackback_srl'); |
12 | 12 | |
13 | - if($this->module_info->list_count) $this->list_count = $this->module_info->list_count; |
|
14 | - if($this->module_info->mobile_list_count) $this->list_count = $this->module_info->mobile_list_count; |
|
15 | - if($this->module_info->search_list_count) $this->search_list_count = $this->module_info->search_list_count; |
|
16 | - if($this->module_info->mobile_search_list_count) $this->list_count = $this->module_info->mobile_search_list_count; |
|
17 | - if($this->module_info->page_count) $this->page_count = $this->module_info->page_count; |
|
18 | - if($this->module_info->mobile_page_count) $this->page_count = $this->module_info->mobile_page_count; |
|
13 | + if ($this->module_info->list_count) $this->list_count = $this->module_info->list_count; |
|
14 | + if ($this->module_info->mobile_list_count) $this->list_count = $this->module_info->mobile_list_count; |
|
15 | + if ($this->module_info->search_list_count) $this->search_list_count = $this->module_info->search_list_count; |
|
16 | + if ($this->module_info->mobile_search_list_count) $this->list_count = $this->module_info->mobile_search_list_count; |
|
17 | + if ($this->module_info->page_count) $this->page_count = $this->module_info->page_count; |
|
18 | + if ($this->module_info->mobile_page_count) $this->page_count = $this->module_info->mobile_page_count; |
|
19 | 19 | $this->except_notice = $this->module_info->except_notice == 'N' ? false : true; |
20 | 20 | |
21 | 21 | // $this->_getStatusNameListecret option backward compatibility |
22 | 22 | $oDocumentModel = getModel('document'); |
23 | 23 | |
24 | 24 | $statusList = $this->_getStatusNameList($oDocumentModel); |
25 | - if(isset($statusList['SECRET'])) |
|
25 | + if (isset($statusList['SECRET'])) |
|
26 | 26 | { |
27 | 27 | $this->module_info->secret = 'Y'; |
28 | 28 | } |
29 | 29 | |
30 | 30 | // use_category <=1.5.x, hide_category >=1.7.x |
31 | 31 | $count_category = count($oDocumentModel->getCategoryList($this->module_info->module_srl)); |
32 | - if($count_category) |
|
32 | + if ($count_category) |
|
33 | 33 | { |
34 | - if($this->module_info->hide_category) |
|
34 | + if ($this->module_info->hide_category) |
|
35 | 35 | { |
36 | 36 | $this->module_info->use_category = ($this->module_info->hide_category == 'Y') ? 'N' : 'Y'; |
37 | 37 | } |
38 | - else if($this->module_info->use_category) |
|
38 | + else if ($this->module_info->use_category) |
|
39 | 39 | { |
40 | 40 | $this->module_info->hide_category = ($this->module_info->use_category == 'Y') ? 'N' : 'Y'; |
41 | 41 | } |
@@ -55,10 +55,10 @@ discard block |
||
55 | 55 | * check the consultation function, if the user is admin then swich off consultation function |
56 | 56 | * if the user is not logged, then disppear write document/write comment./ view document |
57 | 57 | **/ |
58 | - if($this->module_info->consultation == 'Y' && !$this->grant->manager) |
|
58 | + if ($this->module_info->consultation == 'Y' && !$this->grant->manager) |
|
59 | 59 | { |
60 | 60 | $this->consultation = true; |
61 | - if(!Context::get('is_logged')) $this->grant->list = $this->grant->write_document = $this->grant->write_comment = $this->grant->view = false; |
|
61 | + if (!Context::get('is_logged')) $this->grant->list = $this->grant->write_document = $this->grant->write_comment = $this->grant->view = false; |
|
62 | 62 | } else { |
63 | 63 | $this->consultation = false; |
64 | 64 | } |
@@ -67,14 +67,14 @@ discard block |
||
67 | 67 | $extra_keys = $oDocumentModel->getExtraKeys($this->module_info->module_srl); |
68 | 68 | Context::set('extra_keys', $extra_keys); |
69 | 69 | |
70 | - $template_path = sprintf("%sm.skins/%s/",$this->module_path, $this->module_info->mskin); |
|
71 | - if(!is_dir($template_path)||!$this->module_info->mskin) |
|
70 | + $template_path = sprintf("%sm.skins/%s/", $this->module_path, $this->module_info->mskin); |
|
71 | + if (!is_dir($template_path) || !$this->module_info->mskin) |
|
72 | 72 | { |
73 | 73 | $this->module_info->mskin = 'default'; |
74 | - $template_path = sprintf("%sm.skins/%s/",$this->module_path, $this->module_info->mskin); |
|
74 | + $template_path = sprintf("%sm.skins/%s/", $this->module_path, $this->module_info->mskin); |
|
75 | 75 | } |
76 | 76 | $this->setTemplatePath($template_path); |
77 | - Context::addJsFilter($this->module_path.'tpl/filter', 'input_password.xml'); |
|
77 | + Context::addJsFilter($this->module_path . 'tpl/filter', 'input_password.xml'); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | function dispBoardCategory() |
@@ -87,13 +87,13 @@ discard block |
||
87 | 87 | function getBoardCommentPage() |
88 | 88 | { |
89 | 89 | $document_srl = Context::get('document_srl'); |
90 | - $oDocumentModel =& getModel('document'); |
|
91 | - if(!$document_srl) |
|
90 | + $oDocumentModel = & getModel('document'); |
|
91 | + if (!$document_srl) |
|
92 | 92 | { |
93 | 93 | return new Object(-1, "msg_invalid_request"); |
94 | 94 | } |
95 | 95 | $oDocument = $oDocumentModel->getDocument($document_srl); |
96 | - if(!$oDocument->isExists()) |
|
96 | + if (!$oDocument->isExists()) |
|
97 | 97 | { |
98 | 98 | return new Object(-1, "msg_invalid_request"); |
99 | 99 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | function dispBoardMessage($msg_code) |
107 | 107 | { |
108 | 108 | $msg = Context::getLang($msg_code); |
109 | - $oMessageObject = &ModuleHandler::getModuleInstance('message','mobile'); |
|
109 | + $oMessageObject = &ModuleHandler::getModuleInstance('message', 'mobile'); |
|
110 | 110 | $oMessageObject->setError(-1); |
111 | 111 | $oMessageObject->setMessage($msg); |
112 | 112 | $oMessageObject->dispMessage(); |
@@ -10,12 +10,24 @@ discard block |
||
10 | 10 | $oSecurity = new Security(); |
11 | 11 | $oSecurity->encodeHTML('document_srl', 'comment_srl', 'vid', 'mid', 'page', 'category', 'search_target', 'search_keyword', 'sort_index', 'order_type', 'trackback_srl'); |
12 | 12 | |
13 | - if($this->module_info->list_count) $this->list_count = $this->module_info->list_count; |
|
14 | - if($this->module_info->mobile_list_count) $this->list_count = $this->module_info->mobile_list_count; |
|
15 | - if($this->module_info->search_list_count) $this->search_list_count = $this->module_info->search_list_count; |
|
16 | - if($this->module_info->mobile_search_list_count) $this->list_count = $this->module_info->mobile_search_list_count; |
|
17 | - if($this->module_info->page_count) $this->page_count = $this->module_info->page_count; |
|
18 | - if($this->module_info->mobile_page_count) $this->page_count = $this->module_info->mobile_page_count; |
|
13 | + if($this->module_info->list_count) { |
|
14 | + $this->list_count = $this->module_info->list_count; |
|
15 | + } |
|
16 | + if($this->module_info->mobile_list_count) { |
|
17 | + $this->list_count = $this->module_info->mobile_list_count; |
|
18 | + } |
|
19 | + if($this->module_info->search_list_count) { |
|
20 | + $this->search_list_count = $this->module_info->search_list_count; |
|
21 | + } |
|
22 | + if($this->module_info->mobile_search_list_count) { |
|
23 | + $this->list_count = $this->module_info->mobile_search_list_count; |
|
24 | + } |
|
25 | + if($this->module_info->page_count) { |
|
26 | + $this->page_count = $this->module_info->page_count; |
|
27 | + } |
|
28 | + if($this->module_info->mobile_page_count) { |
|
29 | + $this->page_count = $this->module_info->mobile_page_count; |
|
30 | + } |
|
19 | 31 | $this->except_notice = $this->module_info->except_notice == 'N' ? false : true; |
20 | 32 | |
21 | 33 | // $this->_getStatusNameListecret option backward compatibility |
@@ -34,18 +46,15 @@ discard block |
||
34 | 46 | if($this->module_info->hide_category) |
35 | 47 | { |
36 | 48 | $this->module_info->use_category = ($this->module_info->hide_category == 'Y') ? 'N' : 'Y'; |
37 | - } |
|
38 | - else if($this->module_info->use_category) |
|
49 | + } else if($this->module_info->use_category) |
|
39 | 50 | { |
40 | 51 | $this->module_info->hide_category = ($this->module_info->use_category == 'Y') ? 'N' : 'Y'; |
41 | - } |
|
42 | - else |
|
52 | + } else |
|
43 | 53 | { |
44 | 54 | $this->module_info->hide_category = 'N'; |
45 | 55 | $this->module_info->use_category = 'Y'; |
46 | 56 | } |
47 | - } |
|
48 | - else |
|
57 | + } else |
|
49 | 58 | { |
50 | 59 | $this->module_info->hide_category = 'Y'; |
51 | 60 | $this->module_info->use_category = 'N'; |
@@ -58,7 +67,9 @@ discard block |
||
58 | 67 | if($this->module_info->consultation == 'Y' && !$this->grant->manager) |
59 | 68 | { |
60 | 69 | $this->consultation = true; |
61 | - if(!Context::get('is_logged')) $this->grant->list = $this->grant->write_document = $this->grant->write_comment = $this->grant->view = false; |
|
70 | + if(!Context::get('is_logged')) { |
|
71 | + $this->grant->list = $this->grant->write_document = $this->grant->write_comment = $this->grant->view = false; |
|
72 | + } |
|
62 | 73 | } else { |
63 | 74 | $this->consultation = false; |
64 | 75 | } |
@@ -25,21 +25,21 @@ discard block |
||
25 | 25 | |
26 | 26 | // get the list config value, if it is not exitsted then setup the default value |
27 | 27 | $list_config = $oModuleModel->getModulePartConfig('board', $module_srl); |
28 | - if(!$list_config || count($list_config) <= 0) |
|
28 | + if (!$list_config || count($list_config) <= 0) |
|
29 | 29 | { |
30 | - $list_config = array( 'no', 'title', 'nick_name','regdate','readed_count'); |
|
30 | + $list_config = array('no', 'title', 'nick_name', 'regdate', 'readed_count'); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | // get the extra variables |
34 | 34 | $inserted_extra_vars = $oDocumentModel->getExtraKeys($module_srl); |
35 | 35 | |
36 | - foreach($list_config as $key) |
|
36 | + foreach ($list_config as $key) |
|
37 | 37 | { |
38 | - if(preg_match('/^([0-9]+)$/',$key)) |
|
38 | + if (preg_match('/^([0-9]+)$/', $key)) |
|
39 | 39 | { |
40 | - if($inserted_extra_vars[$key]) |
|
40 | + if ($inserted_extra_vars[$key]) |
|
41 | 41 | { |
42 | - $output['extra_vars'.$key] = $inserted_extra_vars[$key]; |
|
42 | + $output['extra_vars' . $key] = $inserted_extra_vars[$key]; |
|
43 | 43 | } |
44 | 44 | else |
45 | 45 | { |
@@ -60,9 +60,9 @@ discard block |
||
60 | 60 | function getDefaultListConfig($module_srl) |
61 | 61 | { |
62 | 62 | // add virtual srl, title, registered date, update date, nickname, ID, name, readed count, voted count etc. |
63 | - $virtual_vars = array( 'no', 'title', 'regdate', 'last_update', 'last_post', 'nick_name', |
|
63 | + $virtual_vars = array('no', 'title', 'regdate', 'last_update', 'last_post', 'nick_name', |
|
64 | 64 | 'user_id', 'user_name', 'readed_count', 'voted_count', 'blamed_count', 'thumbnail', 'summary', 'comment_status'); |
65 | - foreach($virtual_vars as $key) |
|
65 | + foreach ($virtual_vars as $key) |
|
66 | 66 | { |
67 | 67 | $extra_vars[$key] = new ExtraItem($module_srl, -1, Context::getLang($key), $key, 'N', 'N', 'N', null); |
68 | 68 | } |
@@ -71,11 +71,11 @@ discard block |
||
71 | 71 | $oDocumentModel = getModel('document'); |
72 | 72 | $inserted_extra_vars = $oDocumentModel->getExtraKeys($module_srl); |
73 | 73 | |
74 | - if(count($inserted_extra_vars)) |
|
74 | + if (count($inserted_extra_vars)) |
|
75 | 75 | { |
76 | - foreach($inserted_extra_vars as $obj) |
|
76 | + foreach ($inserted_extra_vars as $obj) |
|
77 | 77 | { |
78 | - $extra_vars['extra_vars'.$obj->idx] = $obj; |
|
78 | + $extra_vars['extra_vars' . $obj->idx] = $obj; |
|
79 | 79 | } |
80 | 80 | } |
81 | 81 |
@@ -40,13 +40,11 @@ |
||
40 | 40 | if($inserted_extra_vars[$key]) |
41 | 41 | { |
42 | 42 | $output['extra_vars'.$key] = $inserted_extra_vars[$key]; |
43 | - } |
|
44 | - else |
|
43 | + } else |
|
45 | 44 | { |
46 | 45 | continue; |
47 | 46 | } |
48 | - } |
|
49 | - else |
|
47 | + } else |
|
50 | 48 | { |
51 | 49 | $output[$key] = new ExtraItem($module_srl, -1, Context::getLang($key), $key, 'N', 'N', 'N', null); |
52 | 50 | } |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | function procWAP(&$oMobile) |
16 | 16 | { |
17 | 17 | // check grant |
18 | - if(!$this->grant->list || $this->module_info->consultation == 'Y') |
|
18 | + if (!$this->grant->list || $this->module_info->consultation == 'Y') |
|
19 | 19 | { |
20 | 20 | return $oMobile->setContent(Context::getLang('msg_not_permitted')); |
21 | 21 | } |
@@ -25,13 +25,13 @@ discard block |
||
25 | 25 | |
26 | 26 | // if the doument is existed |
27 | 27 | $document_srl = Context::get('document_srl'); |
28 | - if($document_srl) |
|
28 | + if ($document_srl) |
|
29 | 29 | { |
30 | 30 | $oDocument = $oDocumentModel->getDocument($document_srl); |
31 | - if($oDocument->isExists()) |
|
31 | + if ($oDocument->isExists()) |
|
32 | 32 | { |
33 | 33 | // check the grant |
34 | - if(!$this->grant->view) |
|
34 | + if (!$this->grant->view) |
|
35 | 35 | { |
36 | 36 | return $oMobile->setContent(Context::getLang('msg_not_permitted')); |
37 | 37 | } |
@@ -40,48 +40,48 @@ discard block |
||
40 | 40 | Context::setBrowserTitle($oDocument->getTitleText()); |
41 | 41 | |
42 | 42 | // if the act is display comment list |
43 | - if($this->act=='dispBoardContentCommentList') |
|
43 | + if ($this->act == 'dispBoardContentCommentList') |
|
44 | 44 | { |
45 | 45 | |
46 | 46 | $oCommentModel = getModel('comment'); |
47 | 47 | $output = $oCommentModel->getCommentList($oDocument->document_srl, 0, false, $oDocument->getCommentCount()); |
48 | 48 | |
49 | 49 | $content = ''; |
50 | - if(count($output->data)) |
|
50 | + if (count($output->data)) |
|
51 | 51 | { |
52 | - foreach($output->data as $key => $val) |
|
52 | + foreach ($output->data as $key => $val) |
|
53 | 53 | { |
54 | 54 | $oComment = new commentItem(); |
55 | 55 | $oComment->setAttribute($val); |
56 | 56 | |
57 | - if(!$oComment->isAccessible()) continue; |
|
57 | + if (!$oComment->isAccessible()) continue; |
|
58 | 58 | |
59 | - $content .= "<b>".$oComment->getNickName()."</b> (".$oComment->getRegdate("Y-m-d").")<br>\r\n".$oComment->getContent(false,false)."<br>\r\n"; |
|
59 | + $content .= "<b>" . $oComment->getNickName() . "</b> (" . $oComment->getRegdate("Y-m-d") . ")<br>\r\n" . $oComment->getContent(false, false) . "<br>\r\n"; |
|
60 | 60 | } |
61 | 61 | } |
62 | 62 | |
63 | 63 | // setup mobile contents |
64 | - $oMobile->setContent( $content ); |
|
64 | + $oMobile->setContent($content); |
|
65 | 65 | |
66 | 66 | // setup upper URL |
67 | - $oMobile->setUpperUrl( getUrl('act',''), Context::getLang('cmd_go_upper') ); |
|
67 | + $oMobile->setUpperUrl(getUrl('act', ''), Context::getLang('cmd_go_upper')); |
|
68 | 68 | |
69 | 69 | // display the document if the act is not display the comment list |
70 | 70 | } else { |
71 | 71 | |
72 | 72 | // setup contents (strip all html tags) |
73 | - $content = strip_tags(str_replace('<p>','<br> ',$oDocument->getContent(false,false,false)),'<br><b><i><u><em><small><strong><big>'); |
|
73 | + $content = strip_tags(str_replace('<p>', '<br> ', $oDocument->getContent(false, false, false)), '<br><b><i><u><em><small><strong><big>'); |
|
74 | 74 | |
75 | 75 | |
76 | 76 | // setup content information(include the comments link) |
77 | - $content = Context::getLang('replies').' : <a href="'.getUrl('act','dispBoardContentCommentList').'">'.$oDocument->getCommentCount().'</a><br>'."\r\n".$content; |
|
78 | - $content = '<b>'.$oDocument->getNickName().'</b> ('.$oDocument->getRegdate("Y-m-d").")<br>\r\n".$content; |
|
77 | + $content = Context::getLang('replies') . ' : <a href="' . getUrl('act', 'dispBoardContentCommentList') . '">' . $oDocument->getCommentCount() . '</a><br>' . "\r\n" . $content; |
|
78 | + $content = '<b>' . $oDocument->getNickName() . '</b> (' . $oDocument->getRegdate("Y-m-d") . ")<br>\r\n" . $content; |
|
79 | 79 | |
80 | 80 | // setup mobile contents |
81 | - $oMobile->setContent( $content ); |
|
81 | + $oMobile->setContent($content); |
|
82 | 82 | |
83 | 83 | // setup upper URL |
84 | - $oMobile->setUpperUrl( getUrl('document_srl',''), Context::getLang('cmd_list') ); |
|
84 | + $oMobile->setUpperUrl(getUrl('document_srl', ''), Context::getLang('cmd_list')); |
|
85 | 85 | |
86 | 86 | } |
87 | 87 | |
@@ -92,44 +92,44 @@ discard block |
||
92 | 92 | // board index |
93 | 93 | $args = new stdClass; |
94 | 94 | $args->module_srl = $this->module_srl; |
95 | - $args->page = Context::get('page');; |
|
95 | + $args->page = Context::get('page'); ; |
|
96 | 96 | $args->list_count = 9; |
97 | - $args->sort_index = $this->module_info->order_target?$this->module_info->order_target:'list_order'; |
|
98 | - $args->order_type = $this->module_info->order_type?$this->module_info->order_type:'asc'; |
|
97 | + $args->sort_index = $this->module_info->order_target ? $this->module_info->order_target : 'list_order'; |
|
98 | + $args->order_type = $this->module_info->order_type ? $this->module_info->order_type : 'asc'; |
|
99 | 99 | $output = $oDocumentModel->getDocumentList($args, $this->except_notice); |
100 | 100 | $document_list = $output->data; |
101 | 101 | $page_navigation = $output->page_navigation; |
102 | 102 | |
103 | 103 | $childs = array(); |
104 | - if($document_list && count($document_list)) |
|
104 | + if ($document_list && count($document_list)) |
|
105 | 105 | { |
106 | - foreach($document_list as $key => $val) |
|
106 | + foreach ($document_list as $key => $val) |
|
107 | 107 | { |
108 | - $href = getUrl('mid',$_GET['mid'],'document_srl',$val->document_srl); |
|
108 | + $href = getUrl('mid', $_GET['mid'], 'document_srl', $val->document_srl); |
|
109 | 109 | $obj = null; |
110 | 110 | $obj['href'] = $val->getPermanentUrl(); |
111 | 111 | |
112 | 112 | $title = htmlspecialchars($val->getTitleText()); |
113 | - if($val->getCommentCount()) $title .= ' ['.$val->getCommentCount().']'; |
|
114 | - $obj['link'] = $obj['text'] = '['.$val->getNickName().'] '.$title; |
|
113 | + if ($val->getCommentCount()) $title .= ' [' . $val->getCommentCount() . ']'; |
|
114 | + $obj['link'] = $obj['text'] = '[' . $val->getNickName() . '] ' . $title; |
|
115 | 115 | $childs[] = $obj; |
116 | 116 | } |
117 | 117 | $oMobile->setChilds($childs); |
118 | 118 | } |
119 | 119 | |
120 | 120 | $totalPage = $page_navigation->last_page; |
121 | - $page = (int)Context::get('page'); |
|
122 | - if(!$page) $page = 1; |
|
121 | + $page = (int) Context::get('page'); |
|
122 | + if (!$page) $page = 1; |
|
123 | 123 | |
124 | 124 | // next/prevUrl specification |
125 | - if($page > 1) |
|
125 | + if ($page > 1) |
|
126 | 126 | { |
127 | - $oMobile->setPrevUrl(getUrl('mid',$_GET['mid'],'page',$page-1), sprintf('%s (%d/%d)', Context::getLang('cmd_prev'), $page-1, $totalPage)); |
|
127 | + $oMobile->setPrevUrl(getUrl('mid', $_GET['mid'], 'page', $page - 1), sprintf('%s (%d/%d)', Context::getLang('cmd_prev'), $page - 1, $totalPage)); |
|
128 | 128 | } |
129 | 129 | |
130 | - if($page < $totalPage) |
|
130 | + if ($page < $totalPage) |
|
131 | 131 | { |
132 | - $oMobile->setNextUrl(getUrl('mid',$_GET['mid'],'page',$page+1), sprintf('%s (%d/%d)', Context::getLang('cmd_next'), $page+1, $totalPage)); |
|
132 | + $oMobile->setNextUrl(getUrl('mid', $_GET['mid'], 'page', $page + 1), sprintf('%s (%d/%d)', Context::getLang('cmd_next'), $page + 1, $totalPage)); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | $oMobile->mobilePage = $page; |
@@ -54,7 +54,9 @@ discard block |
||
54 | 54 | $oComment = new commentItem(); |
55 | 55 | $oComment->setAttribute($val); |
56 | 56 | |
57 | - if(!$oComment->isAccessible()) continue; |
|
57 | + if(!$oComment->isAccessible()) { |
|
58 | + continue; |
|
59 | + } |
|
58 | 60 | |
59 | 61 | $content .= "<b>".$oComment->getNickName()."</b> (".$oComment->getRegdate("Y-m-d").")<br>\r\n".$oComment->getContent(false,false)."<br>\r\n"; |
60 | 62 | } |
@@ -110,7 +112,9 @@ discard block |
||
110 | 112 | $obj['href'] = $val->getPermanentUrl(); |
111 | 113 | |
112 | 114 | $title = htmlspecialchars($val->getTitleText()); |
113 | - if($val->getCommentCount()) $title .= ' ['.$val->getCommentCount().']'; |
|
115 | + if($val->getCommentCount()) { |
|
116 | + $title .= ' ['.$val->getCommentCount().']'; |
|
117 | + } |
|
114 | 118 | $obj['link'] = $obj['text'] = '['.$val->getNickName().'] '.$title; |
115 | 119 | $childs[] = $obj; |
116 | 120 | } |
@@ -119,7 +123,9 @@ discard block |
||
119 | 123 | |
120 | 124 | $totalPage = $page_navigation->last_page; |
121 | 125 | $page = (int)Context::get('page'); |
122 | - if(!$page) $page = 1; |
|
126 | + if(!$page) { |
|
127 | + $page = 1; |
|
128 | + } |
|
123 | 129 | |
124 | 130 | // next/prevUrl specification |
125 | 131 | if($page > 1) |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | // get a list by using comment->getCommentList. |
53 | 53 | $oCommentModel = getModel('comment'); |
54 | 54 | $secretNameList = $oCommentModel->getSecretNameList(); |
55 | - $columnList = array('comment_srl', 'document_srl','module_srl','is_secret', 'status', 'content', 'comments.member_srl', 'comments.nick_name', 'comments.regdate', 'ipaddress', 'voted_count', 'blamed_count'); |
|
55 | + $columnList = array('comment_srl', 'document_srl', 'module_srl', 'is_secret', 'status', 'content', 'comments.member_srl', 'comments.nick_name', 'comments.regdate', 'ipaddress', 'voted_count', 'blamed_count'); |
|
56 | 56 | $output = $oCommentModel->getTotalCommentList($args, $columnList); |
57 | 57 | |
58 | 58 | // $modules = $oCommentModel->getDistinctModules(); |
@@ -70,20 +70,20 @@ discard block |
||
70 | 70 | $oModuleModel = getModel('module'); |
71 | 71 | $module_list = array(); |
72 | 72 | $mod_srls = array(); |
73 | - foreach($output->data as $val) |
|
73 | + foreach ($output->data as $val) |
|
74 | 74 | { |
75 | 75 | $mod_srls[] = $val->module_srl; |
76 | 76 | } |
77 | 77 | $mod_srls = array_unique($mod_srls); |
78 | 78 | // Module List |
79 | 79 | $mod_srls_count = count($mod_srls); |
80 | - if($mod_srls_count) |
|
80 | + if ($mod_srls_count) |
|
81 | 81 | { |
82 | 82 | $columnList = array('module_srl', 'mid', 'browser_title'); |
83 | 83 | $module_output = $oModuleModel->getModulesInfo($mod_srls, $columnList); |
84 | - if($module_output && is_array($module_output)) |
|
84 | + if ($module_output && is_array($module_output)) |
|
85 | 85 | { |
86 | - foreach($module_output as $module) |
|
86 | + foreach ($module_output as $module) |
|
87 | 87 | { |
88 | 88 | $module_list[$module->module_srl] = $module; |
89 | 89 | } |
@@ -114,11 +114,11 @@ discard block |
||
114 | 114 | $declared_output = executeQuery('comment.getDeclaredList', $args); |
115 | 115 | $oCommentModel = getModel('comment'); |
116 | 116 | |
117 | - if($declared_output->data && count($declared_output->data)) |
|
117 | + if ($declared_output->data && count($declared_output->data)) |
|
118 | 118 | { |
119 | 119 | $comment_list = array(); |
120 | 120 | |
121 | - foreach($declared_output->data as $key => $comment) |
|
121 | + foreach ($declared_output->data as $key => $comment) |
|
122 | 122 | { |
123 | 123 | $comment_list[$key] = new commentItem(); |
124 | 124 | $comment_list[$key]->setAttribute($comment); |
@@ -48,55 +48,55 @@ discard block |
||
48 | 48 | $oDB = DB::getInstance(); |
49 | 49 | $oModuleModel = getModel('module'); |
50 | 50 | // 2007. 10. 17 add a trigger to delete comments together with posting deleted |
51 | - if(!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after')) |
|
51 | + if (!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after')) |
|
52 | 52 | { |
53 | 53 | return TRUE; |
54 | 54 | } |
55 | 55 | // 2007. 10. 17 add a trigger to delete all of comments together with module deleted |
56 | - if(!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after')) |
|
56 | + if (!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after')) |
|
57 | 57 | { |
58 | 58 | return TRUE; |
59 | 59 | } |
60 | 60 | // 2007. 10. 23 add a column for recommendation votes or notification of the comments |
61 | - if(!$oDB->isColumnExists("comments", "voted_count")) |
|
61 | + if (!$oDB->isColumnExists("comments", "voted_count")) |
|
62 | 62 | { |
63 | 63 | return TRUE; |
64 | 64 | } |
65 | - if(!$oDB->isColumnExists("comments", "notify_message")) |
|
65 | + if (!$oDB->isColumnExists("comments", "notify_message")) |
|
66 | 66 | { |
67 | 67 | return TRUE; |
68 | 68 | } |
69 | 69 | // 2008. 02. 22 add comment setting when a new module added |
70 | - if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before')) |
|
70 | + if (!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before')) |
|
71 | 71 | { |
72 | 72 | return TRUE; |
73 | 73 | } |
74 | 74 | // 2008. 05. 14 add a column for blamed count |
75 | - if(!$oDB->isColumnExists("comments", "blamed_count")) |
|
75 | + if (!$oDB->isColumnExists("comments", "blamed_count")) |
|
76 | 76 | { |
77 | 77 | return TRUE; |
78 | 78 | } |
79 | - if(!$oDB->isColumnExists("comment_voted_log", "point")) |
|
79 | + if (!$oDB->isColumnExists("comment_voted_log", "point")) |
|
80 | 80 | { |
81 | 81 | return TRUE; |
82 | 82 | } |
83 | 83 | |
84 | - if(!$oDB->isIndexExists("comments", "idx_module_list_order")) |
|
84 | + if (!$oDB->isIndexExists("comments", "idx_module_list_order")) |
|
85 | 85 | { |
86 | 86 | return TRUE; |
87 | 87 | } |
88 | 88 | //2012. 02. 24 add comment published status column and index |
89 | - if(!$oDB->isColumnExists("comments", "status")) |
|
89 | + if (!$oDB->isColumnExists("comments", "status")) |
|
90 | 90 | { |
91 | 91 | return TRUE; |
92 | 92 | } |
93 | - if(!$oDB->isIndexExists("comments", "idx_status")) |
|
93 | + if (!$oDB->isIndexExists("comments", "idx_status")) |
|
94 | 94 | { |
95 | 95 | return TRUE; |
96 | 96 | } |
97 | 97 | |
98 | 98 | // 2012. 08. 29 Add a trigger to copy additional setting when the module is copied |
99 | - if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after')) |
|
99 | + if (!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after')) |
|
100 | 100 | { |
101 | 101 | return TRUE; |
102 | 102 | } |
@@ -114,43 +114,43 @@ discard block |
||
114 | 114 | $oModuleModel = getModel('module'); |
115 | 115 | $oModuleController = getController('module'); |
116 | 116 | // 2007. 10. 17 add a trigger to delete comments together with posting deleted |
117 | - if(!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after')) |
|
117 | + if (!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after')) |
|
118 | 118 | { |
119 | 119 | $oModuleController->insertTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after'); |
120 | 120 | } |
121 | 121 | // 2007. 10. 17 add a trigger to delete all of comments together with module deleted |
122 | - if(!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after')) |
|
122 | + if (!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after')) |
|
123 | 123 | { |
124 | 124 | $oModuleController->insertTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after'); |
125 | 125 | } |
126 | 126 | // 2007. 10. 23 add a column for recommendation votes or notification of the comments |
127 | - if(!$oDB->isColumnExists("comments", "voted_count")) |
|
127 | + if (!$oDB->isColumnExists("comments", "voted_count")) |
|
128 | 128 | { |
129 | 129 | $oDB->addColumn("comments", "voted_count", "number", "11"); |
130 | 130 | $oDB->addIndex("comments", "idx_voted_count", array("voted_count")); |
131 | 131 | } |
132 | 132 | |
133 | - if(!$oDB->isColumnExists("comments", "notify_message")) |
|
133 | + if (!$oDB->isColumnExists("comments", "notify_message")) |
|
134 | 134 | { |
135 | 135 | $oDB->addColumn("comments", "notify_message", "char", "1"); |
136 | 136 | } |
137 | 137 | // 2008. 02. 22 add comment setting when a new module added |
138 | - if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before')) |
|
138 | + if (!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before')) |
|
139 | 139 | { |
140 | 140 | $oModuleController->insertTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before'); |
141 | 141 | } |
142 | 142 | // 2008. 05. 14 add a column for blamed count |
143 | - if(!$oDB->isColumnExists("comments", "blamed_count")) |
|
143 | + if (!$oDB->isColumnExists("comments", "blamed_count")) |
|
144 | 144 | { |
145 | 145 | $oDB->addColumn('comments', 'blamed_count', 'number', 11, 0, TRUE); |
146 | 146 | $oDB->addIndex('comments', 'idx_blamed_count', array('blamed_count')); |
147 | 147 | } |
148 | - if(!$oDB->isColumnExists("comment_voted_log", "point")) |
|
148 | + if (!$oDB->isColumnExists("comment_voted_log", "point")) |
|
149 | 149 | { |
150 | 150 | $oDB->addColumn('comment_voted_log', 'point', 'number', 11, 0, TRUE); |
151 | 151 | } |
152 | 152 | |
153 | - if(!$oDB->isIndexExists("comments", "idx_module_list_order")) |
|
153 | + if (!$oDB->isIndexExists("comments", "idx_module_list_order")) |
|
154 | 154 | { |
155 | 155 | $oDB->addIndex( |
156 | 156 | "comments", "idx_module_list_order", array("module_srl", "list_order"), TRUE |
@@ -158,11 +158,11 @@ discard block |
||
158 | 158 | } |
159 | 159 | |
160 | 160 | //2012. 02. 24 add comment published status column and index |
161 | - if(!$oDB->isColumnExists("comments", "status")) |
|
161 | + if (!$oDB->isColumnExists("comments", "status")) |
|
162 | 162 | { |
163 | 163 | $oDB->addColumn("comments", "status", "number", 1, 1, TRUE); |
164 | 164 | } |
165 | - if(!$oDB->isIndexExists("comments", "idx_status")) |
|
165 | + if (!$oDB->isIndexExists("comments", "idx_status")) |
|
166 | 166 | { |
167 | 167 | $oDB->addIndex( |
168 | 168 | "comments", "idx_status", array("status", "comment_srl", "module_srl", "document_srl"), TRUE |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | } |
171 | 171 | |
172 | 172 | // 2012. 08. 29 Add a trigger to copy additional setting when the module is copied |
173 | - if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after')) |
|
173 | + if (!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after')) |
|
174 | 174 | { |
175 | 175 | $oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after'); |
176 | 176 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | function _loadFromDB() |
51 | 51 | { |
52 | - if(!$this->comment_srl) |
|
52 | + if (!$this->comment_srl) |
|
53 | 53 | { |
54 | 54 | return; |
55 | 55 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | */ |
68 | 68 | function setAttribute($attribute) |
69 | 69 | { |
70 | - if(!$attribute->comment_srl) |
|
70 | + if (!$attribute->comment_srl) |
|
71 | 71 | { |
72 | 72 | $this->comment_srl = NULL; |
73 | 73 | return; |
@@ -77,9 +77,9 @@ discard block |
||
77 | 77 | $this->adds($attribute); |
78 | 78 | |
79 | 79 | // define vars on the object for backward compatibility of skins |
80 | - if(count($attribute)) |
|
80 | + if (count($attribute)) |
|
81 | 81 | { |
82 | - foreach($attribute as $key => $val) |
|
82 | + foreach ($attribute as $key => $val) |
|
83 | 83 | { |
84 | 84 | $this->{$key} = $val; |
85 | 85 | } |
@@ -93,29 +93,29 @@ discard block |
||
93 | 93 | |
94 | 94 | function isGranted() |
95 | 95 | { |
96 | - if($_SESSION['own_comment'][$this->comment_srl]) |
|
96 | + if ($_SESSION['own_comment'][$this->comment_srl]) |
|
97 | 97 | { |
98 | 98 | return TRUE; |
99 | 99 | } |
100 | 100 | |
101 | - if(!Context::get('is_logged')) |
|
101 | + if (!Context::get('is_logged')) |
|
102 | 102 | { |
103 | 103 | return FALSE; |
104 | 104 | } |
105 | 105 | |
106 | 106 | $logged_info = Context::get('logged_info'); |
107 | - if($logged_info->is_admin == 'Y') |
|
107 | + if ($logged_info->is_admin == 'Y') |
|
108 | 108 | { |
109 | 109 | return TRUE; |
110 | 110 | } |
111 | 111 | |
112 | 112 | $grant = Context::get('grant'); |
113 | - if($grant->manager) |
|
113 | + if ($grant->manager) |
|
114 | 114 | { |
115 | 115 | return TRUE; |
116 | 116 | } |
117 | 117 | |
118 | - if($this->get('member_srl') && ($this->get('member_srl') == $logged_info->member_srl || $this->get('member_srl') * -1 == $logged_info->member_srl)) |
|
118 | + if ($this->get('member_srl') && ($this->get('member_srl') == $logged_info->member_srl || $this->get('member_srl') * -1 == $logged_info->member_srl)) |
|
119 | 119 | { |
120 | 120 | return TRUE; |
121 | 121 | } |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | |
137 | 137 | function isEditable() |
138 | 138 | { |
139 | - if($this->isGranted() || !$this->get('member_srl')) |
|
139 | + if ($this->isGranted() || !$this->get('member_srl')) |
|
140 | 140 | { |
141 | 141 | return TRUE; |
142 | 142 | } |
@@ -150,12 +150,12 @@ discard block |
||
150 | 150 | |
151 | 151 | function isAccessible() |
152 | 152 | { |
153 | - if($_SESSION['accessibled_comment'][$this->comment_srl]) |
|
153 | + if ($_SESSION['accessibled_comment'][$this->comment_srl]) |
|
154 | 154 | { |
155 | 155 | return TRUE; |
156 | 156 | } |
157 | 157 | |
158 | - if($this->isGranted() || !$this->isSecret()) |
|
158 | + if ($this->isGranted() || !$this->isSecret()) |
|
159 | 159 | { |
160 | 160 | $this->setAccessible(); |
161 | 161 | return TRUE; |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | |
164 | 164 | $oDocumentModel = getModel('document'); |
165 | 165 | $oDocument = $oDocumentModel->getDocument($this->get('document_srl')); |
166 | - if($oDocument->isGranted()) |
|
166 | + if ($oDocument->isGranted()) |
|
167 | 167 | { |
168 | 168 | $this->setAccessible(); |
169 | 169 | return TRUE; |
@@ -184,20 +184,20 @@ discard block |
||
184 | 184 | function notify($type, $content) |
185 | 185 | { |
186 | 186 | // return if not useNotify |
187 | - if(!$this->useNotify()) |
|
187 | + if (!$this->useNotify()) |
|
188 | 188 | { |
189 | 189 | return; |
190 | 190 | } |
191 | 191 | |
192 | 192 | // pass if the author is not logged-in user |
193 | - if(!$this->get('member_srl')) |
|
193 | + if (!$this->get('member_srl')) |
|
194 | 194 | { |
195 | 195 | return; |
196 | 196 | } |
197 | 197 | |
198 | 198 | // return if the currently logged-in user is an author of the comment. |
199 | 199 | $logged_info = Context::get('logged_info'); |
200 | - if($logged_info->member_srl == $this->get('member_srl')) |
|
200 | + if ($logged_info->member_srl == $this->get('member_srl')) |
|
201 | 201 | { |
202 | 202 | return; |
203 | 203 | } |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | $oDocument = $oDocumentModel->getDocument($this->get('document_srl')); |
208 | 208 | |
209 | 209 | // Variables |
210 | - if($type) |
|
210 | + if ($type) |
|
211 | 211 | { |
212 | 212 | $title = "[" . $type . "] "; |
213 | 213 | } |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | |
225 | 225 | function getIpAddress() |
226 | 226 | { |
227 | - if($this->isGranted()) |
|
227 | + if ($this->isGranted()) |
|
228 | 228 | { |
229 | 229 | return $this->get('ipaddress'); |
230 | 230 | } |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | |
235 | 235 | function isExistsHomepage() |
236 | 236 | { |
237 | - if(trim($this->get('homepage'))) |
|
237 | + if (trim($this->get('homepage'))) |
|
238 | 238 | { |
239 | 239 | return TRUE; |
240 | 240 | } |
@@ -245,12 +245,12 @@ discard block |
||
245 | 245 | function getHomepageUrl() |
246 | 246 | { |
247 | 247 | $url = trim($this->get('homepage')); |
248 | - if(!$url) |
|
248 | + if (!$url) |
|
249 | 249 | { |
250 | 250 | return; |
251 | 251 | } |
252 | 252 | |
253 | - if(strncasecmp('http://', $url, 7) !== 0) |
|
253 | + if (strncasecmp('http://', $url, 7) !== 0) |
|
254 | 254 | { |
255 | 255 | $url = "http://" . $url; |
256 | 256 | } |
@@ -284,14 +284,14 @@ discard block |
||
284 | 284 | */ |
285 | 285 | function getContentText($strlen = 0) |
286 | 286 | { |
287 | - if($this->isSecret() && !$this->isAccessible()) |
|
287 | + if ($this->isSecret() && !$this->isAccessible()) |
|
288 | 288 | { |
289 | 289 | return Context::getLang('msg_is_secret'); |
290 | 290 | } |
291 | 291 | |
292 | 292 | $content = $this->get('content'); |
293 | 293 | |
294 | - if($strlen) |
|
294 | + if ($strlen) |
|
295 | 295 | { |
296 | 296 | return cut_str(strip_tags($content), $strlen, '...'); |
297 | 297 | } |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | */ |
306 | 306 | function getContent($add_popup_menu = TRUE, $add_content_info = TRUE, $add_xe_content_class = TRUE) |
307 | 307 | { |
308 | - if($this->isSecret() && !$this->isAccessible()) |
|
308 | + if ($this->isSecret() && !$this->isAccessible()) |
|
309 | 309 | { |
310 | 310 | return Context::getLang('msg_is_secret'); |
311 | 311 | } |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | stripEmbedTagForAdmin($content, $this->get('member_srl')); |
315 | 315 | |
316 | 316 | // when displaying the comment on the pop-up menu |
317 | - if($add_popup_menu && Context::get('is_logged')) |
|
317 | + if ($add_popup_menu && Context::get('is_logged')) |
|
318 | 318 | { |
319 | 319 | $content = sprintf( |
320 | 320 | '%s<div class="comment_popup_menu"><a href="#popup_menu_area" class="comment_%d" onclick="return false">%s</a></div>', $content, $this->comment_srl, Context::getLang('cmd_comment_do') |
@@ -322,10 +322,10 @@ discard block |
||
322 | 322 | } |
323 | 323 | |
324 | 324 | // if additional information which can access contents is set |
325 | - if($add_content_info) |
|
325 | + if ($add_content_info) |
|
326 | 326 | { |
327 | 327 | $memberSrl = $this->get('member_srl'); |
328 | - if($memberSrl < 0) |
|
328 | + if ($memberSrl < 0) |
|
329 | 329 | { |
330 | 330 | $memberSrl = 0; |
331 | 331 | } |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | } |
337 | 337 | else |
338 | 338 | { |
339 | - if($add_xe_content_class) |
|
339 | + if ($add_xe_content_class) |
|
340 | 340 | { |
341 | 341 | $content = sprintf('<div class="xe_content">%s</div>', $content); |
342 | 342 | } |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | |
428 | 428 | function hasUploadedFiles() |
429 | 429 | { |
430 | - if(($this->isSecret() && !$this->isAccessible()) && !$this->isGranted()) |
|
430 | + if (($this->isSecret() && !$this->isAccessible()) && !$this->isGranted()) |
|
431 | 431 | { |
432 | 432 | return FALSE; |
433 | 433 | } |
@@ -436,12 +436,12 @@ discard block |
||
436 | 436 | |
437 | 437 | function getUploadedFiles() |
438 | 438 | { |
439 | - if(($this->isSecret() && !$this->isAccessible()) && !$this->isGranted()) |
|
439 | + if (($this->isSecret() && !$this->isAccessible()) && !$this->isGranted()) |
|
440 | 440 | { |
441 | 441 | return; |
442 | 442 | } |
443 | 443 | |
444 | - if(!$this->get('uploaded_count')) |
|
444 | + if (!$this->get('uploaded_count')) |
|
445 | 445 | { |
446 | 446 | return; |
447 | 447 | } |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | function getEditor() |
459 | 459 | { |
460 | 460 | $module_srl = $this->get('module_srl'); |
461 | - if(!$module_srl) |
|
461 | + if (!$module_srl) |
|
462 | 462 | { |
463 | 463 | $module_srl = Context::get('module_srl'); |
464 | 464 | } |
@@ -472,13 +472,13 @@ discard block |
||
472 | 472 | */ |
473 | 473 | function getProfileImage() |
474 | 474 | { |
475 | - if(!$this->isExists() || !$this->get('member_srl')) |
|
475 | + if (!$this->isExists() || !$this->get('member_srl')) |
|
476 | 476 | { |
477 | 477 | return; |
478 | 478 | } |
479 | 479 | $oMemberModel = getModel('member'); |
480 | 480 | $profile_info = $oMemberModel->getProfileImage($this->get('member_srl')); |
481 | - if(!$profile_info) |
|
481 | + if (!$profile_info) |
|
482 | 482 | { |
483 | 483 | return; |
484 | 484 | } |
@@ -493,7 +493,7 @@ discard block |
||
493 | 493 | function getSignature() |
494 | 494 | { |
495 | 495 | // pass if the posting not exists. |
496 | - if(!$this->isExists() || !$this->get('member_srl')) |
|
496 | + if (!$this->isExists() || !$this->get('member_srl')) |
|
497 | 497 | { |
498 | 498 | return; |
499 | 499 | } |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | $signature = $oMemberModel->getSignature($this->get('member_srl')); |
504 | 504 | |
505 | 505 | // check if max height of the signiture is specified on the member module |
506 | - if(!isset($GLOBALS['__member_signature_max_height'])) |
|
506 | + if (!isset($GLOBALS['__member_signature_max_height'])) |
|
507 | 507 | { |
508 | 508 | $oModuleModel = getModel('module'); |
509 | 509 | $member_config = $oModuleModel->getModuleConfig('member'); |
@@ -512,7 +512,7 @@ discard block |
||
512 | 512 | |
513 | 513 | $max_signature_height = $GLOBALS['__member_signature_max_height']; |
514 | 514 | |
515 | - if($max_signature_height) |
|
515 | + if ($max_signature_height) |
|
516 | 516 | { |
517 | 517 | $signature = sprintf('<div style="max-height:%dpx;overflow:auto;overflow-x:hidden;height:expression(this.scrollHeight > %d ? \'%dpx\': \'auto\')">%s</div>', $max_signature_height, $max_signature_height, $max_signature_height, $signature); |
518 | 518 | } |
@@ -522,12 +522,12 @@ discard block |
||
522 | 522 | |
523 | 523 | function thumbnailExists($width = 80, $height = 0, $type = '') |
524 | 524 | { |
525 | - if(!$this->comment_srl) |
|
525 | + if (!$this->comment_srl) |
|
526 | 526 | { |
527 | 527 | return FALSE; |
528 | 528 | } |
529 | 529 | |
530 | - if(!$this->getThumbnail($width, $height, $type)) |
|
530 | + if (!$this->getThumbnail($width, $height, $type)) |
|
531 | 531 | { |
532 | 532 | return FALSE; |
533 | 533 | } |
@@ -538,30 +538,30 @@ discard block |
||
538 | 538 | function getThumbnail($width = 80, $height = 0, $thumbnail_type = '') |
539 | 539 | { |
540 | 540 | // return false if no doc exists |
541 | - if(!$this->comment_srl) |
|
541 | + if (!$this->comment_srl) |
|
542 | 542 | { |
543 | 543 | return; |
544 | 544 | } |
545 | 545 | |
546 | - if($this->isSecret() && !$this->isGranted()) |
|
546 | + if ($this->isSecret() && !$this->isGranted()) |
|
547 | 547 | { |
548 | 548 | return; |
549 | 549 | } |
550 | 550 | |
551 | 551 | // If signiture height setting is omitted, create a square |
552 | - if(!$height) |
|
552 | + if (!$height) |
|
553 | 553 | { |
554 | 554 | $height = $width; |
555 | 555 | } |
556 | 556 | |
557 | 557 | // return false if neigher attached file nor image; |
558 | - if(!$this->hasUploadedFiles() && !preg_match("!<img!is", $this->get('content'))) |
|
558 | + if (!$this->hasUploadedFiles() && !preg_match("!<img!is", $this->get('content'))) |
|
559 | 559 | { |
560 | 560 | return; |
561 | 561 | } |
562 | 562 | |
563 | 563 | // get thumbail generation info on the doc module configuration. |
564 | - if(!in_array($thumbnail_type, array('crop', 'ratio'))) |
|
564 | + if (!in_array($thumbnail_type, array('crop', 'ratio'))) |
|
565 | 565 | { |
566 | 566 | $thumbnail_type = 'crop'; |
567 | 567 | } |
@@ -572,9 +572,9 @@ discard block |
||
572 | 572 | $thumbnail_url = Context::getRequestUri() . $thumbnail_file; |
573 | 573 | |
574 | 574 | // return false if a size of existing thumbnail file is 0. otherwise return the file path |
575 | - if(file_exists($thumbnail_file)) |
|
575 | + if (file_exists($thumbnail_file)) |
|
576 | 576 | { |
577 | - if(filesize($thumbnail_file) < 1) |
|
577 | + if (filesize($thumbnail_file) < 1) |
|
578 | 578 | { |
579 | 579 | return FALSE; |
580 | 580 | } |
@@ -589,40 +589,40 @@ discard block |
||
589 | 589 | $is_tmp_file = FALSE; |
590 | 590 | |
591 | 591 | // find an image file among attached files |
592 | - if($this->hasUploadedFiles()) |
|
592 | + if ($this->hasUploadedFiles()) |
|
593 | 593 | { |
594 | 594 | $file_list = $this->getUploadedFiles(); |
595 | 595 | |
596 | 596 | $first_image = null; |
597 | - foreach($file_list as $file) |
|
597 | + foreach ($file_list as $file) |
|
598 | 598 | { |
599 | - if($file->direct_download !== 'Y') continue; |
|
599 | + if ($file->direct_download !== 'Y') continue; |
|
600 | 600 | |
601 | - if($file->cover_image === 'Y' && file_exists($file->uploaded_filename)) |
|
601 | + if ($file->cover_image === 'Y' && file_exists($file->uploaded_filename)) |
|
602 | 602 | { |
603 | 603 | $source_file = $file->uploaded_filename; |
604 | 604 | break; |
605 | 605 | } |
606 | 606 | |
607 | - if($first_image) continue; |
|
607 | + if ($first_image) continue; |
|
608 | 608 | |
609 | - if(preg_match("/\.(jpe?g|png|gif|bmp)$/i", $file->source_filename)) |
|
609 | + if (preg_match("/\.(jpe?g|png|gif|bmp)$/i", $file->source_filename)) |
|
610 | 610 | { |
611 | - if(file_exists($file->uploaded_filename)) |
|
611 | + if (file_exists($file->uploaded_filename)) |
|
612 | 612 | { |
613 | 613 | $first_image = $file->uploaded_filename; |
614 | 614 | } |
615 | 615 | } |
616 | 616 | } |
617 | 617 | |
618 | - if(!$source_file && $first_image) |
|
618 | + if (!$source_file && $first_image) |
|
619 | 619 | { |
620 | 620 | $source_file = $first_image; |
621 | 621 | } |
622 | 622 | } |
623 | 623 | |
624 | 624 | // get an image file from the doc content if no file attached. |
625 | - if(!$source_file) |
|
625 | + if (!$source_file) |
|
626 | 626 | { |
627 | 627 | $content = $this->get('content'); |
628 | 628 | $target_src = NULL; |
@@ -631,16 +631,16 @@ discard block |
||
631 | 631 | |
632 | 632 | $cnt = count($matches); |
633 | 633 | |
634 | - for($i = 0; $i < $cnt; $i++) |
|
634 | + for ($i = 0; $i < $cnt; $i++) |
|
635 | 635 | { |
636 | 636 | $target_src = $matches[$i][2]; |
637 | - if(preg_match('/\/(common|modules|widgets|addons|layouts)\//i', $target_src)) |
|
637 | + if (preg_match('/\/(common|modules|widgets|addons|layouts)\//i', $target_src)) |
|
638 | 638 | { |
639 | 639 | continue; |
640 | 640 | } |
641 | 641 | else |
642 | 642 | { |
643 | - if(!preg_match('/^(http|https):\/\//i', $target_src)) |
|
643 | + if (!preg_match('/^(http|https):\/\//i', $target_src)) |
|
644 | 644 | { |
645 | 645 | $target_src = Context::getRequestUri() . $target_src; |
646 | 646 | } |
@@ -651,7 +651,7 @@ discard block |
||
651 | 651 | |
652 | 652 | FileHandler::getRemoteFile($target_src, $tmp_file); |
653 | 653 | |
654 | - if(!file_exists($tmp_file)) |
|
654 | + if (!file_exists($tmp_file)) |
|
655 | 655 | { |
656 | 656 | continue; |
657 | 657 | } |
@@ -659,7 +659,7 @@ discard block |
||
659 | 659 | { |
660 | 660 | list($_w, $_h, $_t, $_a) = @getimagesize($tmp_file); |
661 | 661 | |
662 | - if($_w < $width || $_h < $height) |
|
662 | + if ($_w < $width || $_h < $height) |
|
663 | 663 | { |
664 | 664 | continue; |
665 | 665 | } |
@@ -674,13 +674,13 @@ discard block |
||
674 | 674 | |
675 | 675 | $output = FileHandler::createImageFile($source_file, $thumbnail_file, $width, $height, 'jpg', $thumbnail_type); |
676 | 676 | |
677 | - if($is_tmp_file) |
|
677 | + if ($is_tmp_file) |
|
678 | 678 | { |
679 | 679 | FileHandler::removeFile($source_file); |
680 | 680 | } |
681 | 681 | |
682 | 682 | // return the thumbnail path if successfully generated. |
683 | - if($output) |
|
683 | + if ($output) |
|
684 | 684 | { |
685 | 685 | return $thumbnail_url; |
686 | 686 | } |
@@ -333,8 +333,7 @@ discard block |
||
333 | 333 | '<!--BeforeComment(%d,%d)--><div class="comment_%d_%d xe_content">%s</div><!--AfterComment(%d,%d)-->', $this->comment_srl, $memberSrl, $this->comment_srl, $memberSrl, $content, $this->comment_srl, $memberSrl |
334 | 334 | ); |
335 | 335 | // xe_content class name should be specified although content access is not necessary. |
336 | - } |
|
337 | - else |
|
336 | + } else |
|
338 | 337 | { |
339 | 338 | if($add_xe_content_class) |
340 | 339 | { |
@@ -577,8 +576,7 @@ discard block |
||
577 | 576 | if(filesize($thumbnail_file) < 1) |
578 | 577 | { |
579 | 578 | return FALSE; |
580 | - } |
|
581 | - else |
|
579 | + } else |
|
582 | 580 | { |
583 | 581 | return $thumbnail_url; |
584 | 582 | } |
@@ -596,7 +594,9 @@ discard block |
||
596 | 594 | $first_image = null; |
597 | 595 | foreach($file_list as $file) |
598 | 596 | { |
599 | - if($file->direct_download !== 'Y') continue; |
|
597 | + if($file->direct_download !== 'Y') { |
|
598 | + continue; |
|
599 | + } |
|
600 | 600 | |
601 | 601 | if($file->cover_image === 'Y' && file_exists($file->uploaded_filename)) |
602 | 602 | { |
@@ -604,7 +604,9 @@ discard block |
||
604 | 604 | break; |
605 | 605 | } |
606 | 606 | |
607 | - if($first_image) continue; |
|
607 | + if($first_image) { |
|
608 | + continue; |
|
609 | + } |
|
608 | 610 | |
609 | 611 | if(preg_match("/\.(jpe?g|png|gif|bmp)$/i", $file->source_filename)) |
610 | 612 | { |
@@ -637,8 +639,7 @@ discard block |
||
637 | 639 | if(preg_match('/\/(common|modules|widgets|addons|layouts)\//i', $target_src)) |
638 | 640 | { |
639 | 641 | continue; |
640 | - } |
|
641 | - else |
|
642 | + } else |
|
642 | 643 | { |
643 | 644 | if(!preg_match('/^(http|https):\/\//i', $target_src)) |
644 | 645 | { |
@@ -654,8 +655,7 @@ discard block |
||
654 | 655 | if(!file_exists($tmp_file)) |
655 | 656 | { |
656 | 657 | continue; |
657 | - } |
|
658 | - else |
|
658 | + } else |
|
659 | 659 | { |
660 | 660 | list($_w, $_h, $_t, $_a) = @getimagesize($tmp_file); |
661 | 661 |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | $oCommentController = getController('comment'); |
44 | 44 | |
45 | 45 | // feature that only member can do |
46 | - if($logged_info->member_srl) |
|
46 | + if ($logged_info->member_srl) |
|
47 | 47 | { |
48 | 48 | $oCommentModel = getModel('comment'); |
49 | 49 | $columnList = array('comment_srl', 'module_srl', 'member_srl', 'ipaddress'); |
@@ -54,14 +54,14 @@ discard block |
||
54 | 54 | $oModuleModel = getModel('module'); |
55 | 55 | $comment_config = $oModuleModel->getModulePartConfig('document', $module_srl); |
56 | 56 | |
57 | - if($comment_config->use_vote_up != 'N' && $member_srl != $logged_info->member_srl) |
|
57 | + if ($comment_config->use_vote_up != 'N' && $member_srl != $logged_info->member_srl) |
|
58 | 58 | { |
59 | 59 | // Add a vote-up button for positive feedback |
60 | 60 | $url = sprintf("doCallModuleAction('comment','procCommentVoteUp','%s')", $comment_srl); |
61 | 61 | $oCommentController->addCommentPopupMenu($url, 'cmd_vote', '', 'javascript'); |
62 | 62 | } |
63 | 63 | |
64 | - if($comment_config->use_vote_down != 'N' && $member_srl != $logged_info->member_srl) |
|
64 | + if ($comment_config->use_vote_down != 'N' && $member_srl != $logged_info->member_srl) |
|
65 | 65 | { |
66 | 66 | // Add a vote-down button for negative feedback |
67 | 67 | $url = sprintf("doCallModuleAction('comment','procCommentVoteDown','%s')", $comment_srl); |
@@ -76,20 +76,20 @@ discard block |
||
76 | 76 | // call a trigger (after) |
77 | 77 | ModuleHandler::triggerCall('comment.getCommentMenu', 'after', $menu_list); |
78 | 78 | |
79 | - if($this->grant->manager){ |
|
79 | + if ($this->grant->manager) { |
|
80 | 80 | $str_confirm = Context::getLang('confirm_move'); |
81 | 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'); |
|
82 | + $oCommentController->addCommentPopupMenu($url, 'cmd_trash', '', 'javascript'); |
|
83 | 83 | |
84 | 84 | } |
85 | 85 | |
86 | 86 | // find a comment by IP matching if an administrator. |
87 | - if($logged_info->is_admin == 'Y') |
|
87 | + if ($logged_info->is_admin == 'Y') |
|
88 | 88 | { |
89 | 89 | $oCommentModel = getModel('comment'); |
90 | 90 | $oComment = $oCommentModel->getComment($comment_srl); |
91 | 91 | |
92 | - if($oComment->isExists()) |
|
92 | + if ($oComment->isExists()) |
|
93 | 93 | { |
94 | 94 | // Find a post of the corresponding ip address |
95 | 95 | $url = getUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_target', 'ipaddress', 'search_keyword', $oComment->getIpAddress()); |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $menus = Context::get('comment_popup_menu_list'); |
105 | 105 | $menus_count = count($menus); |
106 | 106 | |
107 | - for($i = 0; $i < $menus_count; $i++) |
|
107 | + for ($i = 0; $i < $menus_count; $i++) |
|
108 | 108 | { |
109 | 109 | $menus[$i]->str = Context::getLang($menus[$i]->str); |
110 | 110 | } |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | function getComment($comment_srl = 0, $is_admin = FALSE, $columnList = array()) |
161 | 161 | { |
162 | 162 | $oComment = new commentItem($comment_srl, $columnList); |
163 | - if($is_admin) |
|
163 | + if ($is_admin) |
|
164 | 164 | { |
165 | 165 | $oComment->setGrant(); |
166 | 166 | } |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | */ |
177 | 177 | function getComments($comment_srl_list, $columnList = array()) |
178 | 178 | { |
179 | - if(is_array($comment_srl_list)) |
|
179 | + if (is_array($comment_srl_list)) |
|
180 | 180 | { |
181 | 181 | $comment_srls = implode(',', $comment_srl_list); |
182 | 182 | } |
@@ -185,25 +185,25 @@ discard block |
||
185 | 185 | $args = new stdClass(); |
186 | 186 | $args->comment_srls = $comment_srls; |
187 | 187 | $output = executeQuery('comment.getComments', $args, $columnList); |
188 | - if(!$output->toBool()) |
|
188 | + if (!$output->toBool()) |
|
189 | 189 | { |
190 | 190 | return; |
191 | 191 | } |
192 | 192 | |
193 | 193 | $comment_list = $output->data; |
194 | - if(!$comment_list) |
|
194 | + if (!$comment_list) |
|
195 | 195 | { |
196 | 196 | return; |
197 | 197 | } |
198 | - if(!is_array($comment_list)) |
|
198 | + if (!is_array($comment_list)) |
|
199 | 199 | { |
200 | 200 | $comment_list = array($comment_list); |
201 | 201 | } |
202 | 202 | |
203 | 203 | $comment_count = count($comment_list); |
204 | - foreach($comment_list as $key => $attribute) |
|
204 | + foreach ($comment_list as $key => $attribute) |
|
205 | 205 | { |
206 | - if(!$attribute->comment_srl) |
|
206 | + if (!$attribute->comment_srl) |
|
207 | 207 | { |
208 | 208 | continue; |
209 | 209 | } |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | $oComment = NULL; |
212 | 212 | $oComment = new commentItem(); |
213 | 213 | $oComment->setAttribute($attribute); |
214 | - if($is_admin) |
|
214 | + if ($is_admin) |
|
215 | 215 | { |
216 | 216 | $oComment->setGrant(); |
217 | 217 | } |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | $oDocument = $oDocumentModel->getDocument($document_srl, FALSE, TRUE, $columnList); |
239 | 239 | |
240 | 240 | // return if no doc exists. |
241 | - if(!$oDocument->isExists()) |
|
241 | + if (!$oDocument->isExists()) |
|
242 | 242 | { |
243 | 243 | return; |
244 | 244 | } |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | $oCommentController = getController('comment'); |
251 | 251 | |
252 | 252 | $using_validation = $oCommentController->isModuleUsingPublishValidation($module_srl); |
253 | - if($using_validation) |
|
253 | + if ($using_validation) |
|
254 | 254 | { |
255 | 255 | $args->status = 1; |
256 | 256 | } |
@@ -269,18 +269,18 @@ discard block |
||
269 | 269 | */ |
270 | 270 | function getCommentCountByDate($date = '', $moduleSrlList = array()) |
271 | 271 | { |
272 | - if($date) |
|
272 | + if ($date) |
|
273 | 273 | { |
274 | 274 | $args->regDate = date('Ymd', strtotime($date)); |
275 | 275 | } |
276 | 276 | |
277 | - if(count($moduleSrlList) > 0) |
|
277 | + if (count($moduleSrlList) > 0) |
|
278 | 278 | { |
279 | 279 | $args->module_srl = $moduleSrlList; |
280 | 280 | } |
281 | 281 | |
282 | 282 | $output = executeQuery('comment.getCommentCount', $args); |
283 | - if(!$output->toBool()) |
|
283 | + if (!$output->toBool()) |
|
284 | 284 | { |
285 | 285 | return 0; |
286 | 286 | } |
@@ -299,19 +299,19 @@ discard block |
||
299 | 299 | $args = new stdClass(); |
300 | 300 | $args->module_srl = $module_srl; |
301 | 301 | |
302 | - if(is_null($published)) |
|
302 | + if (is_null($published)) |
|
303 | 303 | { |
304 | 304 | // check if module is using comment validation system |
305 | 305 | $oCommentController = getController("comment"); |
306 | 306 | $is_using_validation = $oCommentController->isModuleUsingPublishValidation($module_srl); |
307 | - if($is_using_validation) |
|
307 | + if ($is_using_validation) |
|
308 | 308 | { |
309 | 309 | $args->status = 1; |
310 | 310 | } |
311 | 311 | } |
312 | 312 | else |
313 | 313 | { |
314 | - if($published) |
|
314 | + if ($published) |
|
315 | 315 | { |
316 | 316 | $args->status = 1; |
317 | 317 | } |
@@ -363,12 +363,12 @@ discard block |
||
363 | 363 | { |
364 | 364 | $args = new stdClass(); |
365 | 365 | |
366 | - if(!is_object($obj)) |
|
366 | + if (!is_object($obj)) |
|
367 | 367 | { |
368 | 368 | $obj = new stdClass(); |
369 | 369 | } |
370 | 370 | |
371 | - if($obj->mid) |
|
371 | + if ($obj->mid) |
|
372 | 372 | { |
373 | 373 | $oModuleModel = getModel('module'); |
374 | 374 | $obj->module_srl = $oModuleModel->getModuleSrlByMid($obj->mid); |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | } |
377 | 377 | |
378 | 378 | // check if module_srl is an arrary. |
379 | - if(is_array($obj->module_srl)) |
|
379 | + if (is_array($obj->module_srl)) |
|
380 | 380 | { |
381 | 381 | $args->module_srl = implode(',', $obj->module_srl); |
382 | 382 | } |
@@ -388,14 +388,14 @@ discard block |
||
388 | 388 | $args->document_srl = $obj->document_srl; |
389 | 389 | $args->list_count = $obj->list_count; |
390 | 390 | |
391 | - if(strpos($args->module_srl, ",") === false) |
|
391 | + if (strpos($args->module_srl, ",") === false) |
|
392 | 392 | { |
393 | - if($args->module_srl) |
|
393 | + if ($args->module_srl) |
|
394 | 394 | { |
395 | 395 | // check if module is using comment validation system |
396 | 396 | $oCommentController = getController("comment"); |
397 | 397 | $is_using_validation = $oCommentController->isModuleUsingPublishValidation($obj->module_srl); |
398 | - if($is_using_validation) |
|
398 | + if ($is_using_validation) |
|
399 | 399 | { |
400 | 400 | $args->status = 1; |
401 | 401 | } |
@@ -404,24 +404,24 @@ discard block |
||
404 | 404 | |
405 | 405 | $output = executeQuery('comment.getNewestCommentList', $args, $columnList); |
406 | 406 | |
407 | - if(!$output->toBool()) |
|
407 | + if (!$output->toBool()) |
|
408 | 408 | { |
409 | 409 | return $output; |
410 | 410 | } |
411 | 411 | |
412 | 412 | $comment_list = $output->data; |
413 | - if($comment_list) |
|
413 | + if ($comment_list) |
|
414 | 414 | { |
415 | - if(!is_array($comment_list)) |
|
415 | + if (!is_array($comment_list)) |
|
416 | 416 | { |
417 | 417 | $comment_list = array($comment_list); |
418 | 418 | } |
419 | 419 | |
420 | 420 | $comment_count = count($comment_list); |
421 | 421 | |
422 | - foreach($comment_list as $key => $attribute) |
|
422 | + foreach ($comment_list as $key => $attribute) |
|
423 | 423 | { |
424 | - if(!$attribute->comment_srl) |
|
424 | + if (!$attribute->comment_srl) |
|
425 | 425 | { |
426 | 426 | continue; |
427 | 427 | } |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | */ |
449 | 449 | function getCommentList($document_srl, $page = 0, $is_admin = FALSE, $count = 0) |
450 | 450 | { |
451 | - if(!isset($document_srl)) |
|
451 | + if (!isset($document_srl)) |
|
452 | 452 | { |
453 | 453 | return; |
454 | 454 | } |
@@ -459,13 +459,13 @@ discard block |
||
459 | 459 | $oDocument = $oDocumentModel->getDocument($document_srl, FALSE, TRUE, $columnList); |
460 | 460 | |
461 | 461 | // return if no doc exists. |
462 | - if(!$oDocument->isExists()) |
|
462 | + if (!$oDocument->isExists()) |
|
463 | 463 | { |
464 | 464 | return; |
465 | 465 | } |
466 | 466 | |
467 | 467 | // return if no comment exists |
468 | - if($oDocument->getCommentCount() < 1) |
|
468 | + if ($oDocument->getCommentCount() < 1) |
|
469 | 469 | { |
470 | 470 | return; |
471 | 471 | } |
@@ -473,11 +473,11 @@ discard block |
||
473 | 473 | // get a list of comments |
474 | 474 | $module_srl = $oDocument->get('module_srl'); |
475 | 475 | |
476 | - if(!$count) |
|
476 | + if (!$count) |
|
477 | 477 | { |
478 | 478 | $comment_config = $this->getCommentConfig($module_srl); |
479 | 479 | $comment_count = $comment_config->comment_count; |
480 | - if(!$comment_count) |
|
480 | + if (!$comment_count) |
|
481 | 481 | { |
482 | 482 | $comment_count = 50; |
483 | 483 | } |
@@ -488,9 +488,9 @@ discard block |
||
488 | 488 | } |
489 | 489 | |
490 | 490 | // get a very last page if no page exists |
491 | - if(!$page) |
|
491 | + if (!$page) |
|
492 | 492 | { |
493 | - $page = (int) ( ($oDocument->getCommentCount() - 1) / $comment_count) + 1; |
|
493 | + $page = (int) (($oDocument->getCommentCount() - 1) / $comment_count) + 1; |
|
494 | 494 | } |
495 | 495 | |
496 | 496 | // get a list of comments |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | //check if module is using validation system |
504 | 504 | $oCommentController = getController('comment'); |
505 | 505 | $using_validation = $oCommentController->isModuleUsingPublishValidation($module_srl); |
506 | - if($using_validation) |
|
506 | + if ($using_validation) |
|
507 | 507 | { |
508 | 508 | $args->status = 1; |
509 | 509 | } |
@@ -511,17 +511,17 @@ discard block |
||
511 | 511 | $output = executeQueryArray('comment.getCommentPageList', $args); |
512 | 512 | |
513 | 513 | // return if an error occurs in the query results |
514 | - if(!$output->toBool()) |
|
514 | + if (!$output->toBool()) |
|
515 | 515 | { |
516 | 516 | return; |
517 | 517 | } |
518 | 518 | |
519 | 519 | // insert data into CommentPageList table if the number of results is different from stored comments |
520 | - if(!$output->data) |
|
520 | + if (!$output->data) |
|
521 | 521 | { |
522 | 522 | $this->fixCommentList($oDocument->get('module_srl'), $document_srl); |
523 | 523 | $output = executeQueryArray('comment.getCommentPageList', $args); |
524 | - if(!$output->toBool()) |
|
524 | + if (!$output->toBool()) |
|
525 | 525 | { |
526 | 526 | return; |
527 | 527 | } |
@@ -542,7 +542,7 @@ discard block |
||
542 | 542 | // create a lock file to prevent repeated work when performing a batch job |
543 | 543 | $lock_file = "./files/cache/tmp/lock." . $document_srl; |
544 | 544 | |
545 | - if(file_exists($lock_file) && filemtime($lock_file) + 60 * 60 * 10 < $_SERVER['REQUEST_TIME']) |
|
545 | + if (file_exists($lock_file) && filemtime($lock_file) + 60 * 60 * 10 < $_SERVER['REQUEST_TIME']) |
|
546 | 546 | { |
547 | 547 | return; |
548 | 548 | } |
@@ -554,13 +554,13 @@ discard block |
||
554 | 554 | $args->document_srl = $document_srl; |
555 | 555 | $args->list_order = 'list_order'; |
556 | 556 | $output = executeQuery('comment.getCommentList', $args); |
557 | - if(!$output->toBool()) |
|
557 | + if (!$output->toBool()) |
|
558 | 558 | { |
559 | 559 | return $output; |
560 | 560 | } |
561 | 561 | |
562 | 562 | $source_list = $output->data; |
563 | - if(!is_array($source_list)) |
|
563 | + if (!is_array($source_list)) |
|
564 | 564 | { |
565 | 565 | $source_list = array($source_list); |
566 | 566 | } |
@@ -576,11 +576,11 @@ discard block |
||
576 | 576 | $logged_info = Context::get('logged_info'); |
577 | 577 | |
578 | 578 | // generate a hierarchical structure of comments for loop |
579 | - for($i = $comment_count - 1; $i >= 0; $i--) |
|
579 | + for ($i = $comment_count - 1; $i >= 0; $i--) |
|
580 | 580 | { |
581 | 581 | $comment_srl = $source_list[$i]->comment_srl; |
582 | 582 | $parent_srl = $source_list[$i]->parent_srl; |
583 | - if(!$comment_srl) |
|
583 | + if (!$comment_srl) |
|
584 | 584 | { |
585 | 585 | continue; |
586 | 586 | } |
@@ -588,7 +588,7 @@ discard block |
||
588 | 588 | // generate a list |
589 | 589 | $list[$comment_srl] = $source_list[$i]; |
590 | 590 | |
591 | - if($parent_srl) |
|
591 | + if ($parent_srl) |
|
592 | 592 | { |
593 | 593 | $list[$parent_srl]->child[] = &$list[$comment_srl]; |
594 | 594 | } |
@@ -600,9 +600,9 @@ discard block |
||
600 | 600 | $this->_arrangeComment($comment_list, $root->child, 0, NULL); |
601 | 601 | |
602 | 602 | // insert values to the database |
603 | - if(count($comment_list)) |
|
603 | + if (count($comment_list)) |
|
604 | 604 | { |
605 | - foreach($comment_list as $comment_srl => $item) |
|
605 | + foreach ($comment_list as $comment_srl => $item) |
|
606 | 606 | { |
607 | 607 | $comment_args = new stdClass(); |
608 | 608 | $comment_args->comment_srl = $comment_srl; |
@@ -631,14 +631,14 @@ discard block |
||
631 | 631 | */ |
632 | 632 | function _arrangeComment(&$comment_list, $list, $depth, $parent = NULL) |
633 | 633 | { |
634 | - if(!count($list)) |
|
634 | + if (!count($list)) |
|
635 | 635 | { |
636 | 636 | return; |
637 | 637 | } |
638 | 638 | |
639 | - foreach($list as $key => $val) |
|
639 | + foreach ($list as $key => $val) |
|
640 | 640 | { |
641 | - if($parent) |
|
641 | + if ($parent) |
|
642 | 642 | { |
643 | 643 | $val->head = $parent->head; |
644 | 644 | } |
@@ -649,7 +649,7 @@ discard block |
||
649 | 649 | |
650 | 650 | $val->arrange = count($comment_list) + 1; |
651 | 651 | |
652 | - if($val->child) |
|
652 | + if ($val->child) |
|
653 | 653 | { |
654 | 654 | $val->depth = $depth; |
655 | 655 | $comment_list[$val->comment_srl] = $val; |
@@ -686,7 +686,7 @@ discard block |
||
686 | 686 | // check if module is using comment validation system |
687 | 687 | $oCommentController = getController("comment"); |
688 | 688 | $is_using_validation = $oCommentController->isModuleUsingPublishValidation($obj->module_srl); |
689 | - if($is_using_validation) |
|
689 | + if ($is_using_validation) |
|
690 | 690 | { |
691 | 691 | $args->s_is_published = 1; |
692 | 692 | } |
@@ -694,12 +694,12 @@ discard block |
||
694 | 694 | // Search options |
695 | 695 | $search_target = $obj->search_target ? $obj->search_target : trim(Context::get('search_target')); |
696 | 696 | $search_keyword = $obj->search_keyword ? $obj->search_keyword : trim(Context::get('search_keyword')); |
697 | - if($search_target && $search_keyword) |
|
697 | + if ($search_target && $search_keyword) |
|
698 | 698 | { |
699 | - switch($search_target) |
|
699 | + switch ($search_target) |
|
700 | 700 | { |
701 | 701 | case 'content' : |
702 | - if($search_keyword) |
|
702 | + if ($search_keyword) |
|
703 | 703 | { |
704 | 704 | $search_keyword = str_replace(' ', '%', $search_keyword); |
705 | 705 | } |
@@ -708,7 +708,7 @@ discard block |
||
708 | 708 | break; |
709 | 709 | |
710 | 710 | case 'user_id' : |
711 | - if($search_keyword) |
|
711 | + if ($search_keyword) |
|
712 | 712 | { |
713 | 713 | $search_keyword = str_replace(' ', '%', $search_keyword); |
714 | 714 | } |
@@ -719,7 +719,7 @@ discard block |
||
719 | 719 | break; |
720 | 720 | |
721 | 721 | case 'user_name' : |
722 | - if($search_keyword) |
|
722 | + if ($search_keyword) |
|
723 | 723 | { |
724 | 724 | $search_keyword = str_replace(' ', '%', $search_keyword); |
725 | 725 | } |
@@ -728,7 +728,7 @@ discard block |
||
728 | 728 | break; |
729 | 729 | |
730 | 730 | case 'nick_name' : |
731 | - if($search_keyword) |
|
731 | + if ($search_keyword) |
|
732 | 732 | { |
733 | 733 | $search_keyword = str_replace(' ', '%', $search_keyword); |
734 | 734 | } |
@@ -737,7 +737,7 @@ discard block |
||
737 | 737 | break; |
738 | 738 | |
739 | 739 | case 'email_address' : |
740 | - if($search_keyword) |
|
740 | + if ($search_keyword) |
|
741 | 741 | { |
742 | 742 | $search_keyword = str_replace(' ', '%', $search_keyword); |
743 | 743 | } |
@@ -746,7 +746,7 @@ discard block |
||
746 | 746 | break; |
747 | 747 | |
748 | 748 | case 'homepage' : |
749 | - if($search_keyword) |
|
749 | + if ($search_keyword) |
|
750 | 750 | { |
751 | 751 | $search_keyword = str_replace(' ', '%', $search_keyword); |
752 | 752 | } |
@@ -771,12 +771,12 @@ discard block |
||
771 | 771 | break; |
772 | 772 | |
773 | 773 | case 'is_published' : |
774 | - if($search_keyword == 'Y') |
|
774 | + if ($search_keyword == 'Y') |
|
775 | 775 | { |
776 | 776 | $args->s_is_published = 1; |
777 | 777 | } |
778 | 778 | |
779 | - if($search_keyword == 'N') |
|
779 | + if ($search_keyword == 'N') |
|
780 | 780 | { |
781 | 781 | $args->s_is_published = 0; |
782 | 782 | } |
@@ -797,12 +797,12 @@ discard block |
||
797 | 797 | $output = executeQueryArray($query_id, $args, $columnList); |
798 | 798 | |
799 | 799 | // return when no result or error occurance |
800 | - if(!$output->toBool() || !count($output->data)) |
|
800 | + if (!$output->toBool() || !count($output->data)) |
|
801 | 801 | { |
802 | 802 | return $output; |
803 | 803 | } |
804 | 804 | |
805 | - foreach($output->data as $key => $val) |
|
805 | + foreach ($output->data as $key => $val) |
|
806 | 806 | { |
807 | 807 | unset($_oComment); |
808 | 808 | $_oComment = new CommentItem(0); |
@@ -831,12 +831,12 @@ discard block |
||
831 | 831 | $search_target = $obj->search_target ? $obj->search_target : trim(Context::get('search_target')); |
832 | 832 | $search_keyword = $obj->search_keyword ? $obj->search_keyword : trim(Context::get('search_keyword')); |
833 | 833 | |
834 | - if($search_target && $search_keyword) |
|
834 | + if ($search_target && $search_keyword) |
|
835 | 835 | { |
836 | - switch($search_target) |
|
836 | + switch ($search_target) |
|
837 | 837 | { |
838 | 838 | case 'content' : |
839 | - if($search_keyword) |
|
839 | + if ($search_keyword) |
|
840 | 840 | { |
841 | 841 | $search_keyword = str_replace(' ', '%', $search_keyword); |
842 | 842 | } |
@@ -845,7 +845,7 @@ discard block |
||
845 | 845 | break; |
846 | 846 | |
847 | 847 | case 'user_id' : |
848 | - if($search_keyword) |
|
848 | + if ($search_keyword) |
|
849 | 849 | { |
850 | 850 | $search_keyword = str_replace(' ', '%', $search_keyword); |
851 | 851 | } |
@@ -855,7 +855,7 @@ discard block |
||
855 | 855 | break; |
856 | 856 | |
857 | 857 | case 'user_name' : |
858 | - if($search_keyword) |
|
858 | + if ($search_keyword) |
|
859 | 859 | { |
860 | 860 | $search_keyword = str_replace(' ', '%', $search_keyword); |
861 | 861 | } |
@@ -864,7 +864,7 @@ discard block |
||
864 | 864 | break; |
865 | 865 | |
866 | 866 | case 'nick_name' : |
867 | - if($search_keyword) |
|
867 | + if ($search_keyword) |
|
868 | 868 | { |
869 | 869 | $search_keyword = str_replace(' ', '%', $search_keyword); |
870 | 870 | } |
@@ -873,7 +873,7 @@ discard block |
||
873 | 873 | break; |
874 | 874 | |
875 | 875 | case 'email_address' : |
876 | - if($search_keyword) |
|
876 | + if ($search_keyword) |
|
877 | 877 | { |
878 | 878 | $search_keyword = str_replace(' ', '%', $search_keyword); |
879 | 879 | } |
@@ -882,7 +882,7 @@ discard block |
||
882 | 882 | break; |
883 | 883 | |
884 | 884 | case 'homepage' : |
885 | - if($search_keyword) |
|
885 | + if ($search_keyword) |
|
886 | 886 | { |
887 | 887 | $search_keyword = str_replace(' ', '%', $search_keyword); |
888 | 888 | } |
@@ -915,7 +915,7 @@ discard block |
||
915 | 915 | $output = executeQueryArray($query_id, $args); |
916 | 916 | |
917 | 917 | // return when no result or error occurance |
918 | - if(!$output->toBool() || !count($output->data)) |
|
918 | + if (!$output->toBool() || !count($output->data)) |
|
919 | 919 | { |
920 | 920 | return $output; |
921 | 921 | } |
@@ -932,12 +932,12 @@ discard block |
||
932 | 932 | { |
933 | 933 | $oModuleModel = getModel('module'); |
934 | 934 | $comment_config = $oModuleModel->getModulePartConfig('comment', $module_srl); |
935 | - if(!is_object($comment_config)) |
|
935 | + if (!is_object($comment_config)) |
|
936 | 936 | { |
937 | 937 | $comment_config = new stdClass(); |
938 | 938 | } |
939 | 939 | |
940 | - if(!isset($comment_config->comment_count)) |
|
940 | + if (!isset($comment_config->comment_count)) |
|
941 | 941 | { |
942 | 942 | $comment_config->comment_count = 50; |
943 | 943 | } |
@@ -952,13 +952,13 @@ discard block |
||
952 | 952 | function getCommentVotedMemberList() |
953 | 953 | { |
954 | 954 | $comment_srl = Context::get('comment_srl'); |
955 | - if(!$comment_srl) |
|
955 | + if (!$comment_srl) |
|
956 | 956 | { |
957 | 957 | return new Object(-1, 'msg_invalid_request'); |
958 | 958 | } |
959 | 959 | |
960 | 960 | $point = Context::get('point'); |
961 | - if($point != -1) |
|
961 | + if ($point != -1) |
|
962 | 962 | { |
963 | 963 | $point = 1; |
964 | 964 | } |
@@ -966,7 +966,7 @@ discard block |
||
966 | 966 | $oCommentModel = getModel('comment'); |
967 | 967 | $oComment = $oCommentModel->getComment($comment_srl, FALSE, FALSE); |
968 | 968 | $module_srl = $oComment->get('module_srl'); |
969 | - if(!$module_srl) |
|
969 | + if (!$module_srl) |
|
970 | 970 | { |
971 | 971 | return new Object(-1, 'msg_invalid_request'); |
972 | 972 | } |
@@ -976,9 +976,9 @@ discard block |
||
976 | 976 | |
977 | 977 | $args = new stdClass(); |
978 | 978 | |
979 | - if($point == -1) |
|
979 | + if ($point == -1) |
|
980 | 980 | { |
981 | - if($comment_config->use_vote_down != 'S') |
|
981 | + if ($comment_config->use_vote_down != 'S') |
|
982 | 982 | { |
983 | 983 | return new Object(-1, 'msg_invalid_request'); |
984 | 984 | } |
@@ -987,7 +987,7 @@ discard block |
||
987 | 987 | } |
988 | 988 | else |
989 | 989 | { |
990 | - if($comment_config->use_vote_up != 'S') |
|
990 | + if ($comment_config->use_vote_up != 'S') |
|
991 | 991 | { |
992 | 992 | return new Object(-1, 'msg_invalid_request'); |
993 | 993 | } |
@@ -997,15 +997,15 @@ discard block |
||
997 | 997 | |
998 | 998 | $args->comment_srl = $comment_srl; |
999 | 999 | $output = executeQueryArray('comment.getVotedMemberList', $args); |
1000 | - if(!$output->toBool()) |
|
1000 | + if (!$output->toBool()) |
|
1001 | 1001 | { |
1002 | 1002 | return $output; |
1003 | 1003 | } |
1004 | 1004 | |
1005 | 1005 | $oMemberModel = getModel('member'); |
1006 | - if($output->data) |
|
1006 | + if ($output->data) |
|
1007 | 1007 | { |
1008 | - foreach($output->data as $k => $d) |
|
1008 | + foreach ($output->data as $k => $d) |
|
1009 | 1009 | { |
1010 | 1010 | $profile_image = $oMemberModel->getProfileImage($d->member_srl); |
1011 | 1011 | $output->data[$k]->src = $profile_image->src; |
@@ -1023,7 +1023,7 @@ discard block |
||
1023 | 1023 | { |
1024 | 1024 | global $lang; |
1025 | 1025 | |
1026 | - if(!isset($lang->secret_name_list)) |
|
1026 | + if (!isset($lang->secret_name_list)) |
|
1027 | 1027 | { |
1028 | 1028 | return array('Y' => 'Secret', 'N' => 'Public'); |
1029 | 1029 | } |
@@ -1064,8 +1064,8 @@ discard block |
||
1064 | 1064 | $output = executeQuery('comment.getCommentListByMemberSrl', $args, $columnList); |
1065 | 1065 | $comment_list = $output->data; |
1066 | 1066 | |
1067 | - if(!$comment_list) return array(); |
|
1068 | - if(!is_array($comment_list)) $comment_list = array($comment_list); |
|
1067 | + if (!$comment_list) return array(); |
|
1068 | + if (!is_array($comment_list)) $comment_list = array($comment_list); |
|
1069 | 1069 | |
1070 | 1070 | return $comment_list; |
1071 | 1071 |
@@ -308,14 +308,12 @@ discard block |
||
308 | 308 | { |
309 | 309 | $args->status = 1; |
310 | 310 | } |
311 | - } |
|
312 | - else |
|
311 | + } else |
|
313 | 312 | { |
314 | 313 | if($published) |
315 | 314 | { |
316 | 315 | $args->status = 1; |
317 | - } |
|
318 | - else |
|
316 | + } else |
|
319 | 317 | { |
320 | 318 | $args->status = 0; |
321 | 319 | } |
@@ -379,8 +377,7 @@ discard block |
||
379 | 377 | if(is_array($obj->module_srl)) |
380 | 378 | { |
381 | 379 | $args->module_srl = implode(',', $obj->module_srl); |
382 | - } |
|
383 | - else |
|
380 | + } else |
|
384 | 381 | { |
385 | 382 | $args->module_srl = $obj->module_srl; |
386 | 383 | } |
@@ -481,8 +478,7 @@ discard block |
||
481 | 478 | { |
482 | 479 | $comment_count = 50; |
483 | 480 | } |
484 | - } |
|
485 | - else |
|
481 | + } else |
|
486 | 482 | { |
487 | 483 | $comment_count = $count; |
488 | 484 | } |
@@ -591,8 +587,7 @@ discard block |
||
591 | 587 | if($parent_srl) |
592 | 588 | { |
593 | 589 | $list[$parent_srl]->child[] = &$list[$comment_srl]; |
594 | - } |
|
595 | - else |
|
590 | + } else |
|
596 | 591 | { |
597 | 592 | $root->child[] = &$list[$comment_srl]; |
598 | 593 | } |
@@ -641,8 +636,7 @@ discard block |
||
641 | 636 | if($parent) |
642 | 637 | { |
643 | 638 | $val->head = $parent->head; |
644 | - } |
|
645 | - else |
|
639 | + } else |
|
646 | 640 | { |
647 | 641 | $val->head = $val->comment_srl; |
648 | 642 | } |
@@ -655,8 +649,7 @@ discard block |
||
655 | 649 | $comment_list[$val->comment_srl] = $val; |
656 | 650 | $this->_arrangeComment($comment_list, $val->child, $depth + 1, $val); |
657 | 651 | unset($val->child); |
658 | - } |
|
659 | - else |
|
652 | + } else |
|
660 | 653 | { |
661 | 654 | $val->depth = $depth; |
662 | 655 | $comment_list[$val->comment_srl] = $val; |
@@ -984,8 +977,7 @@ discard block |
||
984 | 977 | } |
985 | 978 | |
986 | 979 | $args->below_point = 0; |
987 | - } |
|
988 | - else |
|
980 | + } else |
|
989 | 981 | { |
990 | 982 | if($comment_config->use_vote_up != 'S') |
991 | 983 | { |
@@ -1026,8 +1018,7 @@ discard block |
||
1026 | 1018 | if(!isset($lang->secret_name_list)) |
1027 | 1019 | { |
1028 | 1020 | return array('Y' => 'Secret', 'N' => 'Public'); |
1029 | - } |
|
1030 | - else |
|
1021 | + } else |
|
1031 | 1022 | { |
1032 | 1023 | return $lang->secret_name_list; |
1033 | 1024 | } |
@@ -1064,8 +1055,12 @@ discard block |
||
1064 | 1055 | $output = executeQuery('comment.getCommentListByMemberSrl', $args, $columnList); |
1065 | 1056 | $comment_list = $output->data; |
1066 | 1057 | |
1067 | - if(!$comment_list) return array(); |
|
1068 | - if(!is_array($comment_list)) $comment_list = array($comment_list); |
|
1058 | + if(!$comment_list) { |
|
1059 | + return array(); |
|
1060 | + } |
|
1061 | + if(!is_array($comment_list)) { |
|
1062 | + $comment_list = array($comment_list); |
|
1063 | + } |
|
1069 | 1064 | |
1070 | 1065 | return $comment_list; |
1071 | 1066 |