@@ -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) |
@@ -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; |
|
77 | + $content = Context::getLang('replies').' : <a href="'.getUrl('act', 'dispBoardContentCommentList').'">'.$oDocument->getCommentCount().'</a><br>'."\r\n".$content; |
|
78 | 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,25 +92,25 @@ 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().']'; |
|
113 | + if ($val->getCommentCount()) $title .= ' ['.$val->getCommentCount().']'; |
|
114 | 114 | $obj['link'] = $obj['text'] = '['.$val->getNickName().'] '.$title; |
115 | 115 | $childs[] = $obj; |
116 | 116 | } |
@@ -118,18 +118,18 @@ discard block |
||
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; |
@@ -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 |
@@ -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 | } |
@@ -540,9 +540,9 @@ discard block |
||
540 | 540 | function fixCommentList($module_srl, $document_srl) |
541 | 541 | { |
542 | 542 | // create a lock file to prevent repeated work when performing a batch job |
543 | - $lock_file = "./files/cache/tmp/lock." . $document_srl; |
|
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 | } |
@@ -788,7 +788,7 @@ discard block |
||
788 | 788 | break; |
789 | 789 | |
790 | 790 | case 'member_srl' : |
791 | - $args->{"s_" . $search_target} = (int) $search_keyword; |
|
791 | + $args->{"s_".$search_target} = (int) $search_keyword; |
|
792 | 792 | break; |
793 | 793 | } |
794 | 794 | } |
@@ -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 | } |
@@ -907,7 +907,7 @@ discard block |
||
907 | 907 | break; |
908 | 908 | |
909 | 909 | case 'member_srl' : |
910 | - $args->{"s_" . $search_target} = (int) $search_keyword; |
|
910 | + $args->{"s_".$search_target} = (int) $search_keyword; |
|
911 | 911 | break; |
912 | 912 | } |
913 | 913 | } |
@@ -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 |
@@ -24,31 +24,31 @@ |
||
24 | 24 | function procCommunicationAdminInsertConfig() |
25 | 25 | { |
26 | 26 | // get the default information |
27 | - $args = Context::gets('skin', 'colorset', 'editor_skin', 'sel_editor_colorset', 'mskin', 'mcolorset', 'layout_srl', 'mlayout_srl', 'grant_write_default','grant_write_group'); |
|
27 | + $args = Context::gets('skin', 'colorset', 'editor_skin', 'sel_editor_colorset', 'mskin', 'mcolorset', 'layout_srl', 'mlayout_srl', 'grant_write_default', 'grant_write_group'); |
|
28 | 28 | $args->editor_colorset = $args->sel_editor_colorset; |
29 | 29 | unset($args->sel_editor_colorset); |
30 | 30 | |
31 | - if(!$args->skin) |
|
31 | + if (!$args->skin) |
|
32 | 32 | { |
33 | 33 | $args->skin = 'default'; |
34 | 34 | } |
35 | 35 | |
36 | - if(!$args->colorset) |
|
36 | + if (!$args->colorset) |
|
37 | 37 | { |
38 | 38 | $args->colorset = 'white'; |
39 | 39 | } |
40 | 40 | |
41 | - if(!$args->editor_skin) |
|
41 | + if (!$args->editor_skin) |
|
42 | 42 | { |
43 | 43 | $args->editor_skin = 'default'; |
44 | 44 | } |
45 | 45 | |
46 | - if(!$args->mskin) |
|
46 | + if (!$args->mskin) |
|
47 | 47 | { |
48 | 48 | $args->mskin = 'default'; |
49 | 49 | } |
50 | 50 | |
51 | - if(!$args->layout_srl) |
|
51 | + if (!$args->layout_srl) |
|
52 | 52 | { |
53 | 53 | $args->layout_srl = NULL; |
54 | 54 | } |
@@ -30,8 +30,7 @@ discard block |
||
30 | 30 | if($type == 'P') |
31 | 31 | { |
32 | 32 | $dir = 'skins'; |
33 | - } |
|
34 | - else |
|
33 | + } else |
|
35 | 34 | { |
36 | 35 | $dir = 'm.skins'; |
37 | 36 | } |
@@ -39,8 +38,7 @@ discard block |
||
39 | 38 | if(!$skin) |
40 | 39 | { |
41 | 40 | $tpl = ""; |
42 | - } |
|
43 | - else |
|
41 | + } else |
|
44 | 42 | { |
45 | 43 | $oModuleModel = getModel('module'); |
46 | 44 | $skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin, $dir); |
@@ -48,7 +46,9 @@ discard block |
||
48 | 46 | |
49 | 47 | $oModuleModel = getModel('module'); |
50 | 48 | $communication_config = $oModuleModel->getModuleConfig('communication'); |
51 | - if(!is_object($communication_config)) $communication_config = new stdClass; |
|
49 | + if(!is_object($communication_config)) { |
|
50 | + $communication_config = new stdClass; |
|
51 | + } |
|
52 | 52 | if(!$communication_config->colorset) |
53 | 53 | { |
54 | 54 | $communication_config->colorset = "white"; |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | $type = Context::get('type') == 'P' ? 'P' : 'M'; |
28 | 28 | Context::set('type', $type); |
29 | 29 | |
30 | - if($type == 'P') |
|
30 | + if ($type == 'P') |
|
31 | 31 | { |
32 | 32 | $dir = 'skins'; |
33 | 33 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $dir = 'm.skins'; |
37 | 37 | } |
38 | 38 | |
39 | - if(!$skin) |
|
39 | + if (!$skin) |
|
40 | 40 | { |
41 | 41 | $tpl = ""; |
42 | 42 | } |
@@ -48,8 +48,8 @@ discard block |
||
48 | 48 | |
49 | 49 | $oModuleModel = getModel('module'); |
50 | 50 | $communication_config = $oModuleModel->getModuleConfig('communication'); |
51 | - if(!is_object($communication_config)) $communication_config = new stdClass; |
|
52 | - if(!$communication_config->colorset) |
|
51 | + if (!is_object($communication_config)) $communication_config = new stdClass; |
|
52 | + if (!$communication_config->colorset) |
|
53 | 53 | { |
54 | 54 | $communication_config->colorset = "white"; |
55 | 55 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $security->encodeHTML('skin_info.colorset..name'); |
61 | 61 | |
62 | 62 | $oTemplate = TemplateHandler::getInstance(); |
63 | - $tpl = $oTemplate->compile($this->module_path . 'tpl', 'colorset_list'); |
|
63 | + $tpl = $oTemplate->compile($this->module_path.'tpl', 'colorset_list'); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | $this->add('tpl', $tpl); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | */ |
27 | 27 | function checkUpdate() |
28 | 28 | { |
29 | - if(!is_dir("./files/member_extra_info/new_message_flags")) |
|
29 | + if (!is_dir("./files/member_extra_info/new_message_flags")) |
|
30 | 30 | { |
31 | 31 | return TRUE; |
32 | 32 | } |
@@ -34,13 +34,13 @@ discard block |
||
34 | 34 | $oModuleModel = getModel('module'); |
35 | 35 | $config = $oModuleModel->getModuleConfig('message'); |
36 | 36 | |
37 | - if($config->skin) |
|
37 | + if ($config->skin) |
|
38 | 38 | { |
39 | 39 | $config_parse = explode('.', $config->skin); |
40 | - if(count($config_parse) > 1) |
|
40 | + if (count($config_parse) > 1) |
|
41 | 41 | { |
42 | 42 | $template_path = sprintf('./themes/%s/modules/communication/', $config_parse[0]); |
43 | - if(is_dir($template_path)) |
|
43 | + if (is_dir($template_path)) |
|
44 | 44 | { |
45 | 45 | return TRUE; |
46 | 46 | } |
@@ -55,25 +55,25 @@ discard block |
||
55 | 55 | */ |
56 | 56 | function moduleUpdate() |
57 | 57 | { |
58 | - if(!is_dir("./files/member_extra_info/new_message_flags")) |
|
58 | + if (!is_dir("./files/member_extra_info/new_message_flags")) |
|
59 | 59 | { |
60 | 60 | FileHandler::makeDir('./files/member_extra_info/new_message_flags'); |
61 | 61 | } |
62 | 62 | |
63 | 63 | $oModuleModel = getModel('module'); |
64 | 64 | $config = $oModuleModel->getModuleConfig('message'); |
65 | - if(!is_object($config)) |
|
65 | + if (!is_object($config)) |
|
66 | 66 | { |
67 | 67 | $config = new stdClass(); |
68 | 68 | } |
69 | 69 | |
70 | - if($config->skin) |
|
70 | + if ($config->skin) |
|
71 | 71 | { |
72 | 72 | $config_parse = explode('.', $config->skin); |
73 | - if(count($config_parse) > 1) |
|
73 | + if (count($config_parse) > 1) |
|
74 | 74 | { |
75 | 75 | $template_path = sprintf('./themes/%s/modules/communication/', $config_parse[0]); |
76 | - if(is_dir($template_path)) |
|
76 | + if (is_dir($template_path)) |
|
77 | 77 | { |
78 | 78 | $config->skin = implode('|@|', $config_parse); |
79 | 79 | $oModuleController = getController('module'); |
@@ -110,8 +110,7 @@ discard block |
||
110 | 110 | { |
111 | 111 | return new object(-1, 'msg_allow_message_to_friend'); |
112 | 112 | } |
113 | - } |
|
114 | - else if($receiver_member_info->allow_message == 'N') |
|
113 | + } else if($receiver_member_info->allow_message == 'N') |
|
115 | 114 | { |
116 | 115 | return new object(-1, 'msg_disallow_message'); |
117 | 116 | } |
@@ -149,8 +148,7 @@ discard block |
||
149 | 148 | htmlFooter(); |
150 | 149 | Context::close(); |
151 | 150 | exit; |
152 | - } |
|
153 | - else |
|
151 | + } else |
|
154 | 152 | { |
155 | 153 | $this->setMessage('success_sended'); |
156 | 154 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('','act', 'dispCommunicationMessages', 'message_type', 'S', 'receiver_srl', $receiver_srl, 'message_srl', ''); |
@@ -428,8 +426,7 @@ discard block |
||
428 | 426 | if($message_type == 'S') |
429 | 427 | { |
430 | 428 | $args->sender_srl = $member_srl; |
431 | - } |
|
432 | - else |
|
429 | + } else |
|
433 | 430 | { |
434 | 431 | $args->receiver_srl = $member_srl; |
435 | 432 | } |
@@ -656,8 +653,7 @@ discard block |
||
656 | 653 | $output = executeQuery('communication.renameFriendGroup', $args); |
657 | 654 | $msg_code = 'success_updated'; |
658 | 655 | // add if not exists |
659 | - } |
|
660 | - else |
|
656 | + } else |
|
661 | 657 | { |
662 | 658 | $output = executeQuery('communication.addFriendGroup', $args); |
663 | 659 | $msg_code = 'success_registed'; |
@@ -674,13 +670,11 @@ discard block |
||
674 | 670 | htmlFooter(); |
675 | 671 | Context::close(); |
676 | 672 | exit; |
677 | - } |
|
678 | - else |
|
673 | + } else |
|
679 | 674 | { |
680 | 675 | return $output; |
681 | 676 | } |
682 | - } |
|
683 | - else |
|
677 | + } else |
|
684 | 678 | { |
685 | 679 | if(!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) |
686 | 680 | { |
@@ -692,8 +686,7 @@ discard block |
||
692 | 686 | htmlFooter(); |
693 | 687 | Context::close(); |
694 | 688 | exit; |
695 | - } |
|
696 | - else |
|
689 | + } else |
|
697 | 690 | { |
698 | 691 | $this->setMessage($msg_code); |
699 | 692 | } |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | */ |
24 | 24 | function procCommunicationUpdateAllowMessage() |
25 | 25 | { |
26 | - if(!Context::get('is_logged')) |
|
26 | + if (!Context::get('is_logged')) |
|
27 | 27 | { |
28 | 28 | return new Object(-1, 'msg_not_logged'); |
29 | 29 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $args = new stdClass(); |
32 | 32 | $args->allow_message = Context::get('allow_message'); |
33 | 33 | |
34 | - if(!in_array($args->allow_message, array('Y', 'N', 'F'))) |
|
34 | + if (!in_array($args->allow_message, array('Y', 'N', 'F'))) |
|
35 | 35 | { |
36 | 36 | $args->allow_message = 'Y'; |
37 | 37 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | function procCommunicationSendMessage() |
54 | 54 | { |
55 | 55 | // Check login information |
56 | - if(!Context::get('is_logged')) |
|
56 | + if (!Context::get('is_logged')) |
|
57 | 57 | { |
58 | 58 | return new Object(-1, 'msg_not_logged'); |
59 | 59 | } |
@@ -62,25 +62,25 @@ discard block |
||
62 | 62 | |
63 | 63 | // Check variables |
64 | 64 | $receiver_srl = Context::get('receiver_srl'); |
65 | - if(!$receiver_srl) |
|
65 | + if (!$receiver_srl) |
|
66 | 66 | { |
67 | 67 | return new Object(-1, 'msg_not_exists_member'); |
68 | 68 | } |
69 | 69 | |
70 | 70 | $title = trim(Context::get('title')); |
71 | - if(!$title) |
|
71 | + if (!$title) |
|
72 | 72 | { |
73 | 73 | return new Object(-1, 'msg_title_is_null'); |
74 | 74 | } |
75 | 75 | |
76 | 76 | $content = trim(Context::get('content')); |
77 | - if(!$content) |
|
77 | + if (!$content) |
|
78 | 78 | { |
79 | 79 | return new Object(-1, 'msg_content_is_null'); |
80 | 80 | } |
81 | 81 | |
82 | 82 | $send_mail = Context::get('send_mail'); |
83 | - if($send_mail != 'Y') |
|
83 | + if ($send_mail != 'Y') |
|
84 | 84 | { |
85 | 85 | $send_mail = 'N'; |
86 | 86 | } |
@@ -90,28 +90,28 @@ discard block |
||
90 | 90 | $oCommunicationModel = getModel('communication'); |
91 | 91 | $config = $oCommunicationModel->getConfig(); |
92 | 92 | |
93 | - if(!$oCommunicationModel->checkGrant($config->grant_write)) |
|
93 | + if (!$oCommunicationModel->checkGrant($config->grant_write)) |
|
94 | 94 | { |
95 | 95 | return new Object(-1, 'msg_not_permitted'); |
96 | 96 | } |
97 | 97 | |
98 | 98 | $receiver_member_info = $oMemberModel->getMemberInfoByMemberSrl($receiver_srl); |
99 | - if($receiver_member_info->member_srl != $receiver_srl) |
|
99 | + if ($receiver_member_info->member_srl != $receiver_srl) |
|
100 | 100 | { |
101 | 101 | return new Object(-1, 'msg_not_exists_member'); |
102 | 102 | } |
103 | 103 | |
104 | 104 | // check whether to allow to receive the message(pass if a top-administrator) |
105 | - if($logged_info->is_admin != 'Y') |
|
105 | + if ($logged_info->is_admin != 'Y') |
|
106 | 106 | { |
107 | - if($receiver_member_info->allow_message == 'F') |
|
107 | + if ($receiver_member_info->allow_message == 'F') |
|
108 | 108 | { |
109 | - if(!$oCommunicationModel->isFriend($receiver_member_info->member_srl)) |
|
109 | + if (!$oCommunicationModel->isFriend($receiver_member_info->member_srl)) |
|
110 | 110 | { |
111 | 111 | return new object(-1, 'msg_allow_message_to_friend'); |
112 | 112 | } |
113 | 113 | } |
114 | - else if($receiver_member_info->allow_message == 'N') |
|
114 | + else if ($receiver_member_info->allow_message == 'N') |
|
115 | 115 | { |
116 | 116 | return new object(-1, 'msg_disallow_message'); |
117 | 117 | } |
@@ -120,13 +120,13 @@ discard block |
||
120 | 120 | // send a message |
121 | 121 | $output = $this->sendMessage($logged_info->member_srl, $receiver_srl, $title, $content); |
122 | 122 | |
123 | - if(!$output->toBool()) |
|
123 | + if (!$output->toBool()) |
|
124 | 124 | { |
125 | 125 | return $output; |
126 | 126 | } |
127 | 127 | |
128 | 128 | // send an e-mail |
129 | - if($send_mail == 'Y') |
|
129 | + if ($send_mail == 'Y') |
|
130 | 130 | { |
131 | 131 | $view_url = Context::getRequestUri(); |
132 | 132 | $content = sprintf("%s<br /><br />From : <a href=\"%s\" target=\"_blank\">%s</a>", $content, $view_url, $view_url); |
@@ -138,9 +138,9 @@ discard block |
||
138 | 138 | $oMail->send(); |
139 | 139 | } |
140 | 140 | |
141 | - if(!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) |
|
141 | + if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) |
|
142 | 142 | { |
143 | - if(Context::get('is_popup') != 'Y') |
|
143 | + if (Context::get('is_popup') != 'Y') |
|
144 | 144 | { |
145 | 145 | global $lang; |
146 | 146 | htmlHeader(); |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | else |
154 | 154 | { |
155 | 155 | $this->setMessage('success_sended'); |
156 | - $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('','act', 'dispCommunicationMessages', 'message_type', 'S', 'receiver_srl', $receiver_srl, 'message_srl', ''); |
|
156 | + $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'act', 'dispCommunicationMessages', 'message_type', 'S', 'receiver_srl', $receiver_srl, 'message_srl', ''); |
|
157 | 157 | $this->setRedirectUrl($returnUrl); |
158 | 158 | } |
159 | 159 | } |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | $receiver_args->related_srl = 0; |
198 | 198 | $receiver_args->list_order = $related_srl * -1; |
199 | 199 | $receiver_args->sender_srl = $sender_srl; |
200 | - if(!$receiver_args->sender_srl) |
|
200 | + if (!$receiver_args->sender_srl) |
|
201 | 201 | { |
202 | 202 | $receiver_args->sender_srl = $receiver_srl; |
203 | 203 | } |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | $trigger_obj->content = $content; |
219 | 219 | $trigger_obj->sender_log = $sender_log; |
220 | 220 | $triggerOutput = ModuleHandler::triggerCall('communication.sendMessage', 'before', $trigger_obj); |
221 | - if(!$triggerOutput->toBool()) |
|
221 | + if (!$triggerOutput->toBool()) |
|
222 | 222 | { |
223 | 223 | return $triggerOutput; |
224 | 224 | } |
@@ -227,10 +227,10 @@ discard block |
||
227 | 227 | $oDB->begin(); |
228 | 228 | |
229 | 229 | // messages to save in the sendor's message box |
230 | - if($sender_srl && $sender_log) |
|
230 | + if ($sender_srl && $sender_log) |
|
231 | 231 | { |
232 | 232 | $output = executeQuery('communication.sendMessage', $sender_args); |
233 | - if(!$output->toBool()) |
|
233 | + if (!$output->toBool()) |
|
234 | 234 | { |
235 | 235 | $oDB->rollback(); |
236 | 236 | return $output; |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | |
240 | 240 | // messages to save in the receiver's message box |
241 | 241 | $output = executeQuery('communication.sendMessage', $receiver_args); |
242 | - if(!$output->toBool()) |
|
242 | + if (!$output->toBool()) |
|
243 | 243 | { |
244 | 244 | $oDB->rollback(); |
245 | 245 | return $output; |
@@ -247,14 +247,14 @@ discard block |
||
247 | 247 | |
248 | 248 | // Call a trigger (after) |
249 | 249 | $trigger_output = ModuleHandler::triggerCall('communication.sendMessage', 'after', $trigger_obj); |
250 | - if(!$trigger_output->toBool()) |
|
250 | + if (!$trigger_output->toBool()) |
|
251 | 251 | { |
252 | 252 | $oDB->rollback(); |
253 | 253 | return $trigger_output; |
254 | 254 | } |
255 | 255 | |
256 | 256 | // create a flag that message is sent (in file format) |
257 | - $flag_path = './files/member_extra_info/new_message_flags/' . getNumberingPath($receiver_srl); |
|
257 | + $flag_path = './files/member_extra_info/new_message_flags/'.getNumberingPath($receiver_srl); |
|
258 | 258 | FileHandler::makeDir($flag_path); |
259 | 259 | $flag_file = sprintf('%s%s', $flag_path, $receiver_srl); |
260 | 260 | $flag_count = FileHandler::readFile($flag_file); |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | function procCommunicationStoreMessage() |
273 | 273 | { |
274 | 274 | // Check login information |
275 | - if(!Context::get('is_logged')) |
|
275 | + if (!Context::get('is_logged')) |
|
276 | 276 | { |
277 | 277 | return new Object(-1, 'msg_not_logged'); |
278 | 278 | } |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | |
281 | 281 | // Check variable |
282 | 282 | $message_srl = Context::get('message_srl'); |
283 | - if(!$message_srl) |
|
283 | + if (!$message_srl) |
|
284 | 284 | { |
285 | 285 | return new Object(-1, 'msg_invalid_request'); |
286 | 286 | } |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | // get the message |
289 | 289 | $oCommunicationModel = getModel('communication'); |
290 | 290 | $message = $oCommunicationModel->getSelectedMessage($message_srl); |
291 | - if(!$message || $message->message_type != 'R') |
|
291 | + if (!$message || $message->message_type != 'R') |
|
292 | 292 | { |
293 | 293 | return new Object(-1, 'msg_invalid_request'); |
294 | 294 | } |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | $args->message_srl = $message_srl; |
298 | 298 | $args->receiver_srl = $logged_info->member_srl; |
299 | 299 | $output = executeQuery('communication.setMessageStored', $args); |
300 | - if(!$output->toBool()) |
|
300 | + if (!$output->toBool()) |
|
301 | 301 | { |
302 | 302 | return $output; |
303 | 303 | } |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | function procCommunicationDeleteMessage() |
313 | 313 | { |
314 | 314 | // Check login information |
315 | - if(!Context::get('is_logged')) |
|
315 | + if (!Context::get('is_logged')) |
|
316 | 316 | { |
317 | 317 | return new Object(-1, 'msg_not_logged'); |
318 | 318 | } |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | |
323 | 323 | // Check the variable |
324 | 324 | $message_srl = Context::get('message_srl'); |
325 | - if(!$message_srl) |
|
325 | + if (!$message_srl) |
|
326 | 326 | { |
327 | 327 | return new Object(-1, 'msg_invalid_request'); |
328 | 328 | } |
@@ -330,23 +330,23 @@ discard block |
||
330 | 330 | // Get the message |
331 | 331 | $oCommunicationModel = getModel('communication'); |
332 | 332 | $message = $oCommunicationModel->getSelectedMessage($message_srl); |
333 | - if(!$message) |
|
333 | + if (!$message) |
|
334 | 334 | { |
335 | 335 | return new Object(-1, 'msg_invalid_request'); |
336 | 336 | } |
337 | 337 | |
338 | 338 | // Check the grant |
339 | - switch($message->message_type) |
|
339 | + switch ($message->message_type) |
|
340 | 340 | { |
341 | 341 | case 'S': |
342 | - if($message->sender_srl != $member_srl) |
|
342 | + if ($message->sender_srl != $member_srl) |
|
343 | 343 | { |
344 | 344 | return new Object(-1, 'msg_invalid_request'); |
345 | 345 | } |
346 | 346 | break; |
347 | 347 | |
348 | 348 | case 'R': |
349 | - if($message->receiver_srl != $member_srl) |
|
349 | + if ($message->receiver_srl != $member_srl) |
|
350 | 350 | { |
351 | 351 | return new Object(-1, 'msg_invalid_request'); |
352 | 352 | } |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | $args = new stdClass(); |
358 | 358 | $args->message_srl = $message_srl; |
359 | 359 | $output = executeQuery('communication.deleteMessage', $args); |
360 | - if(!$output->toBool()) |
|
360 | + if (!$output->toBool()) |
|
361 | 361 | { |
362 | 362 | return $output; |
363 | 363 | } |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | function procCommunicationDeleteMessages() |
373 | 373 | { |
374 | 374 | // Check login information |
375 | - if(!Context::get('is_logged')) |
|
375 | + if (!Context::get('is_logged')) |
|
376 | 376 | { |
377 | 377 | return new Object(-1, 'msg_not_logged'); |
378 | 378 | } |
@@ -381,41 +381,41 @@ discard block |
||
381 | 381 | $member_srl = $logged_info->member_srl; |
382 | 382 | |
383 | 383 | // check variables |
384 | - if(!Context::get('message_srl_list')) |
|
384 | + if (!Context::get('message_srl_list')) |
|
385 | 385 | { |
386 | 386 | return new Object(-1, 'msg_cart_is_null'); |
387 | 387 | } |
388 | 388 | |
389 | 389 | $message_srl_list = Context::get('message_srl_list'); |
390 | - if(!is_array($message_srl_list)) |
|
390 | + if (!is_array($message_srl_list)) |
|
391 | 391 | { |
392 | 392 | $message_srl_list = explode('|@|', trim($message_srl_list)); |
393 | 393 | } |
394 | 394 | |
395 | - if(!count($message_srl_list)) |
|
395 | + if (!count($message_srl_list)) |
|
396 | 396 | { |
397 | 397 | return new Object(-1, 'msg_cart_is_null'); |
398 | 398 | } |
399 | 399 | |
400 | 400 | $message_type = Context::get('message_type'); |
401 | - if(!$message_type || !in_array($message_type, array('R', 'S', 'T'))) |
|
401 | + if (!$message_type || !in_array($message_type, array('R', 'S', 'T'))) |
|
402 | 402 | { |
403 | 403 | return new Object(-1, 'msg_invalid_request'); |
404 | 404 | } |
405 | 405 | |
406 | 406 | $message_count = count($message_srl_list); |
407 | 407 | $target = array(); |
408 | - for($i = 0; $i < $message_count; $i++) |
|
408 | + for ($i = 0; $i < $message_count; $i++) |
|
409 | 409 | { |
410 | 410 | $message_srl = (int) trim($message_srl_list[$i]); |
411 | - if(!$message_srl) |
|
411 | + if (!$message_srl) |
|
412 | 412 | { |
413 | 413 | continue; |
414 | 414 | } |
415 | 415 | |
416 | 416 | $target[] = $message_srl; |
417 | 417 | } |
418 | - if(!count($target)) |
|
418 | + if (!count($target)) |
|
419 | 419 | { |
420 | 420 | return new Object(-1, 'msg_cart_is_null'); |
421 | 421 | } |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | $args->message_srls = implode(',', $target); |
426 | 426 | $args->message_type = $message_type; |
427 | 427 | |
428 | - if($message_type == 'S') |
|
428 | + if ($message_type == 'S') |
|
429 | 429 | { |
430 | 430 | $args->sender_srl = $member_srl; |
431 | 431 | } |
@@ -435,7 +435,7 @@ discard block |
||
435 | 435 | } |
436 | 436 | |
437 | 437 | $output = executeQuery('communication.deleteMessages', $args); |
438 | - if(!$output->toBool()) |
|
438 | + if (!$output->toBool()) |
|
439 | 439 | { |
440 | 440 | return $output; |
441 | 441 | } |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | function procCommunicationAddFriend() |
454 | 454 | { |
455 | 455 | // Check login information |
456 | - if(!Context::get('is_logged')) |
|
456 | + if (!Context::get('is_logged')) |
|
457 | 457 | { |
458 | 458 | return new Object(-1, 'msg_not_logged'); |
459 | 459 | } |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | $logged_info = Context::get('logged_info'); |
462 | 462 | |
463 | 463 | $target_srl = (int) trim(Context::get('target_srl')); |
464 | - if(!$target_srl) |
|
464 | + if (!$target_srl) |
|
465 | 465 | { |
466 | 466 | return new Object(-1, 'msg_invalid_request'); |
467 | 467 | } |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | $args->member_srl = $logged_info->member_srl; |
475 | 475 | $args->target_srl = $target_srl; |
476 | 476 | $output = executeQuery('communication.addFriend', $args); |
477 | - if(!$output->toBool()) |
|
477 | + if (!$output->toBool()) |
|
478 | 478 | { |
479 | 479 | return $output; |
480 | 480 | } |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | $this->add('member_srl', $target_srl); |
483 | 483 | $this->setMessage('success_registed'); |
484 | 484 | |
485 | - if(!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) |
|
485 | + if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) |
|
486 | 486 | { |
487 | 487 | global $lang; |
488 | 488 | htmlHeader(); |
@@ -501,7 +501,7 @@ discard block |
||
501 | 501 | function procCommunicationMoveFriend() |
502 | 502 | { |
503 | 503 | // Check login information |
504 | - if(!Context::get('is_logged')) |
|
504 | + if (!Context::get('is_logged')) |
|
505 | 505 | { |
506 | 506 | return new Object(-1, 'msg_not_logged'); |
507 | 507 | } |
@@ -510,27 +510,27 @@ discard block |
||
510 | 510 | |
511 | 511 | // Check variables |
512 | 512 | $friend_srl_list = Context::get('friend_srl_list'); |
513 | - if(!$friend_srl_list) |
|
513 | + if (!$friend_srl_list) |
|
514 | 514 | { |
515 | 515 | return new Object(-1, 'msg_cart_is_null'); |
516 | 516 | } |
517 | 517 | |
518 | - if(!is_array($friend_srl_list)) |
|
518 | + if (!is_array($friend_srl_list)) |
|
519 | 519 | { |
520 | 520 | $friend_srl_list = explode('|@|', $friend_srl_list); |
521 | 521 | } |
522 | 522 | |
523 | - if(!count($friend_srl_list)) |
|
523 | + if (!count($friend_srl_list)) |
|
524 | 524 | { |
525 | 525 | return new Object(-1, 'msg_cart_is_null'); |
526 | 526 | } |
527 | 527 | |
528 | 528 | $friend_count = count($friend_srl_list); |
529 | 529 | $target = array(); |
530 | - for($i = 0; $i < $friend_count; $i++) |
|
530 | + for ($i = 0; $i < $friend_count; $i++) |
|
531 | 531 | { |
532 | 532 | $friend_srl = (int) trim($friend_srl_list[$i]); |
533 | - if(!$friend_srl) |
|
533 | + if (!$friend_srl) |
|
534 | 534 | { |
535 | 535 | continue; |
536 | 536 | } |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | $target[] = $friend_srl; |
539 | 539 | } |
540 | 540 | |
541 | - if(!count($target)) |
|
541 | + if (!count($target)) |
|
542 | 542 | { |
543 | 543 | return new Object(-1, 'msg_cart_is_null'); |
544 | 544 | } |
@@ -550,7 +550,7 @@ discard block |
||
550 | 550 | $args->friend_group_srl = Context::get('target_friend_group_srl'); |
551 | 551 | |
552 | 552 | $output = executeQuery('communication.moveFriend', $args); |
553 | - if(!$output->toBool()) |
|
553 | + if (!$output->toBool()) |
|
554 | 554 | { |
555 | 555 | return $output; |
556 | 556 | } |
@@ -568,7 +568,7 @@ discard block |
||
568 | 568 | function procCommunicationDeleteFriend() |
569 | 569 | { |
570 | 570 | // Check login information |
571 | - if(!Context::get('is_logged')) |
|
571 | + if (!Context::get('is_logged')) |
|
572 | 572 | { |
573 | 573 | return new Object(-1, 'msg_not_logged'); |
574 | 574 | } |
@@ -579,12 +579,12 @@ discard block |
||
579 | 579 | // Check variables |
580 | 580 | $friend_srl_list = Context::get('friend_srl_list'); |
581 | 581 | |
582 | - if(!is_array($friend_srl_list)) |
|
582 | + if (!is_array($friend_srl_list)) |
|
583 | 583 | { |
584 | 584 | $friend_srl_list = explode('|@|', $friend_srl_list); |
585 | 585 | } |
586 | 586 | |
587 | - if(!count($friend_srl_list)) |
|
587 | + if (!count($friend_srl_list)) |
|
588 | 588 | { |
589 | 589 | return new Object(-1, 'msg_cart_is_null'); |
590 | 590 | } |
@@ -592,10 +592,10 @@ discard block |
||
592 | 592 | $friend_count = count($friend_srl_list); |
593 | 593 | $target = array(); |
594 | 594 | |
595 | - for($i = 0; $i < $friend_count; $i++) |
|
595 | + for ($i = 0; $i < $friend_count; $i++) |
|
596 | 596 | { |
597 | 597 | $friend_srl = (int) trim($friend_srl_list[$i]); |
598 | - if(!$friend_srl) |
|
598 | + if (!$friend_srl) |
|
599 | 599 | { |
600 | 600 | continue; |
601 | 601 | } |
@@ -603,7 +603,7 @@ discard block |
||
603 | 603 | $target[] = $friend_srl; |
604 | 604 | } |
605 | 605 | |
606 | - if(!count($target)) |
|
606 | + if (!count($target)) |
|
607 | 607 | { |
608 | 608 | return new Object(-1, 'msg_cart_is_null'); |
609 | 609 | } |
@@ -613,7 +613,7 @@ discard block |
||
613 | 613 | $args->friend_srls = implode(',', $target); |
614 | 614 | $args->member_srl = $logged_info->member_srl; |
615 | 615 | $output = executeQuery('communication.deleteFriend', $args); |
616 | - if(!$output->toBool()) |
|
616 | + if (!$output->toBool()) |
|
617 | 617 | { |
618 | 618 | return $output; |
619 | 619 | } |
@@ -631,7 +631,7 @@ discard block |
||
631 | 631 | function procCommunicationAddFriendGroup() |
632 | 632 | { |
633 | 633 | // Check login information |
634 | - if(!Context::get('is_logged')) |
|
634 | + if (!Context::get('is_logged')) |
|
635 | 635 | { |
636 | 636 | return new Object(-1, 'msg_not_logged'); |
637 | 637 | } |
@@ -645,13 +645,13 @@ discard block |
||
645 | 645 | $args->title = Context::get('title'); |
646 | 646 | $args->title = htmlspecialchars($args->title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
647 | 647 | |
648 | - if(!$args->title) |
|
648 | + if (!$args->title) |
|
649 | 649 | { |
650 | 650 | return new Object(-1, 'msg_invalid_request'); |
651 | 651 | } |
652 | 652 | |
653 | 653 | // modify if friend_group_srl exists. |
654 | - if($args->friend_group_srl) |
|
654 | + if ($args->friend_group_srl) |
|
655 | 655 | { |
656 | 656 | $output = executeQuery('communication.renameFriendGroup', $args); |
657 | 657 | $msg_code = 'success_updated'; |
@@ -663,9 +663,9 @@ discard block |
||
663 | 663 | $msg_code = 'success_registed'; |
664 | 664 | } |
665 | 665 | |
666 | - if(!$output->toBool()) |
|
666 | + if (!$output->toBool()) |
|
667 | 667 | { |
668 | - if(!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) |
|
668 | + if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) |
|
669 | 669 | { |
670 | 670 | global $lang; |
671 | 671 | htmlHeader(); |
@@ -682,7 +682,7 @@ discard block |
||
682 | 682 | } |
683 | 683 | else |
684 | 684 | { |
685 | - if(!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) |
|
685 | + if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) |
|
686 | 686 | { |
687 | 687 | global $lang; |
688 | 688 | htmlHeader(); |
@@ -707,7 +707,7 @@ discard block |
||
707 | 707 | function procCommunicationRenameFriendGroup() |
708 | 708 | { |
709 | 709 | // Check login information |
710 | - if(!Context::get('is_logged')) |
|
710 | + if (!Context::get('is_logged')) |
|
711 | 711 | { |
712 | 712 | return new Object(-1, 'msg_not_logged'); |
713 | 713 | } |
@@ -721,13 +721,13 @@ discard block |
||
721 | 721 | $args->title = Context::get('title'); |
722 | 722 | $args->title = htmlspecialchars($args->title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
723 | 723 | |
724 | - if(!$args->title) |
|
724 | + if (!$args->title) |
|
725 | 725 | { |
726 | 726 | return new Object(-1, 'msg_invalid_request'); |
727 | 727 | } |
728 | 728 | |
729 | 729 | $output = executeQuery('communication.renameFriendGroup', $args); |
730 | - if(!$output->toBool()) |
|
730 | + if (!$output->toBool()) |
|
731 | 731 | { |
732 | 732 | return $output; |
733 | 733 | } |
@@ -742,7 +742,7 @@ discard block |
||
742 | 742 | function procCommunicationDeleteFriendGroup() |
743 | 743 | { |
744 | 744 | // Check login information |
745 | - if(!Context::get('is_logged')) |
|
745 | + if (!Context::get('is_logged')) |
|
746 | 746 | { |
747 | 747 | return new Object(-1, 'msg_not_logged'); |
748 | 748 | } |
@@ -754,7 +754,7 @@ discard block |
||
754 | 754 | $args->friend_group_srl = Context::get('friend_group_srl'); |
755 | 755 | $args->member_srl = $logged_info->member_srl; |
756 | 756 | $output = executeQuery('communication.deleteFriendGroup', $args); |
757 | - if(!$output->toBool()) |
|
757 | + if (!$output->toBool()) |
|
758 | 758 | { |
759 | 759 | return $output; |
760 | 760 | } |
@@ -35,12 +35,12 @@ discard block |
||
35 | 35 | { |
36 | 36 | // Add site_srl to the counter |
37 | 37 | $oDB = DB::getInstance(); |
38 | - if(!$oDB->isColumnExists('counter_log', 'site_srl')) |
|
38 | + if (!$oDB->isColumnExists('counter_log', 'site_srl')) |
|
39 | 39 | { |
40 | 40 | return TRUE; |
41 | 41 | } |
42 | 42 | |
43 | - if(!$oDB->isIndexExists('counter_log', 'idx_site_counter_log')) |
|
43 | + if (!$oDB->isIndexExists('counter_log', 'idx_site_counter_log')) |
|
44 | 44 | { |
45 | 45 | return TRUE; |
46 | 46 | } |
@@ -58,12 +58,12 @@ discard block |
||
58 | 58 | // Add site_srl to the counter |
59 | 59 | $oDB = DB::getInstance(); |
60 | 60 | |
61 | - if(!$oDB->isColumnExists('counter_log', 'site_srl')) |
|
61 | + if (!$oDB->isColumnExists('counter_log', 'site_srl')) |
|
62 | 62 | { |
63 | 63 | $oDB->addColumn('counter_log', 'site_srl', 'number', 11, 0, TRUE); |
64 | 64 | } |
65 | 65 | |
66 | - if(!$oDB->isIndexExists('counter_log', 'idx_site_counter_log')) |
|
66 | + if (!$oDB->isIndexExists('counter_log', 'idx_site_counter_log')) |
|
67 | 67 | { |
68 | 68 | $oDB->addIndex('counter_log', 'idx_site_counter_log', array('site_srl', 'ipaddress'), FALSE); |
69 | 69 | } |
@@ -52,16 +52,14 @@ discard block |
||
52 | 52 | { |
53 | 53 | // Register pageview |
54 | 54 | $this->insertPageView($site_srl); |
55 | - } |
|
56 | - else // If unregistered IP |
|
55 | + } else // If unregistered IP |
|
57 | 56 | { |
58 | 57 | // Leave logs |
59 | 58 | $this->insertLog($site_srl); |
60 | 59 | // Register unique and pageview |
61 | 60 | $this->insertUniqueVisitor($site_srl); |
62 | 61 | } |
63 | - } |
|
64 | - else // Register today's row if not exist |
|
62 | + } else // Register today's row if not exist |
|
65 | 63 | { |
66 | 64 | $this->insertTodayStatus(0, $site_srl); |
67 | 65 | // check user if the previous row exists |
@@ -101,8 +99,7 @@ discard block |
||
101 | 99 | { |
102 | 100 | $args->site_srl = $site_srl; |
103 | 101 | $output = executeQuery('counter.updateSiteCounterUnique', $args); |
104 | - } |
|
105 | - else |
|
102 | + } else |
|
106 | 103 | { |
107 | 104 | $output = executeQuery('counter.updateCounterUnique', $args); |
108 | 105 | } |
@@ -123,8 +120,7 @@ discard block |
||
123 | 120 | { |
124 | 121 | $args->site_srl = $site_srl; |
125 | 122 | executeQuery('counter.updateSiteCounterPageview', $args); |
126 | - } |
|
127 | - else |
|
123 | + } else |
|
128 | 124 | { |
129 | 125 | executeQuery('counter.updateCounterPageview', $args); |
130 | 126 | } |
@@ -145,8 +141,7 @@ discard block |
||
145 | 141 | { |
146 | 142 | $args->site_srl = $site_srl; |
147 | 143 | executeQuery('counter.insertSiteTodayStatus', $args); |
148 | - } |
|
149 | - else |
|
144 | + } else |
|
150 | 145 | { |
151 | 146 | executeQuery('counter.insertTodayStatus', $args); |
152 | 147 | } |
@@ -165,8 +160,7 @@ discard block |
||
165 | 160 | if($regdate) |
166 | 161 | { |
167 | 162 | $args->regdate = $regdate; |
168 | - } |
|
169 | - else |
|
163 | + } else |
|
170 | 164 | { |
171 | 165 | $args->regdate = date("Ymd"); |
172 | 166 | } |
@@ -178,8 +172,7 @@ discard block |
||
178 | 172 | |
179 | 173 | $u_args->site_srl = $site_srl; // /< when inserting a daily row, attempt to inser total rows(where regdate=0) together |
180 | 174 | executeQuery($query_id, $u_args); |
181 | - } |
|
182 | - else |
|
175 | + } else |
|
183 | 176 | { |
184 | 177 | $query_id = 'counter.insertTodayStatus'; |
185 | 178 | executeQuery($query_id); // /< when inserting a daily row, attempt to inser total rows(where regdate=0) together |
@@ -46,9 +46,9 @@ discard block |
||
46 | 46 | // Check the logs |
47 | 47 | $oCounterModel = getModel('counter'); |
48 | 48 | |
49 | - if($oCounterModel->isInsertedTodayStatus($site_srl)) |
|
49 | + if ($oCounterModel->isInsertedTodayStatus($site_srl)) |
|
50 | 50 | { |
51 | - if($oCounterModel->isLogged($site_srl)) |
|
51 | + if ($oCounterModel->isLogged($site_srl)) |
|
52 | 52 | { |
53 | 53 | // Register pageview |
54 | 54 | $this->insertPageView($site_srl); |
@@ -95,9 +95,9 @@ discard block |
||
95 | 95 | function insertUniqueVisitor($site_srl = 0) |
96 | 96 | { |
97 | 97 | $args = new stdClass(); |
98 | - $args->regdate = '0,' . date('Ymd'); |
|
98 | + $args->regdate = '0,'.date('Ymd'); |
|
99 | 99 | |
100 | - if($site_srl) |
|
100 | + if ($site_srl) |
|
101 | 101 | { |
102 | 102 | $args->site_srl = $site_srl; |
103 | 103 | $output = executeQuery('counter.updateSiteCounterUnique', $args); |
@@ -117,9 +117,9 @@ discard block |
||
117 | 117 | function insertPageView($site_srl = 0) |
118 | 118 | { |
119 | 119 | $args = new stdClass; |
120 | - $args->regdate = '0,' . date('Ymd'); |
|
120 | + $args->regdate = '0,'.date('Ymd'); |
|
121 | 121 | |
122 | - if($site_srl) |
|
122 | + if ($site_srl) |
|
123 | 123 | { |
124 | 124 | $args->site_srl = $site_srl; |
125 | 125 | executeQuery('counter.updateSiteCounterPageview', $args); |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | $args = new stdClass(); |
142 | 142 | $args->regdate = 0; |
143 | 143 | |
144 | - if($site_srl) |
|
144 | + if ($site_srl) |
|
145 | 145 | { |
146 | 146 | $args->site_srl = $site_srl; |
147 | 147 | executeQuery('counter.insertSiteTodayStatus', $args); |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | function insertTodayStatus($regdate = 0, $site_srl = 0) |
163 | 163 | { |
164 | 164 | $args = new stdClass(); |
165 | - if($regdate) |
|
165 | + if ($regdate) |
|
166 | 166 | { |
167 | 167 | $args->regdate = $regdate; |
168 | 168 | } |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | $args->regdate = date("Ymd"); |
172 | 172 | } |
173 | 173 | |
174 | - if($site_srl) |
|
174 | + if ($site_srl) |
|
175 | 175 | { |
176 | 176 | $args->site_srl = $site_srl; |
177 | 177 | $query_id = 'counter.insertSiteTodayStatus'; |
@@ -42,7 +42,9 @@ discard block |
||
42 | 42 | if($iplogged === false) |
43 | 43 | { |
44 | 44 | $output = executeQuery('counter.getCounterLog', $args); |
45 | - if($output->data->count) $iplogged = TRUE; |
|
45 | + if($output->data->count) { |
|
46 | + $iplogged = TRUE; |
|
47 | + } |
|
46 | 48 | } |
47 | 49 | |
48 | 50 | if($iplogged && $oCacheHandler->isSupport()) |
@@ -78,8 +80,7 @@ discard block |
||
78 | 80 | { |
79 | 81 | $args->site_srl = $site_srl; |
80 | 82 | $output = executeQuery('counter.getSiteTodayStatus', $args); |
81 | - } |
|
82 | - else |
|
83 | + } else |
|
83 | 84 | { |
84 | 85 | $output = executeQuery('counter.getTodayStatus', $args); |
85 | 86 | } |
@@ -113,8 +114,7 @@ discard block |
||
113 | 114 | { |
114 | 115 | $args->site_srl = $site_srl; |
115 | 116 | $output = executeQuery('counter.getSiteCounterStatusDays', $args); |
116 | - } |
|
117 | - else |
|
117 | + } else |
|
118 | 118 | { |
119 | 119 | $output = executeQuery('counter.getCounterStatusDays', $args); |
120 | 120 | } |
@@ -125,7 +125,9 @@ discard block |
||
125 | 125 | return $status; |
126 | 126 | } |
127 | 127 | |
128 | - if(!is_array($status)) $status = array($status); |
|
128 | + if(!is_array($status)) { |
|
129 | + $status = array($status); |
|
130 | + } |
|
129 | 131 | $output = array(); |
130 | 132 | foreach($status as $val) |
131 | 133 | { |
@@ -157,8 +159,7 @@ discard block |
||
157 | 159 | $args = new stdClass(); |
158 | 160 | $args->site_srl = $site_srl; |
159 | 161 | $output = executeQuery('counter.getSiteStartLogDate', $args); |
160 | - } |
|
161 | - else |
|
162 | + } else |
|
162 | 163 | { |
163 | 164 | $output = executeQuery('counter.getStartLogDate'); |
164 | 165 | } |
@@ -178,8 +179,7 @@ discard block |
||
178 | 179 | { |
179 | 180 | $args->site_srl = $site_srl; |
180 | 181 | $output = executeQuery('counter.getSiteCounterStatus', $args); |
181 | - } |
|
182 | - else |
|
182 | + } else |
|
183 | 183 | { |
184 | 184 | $output = executeQuery('counter.getCounterStatus', $args); |
185 | 185 | } |
@@ -187,7 +187,9 @@ discard block |
||
187 | 187 | $count = (int)($isPageView ? $output->data->pageview : $output->data->unique_visitor); |
188 | 188 | $status->list[$i] = $count; |
189 | 189 | |
190 | - if($count > $max) $max = $count; |
|
190 | + if($count > $max) { |
|
191 | + $max = $count; |
|
192 | + } |
|
191 | 193 | |
192 | 194 | $sum += $count; |
193 | 195 | } |
@@ -224,8 +226,7 @@ discard block |
||
224 | 226 | { |
225 | 227 | $args->site_srl = $site_srl; |
226 | 228 | $output = executeQuery('counter.getSiteCounterStatus', $args); |
227 | - } |
|
228 | - else |
|
229 | + } else |
|
229 | 230 | { |
230 | 231 | $output = executeQuery('counter.getCounterStatus', $args); |
231 | 232 | } |
@@ -233,7 +234,9 @@ discard block |
||
233 | 234 | $count = (int)($isPageView ? $output->data->pageview : $output->data->unique_visitor); |
234 | 235 | $status->list[$day] = $count; |
235 | 236 | |
236 | - if($count > $max) $max = $count; |
|
237 | + if($count > $max) { |
|
238 | + $max = $count; |
|
239 | + } |
|
237 | 240 | |
238 | 241 | $sum += $count; |
239 | 242 | } |
@@ -251,8 +254,7 @@ discard block |
||
251 | 254 | { |
252 | 255 | $args->site_srl = $site_srl; |
253 | 256 | $output = executeQuery('counter.getSiteCounterStatus', $args); |
254 | - } |
|
255 | - else |
|
257 | + } else |
|
256 | 258 | { |
257 | 259 | $output = executeQuery('counter.getCounterStatus', $args); |
258 | 260 | } |
@@ -260,7 +262,9 @@ discard block |
||
260 | 262 | $count = (int)($isPageView ? $output->data->pageview : $output->data->unique_visitor); |
261 | 263 | $status->list[$i] = $count; |
262 | 264 | |
263 | - if($count > $max) $max = $count; |
|
265 | + if($count > $max) { |
|
266 | + $max = $count; |
|
267 | + } |
|
264 | 268 | |
265 | 269 | $sum += $count; |
266 | 270 | } |
@@ -277,8 +281,7 @@ discard block |
||
277 | 281 | { |
278 | 282 | $args->site_srl = $site_srl; |
279 | 283 | $output = executeQuery('counter.getSiteCounterLogStatus', $args); |
280 | - } |
|
281 | - else |
|
284 | + } else |
|
282 | 285 | { |
283 | 286 | $args->site_srl = 0; |
284 | 287 | $output = executeQuery('counter.getCounterLogStatus', $args); |
@@ -287,7 +290,9 @@ discard block |
||
287 | 290 | $count = (int) $output->data->count; |
288 | 291 | $status->list[$i] = $count; |
289 | 292 | |
290 | - if($count > $max) $max = $count; |
|
293 | + if($count > $max) { |
|
294 | + $max = $count; |
|
295 | + } |
|
291 | 296 | |
292 | 297 | $sum += $count; |
293 | 298 | } |
@@ -308,8 +313,7 @@ discard block |
||
308 | 313 | { |
309 | 314 | $args->site_srl = $site_srl; |
310 | 315 | $output = executeQuery('counter.getSiteCounterStatus', $args); |
311 | - } |
|
312 | - else |
|
316 | + } else |
|
313 | 317 | { |
314 | 318 | $output = executeQuery('counter.getCounterStatus', $args); |
315 | 319 | } |
@@ -317,7 +321,9 @@ discard block |
||
317 | 321 | $count = (int)($isPageView ? $output->data->pageview : $output->data->unique_visitor); |
318 | 322 | $status->list[$i] = $count; |
319 | 323 | |
320 | - if($count > $max) $max = $count; |
|
324 | + if($count > $max) { |
|
325 | + $max = $count; |
|
326 | + } |
|
321 | 327 | |
322 | 328 | $sum += $count; |
323 | 329 | } |
@@ -32,20 +32,20 @@ discard block |
||
32 | 32 | |
33 | 33 | $iplogged = false; |
34 | 34 | $oCacheHandler = CacheHandler::getInstance('object'); |
35 | - if($oCacheHandler->isSupport()) |
|
35 | + if ($oCacheHandler->isSupport()) |
|
36 | 36 | { |
37 | - $object_key = 'counter:' . $site_srl . '_' . str_replace(array('.', ':'), '-', $args->ipaddress); |
|
38 | - $cache_key = $oCacheHandler->getGroupKey('counterIpLogged_' . $args->regdate, $object_key); |
|
37 | + $object_key = 'counter:'.$site_srl.'_'.str_replace(array('.', ':'), '-', $args->ipaddress); |
|
38 | + $cache_key = $oCacheHandler->getGroupKey('counterIpLogged_'.$args->regdate, $object_key); |
|
39 | 39 | $iplogged = $oCacheHandler->get($cache_key); |
40 | 40 | } |
41 | 41 | |
42 | - if($iplogged === false) |
|
42 | + if ($iplogged === false) |
|
43 | 43 | { |
44 | 44 | $output = executeQuery('counter.getCounterLog', $args); |
45 | - if($output->data->count) $iplogged = TRUE; |
|
45 | + if ($output->data->count) $iplogged = TRUE; |
|
46 | 46 | } |
47 | 47 | |
48 | - if($iplogged && $oCacheHandler->isSupport()) |
|
48 | + if ($iplogged && $oCacheHandler->isSupport()) |
|
49 | 49 | { |
50 | 50 | $oCacheHandler->put($cache_key, $iplogged); |
51 | 51 | } |
@@ -66,15 +66,15 @@ discard block |
||
66 | 66 | |
67 | 67 | $insertedTodayStatus = false; |
68 | 68 | $oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE); |
69 | - if($oCacheHandler->isSupport()) |
|
69 | + if ($oCacheHandler->isSupport()) |
|
70 | 70 | { |
71 | - $cache_key = 'counter:insertedTodayStatus:' . $site_srl . '_' . $args->regdate; |
|
71 | + $cache_key = 'counter:insertedTodayStatus:'.$site_srl.'_'.$args->regdate; |
|
72 | 72 | $insertedTodayStatus = $oCacheHandler->get($cache_key); |
73 | 73 | } |
74 | 74 | |
75 | - if($insertedTodayStatus === false) |
|
75 | + if ($insertedTodayStatus === false) |
|
76 | 76 | { |
77 | - if($site_srl) |
|
77 | + if ($site_srl) |
|
78 | 78 | { |
79 | 79 | $args->site_srl = $site_srl; |
80 | 80 | $output = executeQuery('counter.getSiteTodayStatus', $args); |
@@ -86,11 +86,11 @@ discard block |
||
86 | 86 | |
87 | 87 | $insertedTodayStatus = !!$output->data->count; |
88 | 88 | |
89 | - if($insertedTodayStatus && $oCacheHandler->isSupport()) |
|
89 | + if ($insertedTodayStatus && $oCacheHandler->isSupport()) |
|
90 | 90 | { |
91 | 91 | $oCacheHandler->put($cache_key, TRUE); |
92 | 92 | $_old_date = date('Ymd', strtotime('-1 day')); |
93 | - $oCacheHandler->delete('counter:insertedTodayStatus:' . $site_srl . '_' . $_old_date); |
|
93 | + $oCacheHandler->delete('counter:insertedTodayStatus:'.$site_srl.'_'.$_old_date); |
|
94 | 94 | } |
95 | 95 | } |
96 | 96 | |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | // If more than one date logs are selected |
110 | 110 | $args = new stdClass(); |
111 | 111 | $args->regdate = is_array($selected_date) ? join(',', $selected_date) : $selected_date; |
112 | - if($site_srl) |
|
112 | + if ($site_srl) |
|
113 | 113 | { |
114 | 114 | $args->site_srl = $site_srl; |
115 | 115 | $output = executeQuery('counter.getSiteCounterStatusDays', $args); |
@@ -120,14 +120,14 @@ discard block |
||
120 | 120 | } |
121 | 121 | $status = $output->data; |
122 | 122 | |
123 | - if(!is_array($selected_date)) |
|
123 | + if (!is_array($selected_date)) |
|
124 | 124 | { |
125 | 125 | return $status; |
126 | 126 | } |
127 | 127 | |
128 | - if(!is_array($status)) $status = array($status); |
|
128 | + if (!is_array($status)) $status = array($status); |
|
129 | 129 | $output = array(); |
130 | - foreach($status as $val) |
|
130 | + foreach ($status as $val) |
|
131 | 131 | { |
132 | 132 | $output[substr($val->regdate, 0, 8)] = $val; |
133 | 133 | } |
@@ -148,11 +148,11 @@ discard block |
||
148 | 148 | $max = 0; |
149 | 149 | $sum = 0; |
150 | 150 | |
151 | - switch($type) |
|
151 | + switch ($type) |
|
152 | 152 | { |
153 | 153 | case 'year' : |
154 | 154 | // Get a date to start counting |
155 | - if($site_srl) |
|
155 | + if ($site_srl) |
|
156 | 156 | { |
157 | 157 | $args = new stdClass(); |
158 | 158 | $args->site_srl = $site_srl; |
@@ -163,18 +163,18 @@ discard block |
||
163 | 163 | $output = executeQuery('counter.getStartLogDate'); |
164 | 164 | } |
165 | 165 | |
166 | - if(!($start_year = substr($output->data->regdate, 0, 4))) |
|
166 | + if (!($start_year = substr($output->data->regdate, 0, 4))) |
|
167 | 167 | { |
168 | 168 | $start_year = date("Y"); |
169 | 169 | } |
170 | 170 | |
171 | - for($i = $start_year, $y = date("Y"); $i <= $y; $i++) |
|
171 | + for ($i = $start_year, $y = date("Y"); $i <= $y; $i++) |
|
172 | 172 | { |
173 | 173 | $args = new stdClass(); |
174 | 174 | $args->start_date = sprintf('%04d0000', $i); |
175 | 175 | $args->end_date = sprintf('%04d1231', $i); |
176 | 176 | |
177 | - if($site_srl) |
|
177 | + if ($site_srl) |
|
178 | 178 | { |
179 | 179 | $args->site_srl = $site_srl; |
180 | 180 | $output = executeQuery('counter.getSiteCounterStatus', $args); |
@@ -184,10 +184,10 @@ discard block |
||
184 | 184 | $output = executeQuery('counter.getCounterStatus', $args); |
185 | 185 | } |
186 | 186 | |
187 | - $count = (int)($isPageView ? $output->data->pageview : $output->data->unique_visitor); |
|
187 | + $count = (int) ($isPageView ? $output->data->pageview : $output->data->unique_visitor); |
|
188 | 188 | $status->list[$i] = $count; |
189 | 189 | |
190 | - if($count > $max) $max = $count; |
|
190 | + if ($count > $max) $max = $count; |
|
191 | 191 | |
192 | 192 | $sum += $count; |
193 | 193 | } |
@@ -197,14 +197,14 @@ discard block |
||
197 | 197 | $time = strtotime($selected_date); |
198 | 198 | $w = date("D"); |
199 | 199 | |
200 | - while(date("D", $time) != "Sun") |
|
200 | + while (date("D", $time) != "Sun") |
|
201 | 201 | { |
202 | 202 | $time += 60 * 60 * 24; |
203 | 203 | } |
204 | 204 | |
205 | 205 | $time -= 60 * 60 * 24; |
206 | 206 | |
207 | - while(date("D", $time) != "Sun") |
|
207 | + while (date("D", $time) != "Sun") |
|
208 | 208 | { |
209 | 209 | $thisWeek[] = date("Ymd", $time); |
210 | 210 | $time -= 60 * 60 * 24; |
@@ -214,13 +214,13 @@ discard block |
||
214 | 214 | |
215 | 215 | asort($thisWeek); |
216 | 216 | |
217 | - foreach($thisWeek as $day) |
|
217 | + foreach ($thisWeek as $day) |
|
218 | 218 | { |
219 | 219 | $args = new stdClass(); |
220 | 220 | $args->start_date = $day; |
221 | 221 | $args->end_date = $day; |
222 | 222 | |
223 | - if($site_srl) |
|
223 | + if ($site_srl) |
|
224 | 224 | { |
225 | 225 | $args->site_srl = $site_srl; |
226 | 226 | $output = executeQuery('counter.getSiteCounterStatus', $args); |
@@ -230,10 +230,10 @@ discard block |
||
230 | 230 | $output = executeQuery('counter.getCounterStatus', $args); |
231 | 231 | } |
232 | 232 | |
233 | - $count = (int)($isPageView ? $output->data->pageview : $output->data->unique_visitor); |
|
233 | + $count = (int) ($isPageView ? $output->data->pageview : $output->data->unique_visitor); |
|
234 | 234 | $status->list[$day] = $count; |
235 | 235 | |
236 | - if($count > $max) $max = $count; |
|
236 | + if ($count > $max) $max = $count; |
|
237 | 237 | |
238 | 238 | $sum += $count; |
239 | 239 | } |
@@ -241,13 +241,13 @@ discard block |
||
241 | 241 | |
242 | 242 | case 'month' : |
243 | 243 | $year = substr($selected_date, 0, 4); |
244 | - for($i = 1; $i <= 12; $i++) |
|
244 | + for ($i = 1; $i <= 12; $i++) |
|
245 | 245 | { |
246 | 246 | $args = new stdClass(); |
247 | 247 | $args->start_date = sprintf('%04d%02d00', $year, $i); |
248 | 248 | $args->end_date = sprintf('%04d%02d31', $year, $i); |
249 | 249 | |
250 | - if($site_srl) |
|
250 | + if ($site_srl) |
|
251 | 251 | { |
252 | 252 | $args->site_srl = $site_srl; |
253 | 253 | $output = executeQuery('counter.getSiteCounterStatus', $args); |
@@ -257,23 +257,23 @@ discard block |
||
257 | 257 | $output = executeQuery('counter.getCounterStatus', $args); |
258 | 258 | } |
259 | 259 | |
260 | - $count = (int)($isPageView ? $output->data->pageview : $output->data->unique_visitor); |
|
260 | + $count = (int) ($isPageView ? $output->data->pageview : $output->data->unique_visitor); |
|
261 | 261 | $status->list[$i] = $count; |
262 | 262 | |
263 | - if($count > $max) $max = $count; |
|
263 | + if ($count > $max) $max = $count; |
|
264 | 264 | |
265 | 265 | $sum += $count; |
266 | 266 | } |
267 | 267 | break; |
268 | 268 | |
269 | 269 | case 'hour' : |
270 | - for($i = 0; $i < 24; $i++) |
|
270 | + for ($i = 0; $i < 24; $i++) |
|
271 | 271 | { |
272 | 272 | $args = new stdClass(); |
273 | 273 | $args->start_date = sprintf('%08d%02d0000', $selected_date, $i); |
274 | 274 | $args->end_date = sprintf('%08d%02d5959', $selected_date, $i); |
275 | 275 | |
276 | - if($site_srl) |
|
276 | + if ($site_srl) |
|
277 | 277 | { |
278 | 278 | $args->site_srl = $site_srl; |
279 | 279 | $output = executeQuery('counter.getSiteCounterLogStatus', $args); |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | $count = (int) $output->data->count; |
288 | 288 | $status->list[$i] = $count; |
289 | 289 | |
290 | - if($count > $max) $max = $count; |
|
290 | + if ($count > $max) $max = $count; |
|
291 | 291 | |
292 | 292 | $sum += $count; |
293 | 293 | } |
@@ -298,13 +298,13 @@ discard block |
||
298 | 298 | $month = substr($selected_date, 4, 2); |
299 | 299 | $end_day = date('t', mktime(0, 0, 0, $month, 1, $year)); |
300 | 300 | |
301 | - for($i = 1; $i <= $end_day; $i++) |
|
301 | + for ($i = 1; $i <= $end_day; $i++) |
|
302 | 302 | { |
303 | 303 | $args = new stdClass(); |
304 | 304 | $args->start_date = sprintf('%04d%02d%02d', $year, $month, $i); |
305 | 305 | $args->end_date = sprintf('%04d%02d%02d', $year, $month, $i); |
306 | 306 | |
307 | - if($site_srl) |
|
307 | + if ($site_srl) |
|
308 | 308 | { |
309 | 309 | $args->site_srl = $site_srl; |
310 | 310 | $output = executeQuery('counter.getSiteCounterStatus', $args); |
@@ -314,10 +314,10 @@ discard block |
||
314 | 314 | $output = executeQuery('counter.getCounterStatus', $args); |
315 | 315 | } |
316 | 316 | |
317 | - $count = (int)($isPageView ? $output->data->pageview : $output->data->unique_visitor); |
|
317 | + $count = (int) ($isPageView ? $output->data->pageview : $output->data->unique_visitor); |
|
318 | 318 | $status->list[$i] = $count; |
319 | 319 | |
320 | - if($count > $max) $max = $count; |
|
320 | + if ($count > $max) $max = $count; |
|
321 | 321 | |
322 | 322 | $sum += $count; |
323 | 323 | } |
@@ -337,9 +337,9 @@ discard block |
||
337 | 337 | $output1 = $this->getHourlyStatus('week', $date1); |
338 | 338 | |
339 | 339 | $tmp = array(); |
340 | - foreach($output1->list as $key => $value) |
|
340 | + foreach ($output1->list as $key => $value) |
|
341 | 341 | { |
342 | - $tmp["'" . $key . "'"] = $value; |
|
342 | + $tmp["'".$key."'"] = $value; |
|
343 | 343 | } |
344 | 344 | $output1->list = $tmp; |
345 | 345 | |
@@ -348,9 +348,9 @@ discard block |
||
348 | 348 | $output2 = $this->getHourlyStatus('week', $date2); |
349 | 349 | |
350 | 350 | $tmp = array(); |
351 | - foreach($output2->list as $key => $value) |
|
351 | + foreach ($output2->list as $key => $value) |
|
352 | 352 | { |
353 | - $tmp["'" . $key . "'"] = $value; |
|
353 | + $tmp["'".$key."'"] = $value; |
|
354 | 354 | } |
355 | 355 | $output2->list = $tmp; |
356 | 356 | |
@@ -365,9 +365,9 @@ discard block |
||
365 | 365 | $output1 = $this->getHourlyStatus('week', $date1, 0, TRUE); |
366 | 366 | |
367 | 367 | $tmp = array(); |
368 | - foreach($output1->list as $key => $value) |
|
368 | + foreach ($output1->list as $key => $value) |
|
369 | 369 | { |
370 | - $tmp["'" . $key . "'"] = $value; |
|
370 | + $tmp["'".$key."'"] = $value; |
|
371 | 371 | } |
372 | 372 | $output1->list = $tmp; |
373 | 373 | |
@@ -376,9 +376,9 @@ discard block |
||
376 | 376 | $output2 = $this->getHourlyStatus('week', $date2, 0, TRUE); |
377 | 377 | |
378 | 378 | $tmp = array(); |
379 | - foreach($output2->list as $key => $value) |
|
379 | + foreach ($output2->list as $key => $value) |
|
380 | 380 | { |
381 | - $tmp["'" . $key . "'"] = $value; |
|
381 | + $tmp["'".$key."'"] = $value; |
|
382 | 382 | } |
383 | 383 | $output2->list = $tmp; |
384 | 384 |