@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /* Copyright (C) NAVER <http://www.navercorp.com> */ |
| 3 | 3 | |
| 4 | -if(!defined('__XE__')) |
|
| 4 | +if (!defined('__XE__')) |
|
| 5 | 5 | exit(); |
| 6 | 6 | |
| 7 | 7 | /** |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | * Display point level icon before user name when point system is enabled. |
| 13 | 13 | * */ |
| 14 | 14 | // return unless before_display_content |
| 15 | -if($called_position != "before_display_content" || Context::get('act') == 'dispPageAdminContentModify' || Context::getResponseMethod() != 'HTML' || isCrawler()) |
|
| 15 | +if ($called_position != "before_display_content" || Context::get('act') == 'dispPageAdminContentModify' || Context::getResponseMethod() != 'HTML' || isCrawler()) |
|
| 16 | 16 | { |
| 17 | 17 | return; |
| 18 | 18 | } |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | require_once(_XE_PATH_ . 'addons/point_level_icon/point_level_icon.lib.php'); |
| 21 | 21 | |
| 22 | 22 | $temp_output = preg_replace_callback('!<(div|span|a)([^\>]*)member_([0-9\-]+)([^\>]*)>(.*?)\<\/(div|span|a)\>!is', 'pointLevelIconTrans', $output); |
| 23 | -if($temp_output) |
|
| 23 | +if ($temp_output) |
|
| 24 | 24 | { |
| 25 | 25 | $output = $temp_output; |
| 26 | 26 | } |
@@ -1,8 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /* Copyright (C) NAVER <http://www.navercorp.com> */ |
| 3 | 3 | |
| 4 | -if(!defined('__XE__')) |
|
| 4 | +if(!defined('__XE__')) { |
|
| 5 | 5 | exit(); |
| 6 | +} |
|
| 6 | 7 | |
| 7 | 8 | /** |
| 8 | 9 | * @file point.addon.php |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | function pointLevelIconTrans($matches) |
| 8 | 8 | { |
| 9 | 9 | $member_srl = $matches[3]; |
| 10 | - if($member_srl < 1) |
|
| 10 | + if ($member_srl < 1) |
|
| 11 | 11 | { |
| 12 | 12 | return $matches[0]; |
| 13 | 13 | } |
@@ -16,15 +16,15 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | // Check Group Image Mark |
| 18 | 18 | $oMemberModel = getModel('member'); |
| 19 | - if($oMemberModel->getGroupImageMark($member_srl)) |
|
| 19 | + if ($oMemberModel->getGroupImageMark($member_srl)) |
|
| 20 | 20 | { |
| 21 | 21 | return $orig_text . $matches[5] . '</' . $matches[6] . '>'; |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | - if(!isset($GLOBALS['_pointLevelIcon'][$member_srl])) |
|
| 24 | + if (!isset($GLOBALS['_pointLevelIcon'][$member_srl])) |
|
| 25 | 25 | { |
| 26 | 26 | // Get point configuration |
| 27 | - if(!$GLOBALS['_pointConfig']) |
|
| 27 | + if (!$GLOBALS['_pointConfig']) |
|
| 28 | 28 | { |
| 29 | 29 | $oModuleModel = getModel('module'); |
| 30 | 30 | $GLOBALS['_pointConfig'] = $oModuleModel->getModuleConfig('point'); |
@@ -32,14 +32,14 @@ discard block |
||
| 32 | 32 | $config = $GLOBALS['_pointConfig']; |
| 33 | 33 | |
| 34 | 34 | // Get point model |
| 35 | - if(!$GLOBALS['_pointModel']) |
|
| 35 | + if (!$GLOBALS['_pointModel']) |
|
| 36 | 36 | { |
| 37 | 37 | $GLOBALS['_pointModel'] = getModel('point'); |
| 38 | 38 | } |
| 39 | 39 | $oPointModel = &$GLOBALS['_pointModel']; |
| 40 | 40 | |
| 41 | 41 | // Get points |
| 42 | - if(!$oPointModel->isExistsPoint($member_srl)) |
|
| 42 | + if (!$oPointModel->isExistsPoint($member_srl)) |
|
| 43 | 43 | { |
| 44 | 44 | return $matches[0]; |
| 45 | 45 | } |
@@ -55,11 +55,11 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | // Get per to go to the next level if not a top level |
| 57 | 57 | $per = NULL; |
| 58 | - if($level < $config->max_level) |
|
| 58 | + if ($level < $config->max_level) |
|
| 59 | 59 | { |
| 60 | 60 | $next_point = $config->level_step[$level + 1]; |
| 61 | 61 | $present_point = $config->level_step[$level]; |
| 62 | - if($next_point > 0) |
|
| 62 | + if ($next_point > 0) |
|
| 63 | 63 | { |
| 64 | 64 | $per = (int) (($point - $present_point) / ($next_point - $present_point) * 100); |
| 65 | 65 | $per = $per . '%'; |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /* Copyright (C) NAVER <http://www.navercorp.com> */ |
| 3 | 3 | |
| 4 | -if(!defined('__XE__')) |
|
| 4 | +if (!defined('__XE__')) |
|
| 5 | 5 | { |
| 6 | 6 | exit(); |
| 7 | 7 | } |
@@ -11,9 +11,9 @@ discard block |
||
| 11 | 11 | * @author NAVER ([email protected]) |
| 12 | 12 | * @brief Add-on to resize images in the body |
| 13 | 13 | */ |
| 14 | -if($called_position == 'after_module_proc' && Context::getResponseMethod() == "HTML" && !isCrawler()) |
|
| 14 | +if ($called_position == 'after_module_proc' && Context::getResponseMethod() == "HTML" && !isCrawler()) |
|
| 15 | 15 | { |
| 16 | - if(Mobile::isFromMobilePhone()) |
|
| 16 | + if (Mobile::isFromMobilePhone()) |
|
| 17 | 17 | { |
| 18 | 18 | Context::loadFile('./addons/resize_image/css/resize_image.mobile.css', true); |
| 19 | 19 | } |
@@ -16,8 +16,7 @@ |
||
| 16 | 16 | if(Mobile::isFromMobilePhone()) |
| 17 | 17 | { |
| 18 | 18 | Context::loadFile('./addons/resize_image/css/resize_image.mobile.css', true); |
| 19 | - } |
|
| 20 | - else |
|
| 19 | + } else |
|
| 21 | 20 | { |
| 22 | 21 | Context::loadJavascriptPlugin('ui'); |
| 23 | 22 | Context::loadFile(array('./addons/resize_image/js/resize_image.min.js', 'body', '', null), true); |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | function getInstance($opt = null) |
| 20 | 20 | { |
| 21 | - if(!$GLOBALS['__CacheApc__']) |
|
| 21 | + if (!$GLOBALS['__CacheApc__']) |
|
| 22 | 22 | { |
| 23 | 23 | $GLOBALS['__CacheApc__'] = new CacheApc(); |
| 24 | 24 | } |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | function put($key, $buff, $valid_time = 0) |
| 58 | 58 | { |
| 59 | - if($valid_time == 0) |
|
| 59 | + if ($valid_time == 0) |
|
| 60 | 60 | { |
| 61 | 61 | $valid_time = $this->valid_time; |
| 62 | 62 | } |
@@ -76,13 +76,13 @@ discard block |
||
| 76 | 76 | { |
| 77 | 77 | $_key = md5(_XE_PATH_ . $key); |
| 78 | 78 | $obj = apc_fetch($_key, $success); |
| 79 | - if(!$success || !is_array($obj)) |
|
| 79 | + if (!$success || !is_array($obj)) |
|
| 80 | 80 | { |
| 81 | 81 | return false; |
| 82 | 82 | } |
| 83 | 83 | unset($obj[1]); |
| 84 | 84 | |
| 85 | - if($modified_time > 0 && $modified_time > $obj[0]) |
|
| 85 | + if ($modified_time > 0 && $modified_time > $obj[0]) |
|
| 86 | 86 | { |
| 87 | 87 | $this->delete($key); |
| 88 | 88 | return false; |
@@ -103,12 +103,12 @@ discard block |
||
| 103 | 103 | { |
| 104 | 104 | $_key = md5(_XE_PATH_ . $key); |
| 105 | 105 | $obj = apc_fetch($_key, $success); |
| 106 | - if(!$success || !is_array($obj)) |
|
| 106 | + if (!$success || !is_array($obj)) |
|
| 107 | 107 | { |
| 108 | 108 | return false; |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | - if($modified_time > 0 && $modified_time > $obj[0]) |
|
| 111 | + if ($modified_time > 0 && $modified_time > $obj[0]) |
|
| 112 | 112 | { |
| 113 | 113 | $this->delete($key); |
| 114 | 114 | return false; |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | } |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | -CacheApc::$isSupport = function_exists('apc_add'); |
|
| 151 | +CacheApc::$isSupport = function_exists('apc_add'); |
|
| 152 | 152 | |
| 153 | 153 | /* End of file CacheApc.class.php */ |
| 154 | 154 | /* Location: ./classes/cache/CacheApc.class.php */ |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | function getInstance($url) |
| 24 | 24 | { |
| 25 | - if(!$GLOBALS['__CacheMemcache__']) |
|
| 25 | + if (!$GLOBALS['__CacheMemcache__']) |
|
| 26 | 26 | { |
| 27 | 27 | $GLOBALS['__CacheMemcache__'] = new CacheMemcache($url); |
| 28 | 28 | } |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | $config['url'] = is_array($url) ? $url : array($url); |
| 43 | 43 | $this->Memcache = new Memcache; |
| 44 | 44 | |
| 45 | - foreach($config['url'] as $url) |
|
| 45 | + foreach ($config['url'] as $url) |
|
| 46 | 46 | { |
| 47 | 47 | $info = parse_url($url); |
| 48 | 48 | $this->Memcache->addServer($info['host'], $info['port']); |
@@ -56,12 +56,12 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | function isSupport() |
| 58 | 58 | { |
| 59 | - if(isset($GLOBALS['XE_MEMCACHE_SUPPORT'])) |
|
| 59 | + if (isset($GLOBALS['XE_MEMCACHE_SUPPORT'])) |
|
| 60 | 60 | { |
| 61 | 61 | return true; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - if($this->Memcache->set('xe', 'xe', MEMCACHE_COMPRESSED, 1)) |
|
| 64 | + if ($this->Memcache->set('xe', 'xe', MEMCACHE_COMPRESSED, 1)) |
|
| 65 | 65 | { |
| 66 | 66 | $GLOBALS['XE_MEMCACHE_SUPPORT'] = true; |
| 67 | 67 | } |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | */ |
| 104 | 104 | function put($key, $buff, $valid_time = 0) |
| 105 | 105 | { |
| 106 | - if($valid_time == 0) |
|
| 106 | + if ($valid_time == 0) |
|
| 107 | 107 | { |
| 108 | 108 | $valid_time = $this->valid_time; |
| 109 | 109 | } |
@@ -124,13 +124,13 @@ discard block |
||
| 124 | 124 | $_key = $this->getKey($key); |
| 125 | 125 | |
| 126 | 126 | $obj = $this->Memcache->get($_key); |
| 127 | - if(!$obj || !is_array($obj)) |
|
| 127 | + if (!$obj || !is_array($obj)) |
|
| 128 | 128 | { |
| 129 | 129 | return false; |
| 130 | 130 | } |
| 131 | 131 | unset($obj[1]); |
| 132 | 132 | |
| 133 | - if($modified_time > 0 && $modified_time > $obj[0]) |
|
| 133 | + if ($modified_time > 0 && $modified_time > $obj[0]) |
|
| 134 | 134 | { |
| 135 | 135 | $this->_delete($_key); |
| 136 | 136 | return false; |
@@ -153,12 +153,12 @@ discard block |
||
| 153 | 153 | { |
| 154 | 154 | $_key = $this->getKey($key); |
| 155 | 155 | $obj = $this->Memcache->get($_key); |
| 156 | - if(!$obj || !is_array($obj)) |
|
| 156 | + if (!$obj || !is_array($obj)) |
|
| 157 | 157 | { |
| 158 | 158 | return false; |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | - if($modified_time > 0 && $modified_time > $obj[0]) |
|
| 161 | + if ($modified_time > 0 && $modified_time > $obj[0]) |
|
| 162 | 162 | { |
| 163 | 163 | $this->_delete($_key); |
| 164 | 164 | return false; |
@@ -21,8 +21,7 @@ |
||
| 21 | 21 | if($absolute_url) |
| 22 | 22 | { |
| 23 | 23 | return getFullUrl('','vid',$vid, 'mid',$mid, 'act',$format); |
| 24 | - } |
|
| 25 | - else |
|
| 24 | + } else |
|
| 26 | 25 | { |
| 27 | 26 | return getUrl('','vid',$vid, 'mid',$mid, 'act',$format); |
| 28 | 27 | } |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | function getInstance($opt = null) |
| 22 | 22 | { |
| 23 | - if(!$GLOBALS['__CacheWincache__']) |
|
| 23 | + if (!$GLOBALS['__CacheWincache__']) |
|
| 24 | 24 | { |
| 25 | 25 | $GLOBALS['__CacheWincache__'] = new CacheWincache(); |
| 26 | 26 | } |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | */ |
| 60 | 60 | function put($key, $buff, $valid_time = 0) |
| 61 | 61 | { |
| 62 | - if($valid_time == 0) |
|
| 62 | + if ($valid_time == 0) |
|
| 63 | 63 | { |
| 64 | 64 | $valid_time = $this->valid_time; |
| 65 | 65 | } |
@@ -78,13 +78,13 @@ discard block |
||
| 78 | 78 | { |
| 79 | 79 | $_key = md5(_XE_PATH_ . $key); |
| 80 | 80 | $obj = wincache_ucache_get($_key, $success); |
| 81 | - if(!$success || !is_array($obj)) |
|
| 81 | + if (!$success || !is_array($obj)) |
|
| 82 | 82 | { |
| 83 | 83 | return false; |
| 84 | 84 | } |
| 85 | 85 | unset($obj[1]); |
| 86 | 86 | |
| 87 | - if($modified_time > 0 && $modified_time > $obj[0]) |
|
| 87 | + if ($modified_time > 0 && $modified_time > $obj[0]) |
|
| 88 | 88 | { |
| 89 | 89 | $this->_delete($_key); |
| 90 | 90 | return false; |
@@ -105,12 +105,12 @@ discard block |
||
| 105 | 105 | { |
| 106 | 106 | $_key = md5(_XE_PATH_ . $key); |
| 107 | 107 | $obj = wincache_ucache_get($_key, $success); |
| 108 | - if(!$success || !is_array($obj)) |
|
| 108 | + if (!$success || !is_array($obj)) |
|
| 109 | 109 | { |
| 110 | 110 | return false; |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | - if($modified_time > 0 && $modified_time > $obj[0]) |
|
| 113 | + if ($modified_time > 0 && $modified_time > $obj[0]) |
|
| 114 | 114 | { |
| 115 | 115 | $this->_delete($_key); |
| 116 | 116 | return false; |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | function __connect($connection) |
| 45 | 45 | { |
| 46 | 46 | // Attempt to connect |
| 47 | - if($connection["db_port"]) |
|
| 47 | + if ($connection["db_port"]) |
|
| 48 | 48 | { |
| 49 | 49 | $result = @mysqli_connect($connection["db_hostname"] |
| 50 | 50 | , $connection["db_userid"] |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | , $connection["db_database"]); |
| 61 | 61 | } |
| 62 | 62 | $error = mysqli_connect_errno(); |
| 63 | - if($error) |
|
| 63 | + if ($error) |
|
| 64 | 64 | { |
| 65 | 65 | $this->setError($error, mysqli_connect_error()); |
| 66 | 66 | return; |
@@ -87,11 +87,11 @@ discard block |
||
| 87 | 87 | */ |
| 88 | 88 | function addQuotes($string) |
| 89 | 89 | { |
| 90 | - if(version_compare(PHP_VERSION, "5.4.0", "<") && get_magic_quotes_gpc()) |
|
| 90 | + if (version_compare(PHP_VERSION, "5.4.0", "<") && get_magic_quotes_gpc()) |
|
| 91 | 91 | { |
| 92 | 92 | $string = stripslashes(str_replace("\\", "\\\\", $string)); |
| 93 | 93 | } |
| 94 | - if(!is_numeric($string)) |
|
| 94 | + if (!is_numeric($string)) |
|
| 95 | 95 | { |
| 96 | 96 | $connection = $this->_getConnection('master'); |
| 97 | 97 | $string = mysqli_escape_string($connection, $string); |
@@ -108,23 +108,23 @@ discard block |
||
| 108 | 108 | */ |
| 109 | 109 | function __query($query, $connection) |
| 110 | 110 | { |
| 111 | - if($this->use_prepared_statements == 'Y') |
|
| 111 | + if ($this->use_prepared_statements == 'Y') |
|
| 112 | 112 | { |
| 113 | 113 | // 1. Prepare query |
| 114 | 114 | $stmt = mysqli_prepare($connection, $query); |
| 115 | - if($stmt) |
|
| 115 | + if ($stmt) |
|
| 116 | 116 | { |
| 117 | 117 | $types = ''; |
| 118 | 118 | $params = array(); |
| 119 | 119 | $this->_prepareQueryParameters($types, $params); |
| 120 | 120 | |
| 121 | - if(!empty($params)) |
|
| 121 | + if (!empty($params)) |
|
| 122 | 122 | { |
| 123 | 123 | $args[0] = $stmt; |
| 124 | 124 | $args[1] = $types; |
| 125 | 125 | |
| 126 | 126 | $i = 2; |
| 127 | - foreach($params as $key => $param) |
|
| 127 | + foreach ($params as $key => $param) |
|
| 128 | 128 | { |
| 129 | 129 | $copy[$key] = $param; |
| 130 | 130 | $args[$i++] = &$copy[$key]; |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | // 2. Bind parameters |
| 134 | 134 | $status = call_user_func_array('mysqli_stmt_bind_param', $args); |
| 135 | - if(!$status) |
|
| 135 | + if (!$status) |
|
| 136 | 136 | { |
| 137 | 137 | $this->setError(-1, "Invalid arguments: $query" . mysqli_error($connection) . PHP_EOL . print_r($args, true)); |
| 138 | 138 | } |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | // 3. Execute query |
| 142 | 142 | $status = mysqli_stmt_execute($stmt); |
| 143 | 143 | |
| 144 | - if(!$status) |
|
| 144 | + if (!$status) |
|
| 145 | 145 | { |
| 146 | 146 | $this->setError(-1, "Prepared statement failed: $query" . mysqli_error($connection) . PHP_EOL . print_r($args, true)); |
| 147 | 147 | } |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | $result = mysqli_query($connection, $query); |
| 156 | 156 | // Error Check |
| 157 | 157 | $error = mysqli_error($connection); |
| 158 | - if($error) |
|
| 158 | + if ($error) |
|
| 159 | 159 | { |
| 160 | 160 | $this->setError(mysqli_errno($connection), $error); |
| 161 | 161 | } |
@@ -174,23 +174,23 @@ discard block |
||
| 174 | 174 | { |
| 175 | 175 | $types = ''; |
| 176 | 176 | $params = array(); |
| 177 | - if(!$this->param) |
|
| 177 | + if (!$this->param) |
|
| 178 | 178 | { |
| 179 | 179 | return; |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | - foreach($this->param as $k => $o) |
|
| 182 | + foreach ($this->param as $k => $o) |
|
| 183 | 183 | { |
| 184 | 184 | $value = $o->getUnescapedValue(); |
| 185 | 185 | $type = $o->getType(); |
| 186 | 186 | |
| 187 | 187 | // Skip column names -> this should be concatenated to query string |
| 188 | - if($o->isColumnName()) |
|
| 188 | + if ($o->isColumnName()) |
|
| 189 | 189 | { |
| 190 | 190 | continue; |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | - switch($type) |
|
| 193 | + switch ($type) |
|
| 194 | 194 | { |
| 195 | 195 | case 'number' : |
| 196 | 196 | $type = 'i'; |
@@ -202,9 +202,9 @@ discard block |
||
| 202 | 202 | $type = 's'; |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | - if(is_array($value)) |
|
| 205 | + if (is_array($value)) |
|
| 206 | 206 | { |
| 207 | - foreach($value as $v) |
|
| 207 | + foreach ($value as $v) |
|
| 208 | 208 | { |
| 209 | 209 | $params[] = $v; |
| 210 | 210 | $types .= $type; |
@@ -226,12 +226,12 @@ discard block |
||
| 226 | 226 | */ |
| 227 | 227 | function _fetch($result, $arrayIndexEndValue = NULL) |
| 228 | 228 | { |
| 229 | - if($this->use_prepared_statements != 'Y') |
|
| 229 | + if ($this->use_prepared_statements != 'Y') |
|
| 230 | 230 | { |
| 231 | 231 | return parent::_fetch($result, $arrayIndexEndValue); |
| 232 | 232 | } |
| 233 | 233 | $output = array(); |
| 234 | - if(!$this->isConnected() || $this->isError() || !$result) |
|
| 234 | + if (!$this->isConnected() || $this->isError() || !$result) |
|
| 235 | 235 | { |
| 236 | 236 | return $output; |
| 237 | 237 | } |
@@ -247,9 +247,9 @@ discard block |
||
| 247 | 247 | * MYSQLI_TYPE for longtext is 252 |
| 248 | 248 | */ |
| 249 | 249 | $longtext_exists = false; |
| 250 | - foreach($fields as $field) |
|
| 250 | + foreach ($fields as $field) |
|
| 251 | 251 | { |
| 252 | - if(isset($resultArray[$field->name])) // When joined tables are used and the same column name appears twice, we should add it separately, otherwise bind_result fails |
|
| 252 | + if (isset($resultArray[$field->name])) // When joined tables are used and the same column name appears twice, we should add it separately, otherwise bind_result fails |
|
| 253 | 253 | { |
| 254 | 254 | $field->name = 'repeat_' . $field->name; |
| 255 | 255 | } |
@@ -258,14 +258,14 @@ discard block |
||
| 258 | 258 | $row[$field->name] = ""; |
| 259 | 259 | $resultArray[$field->name] = &$row[$field->name]; |
| 260 | 260 | |
| 261 | - if($field->type == 252) |
|
| 261 | + if ($field->type == 252) |
|
| 262 | 262 | { |
| 263 | 263 | $longtext_exists = true; |
| 264 | 264 | } |
| 265 | 265 | } |
| 266 | 266 | $resultArray = array_merge(array($stmt), $resultArray); |
| 267 | 267 | |
| 268 | - if($longtext_exists) |
|
| 268 | + if ($longtext_exists) |
|
| 269 | 269 | { |
| 270 | 270 | mysqli_stmt_store_result($stmt); |
| 271 | 271 | } |
@@ -273,17 +273,17 @@ discard block |
||
| 273 | 273 | call_user_func_array('mysqli_stmt_bind_result', $resultArray); |
| 274 | 274 | |
| 275 | 275 | $rows = array(); |
| 276 | - while(mysqli_stmt_fetch($stmt)) |
|
| 276 | + while (mysqli_stmt_fetch($stmt)) |
|
| 277 | 277 | { |
| 278 | 278 | $resultObject = new stdClass(); |
| 279 | 279 | |
| 280 | - foreach($resultArray as $key => $value) |
|
| 280 | + foreach ($resultArray as $key => $value) |
|
| 281 | 281 | { |
| 282 | - if($key === 0) |
|
| 282 | + if ($key === 0) |
|
| 283 | 283 | { |
| 284 | 284 | continue; // Skip stmt object |
| 285 | 285 | } |
| 286 | - if(strpos($key, 'repeat_')) |
|
| 286 | + if (strpos($key, 'repeat_')) |
|
| 287 | 287 | { |
| 288 | 288 | $key = substr($key, 6); |
| 289 | 289 | } |
@@ -295,9 +295,9 @@ discard block |
||
| 295 | 295 | |
| 296 | 296 | mysqli_stmt_close($stmt); |
| 297 | 297 | |
| 298 | - if($arrayIndexEndValue) |
|
| 298 | + if ($arrayIndexEndValue) |
|
| 299 | 299 | { |
| 300 | - foreach($rows as $row) |
|
| 300 | + foreach ($rows as $row) |
|
| 301 | 301 | { |
| 302 | 302 | $output[$arrayIndexEndValue--] = $row; |
| 303 | 303 | } |
@@ -307,9 +307,9 @@ discard block |
||
| 307 | 307 | $output = $rows; |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | - if(count($output) == 1) |
|
| 310 | + if (count($output) == 1) |
|
| 311 | 311 | { |
| 312 | - if(isset($arrayIndexEndValue)) |
|
| 312 | + if (isset($arrayIndexEndValue)) |
|
| 313 | 313 | { |
| 314 | 314 | return $output; |
| 315 | 315 | } |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | */ |
| 331 | 331 | function _executeInsertAct($queryObject, $with_values = false) |
| 332 | 332 | { |
| 333 | - if($this->use_prepared_statements != 'Y') |
|
| 333 | + if ($this->use_prepared_statements != 'Y') |
|
| 334 | 334 | { |
| 335 | 335 | return parent::_executeInsertAct($queryObject); |
| 336 | 336 | } |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | */ |
| 349 | 349 | function _executeUpdateAct($queryObject, $with_values = false) |
| 350 | 350 | { |
| 351 | - if($this->use_prepared_statements != 'Y') |
|
| 351 | + if ($this->use_prepared_statements != 'Y') |
|
| 352 | 352 | { |
| 353 | 353 | return parent::_executeUpdateAct($queryObject); |
| 354 | 354 | } |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | */ |
| 367 | 367 | function _executeDeleteAct($queryObject, $with_values = false) |
| 368 | 368 | { |
| 369 | - if($this->use_prepared_statements != 'Y') |
|
| 369 | + if ($this->use_prepared_statements != 'Y') |
|
| 370 | 370 | { |
| 371 | 371 | return parent::_executeDeleteAct($queryObject); |
| 372 | 372 | } |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | */ |
| 388 | 388 | function _executeSelectAct($queryObject, $connection = null, $with_values = false) |
| 389 | 389 | { |
| 390 | - if($this->use_prepared_statements != 'Y') |
|
| 390 | + if ($this->use_prepared_statements != 'Y') |
|
| 391 | 391 | { |
| 392 | 392 | return parent::_executeSelectAct($queryObject, $connection); |
| 393 | 393 | } |
@@ -51,8 +51,7 @@ discard block |
||
| 51 | 51 | , $connection["db_password"] |
| 52 | 52 | , $connection["db_database"] |
| 53 | 53 | , $connection["db_port"]); |
| 54 | - } |
|
| 55 | - else |
|
| 54 | + } else |
|
| 56 | 55 | { |
| 57 | 56 | $result = @mysqli_connect($connection["db_hostname"] |
| 58 | 57 | , $connection["db_userid"] |
@@ -209,8 +208,7 @@ discard block |
||
| 209 | 208 | $params[] = $v; |
| 210 | 209 | $types .= $type; |
| 211 | 210 | } |
| 212 | - } |
|
| 213 | - else |
|
| 211 | + } else |
|
| 214 | 212 | { |
| 215 | 213 | $params[] = $value; |
| 216 | 214 | $types .= $type; |
@@ -249,10 +247,12 @@ discard block |
||
| 249 | 247 | $longtext_exists = false; |
| 250 | 248 | foreach($fields as $field) |
| 251 | 249 | { |
| 252 | - if(isset($resultArray[$field->name])) // When joined tables are used and the same column name appears twice, we should add it separately, otherwise bind_result fails |
|
| 250 | + if(isset($resultArray[$field->name])) { |
|
| 251 | + // When joined tables are used and the same column name appears twice, we should add it separately, otherwise bind_result fails |
|
| 253 | 252 | { |
| 254 | 253 | $field->name = 'repeat_' . $field->name; |
| 255 | 254 | } |
| 255 | + } |
|
| 256 | 256 | |
| 257 | 257 | // Array passed needs to contain references, not values |
| 258 | 258 | $row[$field->name] = ""; |
@@ -301,8 +301,7 @@ discard block |
||
| 301 | 301 | { |
| 302 | 302 | $output[$arrayIndexEndValue--] = $row; |
| 303 | 303 | } |
| 304 | - } |
|
| 305 | - else |
|
| 304 | + } else |
|
| 306 | 305 | { |
| 307 | 306 | $output = $rows; |
| 308 | 307 | } |
@@ -312,8 +311,7 @@ discard block |
||
| 312 | 311 | if(isset($arrayIndexEndValue)) |
| 313 | 312 | { |
| 314 | 313 | return $output; |
| 315 | - } |
|
| 316 | - else |
|
| 314 | + } else |
|
| 317 | 315 | { |
| 318 | 316 | return $output[0]; |
| 319 | 317 | } |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | /** |
| 31 | 31 | * Search Result |
| 32 | 32 | * |
| 33 | - * @return Object |
|
| 33 | + * @return Object|null |
|
| 34 | 34 | */ |
| 35 | 35 | function IS() |
| 36 | 36 | { |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | |
| 57 | 57 | function isJoinTable() |
| 58 | 58 | {
|
| 59 | - if($this->join_type) |
|
| 59 | + if ($this->join_type) |
|
| 60 | 60 | {
|
| 61 | 61 | return true; |
| 62 | 62 | } |
@@ -32,14 +32,14 @@ discard block |
||
| 32 | 32 | function ConditionGroup($conditions, $pipe = "") |
| 33 | 33 | {
|
| 34 | 34 | $this->conditions = array(); |
| 35 | - foreach($conditions as $condition) |
|
| 35 | + foreach ($conditions as $condition) |
|
| 36 | 36 | {
|
| 37 | - if($condition->show()) |
|
| 37 | + if ($condition->show()) |
|
| 38 | 38 | {
|
| 39 | 39 | $this->conditions[] = $condition; |
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | - if(count($this->conditions) === 0) |
|
| 42 | + if (count($this->conditions) === 0) |
|
| 43 | 43 | {
|
| 44 | 44 | $this->_show = false; |
| 45 | 45 | } |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | |
| 59 | 59 | function setPipe($pipe) |
| 60 | 60 | {
|
| 61 | - if($this->pipe !== $pipe) |
|
| 61 | + if ($this->pipe !== $pipe) |
|
| 62 | 62 | {
|
| 63 | 63 | $this->_group = null; |
| 64 | 64 | } |
@@ -72,14 +72,14 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | function toString($with_value = true) |
| 74 | 74 | {
|
| 75 | - if(!isset($this->_group)) |
|
| 75 | + if (!isset($this->_group)) |
|
| 76 | 76 | {
|
| 77 | 77 | $cond_indx = 0; |
| 78 | 78 | $group = ''; |
| 79 | 79 | |
| 80 | - foreach($this->conditions as $condition) |
|
| 80 | + foreach ($this->conditions as $condition) |
|
| 81 | 81 | {
|
| 82 | - if($cond_indx === 0) |
|
| 82 | + if ($cond_indx === 0) |
|
| 83 | 83 | {
|
| 84 | 84 | $condition->setPipe("");
|
| 85 | 85 | } |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | $cond_indx++; |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - if($this->pipe !== "" && trim($group) !== '') |
|
| 90 | + if ($this->pipe !== "" && trim($group) !== '') |
|
| 91 | 91 | {
|
| 92 | 92 | $group = $this->pipe . ' (' . $group . ')';
|
| 93 | 93 | } |
@@ -104,10 +104,10 @@ discard block |
||
| 104 | 104 | function getArguments() |
| 105 | 105 | {
|
| 106 | 106 | $args = array(); |
| 107 | - foreach($this->conditions as $condition) |
|
| 107 | + foreach ($this->conditions as $condition) |
|
| 108 | 108 | {
|
| 109 | 109 | $arg = $condition->getArgument(); |
| 110 | - if($arg) |
|
| 110 | + if ($arg) |
|
| 111 | 111 | {
|
| 112 | 112 | $args[] = $arg; |
| 113 | 113 | } |
@@ -111,8 +111,7 @@ |
||
| 111 | 111 | if($this->limit) |
| 112 | 112 | {
|
| 113 | 113 | return $this->limit->toString(); |
| 114 | - } |
|
| 115 | - else |
|
| 114 | + } else |
|
| 116 | 115 | {
|
| 117 | 116 | return ""; |
| 118 | 117 | } |