@@ -54,6 +54,9 @@ discard block |
||
| 54 | 54 | return $config; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | + /** |
|
| 58 | + * @param string $property |
|
| 59 | + */ |
|
| 57 | 60 | public function addMeta($property, $content, $attr_name = 'property') |
| 58 | 61 | { |
| 59 | 62 | if (!$content) return; |
@@ -68,6 +71,10 @@ discard block |
||
| 68 | 71 | $this->SEO['meta'][] = array('property' => $property, 'content' => $content, 'attr_name' => $attr_name); |
| 69 | 72 | } |
| 70 | 73 | |
| 74 | + /** |
|
| 75 | + * @param string $rel |
|
| 76 | + * @param string $href |
|
| 77 | + */ |
|
| 71 | 78 | public function addLink($rel, $href) |
| 72 | 79 | { |
| 73 | 80 | if (!$href) return; |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | $oModuleModel = getModel('module'); |
| 21 | 21 | $config = $oModuleModel->getModuleConfig('seo'); |
| 22 | 22 | |
| 23 | - require_once(_XE_PATH_ . 'libs/idna_convert/idna_convert.class.php'); |
|
| 23 | + require_once(_XE_PATH_.'libs/idna_convert/idna_convert.class.php'); |
|
| 24 | 24 | $IDN = new idna_convert(array('idn_version' => 2008)); |
| 25 | 25 | $request_uri = $IDN->encode(Context::get('request_uri')); |
| 26 | 26 | |
@@ -31,16 +31,16 @@ discard block |
||
| 31 | 31 | if (!$config->ga_track_subdomain) $config->ga_track_subdomain = 'N'; |
| 32 | 32 | if ($config->site_image) |
| 33 | 33 | { |
| 34 | - $config->site_image_url = $request_uri . 'files/attach/site_image/' . $config->site_image; |
|
| 34 | + $config->site_image_url = $request_uri.'files/attach/site_image/'.$config->site_image; |
|
| 35 | 35 | |
| 36 | 36 | $oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE); |
| 37 | - if($oCacheHandler->isSupport()) { |
|
| 37 | + if ($oCacheHandler->isSupport()) { |
|
| 38 | 38 | $site_image = false; |
| 39 | 39 | $cache_key = 'seo:site_image'; |
| 40 | 40 | $site_image = $oCacheHandler->get($cache_key); |
| 41 | - if(!$site_image) { |
|
| 42 | - $path = _XE_PATH_ . 'files/attach/site_image/'; |
|
| 43 | - list($width, $height) = @getimagesize($path . $config->site_image); |
|
| 41 | + if (!$site_image) { |
|
| 42 | + $path = _XE_PATH_.'files/attach/site_image/'; |
|
| 43 | + list($width, $height) = @getimagesize($path.$config->site_image); |
|
| 44 | 44 | $site_image_dimension = array( |
| 45 | 45 | 'width' => $width, |
| 46 | 46 | 'height' => $height |
@@ -86,9 +86,9 @@ discard block |
||
| 86 | 86 | foreach ($list as $val) { |
| 87 | 87 | if ($type == 'meta') { |
| 88 | 88 | $attr_name = $val['attr_name']; |
| 89 | - Context::addHtmlHeader('<meta ' . $attr_name . '="' . $val['property'] . '" content="' . $val['content'] . '" />'); |
|
| 89 | + Context::addHtmlHeader('<meta '.$attr_name.'="'.$val['property'].'" content="'.$val['content'].'" />'); |
|
| 90 | 90 | } elseif ($type == 'link') { |
| 91 | - Context::addHtmlHeader('<link rel="' . $val['rel'] . '" href="' . $val['href'] . '" />'); |
|
| 91 | + Context::addHtmlHeader('<link rel="'.$val['rel'].'" href="'.$val['href'].'" />'); |
|
| 92 | 92 | } |
| 93 | 93 | } |
| 94 | 94 | } |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | </script> |
| 115 | 115 | GASCRIPT; |
| 116 | 116 | |
| 117 | - Context::addHtmlHeader($ga_script . PHP_EOL); |
|
| 117 | + Context::addHtmlHeader($ga_script.PHP_EOL); |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | // Naver Analytics |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | <script src="//wcs.naver.net/wcslog.js"></script> |
| 125 | 125 | <script>if(!wcs_add){var wcs_add={wa:'{$config->na_id}'};}if(typeof wcs_do!="undefined"){wcs_do();}</script> |
| 126 | 126 | NASCRIPT; |
| 127 | - Context::addHtmlFooter($na_script . PHP_EOL); |
|
| 127 | + Context::addHtmlFooter($na_script.PHP_EOL); |
|
| 128 | 128 | } |
| 129 | 129 | } |
| 130 | 130 | |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | |
| 140 | 140 | $seo_config = $this->getConfig(); |
| 141 | 141 | |
| 142 | - if($seo_config->enable === 'Y') { |
|
| 142 | + if ($seo_config->enable === 'Y') { |
|
| 143 | 143 | foreach ($this->triggers as $trigger) { |
| 144 | 144 | if (!$oModuleModel->getTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4])) return TRUE; |
| 145 | 145 | } |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | |
| 156 | 156 | $seo_config = $this->getConfig(); |
| 157 | 157 | |
| 158 | - if($seo_config->enable === 'Y') { |
|
| 158 | + if ($seo_config->enable === 'Y') { |
|
| 159 | 159 | foreach ($this->triggers as $trigger) { |
| 160 | 160 | if (!$oModuleModel->getTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4])) { |
| 161 | 161 | $oModuleController->insertTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]); |
@@ -24,11 +24,21 @@ discard block |
||
| 24 | 24 | $IDN = new idna_convert(array('idn_version' => 2008)); |
| 25 | 25 | $request_uri = $IDN->encode(Context::get('request_uri')); |
| 26 | 26 | |
| 27 | - if (!$config) $config = new stdClass; |
|
| 28 | - if (!$config->enable) $config->enable = 'Y'; |
|
| 29 | - if (!$config->use_optimize_title) $config->use_optimize_title = 'N'; |
|
| 30 | - if (!$config->ga_except_admin) $config->ga_except_admin = 'N'; |
|
| 31 | - if (!$config->ga_track_subdomain) $config->ga_track_subdomain = 'N'; |
|
| 27 | + if (!$config) { |
|
| 28 | + $config = new stdClass; |
|
| 29 | + } |
|
| 30 | + if (!$config->enable) { |
|
| 31 | + $config->enable = 'Y'; |
|
| 32 | + } |
|
| 33 | + if (!$config->use_optimize_title) { |
|
| 34 | + $config->use_optimize_title = 'N'; |
|
| 35 | + } |
|
| 36 | + if (!$config->ga_except_admin) { |
|
| 37 | + $config->ga_except_admin = 'N'; |
|
| 38 | + } |
|
| 39 | + if (!$config->ga_track_subdomain) { |
|
| 40 | + $config->ga_track_subdomain = 'N'; |
|
| 41 | + } |
|
| 32 | 42 | if ($config->site_image) |
| 33 | 43 | { |
| 34 | 44 | $config->site_image_url = $request_uri . 'files/attach/site_image/' . $config->site_image; |
@@ -56,7 +66,9 @@ discard block |
||
| 56 | 66 | |
| 57 | 67 | public function addMeta($property, $content, $attr_name = 'property') |
| 58 | 68 | { |
| 59 | - if (!$content) return; |
|
| 69 | + if (!$content) { |
|
| 70 | + return; |
|
| 71 | + } |
|
| 60 | 72 | |
| 61 | 73 | $oModuleController = getController('module'); |
| 62 | 74 | $oModuleController->replaceDefinedLangCode($content); |
@@ -70,7 +82,9 @@ discard block |
||
| 70 | 82 | |
| 71 | 83 | public function addLink($rel, $href) |
| 72 | 84 | { |
| 73 | - if (!$href) return; |
|
| 85 | + if (!$href) { |
|
| 86 | + return; |
|
| 87 | + } |
|
| 74 | 88 | |
| 75 | 89 | $this->SEO['link'][] = array('rel' => $rel, 'href' => $href); |
| 76 | 90 | } |
@@ -81,7 +95,9 @@ discard block |
||
| 81 | 95 | $logged_info = Context::get('logged_info'); |
| 82 | 96 | |
| 83 | 97 | foreach ($this->SEO as $type => $list) { |
| 84 | - if (!$list || !count($list)) continue; |
|
| 98 | + if (!$list || !count($list)) { |
|
| 99 | + continue; |
|
| 100 | + } |
|
| 85 | 101 | |
| 86 | 102 | foreach ($list as $val) { |
| 87 | 103 | if ($type == 'meta') { |
@@ -141,7 +157,9 @@ discard block |
||
| 141 | 157 | |
| 142 | 158 | if($seo_config->enable === 'Y') { |
| 143 | 159 | foreach ($this->triggers as $trigger) { |
| 144 | - if (!$oModuleModel->getTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4])) return TRUE; |
|
| 160 | + if (!$oModuleModel->getTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4])) { |
|
| 161 | + return TRUE; |
|
| 162 | + } |
|
| 145 | 163 | } |
| 146 | 164 | } |
| 147 | 165 | |
@@ -63,6 +63,9 @@ discard block |
||
| 63 | 63 | return $module_srls; |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | + /** |
|
| 67 | + * @param string $key |
|
| 68 | + */ |
|
| 66 | 69 | function getLang($key, $site_srl) |
| 67 | 70 | { |
| 68 | 71 | if(!$this->langs[$site_srl]) |
@@ -438,6 +441,12 @@ discard block |
||
| 438 | 441 | return $article; |
| 439 | 442 | } |
| 440 | 443 | |
| 444 | + /** |
|
| 445 | + * @param string $startTime |
|
| 446 | + * @param string $endTime |
|
| 447 | + * @param string $type |
|
| 448 | + * @param string $id |
|
| 449 | + */ |
|
| 441 | 450 | function getArticles($module_srl = null, $page=1, $startTime = null, $endTime = null, $type = null, $id = null) { |
| 442 | 451 | if($this->site_url==null) $this->init(); |
| 443 | 452 | |
@@ -481,6 +490,12 @@ discard block |
||
| 481 | 490 | return $result; |
| 482 | 491 | } |
| 483 | 492 | |
| 493 | + /** |
|
| 494 | + * @param string $startTime |
|
| 495 | + * @param string $endTime |
|
| 496 | + * @param string $type |
|
| 497 | + * @param string $id |
|
| 498 | + */ |
|
| 484 | 499 | function getDeleted($module_srl = null, $page = 1, $startTime = null, $endTime = null, $type = null, $id = null) { |
| 485 | 500 | if($this->site_url==null) $this->init(); |
| 486 | 501 | |
@@ -538,6 +553,9 @@ discard block |
||
| 538 | 553 | return $output->data; |
| 539 | 554 | } |
| 540 | 555 | |
| 556 | + /** |
|
| 557 | + * @param string $type |
|
| 558 | + */ |
|
| 541 | 559 | function getID($type, $target_id = null) { |
| 542 | 560 | if($this->site_url==null) $this->init(); |
| 543 | 561 | |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | { |
| 12 | 12 | private $site_url = null; |
| 13 | 13 | private $uri_scheme = 'http://'; |
| 14 | - private $syndication_password= null; |
|
| 14 | + private $syndication_password = null; |
|
| 15 | 15 | private $year = null; |
| 16 | 16 | private $langs = array(); |
| 17 | 17 | private $granted_modules = array(); |
@@ -20,15 +20,15 @@ discard block |
||
| 20 | 20 | function init() { |
| 21 | 21 | $oModuleModel = getModel('module'); |
| 22 | 22 | $config = $oModuleModel->getModuleConfig('syndication'); |
| 23 | - if(Context::getSslStatus() == 'always') $this->uri_scheme = 'https://'; |
|
| 23 | + if (Context::getSslStatus() == 'always') $this->uri_scheme = 'https://'; |
|
| 24 | 24 | |
| 25 | 25 | $this->site_url = preg_replace('/\/+$/is', '', $config->site_url); |
| 26 | 26 | $this->syndication_password = $config->syndication_password; |
| 27 | 27 | $this->year = $config->year; |
| 28 | 28 | |
| 29 | 29 | $output = executeQueryArray('syndication.getGrantedModules'); |
| 30 | - if($output->data) { |
|
| 31 | - foreach($output->data as $key => $val) { |
|
| 30 | + if ($output->data) { |
|
| 31 | + foreach ($output->data as $key => $val) { |
|
| 32 | 32 | $this->granted_modules[] = $val->module_srl; |
| 33 | 33 | } |
| 34 | 34 | } |
@@ -41,10 +41,10 @@ discard block |
||
| 41 | 41 | $args->module_srl = $module_srl; |
| 42 | 42 | |
| 43 | 43 | $output = executeQuery('syndication.getExceptModule', $args); |
| 44 | - if($output->data->count) return TRUE; |
|
| 44 | + if ($output->data->count) return TRUE; |
|
| 45 | 45 | |
| 46 | 46 | $output = executeQuery('syndication.getGrantedModule', $args); |
| 47 | - if($output->data->count) return TRUE; |
|
| 47 | + if ($output->data->count) return TRUE; |
|
| 48 | 48 | |
| 49 | 49 | return FALSE; |
| 50 | 50 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $module_srls = array(); |
| 56 | 56 | if (is_array($output->data)) |
| 57 | 57 | { |
| 58 | - foreach($output->data as $val) |
|
| 58 | + foreach ($output->data as $val) |
|
| 59 | 59 | { |
| 60 | 60 | $module_srls[] = $val->module_srl; |
| 61 | 61 | } |
@@ -65,21 +65,21 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | function getLang($key, $site_srl) |
| 67 | 67 | { |
| 68 | - if(!$this->langs[$site_srl]) |
|
| 68 | + if (!$this->langs[$site_srl]) |
|
| 69 | 69 | { |
| 70 | 70 | $this->langs[$site_srl] = array(); |
| 71 | 71 | $args = new stdClass; |
| 72 | 72 | $args->site_srl = $site_srl; |
| 73 | 73 | $args->lang_code = Context::getLangType(); |
| 74 | 74 | $output = executeQueryArray("syndication.getLang", $args); |
| 75 | - if(!$output->toBool() || !$output->data) return $key; |
|
| 75 | + if (!$output->toBool() || !$output->data) return $key; |
|
| 76 | 76 | |
| 77 | - foreach($output->data as $value) |
|
| 77 | + foreach ($output->data as $value) |
|
| 78 | 78 | { |
| 79 | 79 | $this->langs[$site_srl][$value->name] = $value->value; |
| 80 | 80 | } |
| 81 | 81 | } |
| 82 | - if($this->langs[$site_srl][$key]) |
|
| 82 | + if ($this->langs[$site_srl][$key]) |
|
| 83 | 83 | { |
| 84 | 84 | return $this->langs[$site_srl][$key]; |
| 85 | 85 | } |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | function handleLang($title, $site_srl) |
| 90 | 90 | { |
| 91 | 91 | $matches = NULL; |
| 92 | - if(!preg_match("/\\\$user_lang->(.+)/", $title, $matches)) |
|
| 92 | + if (!preg_match("/\\\$user_lang->(.+)/", $title, $matches)) |
|
| 93 | 93 | { |
| 94 | 94 | return $title; |
| 95 | 95 | } |
@@ -102,9 +102,9 @@ discard block |
||
| 102 | 102 | function getSyndicationList() { |
| 103 | 103 | $oModuleModel = getModel('module'); |
| 104 | 104 | $config = $oModuleModel->getModuleConfig('syndication'); |
| 105 | - if(!$config->year || !$config->site_url || !$config->syndication_token) |
|
| 105 | + if (!$config->year || !$config->site_url || !$config->syndication_token) |
|
| 106 | 106 | { |
| 107 | - return $this->makeObject(-1,'msg_check_syndication_config'); |
|
| 107 | + return $this->makeObject(-1, 'msg_check_syndication_config'); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | $id = Context::get('id'); |
@@ -114,49 +114,49 @@ discard block |
||
| 114 | 114 | $endTime = Context::get('end-time'); |
| 115 | 115 | |
| 116 | 116 | $page = Context::get('page'); |
| 117 | - if(!$page) |
|
| 117 | + if (!$page) |
|
| 118 | 118 | { |
| 119 | 119 | $page = 1; |
| 120 | 120 | } |
| 121 | 121 | $vars = Context::getRequestVars(); |
| 122 | - if(!$id || !$type) |
|
| 122 | + if (!$id || !$type) |
|
| 123 | 123 | { |
| 124 | - return $this->makeObject(-1,'msg_invalid_request'); |
|
| 124 | + return $this->makeObject(-1, 'msg_invalid_request'); |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | - if(!preg_match('/^tag:([^,]+),([0-9]+):(site|channel|article)(.*)$/i',$id,$matches)) |
|
| 127 | + if (!preg_match('/^tag:([^,]+),([0-9]+):(site|channel|article)(.*)$/i', $id, $matches)) |
|
| 128 | 128 | { |
| 129 | - return $this->makeObject(-1,'msg_invalid_request'); |
|
| 129 | + return $this->makeObject(-1, 'msg_invalid_request'); |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | - if($config->syndication_password != Context::get('syndication_password')) |
|
| 132 | + if ($config->syndication_password != Context::get('syndication_password')) |
|
| 133 | 133 | { |
| 134 | - return $this->makeObject(-1,'msg_invalid_request'); |
|
| 134 | + return $this->makeObject(-1, 'msg_invalid_request'); |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | $url = $matches[1]; |
| 138 | 138 | $year = $matches[2]; |
| 139 | 139 | $target = $matches[3]; |
| 140 | 140 | $id = $matches[4]; |
| 141 | - if($id && $id{0}==':') |
|
| 141 | + if ($id && $id{0} == ':') |
|
| 142 | 142 | { |
| 143 | 143 | $id = substr($id, 1); |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | $module_srl = null; |
| 147 | 147 | $document_srl = null; |
| 148 | - if($id && strpos($id,'-')!==false) |
|
| 148 | + if ($id && strpos($id, '-') !== false) |
|
| 149 | 149 | { |
| 150 | 150 | list($module_srl, $document_srl) = explode('-', $id); |
| 151 | 151 | } |
| 152 | - elseif($id) |
|
| 152 | + elseif ($id) |
|
| 153 | 153 | { |
| 154 | 154 | $module_srl = $id; |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | - if(!$url || !$year || !$target) |
|
| 157 | + if (!$url || !$year || !$target) |
|
| 158 | 158 | { |
| 159 | - return $this->makeObject(-1,'msg_invalid_request'); |
|
| 159 | + return $this->makeObject(-1, 'msg_invalid_request'); |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | $time_zone = substr($GLOBALS['_time_zone'], 0, 3).':'.substr($GLOBALS['_time_zone'], 3); |
@@ -164,12 +164,12 @@ discard block |
||
| 164 | 164 | |
| 165 | 165 | $site_module_info = Context::get('site_module_info'); |
| 166 | 166 | |
| 167 | - if($target == 'channel' && !$module_srl) |
|
| 167 | + if ($target == 'channel' && !$module_srl) |
|
| 168 | 168 | { |
| 169 | 169 | $target = 'site'; |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | - if($module_srl) |
|
| 172 | + if ($module_srl) |
|
| 173 | 173 | { |
| 174 | 174 | $args = new stdClass; |
| 175 | 175 | $args->module_srls = $module_srl; |
@@ -178,13 +178,13 @@ discard block |
||
| 178 | 178 | self::$modules[$module_srl] = $output->data; |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | - if($target == 'channel' && $module_srl) |
|
| 181 | + if ($target == 'channel' && $module_srl) |
|
| 182 | 182 | { |
| 183 | - if($module_info) |
|
| 183 | + if ($module_info) |
|
| 184 | 184 | { |
| 185 | 185 | $args->module_srl = $module_srl; |
| 186 | 186 | $output = executeQuery('syndication.getExceptModules', $args); |
| 187 | - if($output->data->count) |
|
| 187 | + if ($output->data->count) |
|
| 188 | 188 | { |
| 189 | 189 | $error = 'target is not founded'; |
| 190 | 190 | } |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | unset($args); |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | - if(!$error) |
|
| 200 | + if (!$error) |
|
| 201 | 201 | { |
| 202 | 202 | Context::set('target', $target); |
| 203 | 203 | Context::set('type', $type); |
@@ -208,20 +208,20 @@ discard block |
||
| 208 | 208 | $oModuleModel = getModel('module'); |
| 209 | 209 | $site_config = $oModuleModel->getModuleConfig('module'); |
| 210 | 210 | |
| 211 | - switch($target) |
|
| 211 | + switch ($target) |
|
| 212 | 212 | { |
| 213 | 213 | case 'site' : |
| 214 | 214 | $site_info = new stdClass; |
| 215 | 215 | $site_info->id = $this->getID('site'); |
| 216 | - $site_info->site_url = getFullSiteUrl($this->uri_scheme . $this->site_url, ''); |
|
| 216 | + $site_info->site_url = getFullSiteUrl($this->uri_scheme.$this->site_url, ''); |
|
| 217 | 217 | $site_info->site_title = $this->handleLang($site_module_info->browser_title, $site_module_info->site_srl); |
| 218 | 218 | $site_info->title = $site_info->site_title; |
| 219 | 219 | |
| 220 | - if($module_srl) |
|
| 220 | + if ($module_srl) |
|
| 221 | 221 | { |
| 222 | 222 | $args->module_srl = $module_srl; |
| 223 | 223 | $site_info->title = $this->handleLang($module_info->browser_title, $module_info->site_srl); |
| 224 | - if(!$site_info->title) |
|
| 224 | + if (!$site_info->title) |
|
| 225 | 225 | { |
| 226 | 226 | $site_info->title = $site_info->site_title; |
| 227 | 227 | } |
@@ -229,10 +229,10 @@ discard block |
||
| 229 | 229 | else |
| 230 | 230 | { |
| 231 | 231 | $except_module_output = executeQueryArray('syndication.getExceptModuleSrls'); |
| 232 | - if(is_array($except_module_output->data)) |
|
| 232 | + if (is_array($except_module_output->data)) |
|
| 233 | 233 | { |
| 234 | 234 | $except_module_srls = array(); |
| 235 | - foreach($except_module_output->data as $val) |
|
| 235 | + foreach ($except_module_output->data as $val) |
|
| 236 | 236 | { |
| 237 | 237 | $except_module_srls[] = $val->module_srl; |
| 238 | 238 | } |
@@ -242,25 +242,25 @@ discard block |
||
| 242 | 242 | |
| 243 | 243 | $output = executeQuery('syndication.getSiteUpdatedTime', $args); |
| 244 | 244 | |
| 245 | - if($output->data) |
|
| 245 | + if ($output->data) |
|
| 246 | 246 | { |
| 247 | 247 | $site_info->updated = date("Y-m-d\\TH:i:s", ztime($output->data->last_update)).$time_zone; |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | - $site_info->self_href = $this->getSelfHref($site_info->id,$type); |
|
| 250 | + $site_info->self_href = $this->getSelfHref($site_info->id, $type); |
|
| 251 | 251 | Context::set('site_info', $site_info); |
| 252 | 252 | |
| 253 | 253 | $this->setTemplateFile('site'); |
| 254 | - switch($type) { |
|
| 254 | + switch ($type) { |
|
| 255 | 255 | case 'article' : |
| 256 | 256 | // 문서 전체를 신디케이션에 추가 |
| 257 | - Context::set('articles', $this->getArticles($module_srl, $page, $startTime, $endTime, 'article',$site_info->id)); |
|
| 257 | + Context::set('articles', $this->getArticles($module_srl, $page, $startTime, $endTime, 'article', $site_info->id)); |
|
| 258 | 258 | $next_url = Context::get('articles')->next_url; |
| 259 | 259 | |
| 260 | 260 | break; |
| 261 | 261 | case 'deleted' : |
| 262 | 262 | // 문서 전체를 신디케이션에서 삭제 |
| 263 | - Context::set('deleted', $this->getArticles($module_srl, $page, $startTime, $endTime, 'deleted',$site_info->id)); |
|
| 263 | + Context::set('deleted', $this->getArticles($module_srl, $page, $startTime, $endTime, 'deleted', $site_info->id)); |
|
| 264 | 264 | $next_url = Context::get('deleted')->next_url; |
| 265 | 265 | break; |
| 266 | 266 | default : |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | } |
| 270 | 270 | |
| 271 | 271 | // 다음 페이지가 있다면 다시 신디케이션 호출 |
| 272 | - if($next_url) |
|
| 272 | + if ($next_url) |
|
| 273 | 273 | { |
| 274 | 274 | $oSyndicationController = getController('syndication'); |
| 275 | 275 | $oSyndicationController->ping(Context::get('id'), Context::get('type'), ++$page); |
@@ -282,10 +282,10 @@ discard block |
||
| 282 | 282 | $channel_info->title = $this->handleLang($module_info->browser_title, $module_info->site_srl); |
| 283 | 283 | $channel_info->updated = date("Y-m-d\\TH:i:s").$time_zone; |
| 284 | 284 | $channel_info->self_href = $this->getSelfHref($channel_info->id, $type); |
| 285 | - $channel_info->site_url = getFullSiteUrl($this->uri_scheme . $this->site_url, ''); |
|
| 285 | + $channel_info->site_url = getFullSiteUrl($this->uri_scheme.$this->site_url, ''); |
|
| 286 | 286 | $channel_info->alternative_href = $this->getChannelAlternativeHref($module_info->module_srl); |
| 287 | 287 | $channel_info->summary = $module_info->description; |
| 288 | - if($module_info->module == "textyle") |
|
| 288 | + if ($module_info->module == "textyle") |
|
| 289 | 289 | { |
| 290 | 290 | $channel_info->type = "blog"; |
| 291 | 291 | $channel_info->rss_href = getFullSiteUrl($module_info->domain, '', 'mid', $module_info->mid, 'act', 'rss'); |
@@ -295,17 +295,17 @@ discard block |
||
| 295 | 295 | $channel_info->type = "web"; |
| 296 | 296 | } |
| 297 | 297 | $except_module_srls = $this->getExceptModuleSrls(); |
| 298 | - if($except_module_srls) |
|
| 298 | + if ($except_module_srls) |
|
| 299 | 299 | { |
| 300 | - $args->except_modules = implode(',',$except_module_srls); |
|
| 300 | + $args->except_modules = implode(',', $except_module_srls); |
|
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | $output = executeQuery('syndication.getSiteUpdatedTime', $args); |
| 304 | - if($output->data) $channel_info->updated = date("Y-m-d\\TH:i:s", ztime($output->data->last_update)).$time_zone; |
|
| 304 | + if ($output->data) $channel_info->updated = date("Y-m-d\\TH:i:s", ztime($output->data->last_update)).$time_zone; |
|
| 305 | 305 | Context::set('channel_info', $channel_info); |
| 306 | 306 | |
| 307 | 307 | $this->setTemplateFile('channel'); |
| 308 | - switch($type) { |
|
| 308 | + switch ($type) { |
|
| 309 | 309 | case 'article' : |
| 310 | 310 | Context::set('articles', $this->getArticles($module_srl, $page, $startTime, $endTime, 'article', $channel_info->id)); |
| 311 | 311 | break; |
@@ -323,29 +323,29 @@ discard block |
||
| 323 | 323 | $channel_info->id = $this->getID('channel', $module_info->module_srl); |
| 324 | 324 | $channel_info->title = $this->handleLang($module_info->browser_title, $module_info->site_srl); |
| 325 | 325 | $channel_info->site_title = $site_config->siteTitle; |
| 326 | - if(!$channel_info->site_title) { |
|
| 326 | + if (!$channel_info->site_title) { |
|
| 327 | 327 | $channel_info->site_title = $channel_info->title; |
| 328 | 328 | } |
| 329 | 329 | $channel_info->updated = date("Y-m-d\\TH:i:s").$time_zone; |
| 330 | 330 | $channel_info->self_href = $this->getSelfHref($channel_info->id, $type); |
| 331 | - $channel_info->site_url = getFullSiteUrl($this->uri_scheme . $this->site_url, ''); |
|
| 331 | + $channel_info->site_url = getFullSiteUrl($this->uri_scheme.$this->site_url, ''); |
|
| 332 | 332 | $channel_info->alternative_href = $this->getChannelAlternativeHref($module_info->module_srl); |
| 333 | 333 | $channel_info->webmaster_name = $member_config->webmaster_name; |
| 334 | 334 | $channel_info->webmaster_email = $member_config->webmaster_email; |
| 335 | 335 | |
| 336 | 336 | $except_module_srls = $this->getExceptModuleSrls(); |
| 337 | - if($except_module_srls) |
|
| 337 | + if ($except_module_srls) |
|
| 338 | 338 | { |
| 339 | - $args->except_modules = implode(',',$except_module_srls); |
|
| 339 | + $args->except_modules = implode(',', $except_module_srls); |
|
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 | $output = executeQuery('syndication.getSiteUpdatedTime', $args); |
| 343 | - if($output->data) $channel_info->updated = date("Y-m-d\\TH:i:s", ztime($output->data->last_update)).$time_zone; |
|
| 343 | + if ($output->data) $channel_info->updated = date("Y-m-d\\TH:i:s", ztime($output->data->last_update)).$time_zone; |
|
| 344 | 344 | Context::set('channel_info', $channel_info); |
| 345 | 345 | Context::set('member_config', $member_config); |
| 346 | 346 | |
| 347 | 347 | $this->setTemplateFile('channel'); |
| 348 | - switch($type) { |
|
| 348 | + switch ($type) { |
|
| 349 | 349 | case "article" : |
| 350 | 350 | $articles = new stdClass; |
| 351 | 351 | $articles->list = array($this->getArticle($document_srl)); |
@@ -371,15 +371,15 @@ discard block |
||
| 371 | 371 | |
| 372 | 372 | // @DEPRECATED |
| 373 | 373 | function getChannels() { |
| 374 | - if($module_srls) $args->module_srls = $module_srls; |
|
| 375 | - if(count($this->granted_modules)) $args->except_module_srls = implode(',',$this->granted_modules); |
|
| 374 | + if ($module_srls) $args->module_srls = $module_srls; |
|
| 375 | + if (count($this->granted_modules)) $args->except_module_srls = implode(',', $this->granted_modules); |
|
| 376 | 376 | $output = executeQueryArray('syndication.getModules', $args); |
| 377 | 377 | |
| 378 | - $time_zone = substr($GLOBALS['_time_zone'],0,3).':'.substr($GLOBALS['_time_zone'],3); |
|
| 378 | + $time_zone = substr($GLOBALS['_time_zone'], 0, 3).':'.substr($GLOBALS['_time_zone'], 3); |
|
| 379 | 379 | Context::set('time_zone', $time_zone); |
| 380 | 380 | |
| 381 | - if($output->data) { |
|
| 382 | - foreach($output->data as $module_info) { |
|
| 381 | + if ($output->data) { |
|
| 382 | + foreach ($output->data as $module_info) { |
|
| 383 | 383 | unset($obj); |
| 384 | 384 | $obj = new stdClass; |
| 385 | 385 | $obj->id = $this->getID('channel', $module_info->module_srl); |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | $obj->self_href = $this->getSelfHref($obj->id, 'channel'); |
| 389 | 389 | $obj->alternative_href = $this->getChannelAlternativeHref($module_info); |
| 390 | 390 | $obj->summary = $module_info->description; |
| 391 | - if($module_info->module == "textyle") |
|
| 391 | + if ($module_info->module == "textyle") |
|
| 392 | 392 | { |
| 393 | 393 | $obj->type = "blog"; |
| 394 | 394 | $obj->rss_href = getFullSiteUrl($module_info->domain, '', 'mid', $module_info->mid, 'act', 'rss'); |
@@ -405,15 +405,15 @@ discard block |
||
| 405 | 405 | } |
| 406 | 406 | |
| 407 | 407 | function getArticle($document_srl) { |
| 408 | - if($this->site_url==null) $this->init(); |
|
| 408 | + if ($this->site_url == null) $this->init(); |
|
| 409 | 409 | |
| 410 | 410 | $oDocumentModel = getModel('document'); |
| 411 | - $oDocument = $oDocumentModel->getDocument($document_srl,false,false); |
|
| 412 | - if(!$oDocument->isExists()) return; |
|
| 411 | + $oDocument = $oDocumentModel->getDocument($document_srl, false, false); |
|
| 412 | + if (!$oDocument->isExists()) return; |
|
| 413 | 413 | |
| 414 | 414 | $val = $oDocument->getObjectVars(); |
| 415 | 415 | |
| 416 | - $time_zone = substr($GLOBALS['_time_zone'],0,3).':'.substr($GLOBALS['_time_zone'],3); |
|
| 416 | + $time_zone = substr($GLOBALS['_time_zone'], 0, 3).':'.substr($GLOBALS['_time_zone'], 3); |
|
| 417 | 417 | Context::set('time_zone', $time_zone); |
| 418 | 418 | |
| 419 | 419 | $mdoule_info = self::$modules[$oDocument->get('module_srl')]; |
@@ -427,7 +427,7 @@ discard block |
||
| 427 | 427 | $article->nick_name = (!$oDocument->get('nick_name')) ? $oDocument->get('user_name') : $oDocument->get('nick_name'); |
| 428 | 428 | $article->title = $oDocument->getTitle(); |
| 429 | 429 | $article->content = $oDocument->get('content'); |
| 430 | - if($val->category_srl) { |
|
| 430 | + if ($val->category_srl) { |
|
| 431 | 431 | $category = $oDocumentModel->getCategory($val->category_srl); |
| 432 | 432 | $category_title = $category->title; |
| 433 | 433 | $article->category = new stdClass(); |
@@ -438,14 +438,14 @@ discard block |
||
| 438 | 438 | return $article; |
| 439 | 439 | } |
| 440 | 440 | |
| 441 | - function getArticles($module_srl = null, $page=1, $startTime = null, $endTime = null, $type = null, $id = null) { |
|
| 442 | - if($this->site_url==null) $this->init(); |
|
| 441 | + function getArticles($module_srl = null, $page = 1, $startTime = null, $endTime = null, $type = null, $id = null) { |
|
| 442 | + if ($this->site_url == null) $this->init(); |
|
| 443 | 443 | |
| 444 | 444 | $args = new stdClass; |
| 445 | - if($module_srl) $args->module_srl = $module_srl; |
|
| 446 | - if($startTime) $args->start_date = $this->getDate($startTime); |
|
| 447 | - if($endTime) $args->end_date = $this->getDate($endTime); |
|
| 448 | - if(count($this->granted_modules)) $args->except_module_srls = implode(',',$this->granted_modules); |
|
| 445 | + if ($module_srl) $args->module_srl = $module_srl; |
|
| 446 | + if ($startTime) $args->start_date = $this->getDate($startTime); |
|
| 447 | + if ($endTime) $args->end_date = $this->getDate($endTime); |
|
| 448 | + if (count($this->granted_modules)) $args->except_module_srls = implode(',', $this->granted_modules); |
|
| 449 | 449 | $args->page = $page; |
| 450 | 450 | $output = executeQueryArray('syndication.getDocumentList', $args); |
| 451 | 451 | $cur_page = $output->page_navigation->cur_page; |
@@ -455,23 +455,23 @@ discard block |
||
| 455 | 455 | $result->next_url = null; |
| 456 | 456 | $result->list = array(); |
| 457 | 457 | |
| 458 | - $time_zone = substr($GLOBALS['_time_zone'],0,3).':'.substr($GLOBALS['_time_zone'],3); |
|
| 458 | + $time_zone = substr($GLOBALS['_time_zone'], 0, 3).':'.substr($GLOBALS['_time_zone'], 3); |
|
| 459 | 459 | Context::set('time_zone', $time_zone); |
| 460 | 460 | |
| 461 | - if($cur_page<$total_page) { |
|
| 461 | + if ($cur_page < $total_page) { |
|
| 462 | 462 | $next_url = $this->getSelfHref($id, $type); |
| 463 | - if($startTime) $next_url .= '&startTime='.$startTime; |
|
| 464 | - if($endTime) $next_url .= '&endTime='.$endTime; |
|
| 465 | - $result->next_url = $next_url.'&page='.($cur_page+1); |
|
| 463 | + if ($startTime) $next_url .= '&startTime='.$startTime; |
|
| 464 | + if ($endTime) $next_url .= '&endTime='.$endTime; |
|
| 465 | + $result->next_url = $next_url.'&page='.($cur_page + 1); |
|
| 466 | 466 | } |
| 467 | 467 | |
| 468 | - if($output->data) { |
|
| 469 | - foreach($output->data as $key => $val) { |
|
| 468 | + if ($output->data) { |
|
| 469 | + foreach ($output->data as $key => $val) { |
|
| 470 | 470 | $article = new stdClass(); |
| 471 | 471 | $article->id = $this->getID('article', $val->module_srl.'-'.$val->document_srl); |
| 472 | 472 | $article->updated = date("Y-m-d\\TH:i:s", ztime($val->last_update)).$time_zone; |
| 473 | 473 | $article->published = date("Y-m-d\\TH:i:s", ztime($val->regdate)).$time_zone; |
| 474 | - $article->alternative_href = getFullSiteUrl($this->uri_scheme . $this->site_url, '', 'document_srl', $val->document_srl); |
|
| 474 | + $article->alternative_href = getFullSiteUrl($this->uri_scheme.$this->site_url, '', 'document_srl', $val->document_srl); |
|
| 475 | 475 | $article->channel_alternative_href = $this->getChannelAlternativeHref($val->module_srl); |
| 476 | 476 | $article->nick_name = (!$val->nick_name) ? $val->user_name : $val->nick_name; |
| 477 | 477 | $article->content = $val->content; |
@@ -482,12 +482,12 @@ discard block |
||
| 482 | 482 | } |
| 483 | 483 | |
| 484 | 484 | function getDeleted($module_srl = null, $page = 1, $startTime = null, $endTime = null, $type = null, $id = null) { |
| 485 | - if($this->site_url==null) $this->init(); |
|
| 485 | + if ($this->site_url == null) $this->init(); |
|
| 486 | 486 | |
| 487 | 487 | $args = new stdClass; |
| 488 | - if($module_srl) $args->module_srl= $module_srl; |
|
| 489 | - if($startTime) $args->start_date = $this->getDate($startTime); |
|
| 490 | - if($endTime) $args->end_date = $this->getDate($endTime); |
|
| 488 | + if ($module_srl) $args->module_srl = $module_srl; |
|
| 489 | + if ($startTime) $args->start_date = $this->getDate($startTime); |
|
| 490 | + if ($endTime) $args->end_date = $this->getDate($endTime); |
|
| 491 | 491 | $args->page = $page; |
| 492 | 492 | |
| 493 | 493 | $output = executeQueryArray('syndication.getDeletedList', $args); |
@@ -499,21 +499,21 @@ discard block |
||
| 499 | 499 | $result->next_url = null; |
| 500 | 500 | $result->list = array(); |
| 501 | 501 | |
| 502 | - $time_zone = substr($GLOBALS['_time_zone'],0,3).':'.substr($GLOBALS['_time_zone'],3); |
|
| 502 | + $time_zone = substr($GLOBALS['_time_zone'], 0, 3).':'.substr($GLOBALS['_time_zone'], 3); |
|
| 503 | 503 | Context::set('time_zone', $time_zone); |
| 504 | 504 | |
| 505 | - if($cur_page<$total_page) { |
|
| 505 | + if ($cur_page < $total_page) { |
|
| 506 | 506 | $next_url = $this->getSelfHref($id, $type); |
| 507 | - if($startTime) $next_url .= '&startTime='.$startTime; |
|
| 508 | - if($endTime) $next_url .= '&endTime='.$endTime; |
|
| 509 | - $result->next_url = $next_url . '&page='.($cur_page+1); |
|
| 507 | + if ($startTime) $next_url .= '&startTime='.$startTime; |
|
| 508 | + if ($endTime) $next_url .= '&endTime='.$endTime; |
|
| 509 | + $result->next_url = $next_url.'&page='.($cur_page + 1); |
|
| 510 | 510 | } |
| 511 | 511 | |
| 512 | - if($output->data) { |
|
| 513 | - foreach($output->data as $key => $val) { |
|
| 512 | + if ($output->data) { |
|
| 513 | + foreach ($output->data as $key => $val) { |
|
| 514 | 514 | $val->id = $this->getID('article', $val->module_srl.'-'.$val->document_srl); |
| 515 | 515 | $val->deleted = date("Y-m-d\\TH:i:s", ztime($val->regdate)).$time_zone; |
| 516 | - $val->alternative_href = getFullSiteUrl($this->uri_scheme . $this->site_url, '', 'document_srl', $val->document_srl); |
|
| 516 | + $val->alternative_href = getFullSiteUrl($this->uri_scheme.$this->site_url, '', 'document_srl', $val->document_srl); |
|
| 517 | 517 | $val->channel_id = $this->getID('channel', $val->module_srl.'-'.$val->document_srl); |
| 518 | 518 | $output->data[$key] = $val; |
| 519 | 519 | } |
@@ -530,25 +530,25 @@ discard block |
||
| 530 | 530 | $args->document_srl = $document_srl; |
| 531 | 531 | $output = executeQueryArray('syndication.getDeletedList', $args); |
| 532 | 532 | |
| 533 | - $time_zone = substr($GLOBALS['_time_zone'],0,3).':'.substr($GLOBALS['_time_zone'],3); |
|
| 533 | + $time_zone = substr($GLOBALS['_time_zone'], 0, 3).':'.substr($GLOBALS['_time_zone'], 3); |
|
| 534 | 534 | Context::set('time_zone', $time_zone); |
| 535 | 535 | |
| 536 | - foreach($output->data as $key => $val) |
|
| 536 | + foreach ($output->data as $key => $val) |
|
| 537 | 537 | { |
| 538 | 538 | $module_srl = $val->module_srl; |
| 539 | 539 | |
| 540 | - if(!isset($module_info[$module_srl])) |
|
| 540 | + if (!isset($module_info[$module_srl])) |
|
| 541 | 541 | { |
| 542 | 542 | $args = new stdClass; |
| 543 | 543 | $args->module_srl = $module_srl; |
| 544 | 544 | $module_output = executeQuery('syndication.getModuleSiteInfo', $args); |
| 545 | - if($module_output->data) $module_info[$module_srl] = $module_output->data; |
|
| 545 | + if ($module_output->data) $module_info[$module_srl] = $module_output->data; |
|
| 546 | 546 | else $module_info[$module_srl] = null; |
| 547 | 547 | } |
| 548 | 548 | |
| 549 | 549 | $val->id = $this->getID('article', $val->module_srl.'-'.$val->document_srl); |
| 550 | 550 | $val->deleted = date("Y-m-d\\TH:i:s", ztime($val->regdate)).$time_zone; |
| 551 | - $val->alternative_href = getFullSiteUrl($this->uri_scheme . $this->site_url, '', 'mid', $module_info[$module_srl]->mid, 'document_srl', $val->document_srl); |
|
| 551 | + $val->alternative_href = getFullSiteUrl($this->uri_scheme.$this->site_url, '', 'mid', $module_info[$module_srl]->mid, 'document_srl', $val->document_srl); |
|
| 552 | 552 | $val->channel_id = $this->getID('channel', $val->module_srl.'-'.$val->document_srl); |
| 553 | 553 | $output->data[$key] = $val; |
| 554 | 554 | } |
@@ -557,42 +557,42 @@ discard block |
||
| 557 | 557 | } |
| 558 | 558 | |
| 559 | 559 | function getID($type, $target_id = null) { |
| 560 | - if($this->site_url==null) $this->init(); |
|
| 560 | + if ($this->site_url == null) $this->init(); |
|
| 561 | 561 | |
| 562 | - return sprintf('tag:%s,%d:%s', $this->site_url, $this->year, $type) . ($target_id?':'.$target_id:''); |
|
| 562 | + return sprintf('tag:%s,%d:%s', $this->site_url, $this->year, $type).($target_id ? ':'.$target_id : ''); |
|
| 563 | 563 | } |
| 564 | 564 | |
| 565 | 565 | function getChannelAlternativeHref($module_srl) { |
| 566 | 566 | static $module_info = array(); |
| 567 | - if(!isset($module_info[$module_srl])) { |
|
| 567 | + if (!isset($module_info[$module_srl])) { |
|
| 568 | 568 | $args = new stdClass; |
| 569 | 569 | $args->module_srl = $module_srl; |
| 570 | 570 | $output = executeQuery('syndication.getModuleSiteInfo', $args); |
| 571 | - if($output->data) $module_info[$module_srl] = $output->data; |
|
| 571 | + if ($output->data) $module_info[$module_srl] = $output->data; |
|
| 572 | 572 | else $module_info[$module_srl] = null; |
| 573 | 573 | } |
| 574 | 574 | |
| 575 | - if(is_null($module_info[$module_srl])) return $this->site_url; |
|
| 575 | + if (is_null($module_info[$module_srl])) return $this->site_url; |
|
| 576 | 576 | |
| 577 | 577 | $domain = $module_info[$module_srl]->domain; |
| 578 | 578 | $url = getFullSiteUrl($domain, '', 'mid', $module_info[$module_srl]->mid); |
| 579 | - if(substr($url,0,1)=='/') $domain = $this->uri_scheme . $this->site_url . $url; |
|
| 579 | + if (substr($url, 0, 1) == '/') $domain = $this->uri_scheme.$this->site_url.$url; |
|
| 580 | 580 | return $url; |
| 581 | 581 | } |
| 582 | 582 | |
| 583 | 583 | function getSelfHref($id, $type = null) { |
| 584 | - if($this->site_url==null) $this->init(); |
|
| 584 | + if ($this->site_url == null) $this->init(); |
|
| 585 | 585 | |
| 586 | - return sprintf('%s/?module=syndication&act=getSyndicationList&id=%s&type=%s&syndication_password=%s', $this->uri_scheme . $this->site_url, $id, $type, $this->syndication_password); |
|
| 586 | + return sprintf('%s/?module=syndication&act=getSyndicationList&id=%s&type=%s&syndication_password=%s', $this->uri_scheme.$this->site_url, $id, $type, $this->syndication_password); |
|
| 587 | 587 | } |
| 588 | 588 | |
| 589 | 589 | /** |
| 590 | 590 | * 문서의 고유 URL 반환 |
| 591 | 591 | */ |
| 592 | 592 | function getAlternativeHref($document_srl, $module_srl) { |
| 593 | - if($this->site_url==null) $this->init(); |
|
| 593 | + if ($this->site_url == null) $this->init(); |
|
| 594 | 594 | |
| 595 | - if(!self::$modules[$module_srl]) { |
|
| 595 | + if (!self::$modules[$module_srl]) { |
|
| 596 | 596 | $args = new stdClass; |
| 597 | 597 | $args->module_srls = $module_srl; |
| 598 | 598 | $output = executeQuery('syndication.getModules', $args); |
@@ -604,20 +604,20 @@ discard block |
||
| 604 | 604 | |
| 605 | 605 | $domain = $module_info->domain; |
| 606 | 606 | $url = getFullSiteUrl($domain, '', 'mid', $module_info->mid, 'document_srl', $document_srl); |
| 607 | - if(substr($url,0,1)=='/') $domain = $this->uri_scheme . $this->site_url.$url; |
|
| 607 | + if (substr($url, 0, 1) == '/') $domain = $this->uri_scheme.$this->site_url.$url; |
|
| 608 | 608 | return $url; |
| 609 | 609 | } |
| 610 | 610 | |
| 611 | 611 | function getDate($date) { |
| 612 | 612 | $time = strtotime($date); |
| 613 | - if($time == -1) $time = ztime(str_replace(array('-','T',':'),'',$date)); |
|
| 613 | + if ($time == -1) $time = ztime(str_replace(array('-', 'T', ':'), '', $date)); |
|
| 614 | 614 | return date('YmdHis', $time); |
| 615 | 615 | } |
| 616 | 616 | |
| 617 | 617 | function getResentPingLogPath() |
| 618 | 618 | { |
| 619 | 619 | $target_filename = _XE_PATH_.'files/cache/tmp/syndication_ping_log'; |
| 620 | - if(!file_exists($target_filename)) |
|
| 620 | + if (!file_exists($target_filename)) |
|
| 621 | 621 | { |
| 622 | 622 | FileHandler::writeFile($target_filename, ''); |
| 623 | 623 | } |
@@ -633,7 +633,7 @@ discard block |
||
| 633 | 633 | $args->message = urlencode($msg); |
| 634 | 634 | |
| 635 | 635 | $list = $this->getResentPingLog(); |
| 636 | - if(count($list)>=10) |
|
| 636 | + if (count($list) >= 10) |
|
| 637 | 637 | { |
| 638 | 638 | array_pop($list); |
| 639 | 639 | } |
@@ -648,7 +648,7 @@ discard block |
||
| 648 | 648 | $file_path = $this->getResentPingLogPath(); |
| 649 | 649 | $str = FileHandler::readFile($file_path); |
| 650 | 650 | $list = array(); |
| 651 | - if($str) |
|
| 651 | + if ($str) |
|
| 652 | 652 | { |
| 653 | 653 | $list = unserialize($str); |
| 654 | 654 | } |
@@ -20,7 +20,9 @@ discard block |
||
| 20 | 20 | function init() { |
| 21 | 21 | $oModuleModel = getModel('module'); |
| 22 | 22 | $config = $oModuleModel->getModuleConfig('syndication'); |
| 23 | - if(Context::getSslStatus() == 'always') $this->uri_scheme = 'https://'; |
|
| 23 | + if(Context::getSslStatus() == 'always') { |
|
| 24 | + $this->uri_scheme = 'https://'; |
|
| 25 | + } |
|
| 24 | 26 | |
| 25 | 27 | $this->site_url = preg_replace('/\/+$/is', '', $config->site_url); |
| 26 | 28 | $this->syndication_password = $config->syndication_password; |
@@ -41,10 +43,14 @@ discard block |
||
| 41 | 43 | $args->module_srl = $module_srl; |
| 42 | 44 | |
| 43 | 45 | $output = executeQuery('syndication.getExceptModule', $args); |
| 44 | - if($output->data->count) return TRUE; |
|
| 46 | + if($output->data->count) { |
|
| 47 | + return TRUE; |
|
| 48 | + } |
|
| 45 | 49 | |
| 46 | 50 | $output = executeQuery('syndication.getGrantedModule', $args); |
| 47 | - if($output->data->count) return TRUE; |
|
| 51 | + if($output->data->count) { |
|
| 52 | + return TRUE; |
|
| 53 | + } |
|
| 48 | 54 | |
| 49 | 55 | return FALSE; |
| 50 | 56 | } |
@@ -72,7 +78,9 @@ discard block |
||
| 72 | 78 | $args->site_srl = $site_srl; |
| 73 | 79 | $args->lang_code = Context::getLangType(); |
| 74 | 80 | $output = executeQueryArray("syndication.getLang", $args); |
| 75 | - if(!$output->toBool() || !$output->data) return $key; |
|
| 81 | + if(!$output->toBool() || !$output->data) { |
|
| 82 | + return $key; |
|
| 83 | + } |
|
| 76 | 84 | |
| 77 | 85 | foreach($output->data as $value) |
| 78 | 86 | { |
@@ -82,8 +90,9 @@ discard block |
||
| 82 | 90 | if($this->langs[$site_srl][$key]) |
| 83 | 91 | { |
| 84 | 92 | return $this->langs[$site_srl][$key]; |
| 93 | + } else { |
|
| 94 | + return $key; |
|
| 85 | 95 | } |
| 86 | - else return $key; |
|
| 87 | 96 | } |
| 88 | 97 | |
| 89 | 98 | function handleLang($title, $site_srl) |
@@ -92,8 +101,7 @@ discard block |
||
| 92 | 101 | if(!preg_match("/\\\$user_lang->(.+)/", $title, $matches)) |
| 93 | 102 | { |
| 94 | 103 | return $title; |
| 95 | - } |
|
| 96 | - else |
|
| 104 | + } else |
|
| 97 | 105 | { |
| 98 | 106 | return $this->getLang($matches[1], $site_srl); |
| 99 | 107 | } |
@@ -148,8 +156,7 @@ discard block |
||
| 148 | 156 | if($id && strpos($id,'-')!==false) |
| 149 | 157 | { |
| 150 | 158 | list($module_srl, $document_srl) = explode('-', $id); |
| 151 | - } |
|
| 152 | - elseif($id) |
|
| 159 | + } elseif($id) |
|
| 153 | 160 | { |
| 154 | 161 | $module_srl = $id; |
| 155 | 162 | } |
@@ -188,8 +195,7 @@ discard block |
||
| 188 | 195 | { |
| 189 | 196 | $error = 'target is not founded'; |
| 190 | 197 | } |
| 191 | - } |
|
| 192 | - else |
|
| 198 | + } else |
|
| 193 | 199 | { |
| 194 | 200 | $error = 'target is not founded'; |
| 195 | 201 | } |
@@ -225,8 +231,7 @@ discard block |
||
| 225 | 231 | { |
| 226 | 232 | $site_info->title = $site_info->site_title; |
| 227 | 233 | } |
| 228 | - } |
|
| 229 | - else |
|
| 234 | + } else |
|
| 230 | 235 | { |
| 231 | 236 | $except_module_output = executeQueryArray('syndication.getExceptModuleSrls'); |
| 232 | 237 | if(is_array($except_module_output->data)) |
@@ -289,8 +294,7 @@ discard block |
||
| 289 | 294 | { |
| 290 | 295 | $channel_info->type = "blog"; |
| 291 | 296 | $channel_info->rss_href = getFullSiteUrl($module_info->domain, '', 'mid', $module_info->mid, 'act', 'rss'); |
| 292 | - } |
|
| 293 | - else |
|
| 297 | + } else |
|
| 294 | 298 | { |
| 295 | 299 | $channel_info->type = "web"; |
| 296 | 300 | } |
@@ -301,7 +305,9 @@ discard block |
||
| 301 | 305 | } |
| 302 | 306 | |
| 303 | 307 | $output = executeQuery('syndication.getSiteUpdatedTime', $args); |
| 304 | - if($output->data) $channel_info->updated = date("Y-m-d\\TH:i:s", ztime($output->data->last_update)).$time_zone; |
|
| 308 | + if($output->data) { |
|
| 309 | + $channel_info->updated = date("Y-m-d\\TH:i:s", ztime($output->data->last_update)).$time_zone; |
|
| 310 | + } |
|
| 305 | 311 | Context::set('channel_info', $channel_info); |
| 306 | 312 | |
| 307 | 313 | $this->setTemplateFile('channel'); |
@@ -340,7 +346,9 @@ discard block |
||
| 340 | 346 | } |
| 341 | 347 | |
| 342 | 348 | $output = executeQuery('syndication.getSiteUpdatedTime', $args); |
| 343 | - if($output->data) $channel_info->updated = date("Y-m-d\\TH:i:s", ztime($output->data->last_update)).$time_zone; |
|
| 349 | + if($output->data) { |
|
| 350 | + $channel_info->updated = date("Y-m-d\\TH:i:s", ztime($output->data->last_update)).$time_zone; |
|
| 351 | + } |
|
| 344 | 352 | Context::set('channel_info', $channel_info); |
| 345 | 353 | Context::set('member_config', $member_config); |
| 346 | 354 | |
@@ -371,8 +379,12 @@ discard block |
||
| 371 | 379 | |
| 372 | 380 | // @DEPRECATED |
| 373 | 381 | function getChannels() { |
| 374 | - if($module_srls) $args->module_srls = $module_srls; |
|
| 375 | - if(count($this->granted_modules)) $args->except_module_srls = implode(',',$this->granted_modules); |
|
| 382 | + if($module_srls) { |
|
| 383 | + $args->module_srls = $module_srls; |
|
| 384 | + } |
|
| 385 | + if(count($this->granted_modules)) { |
|
| 386 | + $args->except_module_srls = implode(',',$this->granted_modules); |
|
| 387 | + } |
|
| 376 | 388 | $output = executeQueryArray('syndication.getModules', $args); |
| 377 | 389 | |
| 378 | 390 | $time_zone = substr($GLOBALS['_time_zone'],0,3).':'.substr($GLOBALS['_time_zone'],3); |
@@ -392,8 +404,7 @@ discard block |
||
| 392 | 404 | { |
| 393 | 405 | $obj->type = "blog"; |
| 394 | 406 | $obj->rss_href = getFullSiteUrl($module_info->domain, '', 'mid', $module_info->mid, 'act', 'rss'); |
| 395 | - } |
|
| 396 | - else |
|
| 407 | + } else |
|
| 397 | 408 | { |
| 398 | 409 | $obj->type = "web"; |
| 399 | 410 | } |
@@ -405,11 +416,15 @@ discard block |
||
| 405 | 416 | } |
| 406 | 417 | |
| 407 | 418 | function getArticle($document_srl) { |
| 408 | - if($this->site_url==null) $this->init(); |
|
| 419 | + if($this->site_url==null) { |
|
| 420 | + $this->init(); |
|
| 421 | + } |
|
| 409 | 422 | |
| 410 | 423 | $oDocumentModel = getModel('document'); |
| 411 | 424 | $oDocument = $oDocumentModel->getDocument($document_srl,false,false); |
| 412 | - if(!$oDocument->isExists()) return; |
|
| 425 | + if(!$oDocument->isExists()) { |
|
| 426 | + return; |
|
| 427 | + } |
|
| 413 | 428 | |
| 414 | 429 | $val = $oDocument->getObjectVars(); |
| 415 | 430 | |
@@ -439,13 +454,23 @@ discard block |
||
| 439 | 454 | } |
| 440 | 455 | |
| 441 | 456 | function getArticles($module_srl = null, $page=1, $startTime = null, $endTime = null, $type = null, $id = null) { |
| 442 | - if($this->site_url==null) $this->init(); |
|
| 457 | + if($this->site_url==null) { |
|
| 458 | + $this->init(); |
|
| 459 | + } |
|
| 443 | 460 | |
| 444 | 461 | $args = new stdClass; |
| 445 | - if($module_srl) $args->module_srl = $module_srl; |
|
| 446 | - if($startTime) $args->start_date = $this->getDate($startTime); |
|
| 447 | - if($endTime) $args->end_date = $this->getDate($endTime); |
|
| 448 | - if(count($this->granted_modules)) $args->except_module_srls = implode(',',$this->granted_modules); |
|
| 462 | + if($module_srl) { |
|
| 463 | + $args->module_srl = $module_srl; |
|
| 464 | + } |
|
| 465 | + if($startTime) { |
|
| 466 | + $args->start_date = $this->getDate($startTime); |
|
| 467 | + } |
|
| 468 | + if($endTime) { |
|
| 469 | + $args->end_date = $this->getDate($endTime); |
|
| 470 | + } |
|
| 471 | + if(count($this->granted_modules)) { |
|
| 472 | + $args->except_module_srls = implode(',',$this->granted_modules); |
|
| 473 | + } |
|
| 449 | 474 | $args->page = $page; |
| 450 | 475 | $output = executeQueryArray('syndication.getDocumentList', $args); |
| 451 | 476 | $cur_page = $output->page_navigation->cur_page; |
@@ -460,8 +485,12 @@ discard block |
||
| 460 | 485 | |
| 461 | 486 | if($cur_page<$total_page) { |
| 462 | 487 | $next_url = $this->getSelfHref($id, $type); |
| 463 | - if($startTime) $next_url .= '&startTime='.$startTime; |
|
| 464 | - if($endTime) $next_url .= '&endTime='.$endTime; |
|
| 488 | + if($startTime) { |
|
| 489 | + $next_url .= '&startTime='.$startTime; |
|
| 490 | + } |
|
| 491 | + if($endTime) { |
|
| 492 | + $next_url .= '&endTime='.$endTime; |
|
| 493 | + } |
|
| 465 | 494 | $result->next_url = $next_url.'&page='.($cur_page+1); |
| 466 | 495 | } |
| 467 | 496 | |
@@ -482,12 +511,20 @@ discard block |
||
| 482 | 511 | } |
| 483 | 512 | |
| 484 | 513 | function getDeleted($module_srl = null, $page = 1, $startTime = null, $endTime = null, $type = null, $id = null) { |
| 485 | - if($this->site_url==null) $this->init(); |
|
| 514 | + if($this->site_url==null) { |
|
| 515 | + $this->init(); |
|
| 516 | + } |
|
| 486 | 517 | |
| 487 | 518 | $args = new stdClass; |
| 488 | - if($module_srl) $args->module_srl= $module_srl; |
|
| 489 | - if($startTime) $args->start_date = $this->getDate($startTime); |
|
| 490 | - if($endTime) $args->end_date = $this->getDate($endTime); |
|
| 519 | + if($module_srl) { |
|
| 520 | + $args->module_srl= $module_srl; |
|
| 521 | + } |
|
| 522 | + if($startTime) { |
|
| 523 | + $args->start_date = $this->getDate($startTime); |
|
| 524 | + } |
|
| 525 | + if($endTime) { |
|
| 526 | + $args->end_date = $this->getDate($endTime); |
|
| 527 | + } |
|
| 491 | 528 | $args->page = $page; |
| 492 | 529 | |
| 493 | 530 | $output = executeQueryArray('syndication.getDeletedList', $args); |
@@ -504,8 +541,12 @@ discard block |
||
| 504 | 541 | |
| 505 | 542 | if($cur_page<$total_page) { |
| 506 | 543 | $next_url = $this->getSelfHref($id, $type); |
| 507 | - if($startTime) $next_url .= '&startTime='.$startTime; |
|
| 508 | - if($endTime) $next_url .= '&endTime='.$endTime; |
|
| 544 | + if($startTime) { |
|
| 545 | + $next_url .= '&startTime='.$startTime; |
|
| 546 | + } |
|
| 547 | + if($endTime) { |
|
| 548 | + $next_url .= '&endTime='.$endTime; |
|
| 549 | + } |
|
| 509 | 550 | $result->next_url = $next_url . '&page='.($cur_page+1); |
| 510 | 551 | } |
| 511 | 552 | |
@@ -542,8 +583,11 @@ discard block |
||
| 542 | 583 | $args = new stdClass; |
| 543 | 584 | $args->module_srl = $module_srl; |
| 544 | 585 | $module_output = executeQuery('syndication.getModuleSiteInfo', $args); |
| 545 | - if($module_output->data) $module_info[$module_srl] = $module_output->data; |
|
| 546 | - else $module_info[$module_srl] = null; |
|
| 586 | + if($module_output->data) { |
|
| 587 | + $module_info[$module_srl] = $module_output->data; |
|
| 588 | + } else { |
|
| 589 | + $module_info[$module_srl] = null; |
|
| 590 | + } |
|
| 547 | 591 | } |
| 548 | 592 | |
| 549 | 593 | $val->id = $this->getID('article', $val->module_srl.'-'.$val->document_srl); |
@@ -557,7 +601,9 @@ discard block |
||
| 557 | 601 | } |
| 558 | 602 | |
| 559 | 603 | function getID($type, $target_id = null) { |
| 560 | - if($this->site_url==null) $this->init(); |
|
| 604 | + if($this->site_url==null) { |
|
| 605 | + $this->init(); |
|
| 606 | + } |
|
| 561 | 607 | |
| 562 | 608 | return sprintf('tag:%s,%d:%s', $this->site_url, $this->year, $type) . ($target_id?':'.$target_id:''); |
| 563 | 609 | } |
@@ -568,20 +614,29 @@ discard block |
||
| 568 | 614 | $args = new stdClass; |
| 569 | 615 | $args->module_srl = $module_srl; |
| 570 | 616 | $output = executeQuery('syndication.getModuleSiteInfo', $args); |
| 571 | - if($output->data) $module_info[$module_srl] = $output->data; |
|
| 572 | - else $module_info[$module_srl] = null; |
|
| 617 | + if($output->data) { |
|
| 618 | + $module_info[$module_srl] = $output->data; |
|
| 619 | + } else { |
|
| 620 | + $module_info[$module_srl] = null; |
|
| 621 | + } |
|
| 573 | 622 | } |
| 574 | 623 | |
| 575 | - if(is_null($module_info[$module_srl])) return $this->site_url; |
|
| 624 | + if(is_null($module_info[$module_srl])) { |
|
| 625 | + return $this->site_url; |
|
| 626 | + } |
|
| 576 | 627 | |
| 577 | 628 | $domain = $module_info[$module_srl]->domain; |
| 578 | 629 | $url = getFullSiteUrl($domain, '', 'mid', $module_info[$module_srl]->mid); |
| 579 | - if(substr($url,0,1)=='/') $domain = $this->uri_scheme . $this->site_url . $url; |
|
| 630 | + if(substr($url,0,1)=='/') { |
|
| 631 | + $domain = $this->uri_scheme . $this->site_url . $url; |
|
| 632 | + } |
|
| 580 | 633 | return $url; |
| 581 | 634 | } |
| 582 | 635 | |
| 583 | 636 | function getSelfHref($id, $type = null) { |
| 584 | - if($this->site_url==null) $this->init(); |
|
| 637 | + if($this->site_url==null) { |
|
| 638 | + $this->init(); |
|
| 639 | + } |
|
| 585 | 640 | |
| 586 | 641 | return sprintf('%s/?module=syndication&act=getSyndicationList&id=%s&type=%s&syndication_password=%s', $this->uri_scheme . $this->site_url, $id, $type, $this->syndication_password); |
| 587 | 642 | } |
@@ -590,7 +645,9 @@ discard block |
||
| 590 | 645 | * 문서의 고유 URL 반환 |
| 591 | 646 | */ |
| 592 | 647 | function getAlternativeHref($document_srl, $module_srl) { |
| 593 | - if($this->site_url==null) $this->init(); |
|
| 648 | + if($this->site_url==null) { |
|
| 649 | + $this->init(); |
|
| 650 | + } |
|
| 594 | 651 | |
| 595 | 652 | if(!self::$modules[$module_srl]) { |
| 596 | 653 | $args = new stdClass; |
@@ -604,13 +661,17 @@ discard block |
||
| 604 | 661 | |
| 605 | 662 | $domain = $module_info->domain; |
| 606 | 663 | $url = getFullSiteUrl($domain, '', 'mid', $module_info->mid, 'document_srl', $document_srl); |
| 607 | - if(substr($url,0,1)=='/') $domain = $this->uri_scheme . $this->site_url.$url; |
|
| 664 | + if(substr($url,0,1)=='/') { |
|
| 665 | + $domain = $this->uri_scheme . $this->site_url.$url; |
|
| 666 | + } |
|
| 608 | 667 | return $url; |
| 609 | 668 | } |
| 610 | 669 | |
| 611 | 670 | function getDate($date) { |
| 612 | 671 | $time = strtotime($date); |
| 613 | - if($time == -1) $time = ztime(str_replace(array('-','T',':'),'',$date)); |
|
| 672 | + if($time == -1) { |
|
| 673 | + $time = ztime(str_replace(array('-','T',':'),'',$date)); |
|
| 674 | + } |
|
| 614 | 675 | return date('YmdHis', $time); |
| 615 | 676 | } |
| 616 | 677 | |
@@ -21,28 +21,28 @@ discard block |
||
| 21 | 21 | $oSyndicationModel = getModel('syndication'); |
| 22 | 22 | Context::set('ping_log', $oSyndicationModel->getResentPingLog()); |
| 23 | 23 | |
| 24 | - if(!$module_config->syndication_use) |
|
| 24 | + if (!$module_config->syndication_use) |
|
| 25 | 25 | { |
| 26 | 26 | $module_config->syndication_use = 'Y'; |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - if(!$module_config->site_url) |
|
| 29 | + if (!$module_config->site_url) |
|
| 30 | 30 | { |
| 31 | - $module_config->site_url = Context::getDefaultUrl()?Context::getDefaultUrl():getFullUrl(); |
|
| 31 | + $module_config->site_url = Context::getDefaultUrl() ?Context::getDefaultUrl() : getFullUrl(); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | - if(!$module_config->year) |
|
| 34 | + if (!$module_config->year) |
|
| 35 | 35 | { |
| 36 | 36 | $module_config->year = date("Y"); |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - if(!isset($module_config->syndication_password)) |
|
| 39 | + if (!isset($module_config->syndication_password)) |
|
| 40 | 40 | { |
| 41 | 41 | $module_config->syndication_password = uniqid(); |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | Context::set('syndication_use', $module_config->syndication_use); |
| 45 | - Context::set('site_url', preg_replace('/^(http|https):\/\//i','',$module_config->site_url)); |
|
| 45 | + Context::set('site_url', preg_replace('/^(http|https):\/\//i', '', $module_config->site_url)); |
|
| 46 | 46 | Context::set('year', $module_config->year); |
| 47 | 47 | Context::set('syndication_token', $module_config->syndication_token); |
| 48 | 48 | Context::set('syndication_password', $module_config->syndication_password); |
@@ -50,9 +50,9 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | $output = executeQueryArray('syndication.getExceptModules'); |
| 52 | 52 | $except_module_list = array(); |
| 53 | - if($output->data && count($output->data) > 0) |
|
| 53 | + if ($output->data && count($output->data) > 0) |
|
| 54 | 54 | { |
| 55 | - foreach($output->data as $item) |
|
| 55 | + foreach ($output->data as $item) |
|
| 56 | 56 | { |
| 57 | 57 | $except_module_list[] = $item; |
| 58 | 58 | } |
@@ -62,8 +62,8 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | //Security |
| 64 | 64 | $security = new Security(); |
| 65 | - $security->encodeHTML('services..service','except_module..ping'); |
|
| 66 | - $security->encodeHTML('except_module..mid','except_module..browser_title'); |
|
| 65 | + $security->encodeHTML('services..service', 'except_module..ping'); |
|
| 66 | + $security->encodeHTML('except_module..mid', 'except_module..browser_title'); |
|
| 67 | 67 | |
| 68 | 68 | $this->setTemplatePath($this->module_path.'tpl'); |
| 69 | 69 | $this->setTemplateFile('config'); |
@@ -21,36 +21,36 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | $config = new stdClass; |
| 23 | 23 | $config->syndication_use = Context::get('syndication_use'); |
| 24 | - $config->site_url = preg_replace('/\/+$/is','',Context::get('site_url')); |
|
| 24 | + $config->site_url = preg_replace('/\/+$/is', '', Context::get('site_url')); |
|
| 25 | 25 | $config->year = Context::get('year'); |
| 26 | 26 | $config->syndication_token = Context::get('syndication_token'); |
| 27 | 27 | $config->syndication_password = urlencode(Context::get('syndication_password')); |
| 28 | 28 | |
| 29 | - if(!$config->site_url) return $this->makeObject(-1,'msg_site_url_is_null'); |
|
| 30 | - if(!$config->syndication_token) return $this->makeObject(-1,'msg_syndication_token_is_null'); |
|
| 29 | + if (!$config->site_url) return $this->makeObject(-1, 'msg_site_url_is_null'); |
|
| 30 | + if (!$config->syndication_token) return $this->makeObject(-1, 'msg_syndication_token_is_null'); |
|
| 31 | 31 | |
| 32 | - $oModuleController->updateModuleConfig('syndication',$config); |
|
| 32 | + $oModuleController->updateModuleConfig('syndication', $config); |
|
| 33 | 33 | |
| 34 | 34 | $except_module = Context::get('except_module'); |
| 35 | 35 | $output = executeQuery('syndication.deleteExceptModules'); |
| 36 | - if(!$output->toBool()) return $output; |
|
| 36 | + if (!$output->toBool()) return $output; |
|
| 37 | 37 | |
| 38 | - if ($except_module){ |
|
| 39 | - $modules = explode(',',$except_module); |
|
| 40 | - for($i=0,$c=count($modules);$i<$c;$i++) { |
|
| 38 | + if ($except_module) { |
|
| 39 | + $modules = explode(',', $except_module); |
|
| 40 | + for ($i = 0, $c = count($modules); $i < $c; $i++) { |
|
| 41 | 41 | $args->module_srl = $modules[$i]; |
| 42 | - $output = executeQuery('syndication.insertExceptModule',$args); |
|
| 43 | - if(!$output->toBool()) return $output; |
|
| 42 | + $output = executeQuery('syndication.insertExceptModule', $args); |
|
| 43 | + if (!$output->toBool()) return $output; |
|
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - if(!$this->checkOpenSSLSupport()) |
|
| 47 | + if (!$this->checkOpenSSLSupport()) |
|
| 48 | 48 | { |
| 49 | 49 | return $this->makeObject(-1, 'msg_need_openssl_support'); |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | $this->setMessage('success_applied'); |
| 53 | - if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) { |
|
| 53 | + if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) { |
|
| 54 | 54 | $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispSyndicationAdminConfig'); |
| 55 | 55 | $this->setRedirectUrl($returnUrl); |
| 56 | 56 | return; |
@@ -62,18 +62,18 @@ discard block |
||
| 62 | 62 | $oModuleModel = getModel('module'); |
| 63 | 63 | |
| 64 | 64 | $oSyndicationController = getController('syndication'); |
| 65 | - $oSyndicationModel= getModel('syndication'); |
|
| 65 | + $oSyndicationModel = getModel('syndication'); |
|
| 66 | 66 | |
| 67 | 67 | $module_config = $oModuleModel->getModuleConfig('syndication'); |
| 68 | 68 | |
| 69 | 69 | $site_url = trim(Context::get('site_url')); |
| 70 | - if(!$module_config->site_url) return $this->makeObject(-1,'msg_site_url_is_null'); |
|
| 71 | - if(!$module_config->syndication_token) return $this->makeObject(-1,'msg_syndication_token_is_null'); |
|
| 70 | + if (!$module_config->site_url) return $this->makeObject(-1, 'msg_site_url_is_null'); |
|
| 71 | + if (!$module_config->syndication_token) return $this->makeObject(-1, 'msg_syndication_token_is_null'); |
|
| 72 | 72 | |
| 73 | 73 | $id = $oSyndicationModel->getID('site'); |
| 74 | 74 | |
| 75 | 75 | // site_url 정보와 token 정보를 이용해서 ping 전송 테스트 |
| 76 | - if($oSyndicationController->ping($id, 'site')===FALSE) |
|
| 76 | + if ($oSyndicationController->ping($id, 'site') === FALSE) |
|
| 77 | 77 | { |
| 78 | 78 | $this->setError(-1); |
| 79 | 79 | $this->setMessage($oSyndicationController->ping_message); |
@@ -26,21 +26,29 @@ discard block |
||
| 26 | 26 | $config->syndication_token = Context::get('syndication_token'); |
| 27 | 27 | $config->syndication_password = urlencode(Context::get('syndication_password')); |
| 28 | 28 | |
| 29 | - if(!$config->site_url) return $this->makeObject(-1,'msg_site_url_is_null'); |
|
| 30 | - if(!$config->syndication_token) return $this->makeObject(-1,'msg_syndication_token_is_null'); |
|
| 29 | + if(!$config->site_url) { |
|
| 30 | + return $this->makeObject(-1,'msg_site_url_is_null'); |
|
| 31 | + } |
|
| 32 | + if(!$config->syndication_token) { |
|
| 33 | + return $this->makeObject(-1,'msg_syndication_token_is_null'); |
|
| 34 | + } |
|
| 31 | 35 | |
| 32 | 36 | $oModuleController->updateModuleConfig('syndication',$config); |
| 33 | 37 | |
| 34 | 38 | $except_module = Context::get('except_module'); |
| 35 | 39 | $output = executeQuery('syndication.deleteExceptModules'); |
| 36 | - if(!$output->toBool()) return $output; |
|
| 40 | + if(!$output->toBool()) { |
|
| 41 | + return $output; |
|
| 42 | + } |
|
| 37 | 43 | |
| 38 | 44 | if ($except_module){ |
| 39 | 45 | $modules = explode(',',$except_module); |
| 40 | 46 | for($i=0,$c=count($modules);$i<$c;$i++) { |
| 41 | 47 | $args->module_srl = $modules[$i]; |
| 42 | 48 | $output = executeQuery('syndication.insertExceptModule',$args); |
| 43 | - if(!$output->toBool()) return $output; |
|
| 49 | + if(!$output->toBool()) { |
|
| 50 | + return $output; |
|
| 51 | + } |
|
| 44 | 52 | } |
| 45 | 53 | } |
| 46 | 54 | |
@@ -67,8 +75,12 @@ discard block |
||
| 67 | 75 | $module_config = $oModuleModel->getModuleConfig('syndication'); |
| 68 | 76 | |
| 69 | 77 | $site_url = trim(Context::get('site_url')); |
| 70 | - if(!$module_config->site_url) return $this->makeObject(-1,'msg_site_url_is_null'); |
|
| 71 | - if(!$module_config->syndication_token) return $this->makeObject(-1,'msg_syndication_token_is_null'); |
|
| 78 | + if(!$module_config->site_url) { |
|
| 79 | + return $this->makeObject(-1,'msg_site_url_is_null'); |
|
| 80 | + } |
|
| 81 | + if(!$module_config->syndication_token) { |
|
| 82 | + return $this->makeObject(-1,'msg_syndication_token_is_null'); |
|
| 83 | + } |
|
| 72 | 84 | |
| 73 | 85 | $id = $oSyndicationModel->getID('site'); |
| 74 | 86 | |
@@ -77,8 +89,7 @@ discard block |
||
| 77 | 89 | { |
| 78 | 90 | $this->setError(-1); |
| 79 | 91 | $this->setMessage($oSyndicationController->ping_message); |
| 80 | - } |
|
| 81 | - else |
|
| 92 | + } else |
|
| 82 | 93 | { |
| 83 | 94 | $this->setMessage('msg_success_ping_test'); |
| 84 | 95 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | if (Context::getResponseMethod() != 'HTML') return; |
| 45 | 45 | if (Context::get('module') == 'admin') return; |
| 46 | 46 | |
| 47 | - require_once(_XE_PATH_ . 'libs/idna_convert/idna_convert.class.php'); |
|
| 47 | + require_once(_XE_PATH_.'libs/idna_convert/idna_convert.class.php'); |
|
| 48 | 48 | |
| 49 | 49 | $oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE); |
| 50 | 50 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | $piece->image = array(); |
| 89 | 89 | $piece->author = null; |
| 90 | 90 | |
| 91 | - if(stristr($_SERVER['HTTP_USER_AGENT'], 'facebookexternalhit') != FALSE) { |
|
| 91 | + if (stristr($_SERVER['HTTP_USER_AGENT'], 'facebookexternalhit') != FALSE) { |
|
| 92 | 92 | $single_image = true; |
| 93 | 93 | } |
| 94 | 94 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | if ($is_article) { |
| 109 | 109 | if (!$oDocument->isSecret()) { |
| 110 | 110 | $piece->document_title = $oDocument->getTitleText(); |
| 111 | - $piece->url = getFullUrl('', 'mid', $current_module_info->mid, 'document_srl',$document_srl); |
|
| 111 | + $piece->url = getFullUrl('', 'mid', $current_module_info->mid, 'document_srl', $document_srl); |
|
| 112 | 112 | $piece->type = 'article'; |
| 113 | 113 | $piece->description = trim(str_replace(' ', ' ', $oDocument->getContentText(400))); |
| 114 | 114 | $piece->author = $oDocument->getNickName(); |
@@ -116,12 +116,12 @@ discard block |
||
| 116 | 116 | if (count($tags)) $piece->tags = $tags; |
| 117 | 117 | |
| 118 | 118 | $document_images = false; |
| 119 | - if($oCacheHandler->isSupport()) { |
|
| 120 | - $cache_key_document_images = 'seo:document_images:' . $document_srl; |
|
| 119 | + if ($oCacheHandler->isSupport()) { |
|
| 120 | + $cache_key_document_images = 'seo:document_images:'.$document_srl; |
|
| 121 | 121 | $document_images = $oCacheHandler->get($cache_key_document_images); |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | - if($document_images === false && $oDocument->hasUploadedFiles()) { |
|
| 124 | + if ($document_images === false && $oDocument->hasUploadedFiles()) { |
|
| 125 | 125 | $image_ext = array('bmp', 'gif', 'jpg', 'jpeg', 'png'); |
| 126 | 126 | $document_images = array(); |
| 127 | 127 | |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | if (!in_array(strtolower($ext), $image_ext)) continue; |
| 134 | 134 | list($width, $height) = @getimagesize($file->uploaded_filename); |
| 135 | - if($width < 100 && $height < 100) continue; |
|
| 135 | + if ($width < 100 && $height < 100) continue; |
|
| 136 | 136 | |
| 137 | 137 | $image = array( |
| 138 | 138 | 'filepath' => $file->uploaded_filename, |
@@ -140,35 +140,35 @@ discard block |
||
| 140 | 140 | 'height' => $height |
| 141 | 141 | ); |
| 142 | 142 | |
| 143 | - if($file->cover_image === 'Y') { |
|
| 143 | + if ($file->cover_image === 'Y') { |
|
| 144 | 144 | array_unshift($document_images, $image); |
| 145 | 145 | } else { |
| 146 | 146 | $document_images[] = $image; |
| 147 | 147 | } |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | - if($oCacheHandler->isSupport()) { |
|
| 150 | + if ($oCacheHandler->isSupport()) { |
|
| 151 | 151 | $oCacheHandler->put($cache_key_document_images, $document_images); |
| 152 | 152 | } |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | - if($document_images) $piece->image = $document_images; |
|
| 155 | + if ($document_images) $piece->image = $document_images; |
|
| 156 | 156 | } else { |
| 157 | 157 | $piece->url = getFullUrl('', 'mid', $current_module_info->mid); |
| 158 | 158 | } |
| 159 | 159 | } else { |
| 160 | 160 | if (!$is_index) { |
| 161 | 161 | $page = (Context::get('page') > 1) ? Context::get('page') : null; |
| 162 | - $piece->url = getNotEncodedFullUrl('mid', $current_module_info->mid, 'page',$page); |
|
| 162 | + $piece->url = getNotEncodedFullUrl('mid', $current_module_info->mid, 'page', $page); |
|
| 163 | 163 | } |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | $piece->title = $this->getBrowserTitle($piece->document_title); |
| 167 | 167 | |
| 168 | - if($oCacheHandler->isSupport()) { |
|
| 168 | + if ($oCacheHandler->isSupport()) { |
|
| 169 | 169 | $cache_key = 'seo:site_image'; |
| 170 | 170 | $site_image = $oCacheHandler->get($cache_key); |
| 171 | - if($site_image) { |
|
| 171 | + if ($site_image) { |
|
| 172 | 172 | $site_image['url'] = $config->site_image_url; |
| 173 | 173 | } |
| 174 | 174 | $piece->image[] = $site_image; |
@@ -185,8 +185,8 @@ discard block |
||
| 185 | 185 | $this->addMeta('og:site_name', $config->site_name); |
| 186 | 186 | $this->addMeta('og:title', $piece->title); |
| 187 | 187 | $this->addMeta('og:description', $piece->description); |
| 188 | - if($is_article) { |
|
| 189 | - if(Context::getLangType() !== $oDocument->getLangCode()) { |
|
| 188 | + if ($is_article) { |
|
| 189 | + if (Context::getLangType() !== $oDocument->getLangCode()) { |
|
| 190 | 190 | $this->addMeta('og:locale:alternate', $locales[$oDocument->getLangCode()]); |
| 191 | 191 | } |
| 192 | 192 | $this->addMeta('article:published_time', $oDocument->getRegdate('c')); |
@@ -197,15 +197,15 @@ discard block |
||
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | foreach ($piece->image as $img) { |
| 200 | - if(!$img['url']) { |
|
| 201 | - if(!$img['filepath']) continue; |
|
| 202 | - $img['url'] = $request_uri . $img['filepath']; |
|
| 200 | + if (!$img['url']) { |
|
| 201 | + if (!$img['filepath']) continue; |
|
| 202 | + $img['url'] = $request_uri.$img['filepath']; |
|
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | $this->addMeta('og:image', $img['url']); |
| 206 | 206 | $this->addMeta('og:image:width', $img['width']); |
| 207 | 207 | $this->addMeta('og:image:height', $img['height']); |
| 208 | - if($single_image) break; |
|
| 208 | + if ($single_image) break; |
|
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | $this->canonical_url = $piece->url; |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | function triggerAfterFileDeleteFile($data) |
| 219 | 219 | { |
| 220 | 220 | $document_srl = $data->upload_target_srl; |
| 221 | - if(!$document_srl) return $this->makeObject(); |
|
| 221 | + if (!$document_srl) return $this->makeObject(); |
|
| 222 | 222 | |
| 223 | 223 | $this->deleteCacheDocumentImages($document_srl); |
| 224 | 224 | } |
@@ -238,8 +238,8 @@ discard block |
||
| 238 | 238 | private function deleteCacheDocumentImages($document_srl) |
| 239 | 239 | { |
| 240 | 240 | $oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE); |
| 241 | - if($oCacheHandler->isSupport()) { |
|
| 242 | - $cache_key_document_images = 'seo:document_images:' . $document_srl; |
|
| 241 | + if ($oCacheHandler->isSupport()) { |
|
| 242 | + $cache_key_document_images = 'seo:document_images:'.$document_srl; |
|
| 243 | 243 | $oCacheHandler->delete($cache_key_document_images); |
| 244 | 244 | } |
| 245 | 245 | } |
@@ -4,10 +4,14 @@ discard block |
||
| 4 | 4 | function getBrowserTitle($document_title = null) |
| 5 | 5 | { |
| 6 | 6 | $site_module_info = Context::get('site_module_info'); |
| 7 | - if ($site_module_info->site_srl != 0) return Context::getBrowserTitle(); |
|
| 7 | + if ($site_module_info->site_srl != 0) { |
|
| 8 | + return Context::getBrowserTitle(); |
|
| 9 | + } |
|
| 8 | 10 | |
| 9 | 11 | $config = $this->getConfig(); |
| 10 | - if ($config->use_optimize_title != 'Y') return Context::getBrowserTitle(); |
|
| 12 | + if ($config->use_optimize_title != 'Y') { |
|
| 13 | + return Context::getBrowserTitle(); |
|
| 14 | + } |
|
| 11 | 15 | |
| 12 | 16 | $current_module_info = Context::get('current_module_info'); |
| 13 | 17 | $is_index = ($current_module_info->module_srl == $site_module_info->module_srl) ? true : false; |
@@ -16,7 +20,9 @@ discard block |
||
| 16 | 20 | $piece['[:site_name:]'] = $config->site_name; |
| 17 | 21 | $piece['[:site_slogan:]'] = $config->site_slogan; |
| 18 | 22 | $piece['[:module_title:]'] = $current_module_info->browser_title; |
| 19 | - if ($document_title) $piece['[:document_title:]'] = $document_title; |
|
| 23 | + if ($document_title) { |
|
| 24 | + $piece['[:document_title:]'] = $document_title; |
|
| 25 | + } |
|
| 20 | 26 | |
| 21 | 27 | if ($config->use_optimize_title == 'Y') { |
| 22 | 28 | $title = array(); |
@@ -27,7 +33,9 @@ discard block |
||
| 27 | 33 | } else { |
| 28 | 34 | if ($is_index) { |
| 29 | 35 | $title[] = $piece['[:site_name:]']; |
| 30 | - if ($piece['[:site_slogan:]']) $title[] = $piece['[:site_slogan:]']; |
|
| 36 | + if ($piece['[:site_slogan:]']) { |
|
| 37 | + $title[] = $piece['[:site_slogan:]']; |
|
| 38 | + } |
|
| 31 | 39 | } else { |
| 32 | 40 | $title[] = $piece['[:module_title:]']; |
| 33 | 41 | $title[] = $piece['[:site_name:]']; |
@@ -41,8 +49,12 @@ discard block |
||
| 41 | 49 | |
| 42 | 50 | function triggerBeforeDisplay(&$output_content) |
| 43 | 51 | { |
| 44 | - if (Context::getResponseMethod() != 'HTML') return; |
|
| 45 | - if (Context::get('module') == 'admin') return; |
|
| 52 | + if (Context::getResponseMethod() != 'HTML') { |
|
| 53 | + return; |
|
| 54 | + } |
|
| 55 | + if (Context::get('module') == 'admin') { |
|
| 56 | + return; |
|
| 57 | + } |
|
| 46 | 58 | |
| 47 | 59 | require_once(_XE_PATH_ . 'libs/idna_convert/idna_convert.class.php'); |
| 48 | 60 | |
@@ -113,7 +125,9 @@ discard block |
||
| 113 | 125 | $piece->description = trim(str_replace(' ', ' ', $oDocument->getContentText(400))); |
| 114 | 126 | $piece->author = $oDocument->getNickName(); |
| 115 | 127 | $tags = $oDocument->get('tag_list'); |
| 116 | - if (count($tags)) $piece->tags = $tags; |
|
| 128 | + if (count($tags)) { |
|
| 129 | + $piece->tags = $tags; |
|
| 130 | + } |
|
| 117 | 131 | |
| 118 | 132 | $document_images = false; |
| 119 | 133 | if($oCacheHandler->isSupport()) { |
@@ -126,13 +140,19 @@ discard block |
||
| 126 | 140 | $document_images = array(); |
| 127 | 141 | |
| 128 | 142 | foreach ($oDocument->getUploadedFiles() as $file) { |
| 129 | - if ($file->isvalid != 'Y') continue; |
|
| 143 | + if ($file->isvalid != 'Y') { |
|
| 144 | + continue; |
|
| 145 | + } |
|
| 130 | 146 | |
| 131 | 147 | $ext = array_pop(explode('.', $file->uploaded_filename)); |
| 132 | 148 | |
| 133 | - if (!in_array(strtolower($ext), $image_ext)) continue; |
|
| 149 | + if (!in_array(strtolower($ext), $image_ext)) { |
|
| 150 | + continue; |
|
| 151 | + } |
|
| 134 | 152 | list($width, $height) = @getimagesize($file->uploaded_filename); |
| 135 | - if($width < 100 && $height < 100) continue; |
|
| 153 | + if($width < 100 && $height < 100) { |
|
| 154 | + continue; |
|
| 155 | + } |
|
| 136 | 156 | |
| 137 | 157 | $image = array( |
| 138 | 158 | 'filepath' => $file->uploaded_filename, |
@@ -152,7 +172,9 @@ discard block |
||
| 152 | 172 | } |
| 153 | 173 | } |
| 154 | 174 | |
| 155 | - if($document_images) $piece->image = $document_images; |
|
| 175 | + if($document_images) { |
|
| 176 | + $piece->image = $document_images; |
|
| 177 | + } |
|
| 156 | 178 | } else { |
| 157 | 179 | $piece->url = getFullUrl('', 'mid', $current_module_info->mid); |
| 158 | 180 | } |
@@ -198,27 +220,35 @@ discard block |
||
| 198 | 220 | |
| 199 | 221 | foreach ($piece->image as $img) { |
| 200 | 222 | if(!$img['url']) { |
| 201 | - if(!$img['filepath']) continue; |
|
| 223 | + if(!$img['filepath']) { |
|
| 224 | + continue; |
|
| 225 | + } |
|
| 202 | 226 | $img['url'] = $request_uri . $img['filepath']; |
| 203 | 227 | } |
| 204 | 228 | |
| 205 | 229 | $this->addMeta('og:image', $img['url']); |
| 206 | 230 | $this->addMeta('og:image:width', $img['width']); |
| 207 | 231 | $this->addMeta('og:image:height', $img['height']); |
| 208 | - if($single_image) break; |
|
| 232 | + if($single_image) { |
|
| 233 | + break; |
|
| 234 | + } |
|
| 209 | 235 | } |
| 210 | 236 | |
| 211 | 237 | $this->canonical_url = $piece->url; |
| 212 | 238 | |
| 213 | 239 | $this->applySEO(); |
| 214 | 240 | |
| 215 | - if ($config->use_optimize_title == 'Y') Context::setBrowserTitle($piece->title); |
|
| 241 | + if ($config->use_optimize_title == 'Y') { |
|
| 242 | + Context::setBrowserTitle($piece->title); |
|
| 243 | + } |
|
| 216 | 244 | } |
| 217 | 245 | |
| 218 | 246 | function triggerAfterFileDeleteFile($data) |
| 219 | 247 | { |
| 220 | 248 | $document_srl = $data->upload_target_srl; |
| 221 | - if(!$document_srl) return $this->makeObject(); |
|
| 249 | + if(!$document_srl) { |
|
| 250 | + return $this->makeObject(); |
|
| 251 | + } |
|
| 222 | 252 | |
| 223 | 253 | $this->deleteCacheDocumentImages($document_srl); |
| 224 | 254 | } |
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | { |
| 4 | 4 | function init() |
| 5 | 5 | { |
| 6 | - $this->setTemplatePath($this->module_path . 'tpl'); |
|
| 6 | + $this->setTemplatePath($this->module_path.'tpl'); |
|
| 7 | 7 | $this->setTemplateFile(str_replace('dispSeo', '', $this->act)); |
| 8 | 8 | } |
| 9 | 9 | |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | function dispSeoAdminSetting() |
| 16 | 16 | { |
| 17 | 17 | $vars = Context::getRequestVars(); |
| 18 | - if(!$vars->setting_section) Context::set('setting_section', 'general'); |
|
| 18 | + if (!$vars->setting_section) Context::set('setting_section', 'general'); |
|
| 19 | 19 | |
| 20 | 20 | $config = $this->getConfig(); |
| 21 | 21 | |
@@ -15,7 +15,9 @@ |
||
| 15 | 15 | function dispSeoAdminSetting() |
| 16 | 16 | { |
| 17 | 17 | $vars = Context::getRequestVars(); |
| 18 | - if(!$vars->setting_section) Context::set('setting_section', 'general'); |
|
| 18 | + if(!$vars->setting_section) { |
|
| 19 | + Context::set('setting_section', 'general'); |
|
| 20 | + } |
|
| 19 | 21 | |
| 20 | 22 | $config = $this->getConfig(); |
| 21 | 23 | |
@@ -18,16 +18,16 @@ discard block |
||
| 18 | 18 | $config->site_keywords = $vars->site_keywords; |
| 19 | 19 | |
| 20 | 20 | if ($vars->site_image) { |
| 21 | - $path = _XE_PATH_ . 'files/attach/site_image/'; |
|
| 21 | + $path = _XE_PATH_.'files/attach/site_image/'; |
|
| 22 | 22 | $ext = strtolower(array_pop(explode('.', $vars->site_image['name']))); |
| 23 | 23 | $timestamp = time(); |
| 24 | 24 | $filename = "site_image.{$timestamp}.{$ext}"; |
| 25 | - FileHandler::copyFile($vars->site_image['tmp_name'], $path . $filename); |
|
| 25 | + FileHandler::copyFile($vars->site_image['tmp_name'], $path.$filename); |
|
| 26 | 26 | $config->site_image = $filename; |
| 27 | 27 | |
| 28 | 28 | $oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE); |
| 29 | - if($oCacheHandler->isSupport()) { |
|
| 30 | - list($width, $height) = @getimagesize($path . $filename); |
|
| 29 | + if ($oCacheHandler->isSupport()) { |
|
| 30 | + list($width, $height) = @getimagesize($path.$filename); |
|
| 31 | 31 | $site_image_dimension = array( |
| 32 | 32 | 'width' => $width, |
| 33 | 33 | 'height' => $height |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | |
| 59 | 59 | $oModuleController->updateModuleConfig('seo', $config); |
| 60 | 60 | |
| 61 | - if($config->enable === 'Y') { |
|
| 61 | + if ($config->enable === 'Y') { |
|
| 62 | 62 | $this->moduleUpdate(); |
| 63 | 63 | } else { |
| 64 | 64 | // Delete Triggers |
@@ -10,14 +10,14 @@ |
||
| 10 | 10 | { |
| 11 | 11 | function updateConfig($args) |
| 12 | 12 | { |
| 13 | - if(!$args || !is_object($args)) |
|
| 13 | + if (!$args || !is_object($args)) |
|
| 14 | 14 | { |
| 15 | 15 | $args = new stdClass(); |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | $oModuleController = getController('module'); |
| 19 | 19 | $output = $oModuleController->updateModuleConfig('krzip', $args); |
| 20 | - if($output->toBool()) |
|
| 20 | + if ($output->toBool()) |
|
| 21 | 21 | { |
| 22 | 22 | unset($this->module_config); |
| 23 | 23 | } |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | { |
| 11 | 11 | function init() |
| 12 | 12 | { |
| 13 | - $this->setTemplatePath($this->module_path . 'tpl'); |
|
| 13 | + $this->setTemplatePath($this->module_path.'tpl'); |
|
| 14 | 14 | $this->setTemplateFile(lcfirst(str_replace('dispKrzipAdmin', '', $this->act))); |
| 15 | 15 | } |
| 16 | 16 | |