@@ -20,13 +20,13 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | function member() |
| 22 | 22 | { |
| 23 | - if(!Context::isInstalled()) return; |
|
| 23 | + if (!Context::isInstalled()) return; |
|
| 24 | 24 | |
| 25 | 25 | $oModuleModel = getModel('module'); |
| 26 | 26 | $member_config = $oModuleModel->getModuleConfig('member'); |
| 27 | 27 | |
| 28 | 28 | // Set to use SSL upon actions related member join/information/password and so on. 2013.02.15 |
| 29 | - if(!Context::isExistsSSLAction('dispMemberModifyPassword') && Context::getSslStatus() == 'optional') |
|
| 29 | + if (!Context::isExistsSSLAction('dispMemberModifyPassword') && Context::getSslStatus() == 'optional') |
|
| 30 | 30 | { |
| 31 | 31 | $ssl_actions = array('dispMemberModifyPassword', 'dispMemberSignUpForm', 'dispMemberModifyInfo', 'dispMemberModifyEmailAddress', 'dispMemberGetTempPassword', 'dispMemberResendAuthMail', 'dispMemberLoginForm', 'dispMemberFindAccount', 'dispMemberLeave', 'procMemberLogin', 'procMemberModifyPassword', 'procMemberInsert', 'procMemberModifyInfo', 'procMemberFindAccount', 'procMemberModifyEmailAddress', 'procMemberResendAuthMail', 'procMemberLeave'/*, 'getMemberMenu'*/, 'procMemberFindAccountByQuestion'); |
| 32 | 32 | Context::addSSLActions($ssl_actions); |
@@ -44,12 +44,12 @@ discard block |
||
| 44 | 44 | $oModuleController = getController('module'); |
| 45 | 45 | |
| 46 | 46 | $oDB = &DB::getInstance(); |
| 47 | - $oDB->addIndex("member_group","idx_site_title", array("site_srl","title"),true); |
|
| 47 | + $oDB->addIndex("member_group", "idx_site_title", array("site_srl", "title"), true); |
|
| 48 | 48 | |
| 49 | 49 | $oModuleModel = getModel('module'); |
| 50 | 50 | $config = $oModuleModel->getModuleConfig('member'); |
| 51 | 51 | |
| 52 | - if(empty($config)) |
|
| 52 | + if (empty($config)) |
|
| 53 | 53 | { |
| 54 | 54 | $isNotInstall = true; |
| 55 | 55 | $config = new stdClass; |
@@ -58,29 +58,29 @@ discard block |
||
| 58 | 58 | // Set the basic information |
| 59 | 59 | $config->enable_join = 'Y'; |
| 60 | 60 | $config->enable_openid = 'N'; |
| 61 | - if(!$config->enable_auth_mail) $config->enable_auth_mail = 'N'; |
|
| 62 | - if(!$config->image_name) $config->image_name = 'Y'; |
|
| 63 | - if(!$config->image_mark) $config->image_mark = 'Y'; |
|
| 64 | - if(!$config->profile_image) $config->profile_image = 'Y'; |
|
| 65 | - if(!$config->image_name_max_width) $config->image_name_max_width = '90'; |
|
| 66 | - if(!$config->image_name_max_height) $config->image_name_max_height = '20'; |
|
| 67 | - if(!$config->image_mark_max_width) $config->image_mark_max_width = '20'; |
|
| 68 | - if(!$config->image_mark_max_height) $config->image_mark_max_height = '20'; |
|
| 69 | - if(!$config->profile_image_max_width) $config->profile_image_max_width = '90'; |
|
| 70 | - if(!$config->profile_image_max_height) $config->profile_image_max_height = '90'; |
|
| 71 | - if($config->group_image_mark!='Y') $config->group_image_mark = 'N'; |
|
| 72 | - if(!$config->password_strength) $config->password_strength = 'normal'; |
|
| 61 | + if (!$config->enable_auth_mail) $config->enable_auth_mail = 'N'; |
|
| 62 | + if (!$config->image_name) $config->image_name = 'Y'; |
|
| 63 | + if (!$config->image_mark) $config->image_mark = 'Y'; |
|
| 64 | + if (!$config->profile_image) $config->profile_image = 'Y'; |
|
| 65 | + if (!$config->image_name_max_width) $config->image_name_max_width = '90'; |
|
| 66 | + if (!$config->image_name_max_height) $config->image_name_max_height = '20'; |
|
| 67 | + if (!$config->image_mark_max_width) $config->image_mark_max_width = '20'; |
|
| 68 | + if (!$config->image_mark_max_height) $config->image_mark_max_height = '20'; |
|
| 69 | + if (!$config->profile_image_max_width) $config->profile_image_max_width = '90'; |
|
| 70 | + if (!$config->profile_image_max_height) $config->profile_image_max_height = '90'; |
|
| 71 | + if ($config->group_image_mark != 'Y') $config->group_image_mark = 'N'; |
|
| 72 | + if (!$config->password_strength) $config->password_strength = 'normal'; |
|
| 73 | 73 | |
| 74 | - if(!$config->password_hashing_algorithm) |
|
| 74 | + if (!$config->password_hashing_algorithm) |
|
| 75 | 75 | { |
| 76 | 76 | $oPassword = new Password(); |
| 77 | 77 | $config->password_hashing_algorithm = $oPassword->getBestAlgorithm(); |
| 78 | 78 | } |
| 79 | - if(!$config->password_hashing_work_factor) |
|
| 79 | + if (!$config->password_hashing_work_factor) |
|
| 80 | 80 | { |
| 81 | 81 | $config->password_hashing_work_factor = 8; |
| 82 | 82 | } |
| 83 | - if(!$config->password_hashing_auto_upgrade) |
|
| 83 | + if (!$config->password_hashing_auto_upgrade) |
|
| 84 | 84 | { |
| 85 | 85 | $config->password_hashing_auto_upgrade = 'Y'; |
| 86 | 86 | } |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | $oMemberController = getController('member'); |
| 92 | 92 | $oMemberAdminController = getAdminController('member'); |
| 93 | 93 | |
| 94 | - if(!$config->signupForm || !is_array($config->signupForm)) |
|
| 94 | + if (!$config->signupForm || !is_array($config->signupForm)) |
|
| 95 | 95 | { |
| 96 | 96 | $identifier = $isNotInstall ? 'email_address' : 'user_id'; |
| 97 | 97 | |
@@ -106,10 +106,10 @@ discard block |
||
| 106 | 106 | $oMemberAdminController->_createFindAccountByQuestion($config->identifier); |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - $oModuleController->insertModuleConfig('member',$config); |
|
| 109 | + $oModuleController->insertModuleConfig('member', $config); |
|
| 110 | 110 | |
| 111 | 111 | $groups = $oMemberModel->getGroups(); |
| 112 | - if(!count($groups)) |
|
| 112 | + if (!count($groups)) |
|
| 113 | 113 | { |
| 114 | 114 | // Set an administrator, regular member(group1), and associate member(group2) |
| 115 | 115 | $group_args = new stdClass; |
@@ -135,10 +135,10 @@ discard block |
||
| 135 | 135 | $admin_args = new stdClass; |
| 136 | 136 | $admin_args->is_admin = 'Y'; |
| 137 | 137 | $output = executeQuery('member.getMemberList', $admin_args); |
| 138 | - if(!$output->data) |
|
| 138 | + if (!$output->data) |
|
| 139 | 139 | { |
| 140 | - $admin_info = Context::gets('password','nick_name','email_address', 'user_id'); |
|
| 141 | - if($admin_info->email_address) |
|
| 140 | + $admin_info = Context::gets('password', 'nick_name', 'email_address', 'user_id'); |
|
| 141 | + if ($admin_info->email_address) |
|
| 142 | 142 | { |
| 143 | 143 | $admin_info->user_name = 'admin'; |
| 144 | 144 | // Insert admin information |
@@ -150,16 +150,16 @@ discard block |
||
| 150 | 150 | // Register denied ID(default + module name) |
| 151 | 151 | $oModuleModel = getModel('module'); |
| 152 | 152 | $module_list = $oModuleModel->getModuleList(); |
| 153 | - foreach($module_list as $key => $val) |
|
| 153 | + foreach ($module_list as $key => $val) |
|
| 154 | 154 | { |
| 155 | - $oMemberAdminController->insertDeniedID($val->module,''); |
|
| 155 | + $oMemberAdminController->insertDeniedID($val->module, ''); |
|
| 156 | 156 | } |
| 157 | - $oMemberAdminController->insertDeniedID('www',''); |
|
| 158 | - $oMemberAdminController->insertDeniedID('root',''); |
|
| 159 | - $oMemberAdminController->insertDeniedID('administrator',''); |
|
| 160 | - $oMemberAdminController->insertDeniedID('telnet',''); |
|
| 161 | - $oMemberAdminController->insertDeniedID('ftp',''); |
|
| 162 | - $oMemberAdminController->insertDeniedID('http',''); |
|
| 157 | + $oMemberAdminController->insertDeniedID('www', ''); |
|
| 158 | + $oMemberAdminController->insertDeniedID('root', ''); |
|
| 159 | + $oMemberAdminController->insertDeniedID('administrator', ''); |
|
| 160 | + $oMemberAdminController->insertDeniedID('telnet', ''); |
|
| 161 | + $oMemberAdminController->insertDeniedID('ftp', ''); |
|
| 162 | + $oMemberAdminController->insertDeniedID('http', ''); |
|
| 163 | 163 | // Create cache directory to use in the member module |
| 164 | 164 | FileHandler::makeDir('./files/member_extra_info/image_name'); |
| 165 | 165 | FileHandler::makeDir('./files/member_extra_info/image_mark'); |
@@ -184,76 +184,76 @@ discard block |
||
| 184 | 184 | $oModuleModel = getModel('module'); |
| 185 | 185 | $oModuleController = getController('module'); |
| 186 | 186 | $version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated')); |
| 187 | - if($oModuleModel->needUpdate($version_update_id)) |
|
| 187 | + if ($oModuleModel->needUpdate($version_update_id)) |
|
| 188 | 188 | { |
| 189 | 189 | // check member directory (11/08/2007 added) |
| 190 | - if(!is_dir("./files/member_extra_info")) return true; |
|
| 190 | + if (!is_dir("./files/member_extra_info")) return true; |
|
| 191 | 191 | // check member directory (22/10/2007 added) |
| 192 | - if(!is_dir("./files/member_extra_info/profile_image")) return true; |
|
| 192 | + if (!is_dir("./files/member_extra_info/profile_image")) return true; |
|
| 193 | 193 | // Add a column(is_register) to "member_auth_mail" table (22/04/2008) |
| 194 | 194 | $act = $oDB->isColumnExists("member_auth_mail", "is_register"); |
| 195 | - if(!$act) return true; |
|
| 195 | + if (!$act) return true; |
|
| 196 | 196 | // Add a column(site_srl) to "member_group_member" table (11/15/2008) |
| 197 | - if(!$oDB->isColumnExists("member_group_member", "site_srl")) return true; |
|
| 198 | - if(!$oDB->isColumnExists("member_group", "site_srl")) return true; |
|
| 199 | - if($oDB->isIndexExists("member_group","uni_member_group_title")) return true; |
|
| 197 | + if (!$oDB->isColumnExists("member_group_member", "site_srl")) return true; |
|
| 198 | + if (!$oDB->isColumnExists("member_group", "site_srl")) return true; |
|
| 199 | + if ($oDB->isIndexExists("member_group", "uni_member_group_title")) return true; |
|
| 200 | 200 | |
| 201 | 201 | // Add a column for list_order (05/18/2011) |
| 202 | - if(!$oDB->isColumnExists("member_group", "list_order")) return true; |
|
| 202 | + if (!$oDB->isColumnExists("member_group", "list_order")) return true; |
|
| 203 | 203 | |
| 204 | 204 | // image_mark 추가 (2009. 02. 14) |
| 205 | - if(!$oDB->isColumnExists("member_group", "image_mark")) return true; |
|
| 205 | + if (!$oDB->isColumnExists("member_group", "image_mark")) return true; |
|
| 206 | 206 | // Add c column for password expiration date |
| 207 | - if(!$oDB->isColumnExists("member", "change_password_date")) return true; |
|
| 207 | + if (!$oDB->isColumnExists("member", "change_password_date")) return true; |
|
| 208 | 208 | |
| 209 | 209 | // Add columns of question and answer to verify a password |
| 210 | - if(!$oDB->isColumnExists("member", "find_account_question")) return true; |
|
| 211 | - if(!$oDB->isColumnExists("member", "find_account_answer")) return true; |
|
| 210 | + if (!$oDB->isColumnExists("member", "find_account_question")) return true; |
|
| 211 | + if (!$oDB->isColumnExists("member", "find_account_answer")) return true; |
|
| 212 | 212 | |
| 213 | - if(!$oDB->isColumnExists("member", "list_order")) return true; |
|
| 214 | - if(!$oDB->isIndexExists("member","idx_list_order")) return true; |
|
| 213 | + if (!$oDB->isColumnExists("member", "list_order")) return true; |
|
| 214 | + if (!$oDB->isIndexExists("member", "idx_list_order")) return true; |
|
| 215 | 215 | |
| 216 | 216 | $oModuleModel = getModel('module'); |
| 217 | 217 | $config = $oModuleModel->getModuleConfig('member'); |
| 218 | 218 | // check signup form ordering info |
| 219 | - if(!$config->signupForm) return true; |
|
| 219 | + if (!$config->signupForm) return true; |
|
| 220 | 220 | |
| 221 | - foreach($config->signupForm as $form) |
|
| 221 | + foreach ($config->signupForm as $form) |
|
| 222 | 222 | { |
| 223 | - if($form->name === 'email_address' && $form->isPublic !== 'N') |
|
| 223 | + if ($form->name === 'email_address' && $form->isPublic !== 'N') |
|
| 224 | 224 | { |
| 225 | 225 | return true; |
| 226 | 226 | } |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | // check agreement field exist |
| 230 | - if($config->agreement) return true; |
|
| 230 | + if ($config->agreement) return true; |
|
| 231 | 231 | |
| 232 | - if($config->skin) |
|
| 232 | + if ($config->skin) |
|
| 233 | 233 | { |
| 234 | 234 | $config_parse = explode('.', $config->skin); |
| 235 | - if(count($config_parse) > 1) |
|
| 235 | + if (count($config_parse) > 1) |
|
| 236 | 236 | { |
| 237 | 237 | $template_path = sprintf('./themes/%s/modules/member/', $config_parse[0]); |
| 238 | - if(is_dir($template_path)) return true; |
|
| 238 | + if (is_dir($template_path)) return true; |
|
| 239 | 239 | } |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | // supprot multilanguage agreement. |
| 243 | - if(is_readable('./files/member_extra_info/agreement.txt')) return true; |
|
| 243 | + if (is_readable('./files/member_extra_info/agreement.txt')) return true; |
|
| 244 | 244 | |
| 245 | 245 | // 2013. 11. 22 add menu when popup document menu called |
| 246 | - if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) return true; |
|
| 247 | - if(!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) return true; |
|
| 246 | + if (!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) return true; |
|
| 247 | + if (!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) return true; |
|
| 248 | 248 | |
| 249 | 249 | $oModuleController->insertUpdatedLog($version_update_id); |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | - if(!is_readable('./files/ruleset/insertMember.xml')) return true; |
|
| 253 | - if(!is_readable('./files/ruleset/login.xml')) return true; |
|
| 254 | - if(!is_readable('./files/ruleset/find_member_account_by_question.xml')) return true; |
|
| 252 | + if (!is_readable('./files/ruleset/insertMember.xml')) return true; |
|
| 253 | + if (!is_readable('./files/ruleset/login.xml')) return true; |
|
| 254 | + if (!is_readable('./files/ruleset/find_member_account_by_question.xml')) return true; |
|
| 255 | 255 | |
| 256 | - if($oModuleModel->needUpdate('member.1.8.43.recreate_signup_ruleset')) return true; |
|
| 256 | + if ($oModuleModel->needUpdate('member.1.8.43.recreate_signup_ruleset')) return true; |
|
| 257 | 257 | |
| 258 | 258 | return false; |
| 259 | 259 | } |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | $oMemberAdminController = getAdminController('member'); |
| 272 | 272 | $config = $oModuleModel->getModuleConfig('member'); |
| 273 | 273 | $version_update_id = implode('.', array(__CLASS__, __XE_VERSION__, 'updated')); |
| 274 | - if($oModuleModel->needUpdate($version_update_id)) |
|
| 274 | + if ($oModuleModel->needUpdate($version_update_id)) |
|
| 275 | 275 | { |
| 276 | 276 | // Check member directory |
| 277 | 277 | FileHandler::makeDir('./files/member_extra_info/image_name'); |
@@ -279,74 +279,74 @@ discard block |
||
| 279 | 279 | FileHandler::makeDir('./files/member_extra_info/signature'); |
| 280 | 280 | FileHandler::makeDir('./files/member_extra_info/profile_image'); |
| 281 | 281 | // Add a column |
| 282 | - if(!$oDB->isColumnExists("member_auth_mail", "is_register")) |
|
| 282 | + if (!$oDB->isColumnExists("member_auth_mail", "is_register")) |
|
| 283 | 283 | { |
| 284 | 284 | $oDB->addColumn("member_auth_mail", "is_register", "char", 1, "N", true); |
| 285 | 285 | } |
| 286 | 286 | // Add a column(site_srl) to "member_group_member" table (11/15/2008) |
| 287 | - if(!$oDB->isColumnExists("member_group_member", "site_srl")) |
|
| 287 | + if (!$oDB->isColumnExists("member_group_member", "site_srl")) |
|
| 288 | 288 | { |
| 289 | 289 | $oDB->addColumn("member_group_member", "site_srl", "number", 11, 0, true); |
| 290 | 290 | $oDB->addIndex("member_group_member", "idx_site_srl", "site_srl", false); |
| 291 | 291 | } |
| 292 | - if(!$oDB->isColumnExists("member_group", "site_srl")) |
|
| 292 | + if (!$oDB->isColumnExists("member_group", "site_srl")) |
|
| 293 | 293 | { |
| 294 | 294 | $oDB->addColumn("member_group", "site_srl", "number", 11, 0, true); |
| 295 | - $oDB->addIndex("member_group","idx_site_title", array("site_srl","title"),true); |
|
| 295 | + $oDB->addIndex("member_group", "idx_site_title", array("site_srl", "title"), true); |
|
| 296 | 296 | } |
| 297 | - if($oDB->isIndexExists("member_group","uni_member_group_title")) |
|
| 297 | + if ($oDB->isIndexExists("member_group", "uni_member_group_title")) |
|
| 298 | 298 | { |
| 299 | - $oDB->dropIndex("member_group","uni_member_group_title",true); |
|
| 299 | + $oDB->dropIndex("member_group", "uni_member_group_title", true); |
|
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | // Add a column(list_order) to "member_group" table (05/18/2011) |
| 303 | - if(!$oDB->isColumnExists("member_group", "list_order")) |
|
| 303 | + if (!$oDB->isColumnExists("member_group", "list_order")) |
|
| 304 | 304 | { |
| 305 | 305 | $oDB->addColumn("member_group", "list_order", "number", 11, '', true); |
| 306 | - $oDB->addIndex("member_group","idx_list_order", "list_order",false); |
|
| 306 | + $oDB->addIndex("member_group", "idx_list_order", "list_order", false); |
|
| 307 | 307 | $output = executeQuery('member.updateAllMemberGroupListOrder'); |
| 308 | 308 | } |
| 309 | 309 | // Add a column for image_mark (02/14/2009) |
| 310 | - if(!$oDB->isColumnExists("member_group", "image_mark")) |
|
| 310 | + if (!$oDB->isColumnExists("member_group", "image_mark")) |
|
| 311 | 311 | { |
| 312 | 312 | $oDB->addColumn("member_group", "image_mark", "text"); |
| 313 | 313 | } |
| 314 | 314 | // Add a column for password expiration date |
| 315 | - if(!$oDB->isColumnExists("member", "change_password_date")) |
|
| 315 | + if (!$oDB->isColumnExists("member", "change_password_date")) |
|
| 316 | 316 | { |
| 317 | 317 | $oDB->addColumn("member", "change_password_date", "date"); |
| 318 | 318 | executeQuery('member.updateAllChangePasswordDate'); |
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | // Add columns of question and answer to verify a password |
| 322 | - if(!$oDB->isColumnExists("member", "find_account_question")) |
|
| 322 | + if (!$oDB->isColumnExists("member", "find_account_question")) |
|
| 323 | 323 | { |
| 324 | 324 | $oDB->addColumn("member", "find_account_question", "number", 11); |
| 325 | 325 | } |
| 326 | - if(!$oDB->isColumnExists("member", "find_account_answer")) |
|
| 326 | + if (!$oDB->isColumnExists("member", "find_account_answer")) |
|
| 327 | 327 | { |
| 328 | 328 | $oDB->addColumn("member", "find_account_answer", "varchar", 250); |
| 329 | 329 | } |
| 330 | 330 | |
| 331 | - if(!$oDB->isColumnExists("member", "list_order")) |
|
| 331 | + if (!$oDB->isColumnExists("member", "list_order")) |
|
| 332 | 332 | { |
| 333 | 333 | $oDB->addColumn("member", "list_order", "number", 11); |
| 334 | 334 | @set_time_limit(0); |
| 335 | 335 | $args->list_order = 'member_srl'; |
| 336 | - executeQuery('member.updateMemberListOrderAll',$args); |
|
| 336 | + executeQuery('member.updateMemberListOrderAll', $args); |
|
| 337 | 337 | executeQuery('member.updateMemberListOrderAll'); |
| 338 | 338 | } |
| 339 | - if(!$oDB->isIndexExists("member","idx_list_order")) |
|
| 339 | + if (!$oDB->isIndexExists("member", "idx_list_order")) |
|
| 340 | 340 | { |
| 341 | - $oDB->addIndex("member","idx_list_order", array("list_order")); |
|
| 341 | + $oDB->addIndex("member", "idx_list_order", array("list_order")); |
|
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 | $config = $oModuleModel->getModuleConfig('member'); |
| 345 | 345 | |
| 346 | 346 | // check agreement value exist |
| 347 | - if($config->agreement) |
|
| 347 | + if ($config->agreement) |
|
| 348 | 348 | { |
| 349 | - $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt'; |
|
| 349 | + $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.Context::get('lang_type').'.txt'; |
|
| 350 | 350 | $output = FileHandler::writeFile($agreement_file, $config->agreement); |
| 351 | 351 | |
| 352 | 352 | $config->agreement = NULL; |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | } |
| 355 | 355 | |
| 356 | 356 | // check signup form ordering info |
| 357 | - if(!$config->signupForm || !is_array($config->signupForm)) |
|
| 357 | + if (!$config->signupForm || !is_array($config->signupForm)) |
|
| 358 | 358 | { |
| 359 | 359 | $identifier = 'email_address'; |
| 360 | 360 | |
@@ -365,9 +365,9 @@ discard block |
||
| 365 | 365 | |
| 366 | 366 | // 회원정보에서 이메일 노출 제거 |
| 367 | 367 | // @see https://github.com/xpressengine/xe-core/issues/2177 |
| 368 | - foreach($config->signupForm as $form) |
|
| 368 | + foreach ($config->signupForm as $form) |
|
| 369 | 369 | { |
| 370 | - if($form->name === 'email_address') |
|
| 370 | + if ($form->name === 'email_address') |
|
| 371 | 371 | { |
| 372 | 372 | $form->isPublic = 'N'; |
| 373 | 373 | break; |
@@ -375,13 +375,13 @@ discard block |
||
| 375 | 375 | } |
| 376 | 376 | $oModuleController->updateModuleConfig('member', $config); |
| 377 | 377 | |
| 378 | - if($config->skin) |
|
| 378 | + if ($config->skin) |
|
| 379 | 379 | { |
| 380 | 380 | $config_parse = explode('.', $config->skin); |
| 381 | 381 | if (count($config_parse) > 1) |
| 382 | 382 | { |
| 383 | 383 | $template_path = sprintf('./themes/%s/modules/member/', $config_parse[0]); |
| 384 | - if(is_dir($template_path)) |
|
| 384 | + if (is_dir($template_path)) |
|
| 385 | 385 | { |
| 386 | 386 | $config->skin = implode('|@|', $config_parse); |
| 387 | 387 | $oModuleController = getController('module'); |
@@ -391,15 +391,15 @@ discard block |
||
| 391 | 391 | } |
| 392 | 392 | |
| 393 | 393 | // 2013. 11. 22 add menu when popup document menu called |
| 394 | - if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) |
|
| 394 | + if (!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) |
|
| 395 | 395 | $oModuleController->insertTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after'); |
| 396 | - if(!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) |
|
| 396 | + if (!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) |
|
| 397 | 397 | $oModuleController->insertTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after'); |
| 398 | 398 | |
| 399 | - if(is_readable('./files/member_extra_info/agreement.txt')) |
|
| 399 | + if (is_readable('./files/member_extra_info/agreement.txt')) |
|
| 400 | 400 | { |
| 401 | 401 | $source_file = _XE_PATH_.'files/member_extra_info/agreement.txt'; |
| 402 | - $target_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt'; |
|
| 402 | + $target_file = _XE_PATH_.'files/member_extra_info/agreement_'.Context::get('lang_type').'.txt'; |
|
| 403 | 403 | |
| 404 | 404 | FileHandler::rename($source_file, $target_file); |
| 405 | 405 | } |
@@ -408,14 +408,14 @@ discard block |
||
| 408 | 408 | } |
| 409 | 409 | |
| 410 | 410 | FileHandler::makeDir('./files/ruleset'); |
| 411 | - if(!is_readable('./files/ruleset/insertMember.xml')) |
|
| 411 | + if (!is_readable('./files/ruleset/insertMember.xml')) |
|
| 412 | 412 | $oMemberAdminController->_createSignupRuleset($config->signupForm); |
| 413 | - if(!is_readable('./files/ruleset/login.xml')) |
|
| 413 | + if (!is_readable('./files/ruleset/login.xml')) |
|
| 414 | 414 | $oMemberAdminController->_createLoginRuleset($config->identifier); |
| 415 | - if(!is_readable('./files/ruleset/find_member_account_by_question.xml')) |
|
| 415 | + if (!is_readable('./files/ruleset/find_member_account_by_question.xml')) |
|
| 416 | 416 | $oMemberAdminController->_createFindAccountByQuestion($config->identifier); |
| 417 | 417 | |
| 418 | - if($oModuleModel->needUpdate('member.1.8.43.recreate_signup_ruleset')) |
|
| 418 | + if ($oModuleModel->needUpdate('member.1.8.43.recreate_signup_ruleset')) |
|
| 419 | 419 | { |
| 420 | 420 | $oMemberAdminController->_createSignupRuleset($config->signupForm); |
| 421 | 421 | $oModuleController->insertUpdatedLog('member.1.8.43.recreate_signup_ruleset'); |
@@ -438,7 +438,7 @@ discard block |
||
| 438 | 438 | */ |
| 439 | 439 | function recordLoginError($error = 0, $message = 'success') |
| 440 | 440 | { |
| 441 | - if($error == 0) return new Object($error, $message); |
|
| 441 | + if ($error == 0) return new Object($error, $message); |
|
| 442 | 442 | |
| 443 | 443 | // Create a member model object |
| 444 | 444 | $oMemberModel = getModel('member'); |
@@ -446,18 +446,18 @@ discard block |
||
| 446 | 446 | |
| 447 | 447 | // Check if there is recoding table. |
| 448 | 448 | $oDB = &DB::getInstance(); |
| 449 | - if(!$oDB->isTableExists('member_login_count') || $config->enable_login_fail_report == 'N') return new Object($error, $message); |
|
| 449 | + if (!$oDB->isTableExists('member_login_count') || $config->enable_login_fail_report == 'N') return new Object($error, $message); |
|
| 450 | 450 | |
| 451 | 451 | $args = new stdClass(); |
| 452 | 452 | $args->ipaddress = $_SERVER['REMOTE_ADDR']; |
| 453 | 453 | |
| 454 | 454 | $output = executeQuery('member.getLoginCountByIp', $args); |
| 455 | - if($output->data && $output->data->count) |
|
| 455 | + if ($output->data && $output->data->count) |
|
| 456 | 456 | { |
| 457 | 457 | $last_update = strtotime($output->data->last_update); |
| 458 | - $term = intval($_SERVER['REQUEST_TIME']-$last_update); |
|
| 458 | + $term = intval($_SERVER['REQUEST_TIME'] - $last_update); |
|
| 459 | 459 | //update, if IP address access in a short time, update count. If not, make count 1. |
| 460 | - if($term < $config->max_error_count_time) |
|
| 460 | + if ($term < $config->max_error_count_time) |
|
| 461 | 461 | { |
| 462 | 462 | $args->count = $output->data->count + 1; |
| 463 | 463 | } |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | */ |
| 484 | 484 | function recordMemberLoginError($error = 0, $message = 'success', $args = NULL) |
| 485 | 485 | { |
| 486 | - if($error == 0 || !$args->member_srl) return new Object($error, $message); |
|
| 486 | + if ($error == 0 || !$args->member_srl) return new Object($error, $message); |
|
| 487 | 487 | |
| 488 | 488 | // Create a member model object |
| 489 | 489 | $oMemberModel = getModel('member'); |
@@ -491,21 +491,21 @@ discard block |
||
| 491 | 491 | |
| 492 | 492 | // Check if there is recoding table. |
| 493 | 493 | $oDB = &DB::getInstance(); |
| 494 | - if(!$oDB->isTableExists('member_count_history') || $config->enable_login_fail_report == 'N') return new Object($error, $message); |
|
| 494 | + if (!$oDB->isTableExists('member_count_history') || $config->enable_login_fail_report == 'N') return new Object($error, $message); |
|
| 495 | 495 | |
| 496 | 496 | $output = executeQuery('member.getLoginCountHistoryByMemberSrl', $args); |
| 497 | - if($output->data && $output->data->content) |
|
| 497 | + if ($output->data && $output->data->content) |
|
| 498 | 498 | { |
| 499 | 499 | //update |
| 500 | 500 | $content = unserialize($output->data->content); |
| 501 | - $content[] = array($_SERVER['REMOTE_ADDR'],Context::getLang($message),$_SERVER['REQUEST_TIME']); |
|
| 501 | + $content[] = array($_SERVER['REMOTE_ADDR'], Context::getLang($message), $_SERVER['REQUEST_TIME']); |
|
| 502 | 502 | $args->content = serialize($content); |
| 503 | 503 | $output = executeQuery('member.updateLoginCountHistoryByMemberSrl', $args); |
| 504 | 504 | } |
| 505 | 505 | else |
| 506 | 506 | { |
| 507 | 507 | //insert |
| 508 | - $content[0] = array($_SERVER['REMOTE_ADDR'],Context::getLang($message),$_SERVER['REQUEST_TIME']); |
|
| 508 | + $content[0] = array($_SERVER['REMOTE_ADDR'], Context::getLang($message), $_SERVER['REQUEST_TIME']); |
|
| 509 | 509 | $args->content = serialize($content); |
| 510 | 510 | $output = executeQuery('member.insertLoginCountHistoryByMemberSrl', $args); |
| 511 | 511 | } |
@@ -20,7 +20,9 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | function member() |
| 22 | 22 | { |
| 23 | - if(!Context::isInstalled()) return; |
|
| 23 | + if(!Context::isInstalled()) { |
|
| 24 | + return; |
|
| 25 | + } |
|
| 24 | 26 | |
| 25 | 27 | $oModuleModel = getModel('module'); |
| 26 | 28 | $member_config = $oModuleModel->getModuleConfig('member'); |
@@ -58,18 +60,42 @@ discard block |
||
| 58 | 60 | // Set the basic information |
| 59 | 61 | $config->enable_join = 'Y'; |
| 60 | 62 | $config->enable_openid = 'N'; |
| 61 | - if(!$config->enable_auth_mail) $config->enable_auth_mail = 'N'; |
|
| 62 | - if(!$config->image_name) $config->image_name = 'Y'; |
|
| 63 | - if(!$config->image_mark) $config->image_mark = 'Y'; |
|
| 64 | - if(!$config->profile_image) $config->profile_image = 'Y'; |
|
| 65 | - if(!$config->image_name_max_width) $config->image_name_max_width = '90'; |
|
| 66 | - if(!$config->image_name_max_height) $config->image_name_max_height = '20'; |
|
| 67 | - if(!$config->image_mark_max_width) $config->image_mark_max_width = '20'; |
|
| 68 | - if(!$config->image_mark_max_height) $config->image_mark_max_height = '20'; |
|
| 69 | - if(!$config->profile_image_max_width) $config->profile_image_max_width = '90'; |
|
| 70 | - if(!$config->profile_image_max_height) $config->profile_image_max_height = '90'; |
|
| 71 | - if($config->group_image_mark!='Y') $config->group_image_mark = 'N'; |
|
| 72 | - if(!$config->password_strength) $config->password_strength = 'normal'; |
|
| 63 | + if(!$config->enable_auth_mail) { |
|
| 64 | + $config->enable_auth_mail = 'N'; |
|
| 65 | + } |
|
| 66 | + if(!$config->image_name) { |
|
| 67 | + $config->image_name = 'Y'; |
|
| 68 | + } |
|
| 69 | + if(!$config->image_mark) { |
|
| 70 | + $config->image_mark = 'Y'; |
|
| 71 | + } |
|
| 72 | + if(!$config->profile_image) { |
|
| 73 | + $config->profile_image = 'Y'; |
|
| 74 | + } |
|
| 75 | + if(!$config->image_name_max_width) { |
|
| 76 | + $config->image_name_max_width = '90'; |
|
| 77 | + } |
|
| 78 | + if(!$config->image_name_max_height) { |
|
| 79 | + $config->image_name_max_height = '20'; |
|
| 80 | + } |
|
| 81 | + if(!$config->image_mark_max_width) { |
|
| 82 | + $config->image_mark_max_width = '20'; |
|
| 83 | + } |
|
| 84 | + if(!$config->image_mark_max_height) { |
|
| 85 | + $config->image_mark_max_height = '20'; |
|
| 86 | + } |
|
| 87 | + if(!$config->profile_image_max_width) { |
|
| 88 | + $config->profile_image_max_width = '90'; |
|
| 89 | + } |
|
| 90 | + if(!$config->profile_image_max_height) { |
|
| 91 | + $config->profile_image_max_height = '90'; |
|
| 92 | + } |
|
| 93 | + if($config->group_image_mark!='Y') { |
|
| 94 | + $config->group_image_mark = 'N'; |
|
| 95 | + } |
|
| 96 | + if(!$config->password_strength) { |
|
| 97 | + $config->password_strength = 'normal'; |
|
| 98 | + } |
|
| 73 | 99 | |
| 74 | 100 | if(!$config->password_hashing_algorithm) |
| 75 | 101 | { |
@@ -187,36 +213,64 @@ discard block |
||
| 187 | 213 | if($oModuleModel->needUpdate($version_update_id)) |
| 188 | 214 | { |
| 189 | 215 | // check member directory (11/08/2007 added) |
| 190 | - if(!is_dir("./files/member_extra_info")) return true; |
|
| 216 | + if(!is_dir("./files/member_extra_info")) { |
|
| 217 | + return true; |
|
| 218 | + } |
|
| 191 | 219 | // check member directory (22/10/2007 added) |
| 192 | - if(!is_dir("./files/member_extra_info/profile_image")) return true; |
|
| 220 | + if(!is_dir("./files/member_extra_info/profile_image")) { |
|
| 221 | + return true; |
|
| 222 | + } |
|
| 193 | 223 | // Add a column(is_register) to "member_auth_mail" table (22/04/2008) |
| 194 | 224 | $act = $oDB->isColumnExists("member_auth_mail", "is_register"); |
| 195 | - if(!$act) return true; |
|
| 225 | + if(!$act) { |
|
| 226 | + return true; |
|
| 227 | + } |
|
| 196 | 228 | // Add a column(site_srl) to "member_group_member" table (11/15/2008) |
| 197 | - if(!$oDB->isColumnExists("member_group_member", "site_srl")) return true; |
|
| 198 | - if(!$oDB->isColumnExists("member_group", "site_srl")) return true; |
|
| 199 | - if($oDB->isIndexExists("member_group","uni_member_group_title")) return true; |
|
| 229 | + if(!$oDB->isColumnExists("member_group_member", "site_srl")) { |
|
| 230 | + return true; |
|
| 231 | + } |
|
| 232 | + if(!$oDB->isColumnExists("member_group", "site_srl")) { |
|
| 233 | + return true; |
|
| 234 | + } |
|
| 235 | + if($oDB->isIndexExists("member_group","uni_member_group_title")) { |
|
| 236 | + return true; |
|
| 237 | + } |
|
| 200 | 238 | |
| 201 | 239 | // Add a column for list_order (05/18/2011) |
| 202 | - if(!$oDB->isColumnExists("member_group", "list_order")) return true; |
|
| 240 | + if(!$oDB->isColumnExists("member_group", "list_order")) { |
|
| 241 | + return true; |
|
| 242 | + } |
|
| 203 | 243 | |
| 204 | 244 | // image_mark 추가 (2009. 02. 14) |
| 205 | - if(!$oDB->isColumnExists("member_group", "image_mark")) return true; |
|
| 245 | + if(!$oDB->isColumnExists("member_group", "image_mark")) { |
|
| 246 | + return true; |
|
| 247 | + } |
|
| 206 | 248 | // Add c column for password expiration date |
| 207 | - if(!$oDB->isColumnExists("member", "change_password_date")) return true; |
|
| 249 | + if(!$oDB->isColumnExists("member", "change_password_date")) { |
|
| 250 | + return true; |
|
| 251 | + } |
|
| 208 | 252 | |
| 209 | 253 | // Add columns of question and answer to verify a password |
| 210 | - if(!$oDB->isColumnExists("member", "find_account_question")) return true; |
|
| 211 | - if(!$oDB->isColumnExists("member", "find_account_answer")) return true; |
|
| 254 | + if(!$oDB->isColumnExists("member", "find_account_question")) { |
|
| 255 | + return true; |
|
| 256 | + } |
|
| 257 | + if(!$oDB->isColumnExists("member", "find_account_answer")) { |
|
| 258 | + return true; |
|
| 259 | + } |
|
| 212 | 260 | |
| 213 | - if(!$oDB->isColumnExists("member", "list_order")) return true; |
|
| 214 | - if(!$oDB->isIndexExists("member","idx_list_order")) return true; |
|
| 261 | + if(!$oDB->isColumnExists("member", "list_order")) { |
|
| 262 | + return true; |
|
| 263 | + } |
|
| 264 | + if(!$oDB->isIndexExists("member","idx_list_order")) { |
|
| 265 | + return true; |
|
| 266 | + } |
|
| 215 | 267 | |
| 216 | 268 | $oModuleModel = getModel('module'); |
| 217 | 269 | $config = $oModuleModel->getModuleConfig('member'); |
| 218 | 270 | // check signup form ordering info |
| 219 | - if(!$config->signupForm) return true; |
|
| 271 | + if(!$config->signupForm) { |
|
| 272 | + return true; |
|
| 273 | + } |
|
| 220 | 274 | |
| 221 | 275 | foreach($config->signupForm as $form) |
| 222 | 276 | { |
@@ -227,7 +281,9 @@ discard block |
||
| 227 | 281 | } |
| 228 | 282 | |
| 229 | 283 | // check agreement field exist |
| 230 | - if($config->agreement) return true; |
|
| 284 | + if($config->agreement) { |
|
| 285 | + return true; |
|
| 286 | + } |
|
| 231 | 287 | |
| 232 | 288 | if($config->skin) |
| 233 | 289 | { |
@@ -235,25 +291,41 @@ discard block |
||
| 235 | 291 | if(count($config_parse) > 1) |
| 236 | 292 | { |
| 237 | 293 | $template_path = sprintf('./themes/%s/modules/member/', $config_parse[0]); |
| 238 | - if(is_dir($template_path)) return true; |
|
| 294 | + if(is_dir($template_path)) { |
|
| 295 | + return true; |
|
| 296 | + } |
|
| 239 | 297 | } |
| 240 | 298 | } |
| 241 | 299 | |
| 242 | 300 | // supprot multilanguage agreement. |
| 243 | - if(is_readable('./files/member_extra_info/agreement.txt')) return true; |
|
| 301 | + if(is_readable('./files/member_extra_info/agreement.txt')) { |
|
| 302 | + return true; |
|
| 303 | + } |
|
| 244 | 304 | |
| 245 | 305 | // 2013. 11. 22 add menu when popup document menu called |
| 246 | - if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) return true; |
|
| 247 | - if(!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) return true; |
|
| 306 | + if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) { |
|
| 307 | + return true; |
|
| 308 | + } |
|
| 309 | + if(!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) { |
|
| 310 | + return true; |
|
| 311 | + } |
|
| 248 | 312 | |
| 249 | 313 | $oModuleController->insertUpdatedLog($version_update_id); |
| 250 | 314 | } |
| 251 | 315 | |
| 252 | - if(!is_readable('./files/ruleset/insertMember.xml')) return true; |
|
| 253 | - if(!is_readable('./files/ruleset/login.xml')) return true; |
|
| 254 | - if(!is_readable('./files/ruleset/find_member_account_by_question.xml')) return true; |
|
| 316 | + if(!is_readable('./files/ruleset/insertMember.xml')) { |
|
| 317 | + return true; |
|
| 318 | + } |
|
| 319 | + if(!is_readable('./files/ruleset/login.xml')) { |
|
| 320 | + return true; |
|
| 321 | + } |
|
| 322 | + if(!is_readable('./files/ruleset/find_member_account_by_question.xml')) { |
|
| 323 | + return true; |
|
| 324 | + } |
|
| 255 | 325 | |
| 256 | - if($oModuleModel->needUpdate('member.1.8.43.recreate_signup_ruleset')) return true; |
|
| 326 | + if($oModuleModel->needUpdate('member.1.8.43.recreate_signup_ruleset')) { |
|
| 327 | + return true; |
|
| 328 | + } |
|
| 257 | 329 | |
| 258 | 330 | return false; |
| 259 | 331 | } |
@@ -391,10 +463,12 @@ discard block |
||
| 391 | 463 | } |
| 392 | 464 | |
| 393 | 465 | // 2013. 11. 22 add menu when popup document menu called |
| 394 | - if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) |
|
| 395 | - $oModuleController->insertTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after'); |
|
| 396 | - if(!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) |
|
| 397 | - $oModuleController->insertTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after'); |
|
| 466 | + if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after')) { |
|
| 467 | + $oModuleController->insertTrigger('document.getDocumentMenu', 'member', 'controller', 'triggerGetDocumentMenu', 'after'); |
|
| 468 | + } |
|
| 469 | + if(!$oModuleModel->getTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after')) { |
|
| 470 | + $oModuleController->insertTrigger('comment.getCommentMenu', 'member', 'controller', 'triggerGetCommentMenu', 'after'); |
|
| 471 | + } |
|
| 398 | 472 | |
| 399 | 473 | if(is_readable('./files/member_extra_info/agreement.txt')) |
| 400 | 474 | { |
@@ -408,12 +482,15 @@ discard block |
||
| 408 | 482 | } |
| 409 | 483 | |
| 410 | 484 | FileHandler::makeDir('./files/ruleset'); |
| 411 | - if(!is_readable('./files/ruleset/insertMember.xml')) |
|
| 412 | - $oMemberAdminController->_createSignupRuleset($config->signupForm); |
|
| 413 | - if(!is_readable('./files/ruleset/login.xml')) |
|
| 414 | - $oMemberAdminController->_createLoginRuleset($config->identifier); |
|
| 415 | - if(!is_readable('./files/ruleset/find_member_account_by_question.xml')) |
|
| 416 | - $oMemberAdminController->_createFindAccountByQuestion($config->identifier); |
|
| 485 | + if(!is_readable('./files/ruleset/insertMember.xml')) { |
|
| 486 | + $oMemberAdminController->_createSignupRuleset($config->signupForm); |
|
| 487 | + } |
|
| 488 | + if(!is_readable('./files/ruleset/login.xml')) { |
|
| 489 | + $oMemberAdminController->_createLoginRuleset($config->identifier); |
|
| 490 | + } |
|
| 491 | + if(!is_readable('./files/ruleset/find_member_account_by_question.xml')) { |
|
| 492 | + $oMemberAdminController->_createFindAccountByQuestion($config->identifier); |
|
| 493 | + } |
|
| 417 | 494 | |
| 418 | 495 | if($oModuleModel->needUpdate('member.1.8.43.recreate_signup_ruleset')) |
| 419 | 496 | { |
@@ -438,7 +515,9 @@ discard block |
||
| 438 | 515 | */ |
| 439 | 516 | function recordLoginError($error = 0, $message = 'success') |
| 440 | 517 | { |
| 441 | - if($error == 0) return new Object($error, $message); |
|
| 518 | + if($error == 0) { |
|
| 519 | + return new Object($error, $message); |
|
| 520 | + } |
|
| 442 | 521 | |
| 443 | 522 | // Create a member model object |
| 444 | 523 | $oMemberModel = getModel('member'); |
@@ -446,7 +525,9 @@ discard block |
||
| 446 | 525 | |
| 447 | 526 | // Check if there is recoding table. |
| 448 | 527 | $oDB = &DB::getInstance(); |
| 449 | - if(!$oDB->isTableExists('member_login_count') || $config->enable_login_fail_report == 'N') return new Object($error, $message); |
|
| 528 | + if(!$oDB->isTableExists('member_login_count') || $config->enable_login_fail_report == 'N') { |
|
| 529 | + return new Object($error, $message); |
|
| 530 | + } |
|
| 450 | 531 | |
| 451 | 532 | $args = new stdClass(); |
| 452 | 533 | $args->ipaddress = $_SERVER['REMOTE_ADDR']; |
@@ -460,16 +541,14 @@ discard block |
||
| 460 | 541 | if($term < $config->max_error_count_time) |
| 461 | 542 | { |
| 462 | 543 | $args->count = $output->data->count + 1; |
| 463 | - } |
|
| 464 | - else |
|
| 544 | + } else |
|
| 465 | 545 | { |
| 466 | 546 | $args->count = 1; |
| 467 | 547 | } |
| 468 | 548 | unset($oMemberModel); |
| 469 | 549 | unset($config); |
| 470 | 550 | $output = executeQuery('member.updateLoginCountByIp', $args); |
| 471 | - } |
|
| 472 | - else |
|
| 551 | + } else |
|
| 473 | 552 | { |
| 474 | 553 | //insert |
| 475 | 554 | $args->count = 1; |
@@ -483,7 +562,9 @@ discard block |
||
| 483 | 562 | */ |
| 484 | 563 | function recordMemberLoginError($error = 0, $message = 'success', $args = NULL) |
| 485 | 564 | { |
| 486 | - if($error == 0 || !$args->member_srl) return new Object($error, $message); |
|
| 565 | + if($error == 0 || !$args->member_srl) { |
|
| 566 | + return new Object($error, $message); |
|
| 567 | + } |
|
| 487 | 568 | |
| 488 | 569 | // Create a member model object |
| 489 | 570 | $oMemberModel = getModel('member'); |
@@ -491,7 +572,9 @@ discard block |
||
| 491 | 572 | |
| 492 | 573 | // Check if there is recoding table. |
| 493 | 574 | $oDB = &DB::getInstance(); |
| 494 | - if(!$oDB->isTableExists('member_count_history') || $config->enable_login_fail_report == 'N') return new Object($error, $message); |
|
| 575 | + if(!$oDB->isTableExists('member_count_history') || $config->enable_login_fail_report == 'N') { |
|
| 576 | + return new Object($error, $message); |
|
| 577 | + } |
|
| 495 | 578 | |
| 496 | 579 | $output = executeQuery('member.getLoginCountHistoryByMemberSrl', $args); |
| 497 | 580 | if($output->data && $output->data->content) |
@@ -501,8 +584,7 @@ discard block |
||
| 501 | 584 | $content[] = array($_SERVER['REMOTE_ADDR'],Context::getLang($message),$_SERVER['REQUEST_TIME']); |
| 502 | 585 | $args->content = serialize($content); |
| 503 | 586 | $output = executeQuery('member.updateLoginCountHistoryByMemberSrl', $args); |
| 504 | - } |
|
| 505 | - else |
|
| 587 | + } else |
|
| 506 | 588 | { |
| 507 | 589 | //insert |
| 508 | 590 | $content[0] = array($_SERVER['REMOTE_ADDR'],Context::getLang($message),$_SERVER['REQUEST_TIME']); |
@@ -24,31 +24,31 @@ discard block |
||
| 24 | 24 | // if(Context::getRequestMethod() == "GET") return new Object(-1, "msg_invalid_request"); |
| 25 | 25 | // Extract the necessary information in advance |
| 26 | 26 | $logged_info = Context::get('logged_info'); |
| 27 | - if($logged_info->is_admin != 'Y' || !checkCSRF()) |
|
| 27 | + if ($logged_info->is_admin != 'Y' || !checkCSRF()) |
|
| 28 | 28 | { |
| 29 | 29 | return new Object(-1, 'msg_invalid_request'); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - $args = Context::gets('member_srl','email_address','find_account_answer', 'allow_mailing','allow_message','denied','is_admin','description','group_srl_list','limit_date'); |
|
| 33 | - $oMemberModel = &getModel ('member'); |
|
| 34 | - $config = $oMemberModel->getMemberConfig (); |
|
| 32 | + $args = Context::gets('member_srl', 'email_address', 'find_account_answer', 'allow_mailing', 'allow_message', 'denied', 'is_admin', 'description', 'group_srl_list', 'limit_date'); |
|
| 33 | + $oMemberModel = &getModel('member'); |
|
| 34 | + $config = $oMemberModel->getMemberConfig(); |
|
| 35 | 35 | $getVars = array(); |
| 36 | - if($config->signupForm) |
|
| 36 | + if ($config->signupForm) |
|
| 37 | 37 | { |
| 38 | - foreach($config->signupForm as $formInfo) |
|
| 38 | + foreach ($config->signupForm as $formInfo) |
|
| 39 | 39 | { |
| 40 | - if($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired)) |
|
| 40 | + if ($formInfo->isDefaultForm && ($formInfo->isUse || $formInfo->required || $formInfo->mustRequired)) |
|
| 41 | 41 | { |
| 42 | 42 | $getVars[] = $formInfo->name; |
| 43 | 43 | } |
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | - foreach($getVars as $val) |
|
| 46 | + foreach ($getVars as $val) |
|
| 47 | 47 | { |
| 48 | 48 | $args->{$val} = Context::get($val); |
| 49 | 49 | } |
| 50 | 50 | $args->member_srl = Context::get('member_srl'); |
| 51 | - if(Context::get('reset_password')) |
|
| 51 | + if (Context::get('reset_password')) |
|
| 52 | 52 | $args->password = Context::get('reset_password'); |
| 53 | 53 | else unset($args->password); |
| 54 | 54 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | unset($all_args->error_return_url); |
| 61 | 61 | unset($all_args->success_return_url); |
| 62 | 62 | unset($all_args->ruleset); |
| 63 | - if(!isset($args->limit_date)) $args->limit_date = ""; |
|
| 63 | + if (!isset($args->limit_date)) $args->limit_date = ""; |
|
| 64 | 64 | unset($all_args->password); |
| 65 | 65 | unset($all_args->password2); |
| 66 | 66 | unset($all_args->reset_password); |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | $extra_vars = delObjectVars($all_args, $args); |
| 69 | 69 | $args->extra_vars = serialize($extra_vars); |
| 70 | 70 | // Check if an original member exists having the member_srl |
| 71 | - if($args->member_srl) |
|
| 71 | + if ($args->member_srl) |
|
| 72 | 72 | { |
| 73 | 73 | // Create a member model object |
| 74 | 74 | $oMemberModel = getModel('member'); |
@@ -76,14 +76,14 @@ discard block |
||
| 76 | 76 | $columnList = array('member_srl'); |
| 77 | 77 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl, 0, $columnList); |
| 78 | 78 | // If no original member exists, make a new one |
| 79 | - if($member_info->member_srl != $args->member_srl) unset($args->member_srl); |
|
| 79 | + if ($member_info->member_srl != $args->member_srl) unset($args->member_srl); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | // remove whitespace |
| 83 | 83 | $checkInfos = array('user_id', 'user_name', 'nick_name', 'email_address'); |
| 84 | - foreach($checkInfos as $val) |
|
| 84 | + foreach ($checkInfos as $val) |
|
| 85 | 85 | { |
| 86 | - if(isset($args->{$val})) |
|
| 86 | + if (isset($args->{$val})) |
|
| 87 | 87 | { |
| 88 | 88 | $args->{$val} = preg_replace('/[\pZ\pC]+/u', '', $args->{$val}); |
| 89 | 89 | } |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | |
| 92 | 92 | $oMemberController = getController('member'); |
| 93 | 93 | // Execute insert or update depending on the value of member_srl |
| 94 | - if(!$args->member_srl) |
|
| 94 | + if (!$args->member_srl) |
|
| 95 | 95 | { |
| 96 | 96 | $args->password = Context::get('password'); |
| 97 | 97 | $output = $oMemberController->insertMember($args); |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | $msg_code = 'success_updated'; |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | - if(!$output->toBool()) return $output; |
|
| 106 | + if (!$output->toBool()) return $output; |
|
| 107 | 107 | // Save Signature |
| 108 | 108 | $signature = Context::get('signature'); |
| 109 | 109 | $oMemberController->putSignature($args->member_srl, $signature); |
@@ -112,13 +112,13 @@ discard block |
||
| 112 | 112 | $this->setMessage($msg_code); |
| 113 | 113 | |
| 114 | 114 | $profile_image = $_FILES['profile_image']; |
| 115 | - if(is_uploaded_file($profile_image['tmp_name'])) |
|
| 115 | + if (is_uploaded_file($profile_image['tmp_name'])) |
|
| 116 | 116 | { |
| 117 | 117 | $oMemberController->insertProfileImage($args->member_srl, $profile_image['tmp_name']); |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | $image_mark = $_FILES['image_mark']; |
| 121 | - if(is_uploaded_file($image_mark['tmp_name'])) |
|
| 121 | + if (is_uploaded_file($image_mark['tmp_name'])) |
|
| 122 | 122 | { |
| 123 | 123 | $oMemberController->insertImageMark($args->member_srl, $image_mark['tmp_name']); |
| 124 | 124 | } |
@@ -144,9 +144,9 @@ discard block |
||
| 144 | 144 | |
| 145 | 145 | $oMemberController = getController('member'); |
| 146 | 146 | $output = $oMemberController->deleteMember($member_srl); |
| 147 | - if(!$output->toBool()) return $output; |
|
| 147 | + if (!$output->toBool()) return $output; |
|
| 148 | 148 | |
| 149 | - $this->add('page',Context::get('page')); |
|
| 149 | + $this->add('page', Context::get('page')); |
|
| 150 | 150 | $this->setMessage("success_deleted"); |
| 151 | 151 | } |
| 152 | 152 | |
@@ -165,26 +165,26 @@ discard block |
||
| 165 | 165 | ); |
| 166 | 166 | |
| 167 | 167 | $oPassword = new Password(); |
| 168 | - if(!array_key_exists($args->password_hashing_algorithm, $oPassword->getSupportedAlgorithms())) |
|
| 168 | + if (!array_key_exists($args->password_hashing_algorithm, $oPassword->getSupportedAlgorithms())) |
|
| 169 | 169 | { |
| 170 | 170 | $args->password_hashing_algorithm = 'md5'; |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | $args->password_hashing_work_factor = intval($args->password_hashing_work_factor, 10); |
| 174 | - if($args->password_hashing_work_factor < 4) |
|
| 174 | + if ($args->password_hashing_work_factor < 4) |
|
| 175 | 175 | { |
| 176 | 176 | $args->password_hashing_work_factor = 4; |
| 177 | 177 | } |
| 178 | - if($args->password_hashing_work_factor > 16) |
|
| 178 | + if ($args->password_hashing_work_factor > 16) |
|
| 179 | 179 | { |
| 180 | 180 | $args->password_hashing_work_factor = 16; |
| 181 | 181 | } |
| 182 | - if($args->password_hashing_auto_upgrade != 'Y') |
|
| 182 | + if ($args->password_hashing_auto_upgrade != 'Y') |
|
| 183 | 183 | { |
| 184 | 184 | $args->password_hashing_auto_upgrade = 'N'; |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | - if((!$args->webmaster_name || !$args->webmaster_email) && $args->enable_confirm == 'Y') |
|
| 187 | + if ((!$args->webmaster_name || !$args->webmaster_email) && $args->enable_confirm == 'Y') |
|
| 188 | 188 | { |
| 189 | 189 | return new Object(-1, 'msg_mail_authorization'); |
| 190 | 190 | } |
@@ -219,20 +219,20 @@ discard block |
||
| 219 | 219 | $usable_list = Context::get('usable_list'); |
| 220 | 220 | $all_args = Context::getRequestVars(); |
| 221 | 221 | |
| 222 | - $args->limit_day = (int)$args->limit_day; |
|
| 223 | - if(!trim(strip_tags($args->agreement))) |
|
| 222 | + $args->limit_day = (int) $args->limit_day; |
|
| 223 | + if (!trim(strip_tags($args->agreement))) |
|
| 224 | 224 | { |
| 225 | - $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt'; |
|
| 225 | + $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.Context::get('lang_type').'.txt'; |
|
| 226 | 226 | FileHandler::removeFile($agreement_file); |
| 227 | 227 | $args->agreement = NULL; |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | - if($args->redirect_url) |
|
| 230 | + if ($args->redirect_url) |
|
| 231 | 231 | { |
| 232 | 232 | $oModuleModel = getModel('module'); |
| 233 | 233 | $redirectModuleInfo = $oModuleModel->getModuleInfoByModuleSrl($args->redirect_url, array('mid')); |
| 234 | 234 | |
| 235 | - if(!$redirectModuleInfo) |
|
| 235 | + if (!$redirectModuleInfo) |
|
| 236 | 236 | { |
| 237 | 237 | return new Object('-1', 'msg_exist_selected_module'); |
| 238 | 238 | } |
@@ -256,28 +256,28 @@ discard block |
||
| 256 | 256 | $items = array('user_id', 'password', 'user_name', 'nick_name', 'email_address', 'find_account_question', 'homepage', 'blog', 'birthday', 'signature', 'profile_image', 'image_name', 'image_mark', 'profile_image_max_width', 'profile_image_max_height', 'image_name_max_width', 'image_name_max_height', 'image_mark_max_width', 'image_mark_max_height'); |
| 257 | 257 | $mustRequireds = array('email_address', 'nick_name', 'password', 'find_account_question'); |
| 258 | 258 | $extendItems = $oMemberModel->getJoinFormList(); |
| 259 | - foreach($list_order as $key) |
|
| 259 | + foreach ($list_order as $key) |
|
| 260 | 260 | { |
| 261 | 261 | $signupItem = new stdClass(); |
| 262 | 262 | $signupItem->isIdentifier = ($key == $all_args->identifier); |
| 263 | 263 | $signupItem->isDefaultForm = in_array($key, $items); |
| 264 | 264 | |
| 265 | 265 | $signupItem->name = $key; |
| 266 | - if(!in_array($key, $items)) $signupItem->title = $key; |
|
| 266 | + if (!in_array($key, $items)) $signupItem->title = $key; |
|
| 267 | 267 | else $signupItem->title = $lang->{$key}; |
| 268 | 268 | $signupItem->mustRequired = in_array($key, $mustRequireds); |
| 269 | 269 | $signupItem->imageType = (strpos($key, 'image') !== false); |
| 270 | 270 | $signupItem->required = ($all_args->{$key} == 'required') || $signupItem->mustRequired || $signupItem->isIdentifier; |
| 271 | 271 | $signupItem->isUse = in_array($key, $usable_list) || $signupItem->required; |
| 272 | 272 | $signupItem->isPublic = ($all_args->{'is_'.$key.'_public'} == 'Y' && $signupItem->isUse) ? 'Y' : 'N'; |
| 273 | - if($signupItem->imageType) |
|
| 273 | + if ($signupItem->imageType) |
|
| 274 | 274 | { |
| 275 | 275 | $signupItem->max_width = $all_args->{$key.'_max_width'}; |
| 276 | 276 | $signupItem->max_height = $all_args->{$key.'_max_height'}; |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | // set extends form |
| 280 | - if(!$signupItem->isDefaultForm) |
|
| 280 | + if (!$signupItem->isDefaultForm) |
|
| 281 | 281 | { |
| 282 | 282 | $extendItem = $extendItems[$all_args->{$key.'_member_join_form_srl'}]; |
| 283 | 283 | $signupItem->type = $extendItem->column_type; |
@@ -286,13 +286,13 @@ discard block |
||
| 286 | 286 | $signupItem->description = $extendItem->description; |
| 287 | 287 | |
| 288 | 288 | // check usable value change, required/option |
| 289 | - if($signupItem->isUse != ($extendItem->is_active == 'Y') || $signupItem->required != ($extendItem->required == 'Y')) |
|
| 289 | + if ($signupItem->isUse != ($extendItem->is_active == 'Y') || $signupItem->required != ($extendItem->required == 'Y')) |
|
| 290 | 290 | { |
| 291 | 291 | unset($update_args); |
| 292 | 292 | $update_args = new stdClass; |
| 293 | 293 | $update_args->member_join_form_srl = $extendItem->member_join_form_srl; |
| 294 | - $update_args->is_active = $signupItem->isUse?'Y':'N'; |
|
| 295 | - $update_args->required = $signupItem->required?'Y':'N'; |
|
| 294 | + $update_args->is_active = $signupItem->isUse ? 'Y' : 'N'; |
|
| 295 | + $update_args->required = $signupItem->required ? 'Y' : 'N'; |
|
| 296 | 296 | |
| 297 | 297 | $update_output = executeQuery('member.updateJoinForm', $update_args); |
| 298 | 298 | } |
@@ -309,9 +309,9 @@ discard block |
||
| 309 | 309 | $this->_createFindAccountByQuestion($args->identifier); |
| 310 | 310 | |
| 311 | 311 | // check agreement value exist |
| 312 | - if($args->agreement) |
|
| 312 | + if ($args->agreement) |
|
| 313 | 313 | { |
| 314 | - $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt'; |
|
| 314 | + $agreement_file = _XE_PATH_.'files/member_extra_info/agreement_'.Context::get('lang_type').'.txt'; |
|
| 315 | 315 | $output = FileHandler::writeFile($agreement_file, $args->agreement); |
| 316 | 316 | |
| 317 | 317 | unset($args->agreement); |
@@ -339,16 +339,16 @@ discard block |
||
| 339 | 339 | 'after_logout_url' |
| 340 | 340 | ); |
| 341 | 341 | |
| 342 | - if(!$args->change_password_date) |
|
| 342 | + if (!$args->change_password_date) |
|
| 343 | 343 | { |
| 344 | 344 | $args->change_password_date = 0; |
| 345 | 345 | } |
| 346 | 346 | |
| 347 | - if(!trim(strip_tags($args->after_login_url))) |
|
| 347 | + if (!trim(strip_tags($args->after_login_url))) |
|
| 348 | 348 | { |
| 349 | 349 | $args->after_login_url = NULL; |
| 350 | 350 | } |
| 351 | - if(!trim(strip_tags($args->after_logout_url))) |
|
| 351 | + if (!trim(strip_tags($args->after_logout_url))) |
|
| 352 | 352 | { |
| 353 | 353 | $args->after_logout_url = NULL; |
| 354 | 354 | } |
@@ -375,17 +375,17 @@ discard block |
||
| 375 | 375 | ); |
| 376 | 376 | |
| 377 | 377 | $args->layout_srl = $args->layout_srl ? $args->layout_srl : NULL; |
| 378 | - if(!$args->skin) |
|
| 378 | + if (!$args->skin) |
|
| 379 | 379 | { |
| 380 | 380 | $args->skin = 'default'; |
| 381 | 381 | } |
| 382 | - if(!$args->colorset) |
|
| 382 | + if (!$args->colorset) |
|
| 383 | 383 | { |
| 384 | 384 | $args->colorset = 'white'; |
| 385 | 385 | } |
| 386 | 386 | |
| 387 | 387 | $args->mlayout_srl = $args->mlayout_srl ? $args->mlayout_srl : NULL; |
| 388 | - if(!$args->mskin) |
|
| 388 | + if (!$args->mskin) |
|
| 389 | 389 | { |
| 390 | 390 | $args->mskin = 'default'; |
| 391 | 391 | } |
@@ -408,12 +408,12 @@ discard block |
||
| 408 | 408 | $extendItems = $oMemberModel->getJoinFormList(); |
| 409 | 409 | |
| 410 | 410 | $items = array('user_id', 'password', 'user_name', 'nick_name', 'email_address', 'find_account_question', 'homepage', 'blog', 'birthday', 'signature', 'profile_image', 'image_name', 'image_mark'); |
| 411 | - $mustRequireds = array('email_address', 'nick_name','password', 'find_account_question'); |
|
| 411 | + $mustRequireds = array('email_address', 'nick_name', 'password', 'find_account_question'); |
|
| 412 | 412 | $orgRequireds = array('email_address', 'password', 'find_account_question', 'user_id', 'nick_name', 'user_name'); |
| 413 | 413 | $orgUse = array('email_address', 'password', 'find_account_question', 'user_id', 'nick_name', 'user_name', 'homepage', 'blog', 'birthday'); |
| 414 | 414 | $list_order = array(); |
| 415 | 415 | |
| 416 | - foreach($items as $key) |
|
| 416 | + foreach ($items as $key) |
|
| 417 | 417 | { |
| 418 | 418 | unset($signupItem); |
| 419 | 419 | $signupItem = new stdClass; |
@@ -425,23 +425,23 @@ discard block |
||
| 425 | 425 | $signupItem->required = in_array($key, $orgRequireds); |
| 426 | 426 | $signupItem->isUse = ($config->{$key} == 'Y') || in_array($key, $orgUse); |
| 427 | 427 | $signupItem->isPublic = ($signupItem->isUse) ? 'Y' : 'N'; |
| 428 | - if(in_array($key, array('find_account_question', 'password', 'email_address'))) |
|
| 428 | + if (in_array($key, array('find_account_question', 'password', 'email_address'))) |
|
| 429 | 429 | { |
| 430 | 430 | $signupItem->isPublic = 'N'; |
| 431 | 431 | } |
| 432 | 432 | $signupItem->isIdentifier = ($key == $identifier); |
| 433 | - if ($signupItem->imageType){ |
|
| 433 | + if ($signupItem->imageType) { |
|
| 434 | 434 | $signupItem->max_width = $config->{$key.'_max_width'}; |
| 435 | 435 | $signupItem->max_height = $config->{$key.'_max_height'}; |
| 436 | 436 | } |
| 437 | - if($signupItem->isIdentifier) |
|
| 437 | + if ($signupItem->isIdentifier) |
|
| 438 | 438 | array_unshift($list_order, $signupItem); |
| 439 | 439 | else |
| 440 | 440 | $list_order[] = $signupItem; |
| 441 | 441 | } |
| 442 | - if(is_array($extendItems)) |
|
| 442 | + if (is_array($extendItems)) |
|
| 443 | 443 | { |
| 444 | - foreach($extendItems as $form_srl=>$item_info) |
|
| 444 | + foreach ($extendItems as $form_srl=>$item_info) |
|
| 445 | 445 | { |
| 446 | 446 | unset($signupItem); |
| 447 | 447 | $signupItem = new stdClass; |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | $signupItem->isUse = ($item_info->is_active == 'Y'); |
| 455 | 455 | $signupItem->isPublic = ($signupItem->isUse) ? 'Y' : 'N'; |
| 456 | 456 | $signupItem->description = $item_info->description; |
| 457 | - if($signupItem->imageType) |
|
| 457 | + if ($signupItem->imageType) |
|
| 458 | 458 | { |
| 459 | 459 | $signupItem->max_width = $config->{$key.'_max_width'}; |
| 460 | 460 | $signupItem->max_height = $config->{$key.'_max_height'}; |
@@ -472,13 +472,13 @@ discard block |
||
| 472 | 472 | * @param string $agreement |
| 473 | 473 | * @return void |
| 474 | 474 | */ |
| 475 | - function _createSignupRuleset($signupForm, $agreement = null){ |
|
| 475 | + function _createSignupRuleset($signupForm, $agreement = null) { |
|
| 476 | 476 | $xml_file = './files/ruleset/insertMember.xml'; |
| 477 | - $buff = '<?xml version="1.0" encoding="utf-8"?>' . PHP_EOL. |
|
| 478 | - '<ruleset version="1.5.0">' . PHP_EOL. |
|
| 479 | - '<customrules>' . PHP_EOL. |
|
| 480 | - '</customrules>' . PHP_EOL. |
|
| 481 | - '<fields>' . PHP_EOL . '%s' . PHP_EOL . '</fields>' . PHP_EOL. |
|
| 477 | + $buff = '<?xml version="1.0" encoding="utf-8"?>'.PHP_EOL. |
|
| 478 | + '<ruleset version="1.5.0">'.PHP_EOL. |
|
| 479 | + '<customrules>'.PHP_EOL. |
|
| 480 | + '</customrules>'.PHP_EOL. |
|
| 481 | + '<fields>'.PHP_EOL.'%s'.PHP_EOL.'</fields>'.PHP_EOL. |
|
| 482 | 482 | '</ruleset>'; |
| 483 | 483 | |
| 484 | 484 | $fields = array(); |
@@ -487,41 +487,41 @@ discard block |
||
| 487 | 487 | { |
| 488 | 488 | $fields[] = '<field name="accept_agreement"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /></field>'; |
| 489 | 489 | } |
| 490 | - foreach($signupForm as $formInfo) |
|
| 490 | + foreach ($signupForm as $formInfo) |
|
| 491 | 491 | { |
| 492 | - if($formInfo->required || $formInfo->mustRequired) |
|
| 492 | + if ($formInfo->required || $formInfo->mustRequired) |
|
| 493 | 493 | { |
| 494 | - if($formInfo->type == 'tel' || $formInfo->type == 'kr_zip') |
|
| 494 | + if ($formInfo->type == 'tel' || $formInfo->type == 'kr_zip') |
|
| 495 | 495 | { |
| 496 | 496 | $fields[] = sprintf('<field name="%s[]" required="true" />', $formInfo->name); |
| 497 | 497 | } |
| 498 | - else if($formInfo->name == 'password') |
|
| 498 | + else if ($formInfo->name == 'password') |
|
| 499 | 499 | { |
| 500 | 500 | $fields[] = '<field name="password"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /><if test="$act == \'procMemberInsert\'" attr="length" value="4:60" /></field>'; |
| 501 | 501 | $fields[] = '<field name="password2"><if test="$act == \'procMemberInsert\'" attr="required" value="true" /><if test="$act == \'procMemberInsert\'" attr="equalto" value="password" /></field>'; |
| 502 | 502 | } |
| 503 | - else if($formInfo->name == 'find_account_question') |
|
| 503 | + else if ($formInfo->name == 'find_account_question') |
|
| 504 | 504 | { |
| 505 | 505 | $fields[] = '<field name="find_account_question"><if test="$modify_find_account_answer" attr="required" value="true" /></field>'; |
| 506 | 506 | $fields[] = '<field name="find_account_answer" length=":250"><if test="$modify_find_account_answer" attr="required" value="true" /></field>'; |
| 507 | 507 | } |
| 508 | - else if($formInfo->name == 'email_address') |
|
| 508 | + else if ($formInfo->name == 'email_address') |
|
| 509 | 509 | { |
| 510 | 510 | $fields[] = sprintf('<field name="%s" required="true" rule="email"/>', $formInfo->name); |
| 511 | 511 | } |
| 512 | - else if($formInfo->name == 'user_id') |
|
| 512 | + else if ($formInfo->name == 'user_id') |
|
| 513 | 513 | { |
| 514 | 514 | $fields[] = sprintf('<field name="%s" required="true" rule="userid" length="3:20" />', $formInfo->name); |
| 515 | 515 | } |
| 516 | - else if($formInfo->name == 'nick_name') |
|
| 516 | + else if ($formInfo->name == 'nick_name') |
|
| 517 | 517 | { |
| 518 | 518 | $fields[] = sprintf('<field name="%s" required="true" length="2:20" />', $formInfo->name); |
| 519 | 519 | } |
| 520 | - else if(strpos($formInfo->name, 'image') !== false) |
|
| 520 | + else if (strpos($formInfo->name, 'image') !== false) |
|
| 521 | 521 | { |
| 522 | 522 | $fields[] = sprintf('<field name="%s"><if test="$act != \'procMemberAdminInsert\' && $__%s_exist != \'true\'" attr="required" value="true" /></field>', $formInfo->name, $formInfo->name); |
| 523 | 523 | } |
| 524 | - else if($formInfo->name == 'signature') |
|
| 524 | + else if ($formInfo->name == 'signature') |
|
| 525 | 525 | { |
| 526 | 526 | $fields[] = '<field name="signature"><if test="$member_srl" attr="required" value="true" /></field>'; |
| 527 | 527 | } |
@@ -536,7 +536,7 @@ discard block |
||
| 536 | 536 | FileHandler::writeFile($xml_file, $xml_buff); |
| 537 | 537 | unset($xml_buff); |
| 538 | 538 | |
| 539 | - $validator = new Validator($xml_file); |
|
| 539 | + $validator = new Validator($xml_file); |
|
| 540 | 540 | $validator->setCacheDir('files/cache'); |
| 541 | 541 | $validator->getJsPath(); |
| 542 | 542 | } |
@@ -564,7 +564,7 @@ discard block |
||
| 564 | 564 | $xml_buff = sprintf($buff, implode('', $fields)); |
| 565 | 565 | Filehandler::writeFile($xml_file, $xml_buff); |
| 566 | 566 | |
| 567 | - $validator = new Validator($xml_file); |
|
| 567 | + $validator = new Validator($xml_file); |
|
| 568 | 568 | $validator->setCacheDir('files/cache'); |
| 569 | 569 | $validator->getJsPath(); |
| 570 | 570 | } |
@@ -585,7 +585,7 @@ discard block |
||
| 585 | 585 | '</ruleset>'; |
| 586 | 586 | |
| 587 | 587 | $fields = array(); |
| 588 | - if($identifier == 'user_id') |
|
| 588 | + if ($identifier == 'user_id') |
|
| 589 | 589 | $fields[] = '<field name="user_id" required="true" rule="userid" />'; |
| 590 | 590 | |
| 591 | 591 | $fields[] = '<field name="email_address" required="true" rule="email" />'; |
@@ -595,7 +595,7 @@ discard block |
||
| 595 | 595 | $xml_buff = sprintf($buff, implode('', $fields)); |
| 596 | 596 | Filehandler::writeFile($xml_file, $xml_buff); |
| 597 | 597 | |
| 598 | - $validator = new Validator($xml_file); |
|
| 598 | + $validator = new Validator($xml_file); |
|
| 599 | 599 | $validator->setCacheDir('files/cache'); |
| 600 | 600 | $validator->getJsPath(); |
| 601 | 601 | } |
@@ -606,12 +606,12 @@ discard block |
||
| 606 | 606 | */ |
| 607 | 607 | function procMemberAdminInsertGroup() |
| 608 | 608 | { |
| 609 | - $args = Context::gets('title','description','is_default','image_mark'); |
|
| 609 | + $args = Context::gets('title', 'description', 'is_default', 'image_mark'); |
|
| 610 | 610 | $output = $this->insertGroup($args); |
| 611 | - if(!$output->toBool()) return $output; |
|
| 611 | + if (!$output->toBool()) return $output; |
|
| 612 | 612 | |
| 613 | - $this->add('group_srl',''); |
|
| 614 | - $this->add('page',Context::get('page')); |
|
| 613 | + $this->add('group_srl', ''); |
|
| 614 | + $this->add('page', Context::get('page')); |
|
| 615 | 615 | $this->setMessage('success_registed'); |
| 616 | 616 | |
| 617 | 617 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminGroupList'); |
@@ -626,13 +626,13 @@ discard block |
||
| 626 | 626 | { |
| 627 | 627 | $group_srl = Context::get('group_srl'); |
| 628 | 628 | |
| 629 | - $args = Context::gets('group_srl','title','description','is_default','image_mark'); |
|
| 629 | + $args = Context::gets('group_srl', 'title', 'description', 'is_default', 'image_mark'); |
|
| 630 | 630 | $args->site_srl = 0; |
| 631 | 631 | $output = $this->updateGroup($args); |
| 632 | - if(!$output->toBool()) return $output; |
|
| 632 | + if (!$output->toBool()) return $output; |
|
| 633 | 633 | |
| 634 | - $this->add('group_srl',''); |
|
| 635 | - $this->add('page',Context::get('page')); |
|
| 634 | + $this->add('group_srl', ''); |
|
| 635 | + $this->add('page', Context::get('page')); |
|
| 636 | 636 | $this->setMessage('success_updated'); |
| 637 | 637 | |
| 638 | 638 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminGroupList'); |
@@ -648,10 +648,10 @@ discard block |
||
| 648 | 648 | $group_srl = Context::get('group_srl'); |
| 649 | 649 | |
| 650 | 650 | $output = $this->deleteGroup($group_srl); |
| 651 | - if(!$output->toBool()) return $output; |
|
| 651 | + if (!$output->toBool()) return $output; |
|
| 652 | 652 | |
| 653 | - $this->add('group_srl',''); |
|
| 654 | - $this->add('page',Context::get('page')); |
|
| 653 | + $this->add('group_srl', ''); |
|
| 654 | + $this->add('page', Context::get('page')); |
|
| 655 | 655 | $this->setMessage('success_deleted'); |
| 656 | 656 | |
| 657 | 657 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminGroupList'); |
@@ -673,10 +673,10 @@ discard block |
||
| 673 | 673 | $args->default_value = explode("\n", str_replace("\r", '', Context::get('default_value'))); |
| 674 | 674 | $args->required = Context::get('required'); |
| 675 | 675 | $args->is_active = (isset($args->required)); |
| 676 | - if(!in_array(strtoupper($args->required), array('Y','N')))$args->required = 'N'; |
|
| 676 | + if (!in_array(strtoupper($args->required), array('Y', 'N')))$args->required = 'N'; |
|
| 677 | 677 | $args->description = Context::get('description') ? Context::get('description') : ''; |
| 678 | 678 | // Default values |
| 679 | - if(in_array($args->column_type, array('checkbox','select','radio')) && count($args->default_value)) |
|
| 679 | + if (in_array($args->column_type, array('checkbox', 'select', 'radio')) && count($args->default_value)) |
|
| 680 | 680 | { |
| 681 | 681 | $args->default_value = serialize($args->default_value); |
| 682 | 682 | } |
@@ -688,17 +688,17 @@ discard block |
||
| 688 | 688 | // Check ID duplicated |
| 689 | 689 | $oMemberModel = getModel('member'); |
| 690 | 690 | $config = $oMemberModel->getMemberConfig(); |
| 691 | - foreach($config->signupForm as $item) |
|
| 691 | + foreach ($config->signupForm as $item) |
|
| 692 | 692 | { |
| 693 | - if($item->name == $args->column_name) |
|
| 693 | + if ($item->name == $args->column_name) |
|
| 694 | 694 | { |
| 695 | - if($args->member_join_form_srl && $args->member_join_form_srl == $item->member_join_form_srl) continue; |
|
| 696 | - return new Object(-1,'msg_exists_user_id'); |
|
| 695 | + if ($args->member_join_form_srl && $args->member_join_form_srl == $item->member_join_form_srl) continue; |
|
| 696 | + return new Object(-1, 'msg_exists_user_id'); |
|
| 697 | 697 | } |
| 698 | 698 | } |
| 699 | 699 | // Fix if member_join_form_srl exists. Add if not exists. |
| 700 | 700 | $isInsert; |
| 701 | - if(!$args->member_join_form_srl) |
|
| 701 | + if (!$args->member_join_form_srl) |
|
| 702 | 702 | { |
| 703 | 703 | $isInsert = true; |
| 704 | 704 | $args->list_order = $args->member_join_form_srl = getNextSequence(); |
@@ -709,7 +709,7 @@ discard block |
||
| 709 | 709 | $output = executeQuery('member.updateJoinForm', $args); |
| 710 | 710 | } |
| 711 | 711 | |
| 712 | - if(!$output->toBool()) return $output; |
|
| 712 | + if (!$output->toBool()) return $output; |
|
| 713 | 713 | |
| 714 | 714 | // memberConfig update |
| 715 | 715 | $signupItem = new stdClass(); |
@@ -726,15 +726,15 @@ discard block |
||
| 726 | 726 | $config = $oMemberModel->getMemberConfig(); |
| 727 | 727 | unset($config->agreement); |
| 728 | 728 | |
| 729 | - if($isInsert) |
|
| 729 | + if ($isInsert) |
|
| 730 | 730 | { |
| 731 | 731 | $config->signupForm[] = $signupItem; |
| 732 | 732 | } |
| 733 | 733 | else |
| 734 | 734 | { |
| 735 | - foreach($config->signupForm as $key=>$val) |
|
| 735 | + foreach ($config->signupForm as $key=>$val) |
|
| 736 | 736 | { |
| 737 | - if($val->member_join_form_srl == $signupItem->member_join_form_srl) |
|
| 737 | + if ($val->member_join_form_srl == $signupItem->member_join_form_srl) |
|
| 738 | 738 | { |
| 739 | 739 | $config->signupForm[$key] = $signupItem; |
| 740 | 740 | } |
@@ -762,9 +762,9 @@ discard block |
||
| 762 | 762 | $config = $oMemberModel->getMemberConfig(); |
| 763 | 763 | unset($config->agreement); |
| 764 | 764 | |
| 765 | - foreach($config->signupForm as $key=>$val) |
|
| 765 | + foreach ($config->signupForm as $key=>$val) |
|
| 766 | 766 | { |
| 767 | - if($val->member_join_form_srl == $member_join_form_srl) |
|
| 767 | + if ($val->member_join_form_srl == $member_join_form_srl) |
|
| 768 | 768 | { |
| 769 | 769 | unset($config->signupForm[$key]); |
| 770 | 770 | break; |
@@ -784,7 +784,7 @@ discard block |
||
| 784 | 784 | $member_join_form_srl = Context::get('member_join_form_srl'); |
| 785 | 785 | $mode = Context::get('mode'); |
| 786 | 786 | |
| 787 | - switch($mode) |
|
| 787 | + switch ($mode) |
|
| 788 | 788 | { |
| 789 | 789 | case 'up' : |
| 790 | 790 | $output = $this->moveJoinFormUp($member_join_form_srl); |
@@ -801,7 +801,7 @@ discard block |
||
| 801 | 801 | case 'update' : |
| 802 | 802 | break; |
| 803 | 803 | } |
| 804 | - if(!$output->toBool()) return $output; |
|
| 804 | + if (!$output->toBool()) return $output; |
|
| 805 | 805 | |
| 806 | 806 | $this->setMessage($msg_code); |
| 807 | 807 | } |
@@ -820,40 +820,40 @@ discard block |
||
| 820 | 820 | $oDB->begin(); |
| 821 | 821 | |
| 822 | 822 | $oMemberController = getController('member'); |
| 823 | - foreach($members as $key=>$member_srl) |
|
| 823 | + foreach ($members as $key=>$member_srl) |
|
| 824 | 824 | { |
| 825 | 825 | $args = new stdClass(); |
| 826 | 826 | $args->member_srl = $member_srl; |
| 827 | - switch($var->type) |
|
| 827 | + switch ($var->type) |
|
| 828 | 828 | { |
| 829 | 829 | case 'modify': |
| 830 | 830 | { |
| 831 | - if(count($groups) > 0) |
|
| 831 | + if (count($groups) > 0) |
|
| 832 | 832 | { |
| 833 | 833 | $args->site_srl = 0; |
| 834 | 834 | // One of its members to delete all the group |
| 835 | 835 | $output = executeQuery('member.deleteMemberGroupMember', $args); |
| 836 | - if(!$output->toBool()) |
|
| 836 | + if (!$output->toBool()) |
|
| 837 | 837 | { |
| 838 | 838 | $oDB->rollback(); |
| 839 | 839 | return $output; |
| 840 | 840 | } |
| 841 | 841 | // Enter one of the loop a |
| 842 | - foreach($groups as $group_srl) |
|
| 842 | + foreach ($groups as $group_srl) |
|
| 843 | 843 | { |
| 844 | - $output = $oMemberController->addMemberToGroup($args->member_srl,$group_srl); |
|
| 845 | - if(!$output->toBool()) |
|
| 844 | + $output = $oMemberController->addMemberToGroup($args->member_srl, $group_srl); |
|
| 845 | + if (!$output->toBool()) |
|
| 846 | 846 | { |
| 847 | 847 | $oDB->rollback(); |
| 848 | 848 | return $output; |
| 849 | 849 | } |
| 850 | 850 | } |
| 851 | 851 | } |
| 852 | - if($var->denied) |
|
| 852 | + if ($var->denied) |
|
| 853 | 853 | { |
| 854 | 854 | $args->denied = $var->denied; |
| 855 | 855 | $output = executeQuery('member.updateMemberDeniedInfo', $args); |
| 856 | - if(!$output->toBool()) |
|
| 856 | + if (!$output->toBool()) |
|
| 857 | 857 | { |
| 858 | 858 | $oDB->rollback(); |
| 859 | 859 | return $output; |
@@ -866,7 +866,7 @@ discard block |
||
| 866 | 866 | { |
| 867 | 867 | $oMemberController->memberInfo = null; |
| 868 | 868 | $output = $oMemberController->deleteMember($member_srl); |
| 869 | - if(!$output->toBool()) |
|
| 869 | + if (!$output->toBool()) |
|
| 870 | 870 | { |
| 871 | 871 | $oDB->rollback(); |
| 872 | 872 | return $output; |
@@ -879,15 +879,15 @@ discard block |
||
| 879 | 879 | |
| 880 | 880 | $message = $var->message; |
| 881 | 881 | // Send a message |
| 882 | - if($message) |
|
| 882 | + if ($message) |
|
| 883 | 883 | { |
| 884 | 884 | $oCommunicationController = getController('communication'); |
| 885 | 885 | |
| 886 | 886 | $logged_info = Context::get('logged_info'); |
| 887 | - $title = cut_str($message,10,'...'); |
|
| 887 | + $title = cut_str($message, 10, '...'); |
|
| 888 | 888 | $sender_member_srl = $logged_info->member_srl; |
| 889 | 889 | |
| 890 | - foreach($members as $member_srl) |
|
| 890 | + foreach ($members as $member_srl) |
|
| 891 | 891 | { |
| 892 | 892 | $oCommunicationController->sendMessage($sender_member_srl, $member_srl, $title, $message, false); |
| 893 | 893 | } |
@@ -904,14 +904,14 @@ discard block |
||
| 904 | 904 | function procMemberAdminDeleteMembers() |
| 905 | 905 | { |
| 906 | 906 | $target_member_srls = Context::get('target_member_srls'); |
| 907 | - if(!$target_member_srls) return new Object(-1, 'msg_invalid_request'); |
|
| 907 | + if (!$target_member_srls) return new Object(-1, 'msg_invalid_request'); |
|
| 908 | 908 | $member_srls = explode(',', $target_member_srls); |
| 909 | 909 | $oMemberController = getController('member'); |
| 910 | 910 | |
| 911 | - foreach($member_srls as $member) |
|
| 911 | + foreach ($member_srls as $member) |
|
| 912 | 912 | { |
| 913 | 913 | $output = $oMemberController->deleteMember($member); |
| 914 | - if(!$output->toBool()) |
|
| 914 | + if (!$output->toBool()) |
|
| 915 | 915 | { |
| 916 | 916 | $this->setMessage('failed_deleted'); |
| 917 | 917 | return $output; |
@@ -928,11 +928,11 @@ discard block |
||
| 928 | 928 | function procMemberAdminUpdateMembersGroup() |
| 929 | 929 | { |
| 930 | 930 | $member_srl = Context::get('member_srl'); |
| 931 | - if(!$member_srl) return new Object(-1,'msg_invalid_request'); |
|
| 932 | - $member_srls = explode(',',$member_srl); |
|
| 931 | + if (!$member_srl) return new Object(-1, 'msg_invalid_request'); |
|
| 932 | + $member_srls = explode(',', $member_srl); |
|
| 933 | 933 | |
| 934 | 934 | $group_srl = Context::get('group_srls'); |
| 935 | - if(!is_array($group_srl)) $group_srls = explode('|@|', $group_srl); |
|
| 935 | + if (!is_array($group_srl)) $group_srls = explode('|@|', $group_srl); |
|
| 936 | 936 | else $group_srls = $group_srl; |
| 937 | 937 | |
| 938 | 938 | $oDB = &DB::getInstance(); |
@@ -941,7 +941,7 @@ discard block |
||
| 941 | 941 | $args = new stdClass; |
| 942 | 942 | $args->member_srl = $member_srl; |
| 943 | 943 | $output = executeQuery('member.deleteMembersGroup', $args); |
| 944 | - if(!$output->toBool()) |
|
| 944 | + if (!$output->toBool()) |
|
| 945 | 945 | { |
| 946 | 946 | $oDB->rollback(); |
| 947 | 947 | return $output; |
@@ -949,21 +949,21 @@ discard block |
||
| 949 | 949 | // Add to a selected group |
| 950 | 950 | $group_count = count($group_srls); |
| 951 | 951 | $member_count = count($member_srls); |
| 952 | - for($j=0;$j<$group_count;$j++) |
|
| 952 | + for ($j = 0; $j < $group_count; $j++) |
|
| 953 | 953 | { |
| 954 | - $group_srl = (int)trim($group_srls[$j]); |
|
| 955 | - if(!$group_srl) continue; |
|
| 956 | - for($i=0;$i<$member_count;$i++) |
|
| 954 | + $group_srl = (int) trim($group_srls[$j]); |
|
| 955 | + if (!$group_srl) continue; |
|
| 956 | + for ($i = 0; $i < $member_count; $i++) |
|
| 957 | 957 | { |
| 958 | - $member_srl = (int)trim($member_srls[$i]); |
|
| 959 | - if(!$member_srl) continue; |
|
| 958 | + $member_srl = (int) trim($member_srls[$i]); |
|
| 959 | + if (!$member_srl) continue; |
|
| 960 | 960 | |
| 961 | 961 | $args = new stdClass; |
| 962 | 962 | $args->member_srl = $member_srl; |
| 963 | 963 | $args->group_srl = $group_srl; |
| 964 | 964 | |
| 965 | 965 | $output = executeQuery('member.addMemberToGroup', $args); |
| 966 | - if(!$output->toBool()) |
|
| 966 | + if (!$output->toBool()) |
|
| 967 | 967 | { |
| 968 | 968 | $oDB->rollback(); |
| 969 | 969 | return $output; |
@@ -976,7 +976,7 @@ discard block |
||
| 976 | 976 | |
| 977 | 977 | $this->setMessage('success_updated'); |
| 978 | 978 | |
| 979 | - if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) |
|
| 979 | + if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) |
|
| 980 | 980 | { |
| 981 | 981 | global $lang; |
| 982 | 982 | htmlHeader(); |
@@ -997,19 +997,19 @@ discard block |
||
| 997 | 997 | { |
| 998 | 998 | $user_ids = Context::get('user_id'); |
| 999 | 999 | |
| 1000 | - $user_ids = explode(',',$user_ids); |
|
| 1000 | + $user_ids = explode(',', $user_ids); |
|
| 1001 | 1001 | $success_ids = array(); |
| 1002 | 1002 | |
| 1003 | - foreach($user_ids as $val) |
|
| 1003 | + foreach ($user_ids as $val) |
|
| 1004 | 1004 | { |
| 1005 | 1005 | $val = trim($val); |
| 1006 | - if(!$val) continue; |
|
| 1006 | + if (!$val) continue; |
|
| 1007 | 1007 | |
| 1008 | 1008 | $output = $this->insertDeniedID($val, ''); |
| 1009 | - if($output->toBool()) $success_ids[] = $val; |
|
| 1009 | + if ($output->toBool()) $success_ids[] = $val; |
|
| 1010 | 1010 | } |
| 1011 | 1011 | |
| 1012 | - $this->add('user_ids', implode(',',$success_ids)); |
|
| 1012 | + $this->add('user_ids', implode(',', $success_ids)); |
|
| 1013 | 1013 | |
| 1014 | 1014 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminDeniedIDList'); |
| 1015 | 1015 | $this->setRedirectUrl($returnUrl); |
@@ -1026,10 +1026,10 @@ discard block |
||
| 1026 | 1026 | $mode = Context::get('mode'); |
| 1027 | 1027 | $mode = $mode ? $mode : 'insert'; |
| 1028 | 1028 | |
| 1029 | - if($mode == 'delete') |
|
| 1029 | + if ($mode == 'delete') |
|
| 1030 | 1030 | { |
| 1031 | 1031 | $output = $this->deleteDeniedNickName($nick_name); |
| 1032 | - if(!$output->toBool()) |
|
| 1032 | + if (!$output->toBool()) |
|
| 1033 | 1033 | { |
| 1034 | 1034 | return $output; |
| 1035 | 1035 | } |
@@ -1038,19 +1038,19 @@ discard block |
||
| 1038 | 1038 | } |
| 1039 | 1039 | else |
| 1040 | 1040 | { |
| 1041 | - $nick_names = explode(',',$nick_name); |
|
| 1041 | + $nick_names = explode(',', $nick_name); |
|
| 1042 | 1042 | $success_nick_names = array(); |
| 1043 | 1043 | |
| 1044 | - foreach($nick_names as $val) |
|
| 1044 | + foreach ($nick_names as $val) |
|
| 1045 | 1045 | { |
| 1046 | 1046 | $val = trim($val); |
| 1047 | - if(!$val) continue; |
|
| 1047 | + if (!$val) continue; |
|
| 1048 | 1048 | |
| 1049 | 1049 | $output = $this->insertDeniedNickName($val, ''); |
| 1050 | - if($output->toBool()) $success_nick_names[] = $val; |
|
| 1050 | + if ($output->toBool()) $success_nick_names[] = $val; |
|
| 1051 | 1051 | } |
| 1052 | 1052 | |
| 1053 | - $this->add('nick_names', implode(',',$success_nick_names)); |
|
| 1053 | + $this->add('nick_names', implode(',', $success_nick_names)); |
|
| 1054 | 1054 | } |
| 1055 | 1055 | } |
| 1056 | 1056 | |
@@ -1063,16 +1063,16 @@ discard block |
||
| 1063 | 1063 | $user_id = Context::get('user_id'); |
| 1064 | 1064 | $mode = Context::get('mode'); |
| 1065 | 1065 | |
| 1066 | - switch($mode) |
|
| 1066 | + switch ($mode) |
|
| 1067 | 1067 | { |
| 1068 | 1068 | case 'delete' : |
| 1069 | 1069 | $output = $this->deleteDeniedID($user_id); |
| 1070 | - if(!$output->toBool()) return $output; |
|
| 1070 | + if (!$output->toBool()) return $output; |
|
| 1071 | 1071 | $msg_code = 'success_deleted'; |
| 1072 | 1072 | break; |
| 1073 | 1073 | } |
| 1074 | 1074 | |
| 1075 | - $this->add('page',Context::get('page')); |
|
| 1075 | + $this->add('page', Context::get('page')); |
|
| 1076 | 1076 | $this->setMessage($msg_code); |
| 1077 | 1077 | } |
| 1078 | 1078 | |
@@ -1119,24 +1119,24 @@ discard block |
||
| 1119 | 1119 | */ |
| 1120 | 1120 | function insertGroup($args) |
| 1121 | 1121 | { |
| 1122 | - if(!$args->site_srl) $args->site_srl = 0; |
|
| 1122 | + if (!$args->site_srl) $args->site_srl = 0; |
|
| 1123 | 1123 | // Check the value of is_default. |
| 1124 | - if($args->is_default != 'Y') |
|
| 1124 | + if ($args->is_default != 'Y') |
|
| 1125 | 1125 | { |
| 1126 | 1126 | $args->is_default = 'N'; |
| 1127 | 1127 | } |
| 1128 | 1128 | else |
| 1129 | 1129 | { |
| 1130 | 1130 | $output = executeQuery('member.updateGroupDefaultClear', $args); |
| 1131 | - if(!$output->toBool()) return $output; |
|
| 1131 | + if (!$output->toBool()) return $output; |
|
| 1132 | 1132 | } |
| 1133 | 1133 | |
| 1134 | - if(!isset($args->list_order) || $args->list_order=='') |
|
| 1134 | + if (!isset($args->list_order) || $args->list_order == '') |
|
| 1135 | 1135 | { |
| 1136 | 1136 | $args->list_order = $args->group_srl; |
| 1137 | 1137 | } |
| 1138 | 1138 | |
| 1139 | - if(!$args->group_srl) $args->group_srl = getNextSequence(); |
|
| 1139 | + if (!$args->group_srl) $args->group_srl = getNextSequence(); |
|
| 1140 | 1140 | $args->list_order = $args->group_srl; |
| 1141 | 1141 | $output = executeQuery('member.insertGroup', $args); |
| 1142 | 1142 | $this->_deleteMemberGroupCache($args->site_srl); |
@@ -1151,17 +1151,17 @@ discard block |
||
| 1151 | 1151 | */ |
| 1152 | 1152 | function updateGroup($args) |
| 1153 | 1153 | { |
| 1154 | - if(!$args->site_srl) $args->site_srl = 0; |
|
| 1154 | + if (!$args->site_srl) $args->site_srl = 0; |
|
| 1155 | 1155 | // Check the value of is_default. |
| 1156 | - if(!$args->group_srl) return new Object(-1, 'lang->msg_not_founded'); |
|
| 1157 | - if($args->is_default!='Y') |
|
| 1156 | + if (!$args->group_srl) return new Object(-1, 'lang->msg_not_founded'); |
|
| 1157 | + if ($args->is_default != 'Y') |
|
| 1158 | 1158 | { |
| 1159 | 1159 | $args->is_default = 'N'; |
| 1160 | 1160 | } |
| 1161 | 1161 | else |
| 1162 | 1162 | { |
| 1163 | 1163 | $output = executeQuery('member.updateGroupDefaultClear', $args); |
| 1164 | - if(!$output->toBool()) return $output; |
|
| 1164 | + if (!$output->toBool()) return $output; |
|
| 1165 | 1165 | } |
| 1166 | 1166 | |
| 1167 | 1167 | $output = executeQuery('member.updateGroup', $args); |
@@ -1184,8 +1184,8 @@ discard block |
||
| 1184 | 1184 | $columnList = array('group_srl', 'is_default'); |
| 1185 | 1185 | $group_info = $oMemberModel->getGroup($group_srl, $columnList); |
| 1186 | 1186 | |
| 1187 | - if(!$group_info) return new Object(-1, 'lang->msg_not_founded'); |
|
| 1188 | - if($group_info->is_default == 'Y') return new Object(-1, 'msg_not_delete_default'); |
|
| 1187 | + if (!$group_info) return new Object(-1, 'lang->msg_not_founded'); |
|
| 1188 | + if ($group_info->is_default == 'Y') return new Object(-1, 'msg_not_delete_default'); |
|
| 1189 | 1189 | |
| 1190 | 1190 | // Get groups where is_default == 'Y' |
| 1191 | 1191 | $columnList = array('site_srl', 'group_srl'); |
@@ -1222,7 +1222,7 @@ discard block |
||
| 1222 | 1222 | $defaultGroup = $oMemberModel->getDefaultGroup(0); |
| 1223 | 1223 | $defaultGroupSrl = $defaultGroup->group_srl; |
| 1224 | 1224 | $group_srls = $vars->group_srls; |
| 1225 | - foreach($group_srls as $order=>$group_srl) |
|
| 1225 | + foreach ($group_srls as $order=>$group_srl) |
|
| 1226 | 1226 | { |
| 1227 | 1227 | $isInsert = false; |
| 1228 | 1228 | $update_args = new stdClass(); |
@@ -1231,9 +1231,9 @@ discard block |
||
| 1231 | 1231 | $update_args->image_mark = $vars->image_marks[$order]; |
| 1232 | 1232 | $update_args->list_order = $order + 1; |
| 1233 | 1233 | |
| 1234 | - if(!$update_args->title) continue; |
|
| 1234 | + if (!$update_args->title) continue; |
|
| 1235 | 1235 | |
| 1236 | - if(is_numeric($group_srl)) { |
|
| 1236 | + if (is_numeric($group_srl)) { |
|
| 1237 | 1237 | $update_args->group_srl = $group_srl; |
| 1238 | 1238 | $output = $this->updateGroup($update_args); |
| 1239 | 1239 | } |
@@ -1242,7 +1242,7 @@ discard block |
||
| 1242 | 1242 | $output = $this->insertGroup($update_args); |
| 1243 | 1243 | } |
| 1244 | 1244 | |
| 1245 | - if($vars->defaultGroup == $group_srl) { |
|
| 1245 | + if ($vars->defaultGroup == $group_srl) { |
|
| 1246 | 1246 | $defaultGroupSrl = $update_args->group_srl; |
| 1247 | 1247 | } |
| 1248 | 1248 | } |
@@ -1268,7 +1268,7 @@ discard block |
||
| 1268 | 1268 | { |
| 1269 | 1269 | $vars = Context::getRequestVars(); |
| 1270 | 1270 | |
| 1271 | - foreach($vars->group_srls as $key => $val) |
|
| 1271 | + foreach ($vars->group_srls as $key => $val) |
|
| 1272 | 1272 | { |
| 1273 | 1273 | $args = new stdClass; |
| 1274 | 1274 | $args->group_srl = $val; |
@@ -1289,7 +1289,7 @@ discard block |
||
| 1289 | 1289 | { |
| 1290 | 1290 | //remove from cache |
| 1291 | 1291 | $oCacheHandler = CacheHandler::getInstance('object', null, true); |
| 1292 | - if($oCacheHandler->isSupport()) |
|
| 1292 | + if ($oCacheHandler->isSupport()) |
|
| 1293 | 1293 | { |
| 1294 | 1294 | $oCacheHandler->invalidateGroupKey('member'); |
| 1295 | 1295 | } |
@@ -1306,7 +1306,7 @@ discard block |
||
| 1306 | 1306 | $args = new stdClass(); |
| 1307 | 1307 | $args->user_id = $user_id; |
| 1308 | 1308 | $args->description = $description; |
| 1309 | - $args->list_order = -1*getNextSequence(); |
|
| 1309 | + $args->list_order = -1 * getNextSequence(); |
|
| 1310 | 1310 | |
| 1311 | 1311 | return executeQuery('member.insertDeniedID', $args); |
| 1312 | 1312 | } |
@@ -1327,7 +1327,7 @@ discard block |
||
| 1327 | 1327 | */ |
| 1328 | 1328 | function deleteDeniedID($user_id) |
| 1329 | 1329 | { |
| 1330 | - if(!$user_id) unset($user_id); |
|
| 1330 | + if (!$user_id) unset($user_id); |
|
| 1331 | 1331 | |
| 1332 | 1332 | $args = new stdClass; |
| 1333 | 1333 | $args->user_id = $user_id; |
@@ -1341,7 +1341,7 @@ discard block |
||
| 1341 | 1341 | */ |
| 1342 | 1342 | function deleteDeniedNickName($nick_name) |
| 1343 | 1343 | { |
| 1344 | - if(!$nick_name) unset($nick_name); |
|
| 1344 | + if (!$nick_name) unset($nick_name); |
|
| 1345 | 1345 | |
| 1346 | 1346 | $args = new stdClass; |
| 1347 | 1347 | $args->nick_name = $nick_name; |
@@ -1380,16 +1380,16 @@ discard block |
||
| 1380 | 1380 | // Get a list of all join forms |
| 1381 | 1381 | $join_form_list = $oMemberModel->getJoinFormList(); |
| 1382 | 1382 | $join_form_srl_list = array_keys($join_form_list); |
| 1383 | - if(count($join_form_srl_list)<2) return new Object(); |
|
| 1383 | + if (count($join_form_srl_list) < 2) return new Object(); |
|
| 1384 | 1384 | |
| 1385 | 1385 | $prev_member_join_form = NULL; |
| 1386 | - foreach($join_form_list as $key => $val) |
|
| 1386 | + foreach ($join_form_list as $key => $val) |
|
| 1387 | 1387 | { |
| 1388 | - if($val->member_join_form_srl == $member_join_form_srl) break; |
|
| 1388 | + if ($val->member_join_form_srl == $member_join_form_srl) break; |
|
| 1389 | 1389 | $prev_member_join_form = $val; |
| 1390 | 1390 | } |
| 1391 | 1391 | // Return if no previous join form exists |
| 1392 | - if(!$prev_member_join_form) return new Object(); |
|
| 1392 | + if (!$prev_member_join_form) return new Object(); |
|
| 1393 | 1393 | // Information of the join form |
| 1394 | 1394 | $cur_args = new stdClass; |
| 1395 | 1395 | $cur_args->member_join_form_srl = $member_join_form_srl; |
@@ -1400,10 +1400,10 @@ discard block |
||
| 1400 | 1400 | $prev_args->list_order = $list_order; |
| 1401 | 1401 | // Execute Query |
| 1402 | 1402 | $output = executeQuery('member.updateMemberJoinFormListorder', $cur_args); |
| 1403 | - if(!$output->toBool()) return $output; |
|
| 1403 | + if (!$output->toBool()) return $output; |
|
| 1404 | 1404 | |
| 1405 | 1405 | executeQuery('member.updateMemberJoinFormListorder', $prev_args); |
| 1406 | - if(!$output->toBool()) return $output; |
|
| 1406 | + if (!$output->toBool()) return $output; |
|
| 1407 | 1407 | |
| 1408 | 1408 | return new Object(); |
| 1409 | 1409 | } |
@@ -1427,16 +1427,16 @@ discard block |
||
| 1427 | 1427 | // Get information of all join forms |
| 1428 | 1428 | $join_form_list = $oMemberModel->getJoinFormList(); |
| 1429 | 1429 | $join_form_srl_list = array_keys($join_form_list); |
| 1430 | - if(count($join_form_srl_list)<2) return new Object(); |
|
| 1430 | + if (count($join_form_srl_list) < 2) return new Object(); |
|
| 1431 | 1431 | |
| 1432 | - for($i=0;$i<count($join_form_srl_list);$i++) |
|
| 1432 | + for ($i = 0; $i < count($join_form_srl_list); $i++) |
|
| 1433 | 1433 | { |
| 1434 | - if($join_form_srl_list[$i]==$member_join_form_srl) break; |
|
| 1434 | + if ($join_form_srl_list[$i] == $member_join_form_srl) break; |
|
| 1435 | 1435 | } |
| 1436 | 1436 | |
| 1437 | - $next_member_join_form_srl = $join_form_srl_list[$i+1]; |
|
| 1437 | + $next_member_join_form_srl = $join_form_srl_list[$i + 1]; |
|
| 1438 | 1438 | // Return if no previous join form exists |
| 1439 | - if(!$next_member_join_form_srl) return new Object(); |
|
| 1439 | + if (!$next_member_join_form_srl) return new Object(); |
|
| 1440 | 1440 | $next_member_join_form = $join_form_list[$next_member_join_form_srl]; |
| 1441 | 1441 | // Information of the join form |
| 1442 | 1442 | $cur_args = new stdClass; |
@@ -1448,10 +1448,10 @@ discard block |
||
| 1448 | 1448 | $next_args->list_order = $list_order; |
| 1449 | 1449 | // Execute Query |
| 1450 | 1450 | $output = executeQuery('member.updateMemberJoinFormListorder', $cur_args); |
| 1451 | - if(!$output->toBool()) return $output; |
|
| 1451 | + if (!$output->toBool()) return $output; |
|
| 1452 | 1452 | |
| 1453 | 1453 | $output = executeQuery('member.updateMemberJoinFormListorder', $next_args); |
| 1454 | - if(!$output->toBool()) return $output; |
|
| 1454 | + if (!$output->toBool()) return $output; |
|
| 1455 | 1455 | |
| 1456 | 1456 | return new Object(); |
| 1457 | 1457 | } |
@@ -18,32 +18,32 @@ discard block |
||
| 18 | 18 | function proc($args) |
| 19 | 19 | { |
| 20 | 20 | // Targets to sort |
| 21 | - if(!in_array($args->order_target, array('list_order','update_order'))) $args->order_target = 'list_order'; |
|
| 21 | + if (!in_array($args->order_target, array('list_order', 'update_order'))) $args->order_target = 'list_order'; |
|
| 22 | 22 | // Sort order |
| 23 | - if(!in_array($args->order_type, array('asc','desc'))) $args->order_type = 'asc'; |
|
| 23 | + if (!in_array($args->order_type, array('asc', 'desc'))) $args->order_type = 'asc'; |
|
| 24 | 24 | // The number of displayed lists |
| 25 | - $args->list_count = (int)$args->list_count; |
|
| 26 | - if(!$args->list_count) $args->list_count = 5; |
|
| 25 | + $args->list_count = (int) $args->list_count; |
|
| 26 | + if (!$args->list_count) $args->list_count = 5; |
|
| 27 | 27 | // Cut the length of the title |
| 28 | - if(!$args->subject_cut_size) $args->subject_cut_size = 0; |
|
| 28 | + if (!$args->subject_cut_size) $args->subject_cut_size = 0; |
|
| 29 | 29 | // Cut the length of contents |
| 30 | - if(!$args->content_cut_size) $args->content_cut_size = 100; |
|
| 30 | + if (!$args->content_cut_size) $args->content_cut_size = 100; |
|
| 31 | 31 | // Viewing options |
| 32 | - $args->option_view_arr = explode(',',$args->option_view); |
|
| 32 | + $args->option_view_arr = explode(',', $args->option_view); |
|
| 33 | 33 | // markup options |
| 34 | - if(!$args->markup_type) $args->markup_type = 'list'; |
|
| 34 | + if (!$args->markup_type) $args->markup_type = 'list'; |
|
| 35 | 35 | // Set variables for internal use |
| 36 | 36 | $oModuleModel = getModel('module'); |
| 37 | 37 | $module_srls = $args->modules_info = $args->module_srls_info = $args->mid_lists = array(); |
| 38 | 38 | $site_module_info = Context::get('site_module_info'); |
| 39 | 39 | // List URLs if a type is RSS |
| 40 | - if($args->content_type == 'rss') |
|
| 40 | + if ($args->content_type == 'rss') |
|
| 41 | 41 | { |
| 42 | 42 | $args->rss_urls = array(); |
| 43 | - $rss_urls = array_unique(array($args->rss_url0,$args->rss_url1,$args->rss_url2,$args->rss_url3,$args->rss_url4)); |
|
| 44 | - for($i=0,$c=count($rss_urls);$i<$c;$i++) |
|
| 43 | + $rss_urls = array_unique(array($args->rss_url0, $args->rss_url1, $args->rss_url2, $args->rss_url3, $args->rss_url4)); |
|
| 44 | + for ($i = 0, $c = count($rss_urls); $i < $c; $i++) |
|
| 45 | 45 | { |
| 46 | - if($rss_urls[$i]) $args->rss_urls[] = $rss_urls[$i]; |
|
| 46 | + if ($rss_urls[$i]) $args->rss_urls[] = $rss_urls[$i]; |
|
| 47 | 47 | } |
| 48 | 48 | // Get module information after listing module_srls if the module is not RSS |
| 49 | 49 | } |
@@ -51,13 +51,13 @@ discard block |
||
| 51 | 51 | { |
| 52 | 52 | $obj = new stdClass(); |
| 53 | 53 | // Apply to all modules in the site if a target module is not specified |
| 54 | - if(!$args->module_srls) |
|
| 54 | + if (!$args->module_srls) |
|
| 55 | 55 | { |
| 56 | - $obj->site_srl = (int)$site_module_info->site_srl; |
|
| 56 | + $obj->site_srl = (int) $site_module_info->site_srl; |
|
| 57 | 57 | $output = executeQueryArray('widgets.content.getMids', $obj); |
| 58 | - if($output->data) |
|
| 58 | + if ($output->data) |
|
| 59 | 59 | { |
| 60 | - foreach($output->data as $key => $val) |
|
| 60 | + foreach ($output->data as $key => $val) |
|
| 61 | 61 | { |
| 62 | 62 | $args->modules_info[$val->mid] = $val; |
| 63 | 63 | $args->module_srls_info[$val->module_srl] = $val; |
@@ -73,35 +73,35 @@ discard block |
||
| 73 | 73 | { |
| 74 | 74 | $obj->module_srls = $args->module_srls; |
| 75 | 75 | $output = executeQueryArray('widgets.content.getMids', $obj); |
| 76 | - if($output->data) |
|
| 76 | + if ($output->data) |
|
| 77 | 77 | { |
| 78 | - foreach($output->data as $key => $val) |
|
| 78 | + foreach ($output->data as $key => $val) |
|
| 79 | 79 | { |
| 80 | 80 | $args->modules_info[$val->mid] = $val; |
| 81 | 81 | $args->module_srls_info[$val->module_srl] = $val; |
| 82 | 82 | $module_srls[] = $val->module_srl; |
| 83 | 83 | } |
| 84 | - $idx = explode(',',$args->module_srls); |
|
| 85 | - for($i=0,$c=count($idx);$i<$c;$i++) |
|
| 84 | + $idx = explode(',', $args->module_srls); |
|
| 85 | + for ($i = 0, $c = count($idx); $i < $c; $i++) |
|
| 86 | 86 | { |
| 87 | 87 | $srl = $idx[$i]; |
| 88 | - if(!$args->module_srls_info[$srl]) continue; |
|
| 88 | + if (!$args->module_srls_info[$srl]) continue; |
|
| 89 | 89 | $args->mid_lists[$srl] = $args->module_srls_info[$srl]->mid; |
| 90 | 90 | } |
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | 93 | // Exit if no module is found |
| 94 | - if(!count($args->modules_info)) return Context::get('msg_not_founded'); |
|
| 95 | - $args->module_srl = implode(',',$module_srls); |
|
| 94 | + if (!count($args->modules_info)) return Context::get('msg_not_founded'); |
|
| 95 | + $args->module_srl = implode(',', $module_srls); |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | /** |
| 99 | 99 | * Method is separately made because content extraction, articles, comments, trackbacks, RSS and other elements exist |
| 100 | 100 | */ |
| 101 | 101 | // tab mode |
| 102 | - if($args->tab_type == 'none' || $args->tab_type == '') |
|
| 102 | + if ($args->tab_type == 'none' || $args->tab_type == '') |
|
| 103 | 103 | { |
| 104 | - switch($args->content_type) |
|
| 104 | + switch ($args->content_type) |
|
| 105 | 105 | { |
| 106 | 106 | case 'comment': |
| 107 | 107 | $content_items = $this->_getCommentItems($args); |
@@ -125,17 +125,17 @@ discard block |
||
| 125 | 125 | { |
| 126 | 126 | $content_items = array(); |
| 127 | 127 | |
| 128 | - switch($args->content_type) |
|
| 128 | + switch ($args->content_type) |
|
| 129 | 129 | { |
| 130 | 130 | case 'comment': |
| 131 | - foreach($args->mid_lists as $module_srl => $mid) |
|
| 131 | + foreach ($args->mid_lists as $module_srl => $mid) |
|
| 132 | 132 | { |
| 133 | 133 | $args->module_srl = $module_srl; |
| 134 | 134 | $content_items[$module_srl] = $this->_getCommentItems($args); |
| 135 | 135 | } |
| 136 | 136 | break; |
| 137 | 137 | case 'image': |
| 138 | - foreach($args->mid_lists as $module_srl => $mid) |
|
| 138 | + foreach ($args->mid_lists as $module_srl => $mid) |
|
| 139 | 139 | { |
| 140 | 140 | $args->module_srl = $module_srl; |
| 141 | 141 | $content_items[$module_srl] = $this->_getImageItems($args); |
@@ -145,13 +145,13 @@ discard block |
||
| 145 | 145 | $content_items = $this->getRssItems($args); |
| 146 | 146 | break; |
| 147 | 147 | case 'trackback': |
| 148 | - foreach($args->mid_lists as $module_srl => $mid){ |
|
| 148 | + foreach ($args->mid_lists as $module_srl => $mid) { |
|
| 149 | 149 | $args->module_srl = $module_srl; |
| 150 | 150 | $content_items[$module_srl] = $this->_getTrackbackItems($args); |
| 151 | 151 | } |
| 152 | 152 | break; |
| 153 | 153 | default: |
| 154 | - foreach($args->mid_lists as $module_srl => $mid) |
|
| 154 | + foreach ($args->mid_lists as $module_srl => $mid) |
|
| 155 | 155 | { |
| 156 | 156 | $args->module_srl = $module_srl; |
| 157 | 157 | $content_items[$module_srl] = $this->_getDocumentItems($args); |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | } |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | - $output = $this->_compile($args,$content_items); |
|
| 163 | + $output = $this->_compile($args, $content_items); |
|
| 164 | 164 | return $output; |
| 165 | 165 | } |
| 166 | 166 | |
@@ -180,14 +180,14 @@ discard block |
||
| 180 | 180 | |
| 181 | 181 | $content_items = array(); |
| 182 | 182 | |
| 183 | - if(!count($output)) return; |
|
| 183 | + if (!count($output)) return; |
|
| 184 | 184 | |
| 185 | - foreach($output as $key => $oComment) |
|
| 185 | + foreach ($output as $key => $oComment) |
|
| 186 | 186 | { |
| 187 | 187 | $attribute = $oComment->getObjectVars(); |
| 188 | 188 | $title = $oComment->getSummary($args->content_cut_size); |
| 189 | 189 | $thumbnail = $oComment->getThumbnail(); |
| 190 | - $url = sprintf("%s#comment_%s",getUrl('', 'mid', $args->mid_lists[$attribute->module_srl], 'document_srl',$oComment->get('document_srl')),$oComment->get('comment_srl')); |
|
| 190 | + $url = sprintf("%s#comment_%s", getUrl('', 'mid', $args->mid_lists[$attribute->module_srl], 'document_srl', $oComment->get('document_srl')), $oComment->get('comment_srl')); |
|
| 191 | 191 | |
| 192 | 192 | $attribute->mid = $args->mid_lists[$attribute->module_srl]; |
| 193 | 193 | $browser_title = $args->module_srls_info[$attribute->module_srl]->browser_title; |
@@ -212,10 +212,10 @@ discard block |
||
| 212 | 212 | // Get categories |
| 213 | 213 | $obj = new stdClass(); |
| 214 | 214 | $obj->module_srl = $args->module_srl; |
| 215 | - $output = executeQueryArray('widgets.content.getCategories',$obj); |
|
| 216 | - if($output->toBool() && $output->data) |
|
| 215 | + $output = executeQueryArray('widgets.content.getCategories', $obj); |
|
| 216 | + if ($output->toBool() && $output->data) |
|
| 217 | 217 | { |
| 218 | - foreach($output->data as $key => $val) |
|
| 218 | + foreach ($output->data as $key => $val) |
|
| 219 | 219 | { |
| 220 | 220 | $category_lists[$val->module_srl][$val->category_srl] = $val; |
| 221 | 221 | } |
@@ -223,17 +223,17 @@ discard block |
||
| 223 | 223 | // Get a list of documents |
| 224 | 224 | $obj->module_srl = $args->module_srl; |
| 225 | 225 | $obj->sort_index = $args->order_target; |
| 226 | - $obj->order_type = $args->order_type=="desc"?"asc":"desc"; |
|
| 226 | + $obj->order_type = $args->order_type == "desc" ? "asc" : "desc"; |
|
| 227 | 227 | $obj->list_count = $args->list_count; |
| 228 | 228 | $obj->statusList = array('PUBLIC'); |
| 229 | 229 | $output = executeQueryArray('widgets.content.getNewestDocuments', $obj); |
| 230 | - if(!$output->toBool() || !$output->data) return; |
|
| 230 | + if (!$output->toBool() || !$output->data) return; |
|
| 231 | 231 | // If the result exists, make each document as an object |
| 232 | 232 | $content_items = array(); |
| 233 | 233 | $first_thumbnail_idx = -1; |
| 234 | - if(count($output->data)) |
|
| 234 | + if (count($output->data)) |
|
| 235 | 235 | { |
| 236 | - foreach($output->data as $key => $attribute) |
|
| 236 | + foreach ($output->data as $key => $attribute) |
|
| 237 | 237 | { |
| 238 | 238 | $oDocument = new documentItem(); |
| 239 | 239 | $oDocument->setAttribute($attribute, false); |
@@ -242,23 +242,23 @@ discard block |
||
| 242 | 242 | } |
| 243 | 243 | $oDocumentModel->setToAllDocumentExtraVars(); |
| 244 | 244 | |
| 245 | - for($i=0,$c=count($document_srls);$i<$c;$i++) |
|
| 245 | + for ($i = 0, $c = count($document_srls); $i < $c; $i++) |
|
| 246 | 246 | { |
| 247 | 247 | $oDocument = $GLOBALS['XE_DOCUMENT_LIST'][$document_srls[$i]]; |
| 248 | 248 | $document_srl = $oDocument->document_srl; |
| 249 | 249 | $module_srl = $oDocument->get('module_srl'); |
| 250 | 250 | $category_srl = $oDocument->get('category_srl'); |
| 251 | 251 | $thumbnail = $oDocument->getThumbnail(); |
| 252 | - $content_item = new mcontentItem( $args->module_srls_info[$module_srl]->browser_title ); |
|
| 252 | + $content_item = new mcontentItem($args->module_srls_info[$module_srl]->browser_title); |
|
| 253 | 253 | $content_item->adds($oDocument->getObjectVars()); |
| 254 | 254 | $content_item->setTitle($oDocument->getTitleText()); |
| 255 | - $content_item->setCategory( $category_lists[$module_srl][$category_srl]->title ); |
|
| 256 | - $content_item->setDomain( $args->module_srls_info[$module_srl]->domain ); |
|
| 255 | + $content_item->setCategory($category_lists[$module_srl][$category_srl]->title); |
|
| 256 | + $content_item->setDomain($args->module_srls_info[$module_srl]->domain); |
|
| 257 | 257 | $content_item->setContent($oDocument->getSummary($args->content_cut_size)); |
| 258 | - $content_item->setLink( getSiteUrl($domain,'', 'mid',$args->mid_lists[$module_srl], 'document_srl',$document_srl) ); |
|
| 258 | + $content_item->setLink(getSiteUrl($domain, '', 'mid', $args->mid_lists[$module_srl], 'document_srl', $document_srl)); |
|
| 259 | 259 | $content_item->setThumbnail($thumbnail); |
| 260 | 260 | $content_item->add('mid', $args->mid_lists[$module_srl]); |
| 261 | - if($first_thumbnail_idx==-1 && $thumbnail) $first_thumbnail_idx = $i; |
|
| 261 | + if ($first_thumbnail_idx == -1 && $thumbnail) $first_thumbnail_idx = $i; |
|
| 262 | 262 | $content_items[] = $content_item; |
| 263 | 263 | } |
| 264 | 264 | |
@@ -276,10 +276,10 @@ discard block |
||
| 276 | 276 | $obj->direct_download = 'Y'; |
| 277 | 277 | $obj->isvalid = 'Y'; |
| 278 | 278 | // Get categories |
| 279 | - $output = executeQueryArray('widgets.content.getCategories',$obj); |
|
| 280 | - if($output->toBool() && $output->data) |
|
| 279 | + $output = executeQueryArray('widgets.content.getCategories', $obj); |
|
| 280 | + if ($output->toBool() && $output->data) |
|
| 281 | 281 | { |
| 282 | - foreach($output->data as $key => $val) |
|
| 282 | + foreach ($output->data as $key => $val) |
|
| 283 | 283 | { |
| 284 | 284 | $category_lists[$val->module_srl][$val->category_srl] = $val; |
| 285 | 285 | } |
@@ -288,24 +288,24 @@ discard block |
||
| 288 | 288 | $obj->list_count = $args->list_count; |
| 289 | 289 | $files_output = executeQueryArray("file.getOneFileInDocument", $obj); |
| 290 | 290 | $files_count = count($files_output->data); |
| 291 | - if(!$files_count) return; |
|
| 291 | + if (!$files_count) return; |
|
| 292 | 292 | |
| 293 | 293 | $content_items = array(); |
| 294 | 294 | |
| 295 | - for($i=0;$i<$files_count;$i++) $document_srl_list[] = $files_output->data[$i]->document_srl; |
|
| 295 | + for ($i = 0; $i < $files_count; $i++) $document_srl_list[] = $files_output->data[$i]->document_srl; |
|
| 296 | 296 | |
| 297 | 297 | $tmp_document_list = $oDocumentModel->getDocuments($document_srl_list); |
| 298 | 298 | |
| 299 | - if(!count($tmp_document_list)) return; |
|
| 299 | + if (!count($tmp_document_list)) return; |
|
| 300 | 300 | |
| 301 | - foreach($tmp_document_list as $oDocument) |
|
| 301 | + foreach ($tmp_document_list as $oDocument) |
|
| 302 | 302 | { |
| 303 | 303 | $attribute = $oDocument->getObjectVars(); |
| 304 | 304 | $browser_title = $args->module_srls_info[$attribute->module_srl]->browser_title; |
| 305 | 305 | $domain = $args->module_srls_info[$attribute->module_srl]->domain; |
| 306 | 306 | $category = $category_lists[$attribute->module_srl]->text; |
| 307 | 307 | $content = $oDocument->getSummary($args->content_cut_size); |
| 308 | - $url = sprintf("%s#%s",$oDocument->getPermanentUrl() ,$oDocument->getCommentCount()); |
|
| 308 | + $url = sprintf("%s#%s", $oDocument->getPermanentUrl(), $oDocument->getCommentCount()); |
|
| 309 | 309 | $thumbnail = $oDocument->getThumbnail(); |
| 310 | 310 | $content_item = new mcontentItem($browser_title); |
| 311 | 311 | $content_item->adds($attribute); |
@@ -327,11 +327,11 @@ discard block |
||
| 327 | 327 | $content_items = array(); |
| 328 | 328 | $args->mid_lists = array(); |
| 329 | 329 | |
| 330 | - foreach($args->rss_urls as $key => $rss) |
|
| 330 | + foreach ($args->rss_urls as $key => $rss) |
|
| 331 | 331 | { |
| 332 | 332 | $args->rss_url = $rss; |
| 333 | 333 | $content_item = $this->_getRssItems($args); |
| 334 | - if(count($content_item) > 0) |
|
| 334 | + if (count($content_item) > 0) |
|
| 335 | 335 | { |
| 336 | 336 | $browser_title = $content_item[0]->getBrowserTitle(); |
| 337 | 337 | $args->mid_lists[] = $browser_title; |
@@ -339,40 +339,40 @@ discard block |
||
| 339 | 339 | } |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | - if($args->tab_type == 'none' || $args->tab_type == '') |
|
| 342 | + if ($args->tab_type == 'none' || $args->tab_type == '') |
|
| 343 | 343 | { |
| 344 | 344 | $items = array(); |
| 345 | - foreach($content_items as $key => $val) |
|
| 345 | + foreach ($content_items as $key => $val) |
|
| 346 | 346 | { |
| 347 | - foreach($val as $k => $v) |
|
| 347 | + foreach ($val as $k => $v) |
|
| 348 | 348 | { |
| 349 | 349 | $date = $v->get('regdate'); |
| 350 | - $i=0; |
|
| 351 | - while(array_key_exists(sprintf('%s%02d',$date,$i), $items)) $i++; |
|
| 352 | - $items[sprintf('%s%02d',$date,$i)] = $v; |
|
| 350 | + $i = 0; |
|
| 351 | + while (array_key_exists(sprintf('%s%02d', $date, $i), $items)) $i++; |
|
| 352 | + $items[sprintf('%s%02d', $date, $i)] = $v; |
|
| 353 | 353 | } |
| 354 | 354 | } |
| 355 | - if($args->order_type =='asc') ksort($items); |
|
| 355 | + if ($args->order_type == 'asc') ksort($items); |
|
| 356 | 356 | else krsort($items); |
| 357 | - $content_items = array_slice(array_values($items),0,$args->list_count); |
|
| 357 | + $content_items = array_slice(array_values($items), 0, $args->list_count); |
|
| 358 | 358 | } return $content_items; |
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | function _getRssBody($value) |
| 362 | 362 | { |
| 363 | - if(!$value || is_string($value)) return $value; |
|
| 364 | - if(is_object($value)) $value = get_object_vars($value); |
|
| 363 | + if (!$value || is_string($value)) return $value; |
|
| 364 | + if (is_object($value)) $value = get_object_vars($value); |
|
| 365 | 365 | $body = null; |
| 366 | - if(!count($value)) return; |
|
| 367 | - foreach($value as $key => $val) |
|
| 366 | + if (!count($value)) return; |
|
| 367 | + foreach ($value as $key => $val) |
|
| 368 | 368 | { |
| 369 | - if($key == 'body') |
|
| 369 | + if ($key == 'body') |
|
| 370 | 370 | { |
| 371 | 371 | $body = $val; |
| 372 | 372 | continue; |
| 373 | 373 | } |
| 374 | - if(is_object($val)||is_array($val)) $body = $this->_getRssBody($val); |
|
| 375 | - if($body !== null) return $body; |
|
| 374 | + if (is_object($val) || is_array($val)) $body = $this->_getRssBody($val); |
|
| 375 | + if ($body !== null) return $body; |
|
| 376 | 376 | } |
| 377 | 377 | return $body; |
| 378 | 378 | } |
@@ -383,17 +383,17 @@ discard block |
||
| 383 | 383 | // Replace tags such as </p> , </div> , </li> and others to a whitespace |
| 384 | 384 | $content = str_replace(array('</p>', '</div>', '</li>'), ' ', $content); |
| 385 | 385 | // Remove Tag |
| 386 | - $content = preg_replace('!<([^>]*?)>!is','', $content); |
|
| 386 | + $content = preg_replace('!<([^>]*?)>!is', '', $content); |
|
| 387 | 387 | // Replace tags to < , > , " |
| 388 | - $content = str_replace(array('<','>','"',' '), array('<','>','"',' '), $content); |
|
| 388 | + $content = str_replace(array('<', '>', '"', ' '), array('<', '>', '"', ' '), $content); |
|
| 389 | 389 | // Delete a series of whitespaces |
| 390 | 390 | $content = preg_replace('/ ( +)/is', ' ', $content); |
| 391 | 391 | // Truncate string |
| 392 | 392 | $content = trim(cut_str($content, $str_size, $tail)); |
| 393 | 393 | // Replace back < , > , " to theoriginal tags |
| 394 | - $content = str_replace(array('<','>','"'),array('<','>','"'), $content); |
|
| 394 | + $content = str_replace(array('<', '>', '"'), array('<', '>', '"'), $content); |
|
| 395 | 395 | // Fixed a newline bug on a set of consecutive English letters |
| 396 | - $content = preg_replace('/([a-z0-9\+:\/\.\~,\|\!\@\#\$\%\^\&\*\(\)\_]){20}/is',"$0-",$content); |
|
| 396 | + $content = preg_replace('/([a-z0-9\+:\/\.\~,\|\!\@\#\$\%\^\&\*\(\)\_]){20}/is', "$0-", $content); |
|
| 397 | 397 | return $content; |
| 398 | 398 | } |
| 399 | 399 | |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | */ |
| 405 | 405 | function requestFeedContents($rss_url) |
| 406 | 406 | { |
| 407 | - $rss_url = str_replace('&','&',Context::convertEncodingStr($rss_url)); |
|
| 407 | + $rss_url = str_replace('&', '&', Context::convertEncodingStr($rss_url)); |
|
| 408 | 408 | return FileHandler::getRemoteResource($rss_url, null, 3, 'GET', 'application/xml'); |
| 409 | 409 | } |
| 410 | 410 | |
@@ -416,52 +416,52 @@ discard block |
||
| 416 | 416 | $buff = $this->requestFeedContents($args->rss_url); |
| 417 | 417 | |
| 418 | 418 | $encoding = preg_match("/<\?xml.*encoding=\"(.+)\".*\?>/i", $buff, $matches); |
| 419 | - if($encoding && stripos($matches[1], "UTF-8") === FALSE) $buff = Context::convertEncodingStr($buff); |
|
| 419 | + if ($encoding && stripos($matches[1], "UTF-8") === FALSE) $buff = Context::convertEncodingStr($buff); |
|
| 420 | 420 | |
| 421 | 421 | $buff = preg_replace("/<\?xml.*\?>/i", "", $buff); |
| 422 | 422 | |
| 423 | 423 | $oXmlParser = new XmlParser(); |
| 424 | 424 | $xml_doc = $oXmlParser->parse($buff); |
| 425 | 425 | $rss = new stdClass(); |
| 426 | - if($xml_doc->rss) |
|
| 426 | + if ($xml_doc->rss) |
|
| 427 | 427 | { |
| 428 | 428 | $rss->title = $xml_doc->rss->channel->title->body; |
| 429 | 429 | $rss->link = $xml_doc->rss->channel->link->body; |
| 430 | 430 | |
| 431 | 431 | $items = $xml_doc->rss->channel->item; |
| 432 | 432 | |
| 433 | - if(!$items) return; |
|
| 434 | - if($items && !is_array($items)) $items = array($items); |
|
| 433 | + if (!$items) return; |
|
| 434 | + if ($items && !is_array($items)) $items = array($items); |
|
| 435 | 435 | |
| 436 | 436 | $content_items = array(); |
| 437 | 437 | |
| 438 | 438 | foreach ($items as $key => $value) |
| 439 | 439 | { |
| 440 | - if($key >= $args->list_count) break; |
|
| 440 | + if ($key >= $args->list_count) break; |
|
| 441 | 441 | unset($item); |
| 442 | 442 | $item = new stdClass(); |
| 443 | 443 | |
| 444 | - foreach($value as $key2 => $value2) |
|
| 444 | + foreach ($value as $key2 => $value2) |
|
| 445 | 445 | { |
| 446 | - if(is_array($value2)) $value2 = array_shift($value2); |
|
| 446 | + if (is_array($value2)) $value2 = array_shift($value2); |
|
| 447 | 447 | $item->{$key2} = $this->_getRssBody($value2); |
| 448 | 448 | } |
| 449 | 449 | |
| 450 | 450 | $content_item = new mcontentItem($rss->title); |
| 451 | 451 | $content_item->setContentsLink($rss->link); |
| 452 | 452 | $content_item->setTitle($item->title); |
| 453 | - $content_item->setNickName(max($item->author,$item->{'dc:creator'})); |
|
| 453 | + $content_item->setNickName(max($item->author, $item->{'dc:creator'})); |
|
| 454 | 454 | //$content_item->setCategory($item->category); |
| 455 | - $item->description = preg_replace('!<a href=!is','<a target="_blank" rel="noopener" href=', $item->description); |
|
| 455 | + $item->description = preg_replace('!<a href=!is', '<a target="_blank" rel="noopener" href=', $item->description); |
|
| 456 | 456 | $content_item->setContent($this->_getSummary($item->description, $args->content_cut_size)); |
| 457 | 457 | $content_item->setLink($item->link); |
| 458 | - $date = date('YmdHis', strtotime(max($item->pubdate,$item->pubDate,$item->{'dc:date'}))); |
|
| 458 | + $date = date('YmdHis', strtotime(max($item->pubdate, $item->pubDate, $item->{'dc:date'}))); |
|
| 459 | 459 | $content_item->setRegdate($date); |
| 460 | 460 | |
| 461 | 461 | $content_items[] = $content_item; |
| 462 | 462 | } |
| 463 | 463 | } |
| 464 | - else if($xml_doc->{'rdf:rdf'}) |
|
| 464 | + else if ($xml_doc->{'rdf:rdf'}) |
|
| 465 | 465 | { |
| 466 | 466 | // rss1.0 supported (XE's XML is case-insensitive because XML parser converts all to small letters) Fixed by misol |
| 467 | 467 | $rss->title = $xml_doc->{'rdf:rdf'}->channel->title->body; |
@@ -469,102 +469,102 @@ discard block |
||
| 469 | 469 | |
| 470 | 470 | $items = $xml_doc->{'rdf:rdf'}->item; |
| 471 | 471 | |
| 472 | - if(!$items) return; |
|
| 473 | - if($items && !is_array($items)) $items = array($items); |
|
| 472 | + if (!$items) return; |
|
| 473 | + if ($items && !is_array($items)) $items = array($items); |
|
| 474 | 474 | |
| 475 | 475 | $content_items = array(); |
| 476 | 476 | |
| 477 | 477 | foreach ($items as $key => $value) |
| 478 | 478 | { |
| 479 | - if($key >= $args->list_count) break; |
|
| 479 | + if ($key >= $args->list_count) break; |
|
| 480 | 480 | unset($item); |
| 481 | 481 | $item = new stdClass(); |
| 482 | 482 | |
| 483 | - foreach($value as $key2 => $value2) |
|
| 483 | + foreach ($value as $key2 => $value2) |
|
| 484 | 484 | { |
| 485 | - if(is_array($value2)) $value2 = array_shift($value2); |
|
| 485 | + if (is_array($value2)) $value2 = array_shift($value2); |
|
| 486 | 486 | $item->{$key2} = $this->_getRssBody($value2); |
| 487 | 487 | } |
| 488 | 488 | |
| 489 | 489 | $content_item = new mcontentItem($rss->title); |
| 490 | 490 | $content_item->setContentsLink($rss->link); |
| 491 | 491 | $content_item->setTitle($item->title); |
| 492 | - $content_item->setNickName(max($item->author,$item->{'dc:creator'})); |
|
| 492 | + $content_item->setNickName(max($item->author, $item->{'dc:creator'})); |
|
| 493 | 493 | //$content_item->setCategory($item->category); |
| 494 | - $item->description = preg_replace('!<a href=!is','<a target="_blank" rel="noopener" href=', $item->description); |
|
| 494 | + $item->description = preg_replace('!<a href=!is', '<a target="_blank" rel="noopener" href=', $item->description); |
|
| 495 | 495 | $content_item->setContent($this->_getSummary($item->description, $args->content_cut_size)); |
| 496 | 496 | $content_item->setLink($item->link); |
| 497 | - $date = date('YmdHis', strtotime(max($item->pubdate,$item->pubDate,$item->{'dc:date'}))); |
|
| 497 | + $date = date('YmdHis', strtotime(max($item->pubdate, $item->pubDate, $item->{'dc:date'}))); |
|
| 498 | 498 | $content_item->setRegdate($date); |
| 499 | 499 | |
| 500 | 500 | $content_items[] = $content_item; |
| 501 | 501 | } |
| 502 | 502 | } |
| 503 | - else if($xml_doc->feed && $xml_doc->feed->attrs->xmlns == 'http://www.w3.org/2005/Atom') |
|
| 503 | + else if ($xml_doc->feed && $xml_doc->feed->attrs->xmlns == 'http://www.w3.org/2005/Atom') |
|
| 504 | 504 | { |
| 505 | 505 | // Atom 1.0 spec supported by misol |
| 506 | 506 | $rss->title = $xml_doc->feed->title->body; |
| 507 | 507 | $links = $xml_doc->feed->link; |
| 508 | - if(is_array($links)) |
|
| 508 | + if (is_array($links)) |
|
| 509 | 509 | { |
| 510 | 510 | foreach ($links as $value) |
| 511 | 511 | { |
| 512 | - if($value->attrs->rel == 'alternate') |
|
| 512 | + if ($value->attrs->rel == 'alternate') |
|
| 513 | 513 | { |
| 514 | 514 | $rss->link = $value->attrs->href; |
| 515 | 515 | break; |
| 516 | 516 | } |
| 517 | 517 | } |
| 518 | 518 | } |
| 519 | - else if($links->attrs->rel == 'alternate') $rss->link = $links->attrs->href; |
|
| 519 | + else if ($links->attrs->rel == 'alternate') $rss->link = $links->attrs->href; |
|
| 520 | 520 | |
| 521 | 521 | $items = $xml_doc->feed->entry; |
| 522 | 522 | |
| 523 | - if(!$items) return; |
|
| 524 | - if($items && !is_array($items)) $items = array($items); |
|
| 523 | + if (!$items) return; |
|
| 524 | + if ($items && !is_array($items)) $items = array($items); |
|
| 525 | 525 | |
| 526 | 526 | $content_items = array(); |
| 527 | 527 | |
| 528 | 528 | foreach ($items as $key => $value) |
| 529 | 529 | { |
| 530 | - if($key >= $args->list_count) break; |
|
| 530 | + if ($key >= $args->list_count) break; |
|
| 531 | 531 | unset($item); |
| 532 | 532 | |
| 533 | - foreach($value as $key2 => $value2) |
|
| 533 | + foreach ($value as $key2 => $value2) |
|
| 534 | 534 | { |
| 535 | - if(is_array($value2)) $value2 = array_shift($value2); |
|
| 535 | + if (is_array($value2)) $value2 = array_shift($value2); |
|
| 536 | 536 | $item->{$key2} = $this->_getRssBody($value2); |
| 537 | 537 | } |
| 538 | 538 | |
| 539 | 539 | $content_item = new mcontentItem($rss->title); |
| 540 | 540 | $links = $value->link; |
| 541 | - if(is_array($links)) |
|
| 541 | + if (is_array($links)) |
|
| 542 | 542 | { |
| 543 | 543 | foreach ($links as $val) |
| 544 | 544 | { |
| 545 | - if($val->attrs->rel == 'alternate') |
|
| 545 | + if ($val->attrs->rel == 'alternate') |
|
| 546 | 546 | { |
| 547 | 547 | $item->link = $val->attrs->href; |
| 548 | 548 | break; |
| 549 | 549 | } |
| 550 | 550 | } |
| 551 | 551 | } |
| 552 | - else if($links->attrs->rel == 'alternate') $item->link = $links->attrs->href; |
|
| 552 | + else if ($links->attrs->rel == 'alternate') $item->link = $links->attrs->href; |
|
| 553 | 553 | |
| 554 | 554 | $content_item->setContentsLink($rss->link); |
| 555 | - if($item->title) |
|
| 555 | + if ($item->title) |
|
| 556 | 556 | { |
| 557 | - if(stripos($value->title->attrs->type, "html") === FALSE) $item->title = $value->title->body; |
|
| 557 | + if (stripos($value->title->attrs->type, "html") === FALSE) $item->title = $value->title->body; |
|
| 558 | 558 | } |
| 559 | 559 | $content_item->setTitle($item->title); |
| 560 | - $content_item->setNickName(max($item->author,$item->{'dc:creator'})); |
|
| 560 | + $content_item->setNickName(max($item->author, $item->{'dc:creator'})); |
|
| 561 | 561 | $content_item->setAuthorSite($value->author->uri->body); |
| 562 | 562 | |
| 563 | 563 | //$content_item->setCategory($item->category); |
| 564 | 564 | $item->description = ($item->content) ? $item->content : $item->description = $item->summary; |
| 565 | - $item->description = preg_replace('!<a href=!is','<a target="_blank" rel="noopener" href=', $item->description); |
|
| 565 | + $item->description = preg_replace('!<a href=!is', '<a target="_blank" rel="noopener" href=', $item->description); |
|
| 566 | 566 | |
| 567 | - if(($item->content && stripos($value->content->attrs->type, "html") === FALSE) || (!$item->content && stripos($value->summary->attrs->type, "html") === FALSE)) |
|
| 567 | + if (($item->content && stripos($value->content->attrs->type, "html") === FALSE) || (!$item->content && stripos($value->summary->attrs->type, "html") === FALSE)) |
|
| 568 | 568 | { |
| 569 | 569 | $item->description = htmlspecialchars($item->description, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 570 | 570 | |
@@ -572,7 +572,7 @@ discard block |
||
| 572 | 572 | |
| 573 | 573 | $content_item->setContent($this->_getSummary($item->description, $args->content_cut_size)); |
| 574 | 574 | $content_item->setLink($item->link); |
| 575 | - $date = date('YmdHis', strtotime(max($item->published,$item->updated,$item->{'dc:date'}))); |
|
| 575 | + $date = date('YmdHis', strtotime(max($item->published, $item->updated, $item->{'dc:date'}))); |
|
| 576 | 576 | $content_item->setRegdate($date); |
| 577 | 577 | |
| 578 | 578 | $content_items[] = $content_item; |
@@ -581,12 +581,12 @@ discard block |
||
| 581 | 581 | return $content_items; |
| 582 | 582 | } |
| 583 | 583 | |
| 584 | - function _getTrackbackItems($args){ |
|
| 584 | + function _getTrackbackItems($args) { |
|
| 585 | 585 | // Get categories |
| 586 | - $output = executeQueryArray('widgets.content.getCategories',$obj); |
|
| 587 | - if($output->toBool() && $output->data) |
|
| 586 | + $output = executeQueryArray('widgets.content.getCategories', $obj); |
|
| 587 | + if ($output->toBool() && $output->data) |
|
| 588 | 588 | { |
| 589 | - foreach($output->data as $key => $val) { |
|
| 589 | + foreach ($output->data as $key => $val) { |
|
| 590 | 590 | $category_lists[$val->module_srl][$val->category_srl] = $val; |
| 591 | 591 | } |
| 592 | 592 | } |
@@ -598,14 +598,14 @@ discard block |
||
| 598 | 598 | $oTrackbackModel = getModel('trackback'); |
| 599 | 599 | $output = $oTrackbackModel->getNewestTrackbackList($obj); |
| 600 | 600 | // If an error occurs, just ignore it. |
| 601 | - if(!$output->toBool() || !$output->data) return; |
|
| 601 | + if (!$output->toBool() || !$output->data) return; |
|
| 602 | 602 | // If the result exists, make each document as an object |
| 603 | 603 | $content_items = array(); |
| 604 | - foreach($output->data as $key => $item) |
|
| 604 | + foreach ($output->data as $key => $item) |
|
| 605 | 605 | { |
| 606 | 606 | $domain = $args->module_srls_info[$item->module_srl]->domain; |
| 607 | 607 | $category = $category_lists[$item->module_srl]->text; |
| 608 | - $url = getSiteUrl($domain,'','mid', $args->mid_lists[$item->module_srl],'document_srl',$item->document_srl); |
|
| 608 | + $url = getSiteUrl($domain, '', 'mid', $args->mid_lists[$item->module_srl], 'document_srl', $item->document_srl); |
|
| 609 | 609 | $browser_title = $args->module_srls_info[$item->module_srl]->browser_title; |
| 610 | 610 | |
| 611 | 611 | $content_item = new mcontentItem($browser_title); |
@@ -613,8 +613,8 @@ discard block |
||
| 613 | 613 | $content_item->setTitle($item->title); |
| 614 | 614 | $content_item->setCategory($category); |
| 615 | 615 | $content_item->setNickName($item->blog_name); |
| 616 | - $content_item->setContent($item->excerpt); ///<< |
|
| 617 | - $content_item->setDomain($domain); ///<< |
|
| 616 | + $content_item->setContent($item->excerpt); ///<< |
|
| 617 | + $content_item->setDomain($domain); ///<< |
|
| 618 | 618 | $content_item->setLink($url); |
| 619 | 619 | $content_item->add('mid', $args->mid_lists[$item->module_srl]); |
| 620 | 620 | $content_item->setRegdate($item->regdate); |
@@ -623,7 +623,7 @@ discard block |
||
| 623 | 623 | return $content_items; |
| 624 | 624 | } |
| 625 | 625 | |
| 626 | - function _compile($args,$content_items) |
|
| 626 | + function _compile($args, $content_items) |
|
| 627 | 627 | { |
| 628 | 628 | $oTemplate = &TemplateHandler::getInstance(); |
| 629 | 629 | // Set variables for widget |
@@ -671,7 +671,7 @@ discard block |
||
| 671 | 671 | var $contents_link = null; |
| 672 | 672 | var $domain = null; |
| 673 | 673 | |
| 674 | - function mcontentItem($browser_title='') |
|
| 674 | + function mcontentItem($browser_title = '') |
|
| 675 | 675 | { |
| 676 | 676 | $this->browser_title = $browser_title; |
| 677 | 677 | } |
@@ -681,58 +681,58 @@ discard block |
||
| 681 | 681 | } |
| 682 | 682 | function setFirstThumbnailIdx($first_thumbnail_idx) |
| 683 | 683 | { |
| 684 | - if(is_null($this->first_thumbnail) && $first_thumbnail_idx>-1) { |
|
| 684 | + if (is_null($this->first_thumbnail) && $first_thumbnail_idx > -1) { |
|
| 685 | 685 | $this->has_first_thumbnail_idx = true; |
| 686 | - $this->first_thumbnail_idx= $first_thumbnail_idx; |
|
| 686 | + $this->first_thumbnail_idx = $first_thumbnail_idx; |
|
| 687 | 687 | } |
| 688 | 688 | } |
| 689 | 689 | function setExtraImages($extra_images) |
| 690 | 690 | { |
| 691 | - $this->add('extra_images',$extra_images); |
|
| 691 | + $this->add('extra_images', $extra_images); |
|
| 692 | 692 | } |
| 693 | 693 | function setDomain($domain) |
| 694 | 694 | { |
| 695 | 695 | static $default_domain = null; |
| 696 | - if(!$domain) |
|
| 696 | + if (!$domain) |
|
| 697 | 697 | { |
| 698 | - if(is_null($default_domain)) $default_domain = Context::getDefaultUrl(); |
|
| 698 | + if (is_null($default_domain)) $default_domain = Context::getDefaultUrl(); |
|
| 699 | 699 | $domain = $default_domain; |
| 700 | 700 | } |
| 701 | 701 | $this->domain = $domain; |
| 702 | 702 | } |
| 703 | 703 | function setLink($url) |
| 704 | 704 | { |
| 705 | - $this->add('url',$url); |
|
| 705 | + $this->add('url', $url); |
|
| 706 | 706 | } |
| 707 | 707 | function setTitle($title) |
| 708 | 708 | { |
| 709 | - $this->add('title',$title); |
|
| 709 | + $this->add('title', $title); |
|
| 710 | 710 | } |
| 711 | 711 | |
| 712 | 712 | function setThumbnail($thumbnail) |
| 713 | 713 | { |
| 714 | - $this->add('thumbnail',$thumbnail); |
|
| 714 | + $this->add('thumbnail', $thumbnail); |
|
| 715 | 715 | } |
| 716 | 716 | function setContent($content) |
| 717 | 717 | { |
| 718 | - $this->add('content',$content); |
|
| 718 | + $this->add('content', $content); |
|
| 719 | 719 | } |
| 720 | 720 | function setRegdate($regdate) |
| 721 | 721 | { |
| 722 | - $this->add('regdate',$regdate); |
|
| 722 | + $this->add('regdate', $regdate); |
|
| 723 | 723 | } |
| 724 | 724 | function setNickName($nick_name) |
| 725 | 725 | { |
| 726 | - $this->add('nick_name',$nick_name); |
|
| 726 | + $this->add('nick_name', $nick_name); |
|
| 727 | 727 | } |
| 728 | 728 | // Save author's homepage url by misol |
| 729 | 729 | function setAuthorSite($site_url) |
| 730 | 730 | { |
| 731 | - $this->add('author_site',$site_url); |
|
| 731 | + $this->add('author_site', $site_url); |
|
| 732 | 732 | } |
| 733 | 733 | function setCategory($category) |
| 734 | 734 | { |
| 735 | - $this->add('category',$category); |
|
| 735 | + $this->add('category', $category); |
|
| 736 | 736 | } |
| 737 | 737 | function getBrowserTitle() |
| 738 | 738 | { |
@@ -760,17 +760,17 @@ discard block |
||
| 760 | 760 | { |
| 761 | 761 | return $this->get('module_srl'); |
| 762 | 762 | } |
| 763 | - function getTitle($cut_size = 0, $tail='...') |
|
| 763 | + function getTitle($cut_size = 0, $tail = '...') |
|
| 764 | 764 | { |
| 765 | 765 | $title = strip_tags($this->get('title')); |
| 766 | 766 | |
| 767 | - if($cut_size) $title = cut_str($title, $cut_size, $tail); |
|
| 767 | + if ($cut_size) $title = cut_str($title, $cut_size, $tail); |
|
| 768 | 768 | |
| 769 | 769 | $attrs = array(); |
| 770 | - if($this->get('title_bold') == 'Y') $attrs[] = 'font-weight:bold'; |
|
| 771 | - if($this->get('title_color') && $this->get('title_color') != 'N') $attrs[] = 'color:#'.$this->get('title_color'); |
|
| 770 | + if ($this->get('title_bold') == 'Y') $attrs[] = 'font-weight:bold'; |
|
| 771 | + if ($this->get('title_color') && $this->get('title_color') != 'N') $attrs[] = 'color:#'.$this->get('title_color'); |
|
| 772 | 772 | |
| 773 | - if(count($attrs)) $title = sprintf("<span style=\"%s\">%s</span>", implode(';', $attrs), htmlspecialchars($title)); |
|
| 773 | + if (count($attrs)) $title = sprintf("<span style=\"%s\">%s</span>", implode(';', $attrs), htmlspecialchars($title)); |
|
| 774 | 774 | |
| 775 | 775 | return $title; |
| 776 | 776 | } |
@@ -793,12 +793,12 @@ discard block |
||
| 793 | 793 | function getCommentCount() |
| 794 | 794 | { |
| 795 | 795 | $comment_count = $this->get('comment_count'); |
| 796 | - return $comment_count>0 ? $comment_count : ''; |
|
| 796 | + return $comment_count > 0 ? $comment_count : ''; |
|
| 797 | 797 | } |
| 798 | 798 | function getTrackbackCount() |
| 799 | 799 | { |
| 800 | 800 | $trackback_count = $this->get('trackback_count'); |
| 801 | - return $trackback_count>0 ? $trackback_count : ''; |
|
| 801 | + return $trackback_count > 0 ? $trackback_count : ''; |
|
| 802 | 802 | } |
| 803 | 803 | function getRegdate($format = 'Y.m.d H:i:s') |
| 804 | 804 | { |
@@ -18,20 +18,32 @@ discard block |
||
| 18 | 18 | function proc($args) |
| 19 | 19 | { |
| 20 | 20 | // Targets to sort |
| 21 | - if(!in_array($args->order_target, array('list_order','update_order'))) $args->order_target = 'list_order'; |
|
| 21 | + if(!in_array($args->order_target, array('list_order','update_order'))) { |
|
| 22 | + $args->order_target = 'list_order'; |
|
| 23 | + } |
|
| 22 | 24 | // Sort order |
| 23 | - if(!in_array($args->order_type, array('asc','desc'))) $args->order_type = 'asc'; |
|
| 25 | + if(!in_array($args->order_type, array('asc','desc'))) { |
|
| 26 | + $args->order_type = 'asc'; |
|
| 27 | + } |
|
| 24 | 28 | // The number of displayed lists |
| 25 | 29 | $args->list_count = (int)$args->list_count; |
| 26 | - if(!$args->list_count) $args->list_count = 5; |
|
| 30 | + if(!$args->list_count) { |
|
| 31 | + $args->list_count = 5; |
|
| 32 | + } |
|
| 27 | 33 | // Cut the length of the title |
| 28 | - if(!$args->subject_cut_size) $args->subject_cut_size = 0; |
|
| 34 | + if(!$args->subject_cut_size) { |
|
| 35 | + $args->subject_cut_size = 0; |
|
| 36 | + } |
|
| 29 | 37 | // Cut the length of contents |
| 30 | - if(!$args->content_cut_size) $args->content_cut_size = 100; |
|
| 38 | + if(!$args->content_cut_size) { |
|
| 39 | + $args->content_cut_size = 100; |
|
| 40 | + } |
|
| 31 | 41 | // Viewing options |
| 32 | 42 | $args->option_view_arr = explode(',',$args->option_view); |
| 33 | 43 | // markup options |
| 34 | - if(!$args->markup_type) $args->markup_type = 'list'; |
|
| 44 | + if(!$args->markup_type) { |
|
| 45 | + $args->markup_type = 'list'; |
|
| 46 | + } |
|
| 35 | 47 | // Set variables for internal use |
| 36 | 48 | $oModuleModel = getModel('module'); |
| 37 | 49 | $module_srls = $args->modules_info = $args->module_srls_info = $args->mid_lists = array(); |
@@ -43,11 +55,12 @@ discard block |
||
| 43 | 55 | $rss_urls = array_unique(array($args->rss_url0,$args->rss_url1,$args->rss_url2,$args->rss_url3,$args->rss_url4)); |
| 44 | 56 | for($i=0,$c=count($rss_urls);$i<$c;$i++) |
| 45 | 57 | { |
| 46 | - if($rss_urls[$i]) $args->rss_urls[] = $rss_urls[$i]; |
|
| 58 | + if($rss_urls[$i]) { |
|
| 59 | + $args->rss_urls[] = $rss_urls[$i]; |
|
| 60 | + } |
|
| 47 | 61 | } |
| 48 | 62 | // Get module information after listing module_srls if the module is not RSS |
| 49 | - } |
|
| 50 | - else |
|
| 63 | + } else |
|
| 51 | 64 | { |
| 52 | 65 | $obj = new stdClass(); |
| 53 | 66 | // Apply to all modules in the site if a target module is not specified |
@@ -68,8 +81,7 @@ discard block |
||
| 68 | 81 | |
| 69 | 82 | $args->modules_info = $oModuleModel->getMidList($obj); |
| 70 | 83 | // Apply to the module only if a target module is specified |
| 71 | - } |
|
| 72 | - else |
|
| 84 | + } else |
|
| 73 | 85 | { |
| 74 | 86 | $obj->module_srls = $args->module_srls; |
| 75 | 87 | $output = executeQueryArray('widgets.content.getMids', $obj); |
@@ -85,13 +97,17 @@ discard block |
||
| 85 | 97 | for($i=0,$c=count($idx);$i<$c;$i++) |
| 86 | 98 | { |
| 87 | 99 | $srl = $idx[$i]; |
| 88 | - if(!$args->module_srls_info[$srl]) continue; |
|
| 100 | + if(!$args->module_srls_info[$srl]) { |
|
| 101 | + continue; |
|
| 102 | + } |
|
| 89 | 103 | $args->mid_lists[$srl] = $args->module_srls_info[$srl]->mid; |
| 90 | 104 | } |
| 91 | 105 | } |
| 92 | 106 | } |
| 93 | 107 | // Exit if no module is found |
| 94 | - if(!count($args->modules_info)) return Context::get('msg_not_founded'); |
|
| 108 | + if(!count($args->modules_info)) { |
|
| 109 | + return Context::get('msg_not_founded'); |
|
| 110 | + } |
|
| 95 | 111 | $args->module_srl = implode(',',$module_srls); |
| 96 | 112 | } |
| 97 | 113 | |
@@ -120,8 +136,7 @@ discard block |
||
| 120 | 136 | break; |
| 121 | 137 | } |
| 122 | 138 | // If not a tab type |
| 123 | - } |
|
| 124 | - else |
|
| 139 | + } else |
|
| 125 | 140 | { |
| 126 | 141 | $content_items = array(); |
| 127 | 142 | |
@@ -180,7 +195,9 @@ discard block |
||
| 180 | 195 | |
| 181 | 196 | $content_items = array(); |
| 182 | 197 | |
| 183 | - if(!count($output)) return; |
|
| 198 | + if(!count($output)) { |
|
| 199 | + return; |
|
| 200 | + } |
|
| 184 | 201 | |
| 185 | 202 | foreach($output as $key => $oComment) |
| 186 | 203 | { |
@@ -227,7 +244,9 @@ discard block |
||
| 227 | 244 | $obj->list_count = $args->list_count; |
| 228 | 245 | $obj->statusList = array('PUBLIC'); |
| 229 | 246 | $output = executeQueryArray('widgets.content.getNewestDocuments', $obj); |
| 230 | - if(!$output->toBool() || !$output->data) return; |
|
| 247 | + if(!$output->toBool() || !$output->data) { |
|
| 248 | + return; |
|
| 249 | + } |
|
| 231 | 250 | // If the result exists, make each document as an object |
| 232 | 251 | $content_items = array(); |
| 233 | 252 | $first_thumbnail_idx = -1; |
@@ -258,7 +277,9 @@ discard block |
||
| 258 | 277 | $content_item->setLink( getSiteUrl($domain,'', 'mid',$args->mid_lists[$module_srl], 'document_srl',$document_srl) ); |
| 259 | 278 | $content_item->setThumbnail($thumbnail); |
| 260 | 279 | $content_item->add('mid', $args->mid_lists[$module_srl]); |
| 261 | - if($first_thumbnail_idx==-1 && $thumbnail) $first_thumbnail_idx = $i; |
|
| 280 | + if($first_thumbnail_idx==-1 && $thumbnail) { |
|
| 281 | + $first_thumbnail_idx = $i; |
|
| 282 | + } |
|
| 262 | 283 | $content_items[] = $content_item; |
| 263 | 284 | } |
| 264 | 285 | |
@@ -288,15 +309,21 @@ discard block |
||
| 288 | 309 | $obj->list_count = $args->list_count; |
| 289 | 310 | $files_output = executeQueryArray("file.getOneFileInDocument", $obj); |
| 290 | 311 | $files_count = count($files_output->data); |
| 291 | - if(!$files_count) return; |
|
| 312 | + if(!$files_count) { |
|
| 313 | + return; |
|
| 314 | + } |
|
| 292 | 315 | |
| 293 | 316 | $content_items = array(); |
| 294 | 317 | |
| 295 | - for($i=0;$i<$files_count;$i++) $document_srl_list[] = $files_output->data[$i]->document_srl; |
|
| 318 | + for($i=0;$i<$files_count;$i++) { |
|
| 319 | + $document_srl_list[] = $files_output->data[$i]->document_srl; |
|
| 320 | + } |
|
| 296 | 321 | |
| 297 | 322 | $tmp_document_list = $oDocumentModel->getDocuments($document_srl_list); |
| 298 | 323 | |
| 299 | - if(!count($tmp_document_list)) return; |
|
| 324 | + if(!count($tmp_document_list)) { |
|
| 325 | + return; |
|
| 326 | + } |
|
| 300 | 327 | |
| 301 | 328 | foreach($tmp_document_list as $oDocument) |
| 302 | 329 | { |
@@ -348,22 +375,33 @@ discard block |
||
| 348 | 375 | { |
| 349 | 376 | $date = $v->get('regdate'); |
| 350 | 377 | $i=0; |
| 351 | - while(array_key_exists(sprintf('%s%02d',$date,$i), $items)) $i++; |
|
| 378 | + while(array_key_exists(sprintf('%s%02d',$date,$i), $items)) { |
|
| 379 | + $i++; |
|
| 380 | + } |
|
| 352 | 381 | $items[sprintf('%s%02d',$date,$i)] = $v; |
| 353 | 382 | } |
| 354 | 383 | } |
| 355 | - if($args->order_type =='asc') ksort($items); |
|
| 356 | - else krsort($items); |
|
| 384 | + if($args->order_type =='asc') { |
|
| 385 | + ksort($items); |
|
| 386 | + } else { |
|
| 387 | + krsort($items); |
|
| 388 | + } |
|
| 357 | 389 | $content_items = array_slice(array_values($items),0,$args->list_count); |
| 358 | 390 | } return $content_items; |
| 359 | 391 | } |
| 360 | 392 | |
| 361 | 393 | function _getRssBody($value) |
| 362 | 394 | { |
| 363 | - if(!$value || is_string($value)) return $value; |
|
| 364 | - if(is_object($value)) $value = get_object_vars($value); |
|
| 395 | + if(!$value || is_string($value)) { |
|
| 396 | + return $value; |
|
| 397 | + } |
|
| 398 | + if(is_object($value)) { |
|
| 399 | + $value = get_object_vars($value); |
|
| 400 | + } |
|
| 365 | 401 | $body = null; |
| 366 | - if(!count($value)) return; |
|
| 402 | + if(!count($value)) { |
|
| 403 | + return; |
|
| 404 | + } |
|
| 367 | 405 | foreach($value as $key => $val) |
| 368 | 406 | { |
| 369 | 407 | if($key == 'body') |
@@ -371,8 +409,12 @@ discard block |
||
| 371 | 409 | $body = $val; |
| 372 | 410 | continue; |
| 373 | 411 | } |
| 374 | - if(is_object($val)||is_array($val)) $body = $this->_getRssBody($val); |
|
| 375 | - if($body !== null) return $body; |
|
| 412 | + if(is_object($val)||is_array($val)) { |
|
| 413 | + $body = $this->_getRssBody($val); |
|
| 414 | + } |
|
| 415 | + if($body !== null) { |
|
| 416 | + return $body; |
|
| 417 | + } |
|
| 376 | 418 | } |
| 377 | 419 | return $body; |
| 378 | 420 | } |
@@ -416,7 +458,9 @@ discard block |
||
| 416 | 458 | $buff = $this->requestFeedContents($args->rss_url); |
| 417 | 459 | |
| 418 | 460 | $encoding = preg_match("/<\?xml.*encoding=\"(.+)\".*\?>/i", $buff, $matches); |
| 419 | - if($encoding && stripos($matches[1], "UTF-8") === FALSE) $buff = Context::convertEncodingStr($buff); |
|
| 461 | + if($encoding && stripos($matches[1], "UTF-8") === FALSE) { |
|
| 462 | + $buff = Context::convertEncodingStr($buff); |
|
| 463 | + } |
|
| 420 | 464 | |
| 421 | 465 | $buff = preg_replace("/<\?xml.*\?>/i", "", $buff); |
| 422 | 466 | |
@@ -430,20 +474,28 @@ discard block |
||
| 430 | 474 | |
| 431 | 475 | $items = $xml_doc->rss->channel->item; |
| 432 | 476 | |
| 433 | - if(!$items) return; |
|
| 434 | - if($items && !is_array($items)) $items = array($items); |
|
| 477 | + if(!$items) { |
|
| 478 | + return; |
|
| 479 | + } |
|
| 480 | + if($items && !is_array($items)) { |
|
| 481 | + $items = array($items); |
|
| 482 | + } |
|
| 435 | 483 | |
| 436 | 484 | $content_items = array(); |
| 437 | 485 | |
| 438 | 486 | foreach ($items as $key => $value) |
| 439 | 487 | { |
| 440 | - if($key >= $args->list_count) break; |
|
| 488 | + if($key >= $args->list_count) { |
|
| 489 | + break; |
|
| 490 | + } |
|
| 441 | 491 | unset($item); |
| 442 | 492 | $item = new stdClass(); |
| 443 | 493 | |
| 444 | 494 | foreach($value as $key2 => $value2) |
| 445 | 495 | { |
| 446 | - if(is_array($value2)) $value2 = array_shift($value2); |
|
| 496 | + if(is_array($value2)) { |
|
| 497 | + $value2 = array_shift($value2); |
|
| 498 | + } |
|
| 447 | 499 | $item->{$key2} = $this->_getRssBody($value2); |
| 448 | 500 | } |
| 449 | 501 | |
@@ -460,8 +512,7 @@ discard block |
||
| 460 | 512 | |
| 461 | 513 | $content_items[] = $content_item; |
| 462 | 514 | } |
| 463 | - } |
|
| 464 | - else if($xml_doc->{'rdf:rdf'}) |
|
| 515 | + } else if($xml_doc->{'rdf:rdf'}) |
|
| 465 | 516 | { |
| 466 | 517 | // rss1.0 supported (XE's XML is case-insensitive because XML parser converts all to small letters) Fixed by misol |
| 467 | 518 | $rss->title = $xml_doc->{'rdf:rdf'}->channel->title->body; |
@@ -469,20 +520,28 @@ discard block |
||
| 469 | 520 | |
| 470 | 521 | $items = $xml_doc->{'rdf:rdf'}->item; |
| 471 | 522 | |
| 472 | - if(!$items) return; |
|
| 473 | - if($items && !is_array($items)) $items = array($items); |
|
| 523 | + if(!$items) { |
|
| 524 | + return; |
|
| 525 | + } |
|
| 526 | + if($items && !is_array($items)) { |
|
| 527 | + $items = array($items); |
|
| 528 | + } |
|
| 474 | 529 | |
| 475 | 530 | $content_items = array(); |
| 476 | 531 | |
| 477 | 532 | foreach ($items as $key => $value) |
| 478 | 533 | { |
| 479 | - if($key >= $args->list_count) break; |
|
| 534 | + if($key >= $args->list_count) { |
|
| 535 | + break; |
|
| 536 | + } |
|
| 480 | 537 | unset($item); |
| 481 | 538 | $item = new stdClass(); |
| 482 | 539 | |
| 483 | 540 | foreach($value as $key2 => $value2) |
| 484 | 541 | { |
| 485 | - if(is_array($value2)) $value2 = array_shift($value2); |
|
| 542 | + if(is_array($value2)) { |
|
| 543 | + $value2 = array_shift($value2); |
|
| 544 | + } |
|
| 486 | 545 | $item->{$key2} = $this->_getRssBody($value2); |
| 487 | 546 | } |
| 488 | 547 | |
@@ -499,8 +558,7 @@ discard block |
||
| 499 | 558 | |
| 500 | 559 | $content_items[] = $content_item; |
| 501 | 560 | } |
| 502 | - } |
|
| 503 | - else if($xml_doc->feed && $xml_doc->feed->attrs->xmlns == 'http://www.w3.org/2005/Atom') |
|
| 561 | + } else if($xml_doc->feed && $xml_doc->feed->attrs->xmlns == 'http://www.w3.org/2005/Atom') |
|
| 504 | 562 | { |
| 505 | 563 | // Atom 1.0 spec supported by misol |
| 506 | 564 | $rss->title = $xml_doc->feed->title->body; |
@@ -515,24 +573,33 @@ discard block |
||
| 515 | 573 | break; |
| 516 | 574 | } |
| 517 | 575 | } |
| 576 | + } else if($links->attrs->rel == 'alternate') { |
|
| 577 | + $rss->link = $links->attrs->href; |
|
| 518 | 578 | } |
| 519 | - else if($links->attrs->rel == 'alternate') $rss->link = $links->attrs->href; |
|
| 520 | 579 | |
| 521 | 580 | $items = $xml_doc->feed->entry; |
| 522 | 581 | |
| 523 | - if(!$items) return; |
|
| 524 | - if($items && !is_array($items)) $items = array($items); |
|
| 582 | + if(!$items) { |
|
| 583 | + return; |
|
| 584 | + } |
|
| 585 | + if($items && !is_array($items)) { |
|
| 586 | + $items = array($items); |
|
| 587 | + } |
|
| 525 | 588 | |
| 526 | 589 | $content_items = array(); |
| 527 | 590 | |
| 528 | 591 | foreach ($items as $key => $value) |
| 529 | 592 | { |
| 530 | - if($key >= $args->list_count) break; |
|
| 593 | + if($key >= $args->list_count) { |
|
| 594 | + break; |
|
| 595 | + } |
|
| 531 | 596 | unset($item); |
| 532 | 597 | |
| 533 | 598 | foreach($value as $key2 => $value2) |
| 534 | 599 | { |
| 535 | - if(is_array($value2)) $value2 = array_shift($value2); |
|
| 600 | + if(is_array($value2)) { |
|
| 601 | + $value2 = array_shift($value2); |
|
| 602 | + } |
|
| 536 | 603 | $item->{$key2} = $this->_getRssBody($value2); |
| 537 | 604 | } |
| 538 | 605 | |
@@ -548,13 +615,16 @@ discard block |
||
| 548 | 615 | break; |
| 549 | 616 | } |
| 550 | 617 | } |
| 618 | + } else if($links->attrs->rel == 'alternate') { |
|
| 619 | + $item->link = $links->attrs->href; |
|
| 551 | 620 | } |
| 552 | - else if($links->attrs->rel == 'alternate') $item->link = $links->attrs->href; |
|
| 553 | 621 | |
| 554 | 622 | $content_item->setContentsLink($rss->link); |
| 555 | 623 | if($item->title) |
| 556 | 624 | { |
| 557 | - if(stripos($value->title->attrs->type, "html") === FALSE) $item->title = $value->title->body; |
|
| 625 | + if(stripos($value->title->attrs->type, "html") === FALSE) { |
|
| 626 | + $item->title = $value->title->body; |
|
| 627 | + } |
|
| 558 | 628 | } |
| 559 | 629 | $content_item->setTitle($item->title); |
| 560 | 630 | $content_item->setNickName(max($item->author,$item->{'dc:creator'})); |
@@ -598,7 +668,9 @@ discard block |
||
| 598 | 668 | $oTrackbackModel = getModel('trackback'); |
| 599 | 669 | $output = $oTrackbackModel->getNewestTrackbackList($obj); |
| 600 | 670 | // If an error occurs, just ignore it. |
| 601 | - if(!$output->toBool() || !$output->data) return; |
|
| 671 | + if(!$output->toBool() || !$output->data) { |
|
| 672 | + return; |
|
| 673 | + } |
|
| 602 | 674 | // If the result exists, make each document as an object |
| 603 | 675 | $content_items = array(); |
| 604 | 676 | foreach($output->data as $key => $item) |
@@ -695,7 +767,9 @@ discard block |
||
| 695 | 767 | static $default_domain = null; |
| 696 | 768 | if(!$domain) |
| 697 | 769 | { |
| 698 | - if(is_null($default_domain)) $default_domain = Context::getDefaultUrl(); |
|
| 770 | + if(is_null($default_domain)) { |
|
| 771 | + $default_domain = Context::getDefaultUrl(); |
|
| 772 | + } |
|
| 699 | 773 | $domain = $default_domain; |
| 700 | 774 | } |
| 701 | 775 | $this->domain = $domain; |
@@ -764,13 +838,21 @@ discard block |
||
| 764 | 838 | { |
| 765 | 839 | $title = strip_tags($this->get('title')); |
| 766 | 840 | |
| 767 | - if($cut_size) $title = cut_str($title, $cut_size, $tail); |
|
| 841 | + if($cut_size) { |
|
| 842 | + $title = cut_str($title, $cut_size, $tail); |
|
| 843 | + } |
|
| 768 | 844 | |
| 769 | 845 | $attrs = array(); |
| 770 | - if($this->get('title_bold') == 'Y') $attrs[] = 'font-weight:bold'; |
|
| 771 | - if($this->get('title_color') && $this->get('title_color') != 'N') $attrs[] = 'color:#'.$this->get('title_color'); |
|
| 846 | + if($this->get('title_bold') == 'Y') { |
|
| 847 | + $attrs[] = 'font-weight:bold'; |
|
| 848 | + } |
|
| 849 | + if($this->get('title_color') && $this->get('title_color') != 'N') { |
|
| 850 | + $attrs[] = 'color:#'.$this->get('title_color'); |
|
| 851 | + } |
|
| 772 | 852 | |
| 773 | - if(count($attrs)) $title = sprintf("<span style=\"%s\">%s</span>", implode(';', $attrs), htmlspecialchars($title)); |
|
| 853 | + if(count($attrs)) { |
|
| 854 | + $title = sprintf("<span style=\"%s\">%s</span>", implode(';', $attrs), htmlspecialchars($title)); |
|
| 855 | + } |
|
| 774 | 856 | |
| 775 | 857 | return $title; |
| 776 | 858 | } |