@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | $args = new stdClass; |
23 | 23 | $args->poll_srl = $poll_srl; |
24 | 24 | |
25 | - if(Context::get('is_logged')) |
|
25 | + if (Context::get('is_logged')) |
|
26 | 26 | { |
27 | 27 | $logged_info = Context::get('logged_info'); |
28 | 28 | $args->member_srl = $logged_info->member_srl; |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | $args->ipaddress = $_SERVER['REMOTE_ADDR']; |
33 | 33 | } |
34 | 34 | $output = executeQuery('poll.getPollLog', $args); |
35 | - if($output->data->count) return true; |
|
35 | + if ($output->data->count) return true; |
|
36 | 36 | return false; |
37 | 37 | } |
38 | 38 | |
@@ -47,20 +47,20 @@ discard block |
||
47 | 47 | // Get the information related to the survey |
48 | 48 | $columnList = array('poll_count', 'stop_date'); |
49 | 49 | $output = executeQuery('poll.getPoll', $args, $columnList); |
50 | - if(!$output->data) return ''; |
|
50 | + if (!$output->data) return ''; |
|
51 | 51 | |
52 | 52 | $poll = new stdClass; |
53 | 53 | $poll->style = $style; |
54 | - $poll->poll_count = (int)$output->data->poll_count; |
|
54 | + $poll->poll_count = (int) $output->data->poll_count; |
|
55 | 55 | $poll->stop_date = $output->data->stop_date; |
56 | 56 | |
57 | 57 | $columnList = array('poll_index_srl', 'title', 'checkcount', 'poll_count'); |
58 | 58 | $output = executeQuery('poll.getPollTitle', $args, $columnList); |
59 | - if(!$output->data) return; |
|
60 | - if(!is_array($output->data)) $output->data = array($output->data); |
|
59 | + if (!$output->data) return; |
|
60 | + if (!is_array($output->data)) $output->data = array($output->data); |
|
61 | 61 | |
62 | 62 | $poll->poll = array(); |
63 | - foreach($output->data as $key => $val) |
|
63 | + foreach ($output->data as $key => $val) |
|
64 | 64 | { |
65 | 65 | $poll->poll[$val->poll_index_srl] = new stdClass; |
66 | 66 | $poll->poll[$val->poll_index_srl]->title = $val->title; |
@@ -69,16 +69,16 @@ discard block |
||
69 | 69 | } |
70 | 70 | |
71 | 71 | $output = executeQuery('poll.getPollItem', $args); |
72 | - foreach($output->data as $key => $val) |
|
72 | + foreach ($output->data as $key => $val) |
|
73 | 73 | { |
74 | 74 | $poll->poll[$val->poll_index_srl]->item[] = $val; |
75 | 75 | } |
76 | 76 | |
77 | 77 | $poll->poll_srl = $poll_srl; |
78 | 78 | // Only ongoing poll results |
79 | - if($poll->stop_date >= date("Ymd")) |
|
79 | + if ($poll->stop_date >= date("Ymd")) |
|
80 | 80 | { |
81 | - if($this->isPolled($poll_srl)) $tpl_file = "result"; |
|
81 | + if ($this->isPolled($poll_srl)) $tpl_file = "result"; |
|
82 | 82 | else $tpl_file = "form"; |
83 | 83 | } |
84 | 84 | else |
@@ -86,8 +86,8 @@ discard block |
||
86 | 86 | $tpl_file = "result"; |
87 | 87 | } |
88 | 88 | |
89 | - Context::set('poll',$poll); |
|
90 | - Context::set('skin',$skin); |
|
89 | + Context::set('poll', $poll); |
|
90 | + Context::set('skin', $skin); |
|
91 | 91 | // The skin for the default configurations, and the colorset configurations |
92 | 92 | $tpl_path = sprintf("%sskins/%s/", $this->module_path, $skin); |
93 | 93 | |
@@ -104,20 +104,20 @@ discard block |
||
104 | 104 | $args->poll_srl = $poll_srl; |
105 | 105 | // Get the information related to the survey |
106 | 106 | $output = executeQuery('poll.getPoll', $args); |
107 | - if(!$output->data) return ''; |
|
107 | + if (!$output->data) return ''; |
|
108 | 108 | |
109 | 109 | $poll = new stdClass; |
110 | 110 | $poll->style = $style; |
111 | - $poll->poll_count = (int)$output->data->poll_count; |
|
111 | + $poll->poll_count = (int) $output->data->poll_count; |
|
112 | 112 | $poll->stop_date = $output->data->stop_date; |
113 | 113 | |
114 | 114 | $columnList = array('poll_index_srl', 'title', 'checkcount', 'poll_count'); |
115 | 115 | $output = executeQuery('poll.getPollTitle', $args, $columnList); |
116 | - if(!$output->data) return; |
|
117 | - if(!is_array($output->data)) $output->data = array($output->data); |
|
116 | + if (!$output->data) return; |
|
117 | + if (!is_array($output->data)) $output->data = array($output->data); |
|
118 | 118 | |
119 | 119 | $poll->poll = array(); |
120 | - foreach($output->data as $key => $val) |
|
120 | + foreach ($output->data as $key => $val) |
|
121 | 121 | { |
122 | 122 | $poll->poll[$val->poll_index_srl] = new stdClass; |
123 | 123 | $poll->poll[$val->poll_index_srl]->title = $val->title; |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | } |
127 | 127 | |
128 | 128 | $output = executeQuery('poll.getPollItem', $args); |
129 | - foreach($output->data as $key => $val) |
|
129 | + foreach ($output->data as $key => $val) |
|
130 | 130 | { |
131 | 131 | $poll->poll[$val->poll_index_srl]->item[] = $val; |
132 | 132 | } |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | |
136 | 136 | $tpl_file = "result"; |
137 | 137 | |
138 | - Context::set('poll',$poll); |
|
138 | + Context::set('poll', $poll); |
|
139 | 139 | // The skin for the default configurations, and the colorset configurations |
140 | 140 | $tpl_path = sprintf("%sskins/%s/", $this->module_path, $skin); |
141 | 141 | |
@@ -152,13 +152,13 @@ discard block |
||
152 | 152 | $oModuleModel = getModel('module'); |
153 | 153 | $skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin); |
154 | 154 | |
155 | - for($i=0;$i<count($skin_info->colorset);$i++) |
|
155 | + for ($i = 0; $i < count($skin_info->colorset); $i++) |
|
156 | 156 | { |
157 | 157 | $colorset = sprintf('%s|@|%s', $skin_info->colorset[$i]->name, $skin_info->colorset[$i]->title); |
158 | 158 | $colorset_list[] = $colorset; |
159 | 159 | } |
160 | 160 | |
161 | - if(count($colorset_list)) $colorsets = implode("\n", $colorset_list); |
|
161 | + if (count($colorset_list)) $colorsets = implode("\n", $colorset_list); |
|
162 | 162 | $this->add('colorset_list', $colorsets); |
163 | 163 | } |
164 | 164 | } |
@@ -26,13 +26,14 @@ discard block |
||
26 | 26 | { |
27 | 27 | $logged_info = Context::get('logged_info'); |
28 | 28 | $args->member_srl = $logged_info->member_srl; |
29 | - } |
|
30 | - else |
|
29 | + } else |
|
31 | 30 | { |
32 | 31 | $args->ipaddress = $_SERVER['REMOTE_ADDR']; |
33 | 32 | } |
34 | 33 | $output = executeQuery('poll.getPollLog', $args); |
35 | - if($output->data->count) return true; |
|
34 | + if($output->data->count) { |
|
35 | + return true; |
|
36 | + } |
|
36 | 37 | return false; |
37 | 38 | } |
38 | 39 | |
@@ -47,7 +48,9 @@ discard block |
||
47 | 48 | // Get the information related to the survey |
48 | 49 | $columnList = array('poll_count', 'stop_date'); |
49 | 50 | $output = executeQuery('poll.getPoll', $args, $columnList); |
50 | - if(!$output->data) return ''; |
|
51 | + if(!$output->data) { |
|
52 | + return ''; |
|
53 | + } |
|
51 | 54 | |
52 | 55 | $poll = new stdClass; |
53 | 56 | $poll->style = $style; |
@@ -56,8 +59,12 @@ discard block |
||
56 | 59 | |
57 | 60 | $columnList = array('poll_index_srl', 'title', 'checkcount', 'poll_count'); |
58 | 61 | $output = executeQuery('poll.getPollTitle', $args, $columnList); |
59 | - if(!$output->data) return; |
|
60 | - if(!is_array($output->data)) $output->data = array($output->data); |
|
62 | + if(!$output->data) { |
|
63 | + return; |
|
64 | + } |
|
65 | + if(!is_array($output->data)) { |
|
66 | + $output->data = array($output->data); |
|
67 | + } |
|
61 | 68 | |
62 | 69 | $poll->poll = array(); |
63 | 70 | foreach($output->data as $key => $val) |
@@ -78,10 +85,12 @@ discard block |
||
78 | 85 | // Only ongoing poll results |
79 | 86 | if($poll->stop_date >= date("Ymd")) |
80 | 87 | { |
81 | - if($this->isPolled($poll_srl)) $tpl_file = "result"; |
|
82 | - else $tpl_file = "form"; |
|
83 | - } |
|
84 | - else |
|
88 | + if($this->isPolled($poll_srl)) { |
|
89 | + $tpl_file = "result"; |
|
90 | + } else { |
|
91 | + $tpl_file = "form"; |
|
92 | + } |
|
93 | + } else |
|
85 | 94 | { |
86 | 95 | $tpl_file = "result"; |
87 | 96 | } |
@@ -104,7 +113,9 @@ discard block |
||
104 | 113 | $args->poll_srl = $poll_srl; |
105 | 114 | // Get the information related to the survey |
106 | 115 | $output = executeQuery('poll.getPoll', $args); |
107 | - if(!$output->data) return ''; |
|
116 | + if(!$output->data) { |
|
117 | + return ''; |
|
118 | + } |
|
108 | 119 | |
109 | 120 | $poll = new stdClass; |
110 | 121 | $poll->style = $style; |
@@ -113,8 +124,12 @@ discard block |
||
113 | 124 | |
114 | 125 | $columnList = array('poll_index_srl', 'title', 'checkcount', 'poll_count'); |
115 | 126 | $output = executeQuery('poll.getPollTitle', $args, $columnList); |
116 | - if(!$output->data) return; |
|
117 | - if(!is_array($output->data)) $output->data = array($output->data); |
|
127 | + if(!$output->data) { |
|
128 | + return; |
|
129 | + } |
|
130 | + if(!is_array($output->data)) { |
|
131 | + $output->data = array($output->data); |
|
132 | + } |
|
118 | 133 | |
119 | 134 | $poll->poll = array(); |
120 | 135 | foreach($output->data as $key => $val) |
@@ -158,7 +173,9 @@ discard block |
||
158 | 173 | $colorset_list[] = $colorset; |
159 | 174 | } |
160 | 175 | |
161 | - if(count($colorset_list)) $colorsets = implode("\n", $colorset_list); |
|
176 | + if(count($colorset_list)) { |
|
177 | + $colorsets = implode("\n", $colorset_list); |
|
178 | + } |
|
162 | 179 | $this->add('colorset_list', $colorsets); |
163 | 180 | } |
164 | 181 | } |
@@ -44,9 +44,14 @@ discard block |
||
44 | 44 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); |
45 | 45 | $columnList = array('sites.domain'); |
46 | 46 | $site = $oModuleModel->getSiteInfo($module_info->site_srl, $columnList); |
47 | - if(!strpos($site->domain, '.')) $vid = $site->domain; |
|
48 | - else $site = null; |
|
49 | - if($site) $feed_config[$module_srl]['url'] = $oRssModel->getModuleFeedUrl($vid, $module_info->mid, 'rss'); |
|
47 | + if(!strpos($site->domain, '.')) { |
|
48 | + $vid = $site->domain; |
|
49 | + } else { |
|
50 | + $site = null; |
|
51 | + } |
|
52 | + if($site) { |
|
53 | + $feed_config[$module_srl]['url'] = $oRssModel->getModuleFeedUrl($vid, $module_info->mid, 'rss'); |
|
54 | + } |
|
50 | 55 | $feed_config[$module_srl]['mid'] = $module_info->mid; |
51 | 56 | $feed_config[$module_srl]['open_feed'] = $config->open_rss; |
52 | 57 | $feed_config[$module_srl]['open_total_feed'] = $config->open_total_feed; |
@@ -54,7 +59,9 @@ discard block |
||
54 | 59 | } |
55 | 60 | } |
56 | 61 | } |
57 | - if(!$total_config->feed_document_count) $total_config->feed_document_count = 15; |
|
62 | + if(!$total_config->feed_document_count) { |
|
63 | + $total_config->feed_document_count = 15; |
|
64 | + } |
|
58 | 65 | $total_config->url = $oRssModel->getModuleFeedUrl(NULL, '', 'rss', true); |
59 | 66 | |
60 | 67 | Context::set('feed_config', $feed_config); |
@@ -28,25 +28,25 @@ discard block |
||
28 | 28 | $oModuleModel = getModel('module'); |
29 | 29 | $rss_config = $oModuleModel->getModulePartConfigs('rss'); |
30 | 30 | $total_config = $oModuleModel->getModuleConfig('rss'); |
31 | - if(!$total_config) |
|
31 | + if (!$total_config) |
|
32 | 32 | { |
33 | 33 | $total_config = new stdClass(); |
34 | 34 | } |
35 | 35 | $oRssModel = getModel('rss'); |
36 | 36 | |
37 | - if($rss_config) |
|
37 | + if ($rss_config) |
|
38 | 38 | { |
39 | 39 | $feed_config = array(); |
40 | - foreach($rss_config as $module_srl => $config) |
|
40 | + foreach ($rss_config as $module_srl => $config) |
|
41 | 41 | { |
42 | - if($config) |
|
42 | + if ($config) |
|
43 | 43 | { |
44 | 44 | $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); |
45 | 45 | $columnList = array('sites.domain'); |
46 | 46 | $site = $oModuleModel->getSiteInfo($module_info->site_srl, $columnList); |
47 | - if(!strpos($site->domain, '.')) $vid = $site->domain; |
|
47 | + if (!strpos($site->domain, '.')) $vid = $site->domain; |
|
48 | 48 | else $site = null; |
49 | - if($site) $feed_config[$module_srl]['url'] = $oRssModel->getModuleFeedUrl($vid, $module_info->mid, 'rss'); |
|
49 | + if ($site) $feed_config[$module_srl]['url'] = $oRssModel->getModuleFeedUrl($vid, $module_info->mid, 'rss'); |
|
50 | 50 | $feed_config[$module_srl]['mid'] = $module_info->mid; |
51 | 51 | $feed_config[$module_srl]['open_feed'] = $config->open_rss; |
52 | 52 | $feed_config[$module_srl]['open_total_feed'] = $config->open_total_feed; |
@@ -54,14 +54,14 @@ discard block |
||
54 | 54 | } |
55 | 55 | } |
56 | 56 | } |
57 | - if(!$total_config->feed_document_count) $total_config->feed_document_count = 15; |
|
57 | + if (!$total_config->feed_document_count) $total_config->feed_document_count = 15; |
|
58 | 58 | $total_config->url = $oRssModel->getModuleFeedUrl(NULL, '', 'rss', true); |
59 | 59 | |
60 | 60 | Context::set('feed_config', $feed_config); |
61 | 61 | Context::set('total_config', $total_config); |
62 | 62 | |
63 | 63 | $security = new Security(); |
64 | - $security->encodeHTML('feed_config..mid','feed_config..url'); |
|
64 | + $security->encodeHTML('feed_config..mid', 'feed_config..url'); |
|
65 | 65 | $security->encodeHTML('total_config..'); |
66 | 66 | |
67 | 67 | $this->setTemplatePath($this->module_path.'tpl'); |
@@ -37,7 +37,9 @@ discard block |
||
37 | 37 | $current_module_srl = $current_module_info->module_srl; |
38 | 38 | } |
39 | 39 | |
40 | - if(!$current_module_srl) return new Object(); |
|
40 | + if(!$current_module_srl) { |
|
41 | + return new Object(); |
|
42 | + } |
|
41 | 43 | // Imported rss settings of the selected module |
42 | 44 | $oRssModel = getModel('rss'); |
43 | 45 | $rss_config = $oRssModel->getRssModuleConfig($current_module_srl); |
@@ -55,8 +57,7 @@ discard block |
||
55 | 57 | $request_uri = Context::getRequestUri(); |
56 | 58 | Context::set('general_rss_url', $request_uri.'rss'); |
57 | 59 | Context::set('general_atom_url', $request_uri.'atom'); |
58 | - } |
|
59 | - else |
|
60 | + } else |
|
60 | 61 | { |
61 | 62 | Context::set('general_rss_url', getUrl('','module','rss','act','rss')); |
62 | 63 | Context::set('general_atom_url', getUrl('','module','rss','act','atom')); |
@@ -28,29 +28,29 @@ discard block |
||
28 | 28 | $current_module_srl = Context::get('module_srl'); |
29 | 29 | $site_module_info = Context::get('site_module_info'); |
30 | 30 | |
31 | - if(is_array($current_module_srl)) |
|
31 | + if (is_array($current_module_srl)) |
|
32 | 32 | { |
33 | 33 | unset($current_module_srl); |
34 | 34 | } |
35 | - if(!$current_module_srl) { |
|
35 | + if (!$current_module_srl) { |
|
36 | 36 | $current_module_info = Context::get('current_module_info'); |
37 | 37 | $current_module_srl = $current_module_info->module_srl; |
38 | 38 | } |
39 | 39 | |
40 | - if(!$current_module_srl) return new Object(); |
|
40 | + if (!$current_module_srl) return new Object(); |
|
41 | 41 | // Imported rss settings of the selected module |
42 | 42 | $oRssModel = getModel('rss'); |
43 | 43 | $rss_config = $oRssModel->getRssModuleConfig($current_module_srl); |
44 | 44 | |
45 | - if($rss_config->open_rss != 'N') |
|
45 | + if ($rss_config->open_rss != 'N') |
|
46 | 46 | { |
47 | 47 | Context::set('rss_url', $oRssModel->getModuleFeedUrl(Context::get('vid'), Context::get('mid'), 'rss')); |
48 | 48 | Context::set('atom_url', $oRssModel->getModuleFeedUrl(Context::get('vid'), Context::get('mid'), 'atom')); |
49 | 49 | } |
50 | 50 | |
51 | - if(Context::isInstalled() && $site_module_info->mid == Context::get('mid') && $total_config->use_total_feed != 'N') |
|
51 | + if (Context::isInstalled() && $site_module_info->mid == Context::get('mid') && $total_config->use_total_feed != 'N') |
|
52 | 52 | { |
53 | - if(Context::isAllowRewrite() && !Context::get('vid')) |
|
53 | + if (Context::isAllowRewrite() && !Context::get('vid')) |
|
54 | 54 | { |
55 | 55 | $request_uri = Context::getRequestUri(); |
56 | 56 | Context::set('general_rss_url', $request_uri.'rss'); |
@@ -58,8 +58,8 @@ discard block |
||
58 | 58 | } |
59 | 59 | else |
60 | 60 | { |
61 | - Context::set('general_rss_url', getUrl('','module','rss','act','rss')); |
|
62 | - Context::set('general_atom_url', getUrl('','module','rss','act','atom')); |
|
61 | + Context::set('general_rss_url', getUrl('', 'module', 'rss', 'act', 'rss')); |
|
62 | + Context::set('general_atom_url', getUrl('', 'module', 'rss', 'act', 'atom')); |
|
63 | 63 | } |
64 | 64 | } |
65 | 65 | |
@@ -72,9 +72,9 @@ discard block |
||
72 | 72 | $rssConfig = $oModuleModel->getModulePartConfig('rss', $obj->originModuleSrl); |
73 | 73 | |
74 | 74 | $oModuleController = getController('module'); |
75 | - if(is_array($obj->moduleSrlList)) |
|
75 | + if (is_array($obj->moduleSrlList)) |
|
76 | 76 | { |
77 | - foreach($obj->moduleSrlList AS $key=>$moduleSrl) |
|
77 | + foreach ($obj->moduleSrlList AS $key=>$moduleSrl) |
|
78 | 78 | { |
79 | 79 | $oModuleController->insertModulePartConfig('rss', $moduleSrl, $rssConfig); |
80 | 80 | } |
@@ -18,13 +18,13 @@ discard block |
||
18 | 18 | */ |
19 | 19 | function getModuleFeedUrl($vid, $mid, $format = 'rss', $absolute_url = false) |
20 | 20 | { |
21 | - if($absolute_url) |
|
21 | + if ($absolute_url) |
|
22 | 22 | { |
23 | - return getFullUrl('','vid',$vid, 'mid',$mid, 'act',$format); |
|
23 | + return getFullUrl('', 'vid', $vid, 'mid', $mid, 'act', $format); |
|
24 | 24 | } |
25 | 25 | else |
26 | 26 | { |
27 | - return getUrl('','vid',$vid, 'mid',$mid, 'act',$format); |
|
27 | + return getUrl('', 'vid', $vid, 'mid', $mid, 'act', $format); |
|
28 | 28 | } |
29 | 29 | } |
30 | 30 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | // Get the configurations of the rss module |
40 | 40 | $oModuleModel = getModel('module'); |
41 | 41 | $module_rss_config = $oModuleModel->getModulePartConfig('rss', $module_srl); |
42 | - if(!$module_rss_config) |
|
42 | + if (!$module_rss_config) |
|
43 | 43 | { |
44 | 44 | $module_rss_config = new stdClass(); |
45 | 45 | $module_rss_config->open_rss = 'N'; |
@@ -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 | } |
@@ -53,8 +53,7 @@ discard block |
||
53 | 53 | $open_rss_config[$module_srl] = $config->open_rss; |
54 | 54 | } |
55 | 55 | // If mid is not selected, then get all |
56 | - } |
|
57 | - else |
|
56 | + } else |
|
58 | 57 | { |
59 | 58 | if($total_config->use_total_feed != 'N') |
60 | 59 | { |
@@ -73,7 +72,9 @@ discard block |
||
73 | 72 | } |
74 | 73 | } |
75 | 74 | |
76 | - if(!count($module_srls) && !$add_description) return $this->dispError(); |
|
75 | + if(!count($module_srls) && !$add_description) { |
|
76 | + return $this->dispError(); |
|
77 | + } |
|
77 | 78 | |
78 | 79 | $info = new stdClass; |
79 | 80 | $args = new stdClass; |
@@ -87,12 +88,24 @@ discard block |
||
87 | 88 | $args->search_keyword = 'N'; |
88 | 89 | $args->page = (int)Context::get('page'); |
89 | 90 | $args->list_count = 15; |
90 | - if($total_config->feed_document_count) $args->list_count = $total_config->feed_document_count; |
|
91 | - if(!$args->page || $args->page < 1) $args->page = 1; |
|
92 | - if($start_date || $start_date != 0) $args->start_date = $start_date; |
|
93 | - if($end_date || $end_date != 0) $args->end_date = $end_date; |
|
94 | - if($start_date == 0) unset($start_date); |
|
95 | - if($end_date == 0) unset($end_date); |
|
91 | + if($total_config->feed_document_count) { |
|
92 | + $args->list_count = $total_config->feed_document_count; |
|
93 | + } |
|
94 | + if(!$args->page || $args->page < 1) { |
|
95 | + $args->page = 1; |
|
96 | + } |
|
97 | + if($start_date || $start_date != 0) { |
|
98 | + $args->start_date = $start_date; |
|
99 | + } |
|
100 | + if($end_date || $end_date != 0) { |
|
101 | + $args->end_date = $end_date; |
|
102 | + } |
|
103 | + if($start_date == 0) { |
|
104 | + unset($start_date); |
|
105 | + } |
|
106 | + if($end_date == 0) { |
|
107 | + unset($end_date); |
|
108 | + } |
|
96 | 109 | |
97 | 110 | $args->sort_index = 'list_order'; |
98 | 111 | $args->order_type = 'asc'; |
@@ -108,8 +121,7 @@ discard block |
||
108 | 121 | if($config->feed_description) |
109 | 122 | { |
110 | 123 | $info->description = str_replace('\'', ''', htmlspecialchars($config->feed_description, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
111 | - } |
|
112 | - else |
|
124 | + } else |
|
113 | 125 | { |
114 | 126 | $info->description = str_replace('\'', ''', htmlspecialchars($this->module_info->description, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
115 | 127 | } |
@@ -125,9 +137,11 @@ discard block |
||
125 | 137 | |
126 | 138 | if(!$info->title) |
127 | 139 | { |
128 | - if($rss_title) $info->title = $rss_title; |
|
129 | - else if($total_config->feed_title) $info->title = $total_config->feed_title; |
|
130 | - else |
|
140 | + if($rss_title) { |
|
141 | + $info->title = $rss_title; |
|
142 | + } else if($total_config->feed_title) { |
|
143 | + $info->title = $total_config->feed_title; |
|
144 | + } else |
|
131 | 145 | { |
132 | 146 | $site_module_info = Context::get('site_module_info'); |
133 | 147 | $info->title = $site_module_info->browser_title; |
@@ -139,15 +153,18 @@ discard block |
||
139 | 153 | $info->link = Context::getRequestUri(); |
140 | 154 | $info->feed_copyright = str_replace('\'', ''', htmlspecialchars($total_config->feed_copyright, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
141 | 155 | } |
142 | - if($add_description) $info->description .= "\r\n".$add_description; |
|
156 | + if($add_description) { |
|
157 | + $info->description .= "\r\n".$add_description; |
|
158 | + } |
|
143 | 159 | |
144 | - if($total_config->image) $info->image = Context::getRequestUri().str_replace('\'', ''', htmlspecialchars($total_config->image, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
|
160 | + if($total_config->image) { |
|
161 | + $info->image = Context::getRequestUri().str_replace('\'', ''', htmlspecialchars($total_config->image, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
|
162 | + } |
|
145 | 163 | switch(Context::get('format')) |
146 | 164 | { |
147 | 165 | case 'atom': |
148 | 166 | $info->date = date('Y-m-d\TH:i:sP'); |
149 | - if($mid) { $info->id = getUrl('','mid',$mid,'act','atom','page',Context::get('page'),'start_date',Context::get('start_date'),'end_date',Context::get('end_date')); } |
|
150 | - else { $info->id = getUrl('','module','rss','act','atom','page',Context::get('page'),'start_date',Context::get('start_date'),'end_date',Context::get('end_date')); } |
|
167 | + if($mid) { $info->id = getUrl('','mid',$mid,'act','atom','page',Context::get('page'),'start_date',Context::get('start_date'),'end_date',Context::get('end_date')); } else { $info->id = getUrl('','module','rss','act','atom','page',Context::get('page'),'start_date',Context::get('start_date'),'end_date',Context::get('end_date')); } |
|
151 | 168 | break; |
152 | 169 | case 'rss1.0': |
153 | 170 | $info->date = date('Y-m-d\TH:i:sP'); |
@@ -157,8 +174,11 @@ discard block |
||
157 | 174 | break; |
158 | 175 | } |
159 | 176 | |
160 | - if($_SERVER['HTTPS']=='on') $proctcl = 'https://'; |
|
161 | - else $proctcl = 'http://'; |
|
177 | + if($_SERVER['HTTPS']=='on') { |
|
178 | + $proctcl = 'https://'; |
|
179 | + } else { |
|
180 | + $proctcl = 'http://'; |
|
181 | + } |
|
162 | 182 | |
163 | 183 | $temp_link = explode('/', $info->link); |
164 | 184 | if($temp_link[0]=='' && $info->link) |
@@ -248,7 +268,9 @@ discard block |
||
248 | 268 | // Get information of the selected module |
249 | 269 | $current_module_info = Context::get('current_module_info'); |
250 | 270 | $current_module_srl = $current_module_info->module_srl; |
251 | - if(!$current_module_srl) return new Object(); |
|
271 | + if(!$current_module_srl) { |
|
272 | + return new Object(); |
|
273 | + } |
|
252 | 274 | } |
253 | 275 | // Get teh RSS configurations for the selected module |
254 | 276 | $oRssModel = getModel('rss'); |
@@ -30,24 +30,24 @@ discard block |
||
30 | 30 | $oModuleModel = getModel('module'); |
31 | 31 | $oModuleController = getController('module'); |
32 | 32 | // Get the content and information for the current requested module if the method is not called from another module |
33 | - if(!$document_list) |
|
33 | + if (!$document_list) |
|
34 | 34 | { |
35 | 35 | $site_module_info = Context::get('site_module_info'); |
36 | 36 | $site_srl = $site_module_info->site_srl; |
37 | 37 | $mid = Context::getRequestVars()->mid; // The target module id, if absent, then all |
38 | - $start_date = (int)Context::get('start_date'); |
|
39 | - $end_date = (int)Context::get('end_date'); |
|
38 | + $start_date = (int) Context::get('start_date'); |
|
39 | + $end_date = (int) Context::get('end_date'); |
|
40 | 40 | |
41 | 41 | $module_srls = array(); |
42 | 42 | $rss_config = array(); |
43 | 43 | $total_config = ''; |
44 | 44 | $total_config = $oModuleModel->getModuleConfig('rss'); |
45 | 45 | // If one is specified, extract only for this mid |
46 | - if($mid) |
|
46 | + if ($mid) |
|
47 | 47 | { |
48 | 48 | $module_srl = $this->module_info->module_srl; |
49 | 49 | $config = $oModuleModel->getModulePartConfig('rss', $module_srl); |
50 | - if($config->open_rss && $config->open_rss != 'N') |
|
50 | + if ($config->open_rss && $config->open_rss != 'N') |
|
51 | 51 | { |
52 | 52 | $module_srls[] = $module_srl; |
53 | 53 | $open_rss_config[$module_srl] = $config->open_rss; |
@@ -56,14 +56,14 @@ discard block |
||
56 | 56 | } |
57 | 57 | else |
58 | 58 | { |
59 | - if($total_config->use_total_feed != 'N') |
|
59 | + if ($total_config->use_total_feed != 'N') |
|
60 | 60 | { |
61 | 61 | $rss_config = $oModuleModel->getModulePartConfigs('rss', $site_srl); |
62 | - if($rss_config) |
|
62 | + if ($rss_config) |
|
63 | 63 | { |
64 | - foreach($rss_config as $module_srl => $config) |
|
64 | + foreach ($rss_config as $module_srl => $config) |
|
65 | 65 | { |
66 | - if($config && $config->open_rss != 'N' && $config->open_total_feed != 'T_N') |
|
66 | + if ($config && $config->open_rss != 'N' && $config->open_total_feed != 'T_N') |
|
67 | 67 | { |
68 | 68 | $module_srls[] = $module_srl; |
69 | 69 | $open_rss_config[$module_srl] = $config->open_rss; |
@@ -73,39 +73,39 @@ discard block |
||
73 | 73 | } |
74 | 74 | } |
75 | 75 | |
76 | - if(!count($module_srls) && !$add_description) return $this->dispError(); |
|
76 | + if (!count($module_srls) && !$add_description) return $this->dispError(); |
|
77 | 77 | |
78 | 78 | $info = new stdClass; |
79 | 79 | $args = new stdClass; |
80 | 80 | |
81 | - if($module_srls) |
|
81 | + if ($module_srls) |
|
82 | 82 | { |
83 | - $args->module_srl = implode(',',$module_srls); |
|
83 | + $args->module_srl = implode(',', $module_srls); |
|
84 | 84 | //$module_list = $oModuleModel->getMidList($args); //perhaps module_list varialbles not use |
85 | 85 | |
86 | 86 | $args->search_target = 'is_secret'; |
87 | 87 | $args->search_keyword = 'N'; |
88 | - $args->page = (int)Context::get('page'); |
|
88 | + $args->page = (int) Context::get('page'); |
|
89 | 89 | $args->list_count = 15; |
90 | - if($total_config->feed_document_count) $args->list_count = $total_config->feed_document_count; |
|
91 | - if(!$args->page || $args->page < 1) $args->page = 1; |
|
92 | - if($start_date || $start_date != 0) $args->start_date = $start_date; |
|
93 | - if($end_date || $end_date != 0) $args->end_date = $end_date; |
|
94 | - if($start_date == 0) unset($start_date); |
|
95 | - if($end_date == 0) unset($end_date); |
|
90 | + if ($total_config->feed_document_count) $args->list_count = $total_config->feed_document_count; |
|
91 | + if (!$args->page || $args->page < 1) $args->page = 1; |
|
92 | + if ($start_date || $start_date != 0) $args->start_date = $start_date; |
|
93 | + if ($end_date || $end_date != 0) $args->end_date = $end_date; |
|
94 | + if ($start_date == 0) unset($start_date); |
|
95 | + if ($end_date == 0) unset($end_date); |
|
96 | 96 | |
97 | 97 | $args->sort_index = 'list_order'; |
98 | 98 | $args->order_type = 'asc'; |
99 | 99 | $output = $oDocumentModel->getDocumentList($args); |
100 | 100 | $document_list = $output->data; |
101 | 101 | // Extract the feed title and information with Context::getBrowserTitle |
102 | - if($mid) |
|
102 | + if ($mid) |
|
103 | 103 | { |
104 | 104 | $info->title = Context::getBrowserTitle(); |
105 | 105 | $oModuleController->replaceDefinedLangCode($info->title); |
106 | 106 | |
107 | - $info->title = str_replace('\'', ''',$info->title); |
|
108 | - if($config->feed_description) |
|
107 | + $info->title = str_replace('\'', ''', $info->title); |
|
108 | + if ($config->feed_description) |
|
109 | 109 | { |
110 | 110 | $info->description = str_replace('\'', ''', htmlspecialchars($config->feed_description, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
111 | 111 | } |
@@ -113,9 +113,9 @@ discard block |
||
113 | 113 | { |
114 | 114 | $info->description = str_replace('\'', ''', htmlspecialchars($this->module_info->description, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
115 | 115 | } |
116 | - $info->link = getUrl('','mid',$mid); |
|
116 | + $info->link = getUrl('', 'mid', $mid); |
|
117 | 117 | $info->feed_copyright = str_replace('\'', ''', htmlspecialchars($feed_config->feed_copyright, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
118 | - if(!$info->feed_copyright) |
|
118 | + if (!$info->feed_copyright) |
|
119 | 119 | { |
120 | 120 | $info->feed_copyright = str_replace('\'', ''', htmlspecialchars($total_config->feed_copyright, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
121 | 121 | } |
@@ -123,10 +123,10 @@ discard block |
||
123 | 123 | } |
124 | 124 | } |
125 | 125 | |
126 | - if(!$info->title) |
|
126 | + if (!$info->title) |
|
127 | 127 | { |
128 | - if($rss_title) $info->title = $rss_title; |
|
129 | - else if($total_config->feed_title) $info->title = $total_config->feed_title; |
|
128 | + if ($rss_title) $info->title = $rss_title; |
|
129 | + else if ($total_config->feed_title) $info->title = $total_config->feed_title; |
|
130 | 130 | else |
131 | 131 | { |
132 | 132 | $site_module_info = Context::get('site_module_info'); |
@@ -139,15 +139,15 @@ discard block |
||
139 | 139 | $info->link = Context::getRequestUri(); |
140 | 140 | $info->feed_copyright = str_replace('\'', ''', htmlspecialchars($total_config->feed_copyright, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
141 | 141 | } |
142 | - if($add_description) $info->description .= "\r\n".$add_description; |
|
142 | + if ($add_description) $info->description .= "\r\n".$add_description; |
|
143 | 143 | |
144 | - if($total_config->image) $info->image = Context::getRequestUri().str_replace('\'', ''', htmlspecialchars($total_config->image, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
|
145 | - switch(Context::get('format')) |
|
144 | + if ($total_config->image) $info->image = Context::getRequestUri().str_replace('\'', ''', htmlspecialchars($total_config->image, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
|
145 | + switch (Context::get('format')) |
|
146 | 146 | { |
147 | 147 | case 'atom': |
148 | 148 | $info->date = date('Y-m-d\TH:i:sP'); |
149 | - if($mid) { $info->id = getUrl('','mid',$mid,'act','atom','page',Context::get('page'),'start_date',Context::get('start_date'),'end_date',Context::get('end_date')); } |
|
150 | - else { $info->id = getUrl('','module','rss','act','atom','page',Context::get('page'),'start_date',Context::get('start_date'),'end_date',Context::get('end_date')); } |
|
149 | + if ($mid) { $info->id = getUrl('', 'mid', $mid, 'act', 'atom', 'page', Context::get('page'), 'start_date', Context::get('start_date'), 'end_date', Context::get('end_date')); } |
|
150 | + else { $info->id = getUrl('', 'module', 'rss', 'act', 'atom', 'page', Context::get('page'), 'start_date', Context::get('start_date'), 'end_date', Context::get('end_date')); } |
|
151 | 151 | break; |
152 | 152 | case 'rss1.0': |
153 | 153 | $info->date = date('Y-m-d\TH:i:sP'); |
@@ -157,22 +157,22 @@ discard block |
||
157 | 157 | break; |
158 | 158 | } |
159 | 159 | |
160 | - if($_SERVER['HTTPS']=='on') $proctcl = 'https://'; |
|
160 | + if ($_SERVER['HTTPS'] == 'on') $proctcl = 'https://'; |
|
161 | 161 | else $proctcl = 'http://'; |
162 | 162 | |
163 | 163 | $temp_link = explode('/', $info->link); |
164 | - if($temp_link[0]=='' && $info->link) |
|
164 | + if ($temp_link[0] == '' && $info->link) |
|
165 | 165 | { |
166 | 166 | $info->link = $proctcl.$_SERVER['HTTP_HOST'].$info->link; |
167 | 167 | } |
168 | 168 | |
169 | 169 | $temp_id = explode('/', $info->id); |
170 | - if($temp_id[0]=='' && $info->id) |
|
170 | + if ($temp_id[0] == '' && $info->id) |
|
171 | 171 | { |
172 | 172 | $info->id = $proctcl.$_SERVER['HTTP_HOST'].$info->id; |
173 | 173 | } |
174 | 174 | |
175 | - $info->language = str_replace('jp','ja',Context::getLangType()); |
|
175 | + $info->language = str_replace('jp', 'ja', Context::getLangType()); |
|
176 | 176 | // Set the variables used in the RSS output |
177 | 177 | Context::set('info', $info); |
178 | 178 | Context::set('feed_config', $config); |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | function dispError() |
229 | 229 | { |
230 | 230 | // Prepare the output message |
231 | - $this->rss(null, null, Context::getLang('msg_rss_is_disabled') ); |
|
231 | + $this->rss(null, null, Context::getLang('msg_rss_is_disabled')); |
|
232 | 232 | } |
233 | 233 | |
234 | 234 | /** |
@@ -243,12 +243,12 @@ discard block |
||
243 | 243 | $current_module_srl = Context::get('module_srl'); |
244 | 244 | $current_module_srls = Context::get('module_srls'); |
245 | 245 | |
246 | - if(!$current_module_srl && !$current_module_srls) |
|
246 | + if (!$current_module_srl && !$current_module_srls) |
|
247 | 247 | { |
248 | 248 | // Get information of the selected module |
249 | 249 | $current_module_info = Context::get('current_module_info'); |
250 | 250 | $current_module_srl = $current_module_info->module_srl; |
251 | - if(!$current_module_srl) return new Object(); |
|
251 | + if (!$current_module_srl) return new Object(); |
|
252 | 252 | } |
253 | 253 | // Get teh RSS configurations for the selected module |
254 | 254 | $oRssModel = getModel('rss'); |
@@ -22,7 +22,7 @@ |
||
22 | 22 | $oSessionController = getController('session'); |
23 | 23 | $oSessionController->gc(0); |
24 | 24 | |
25 | - $this->add('result',Context::getLang('session_cleared')); |
|
25 | + $this->add('result', Context::getLang('session_cleared')); |
|
26 | 26 | } |
27 | 27 | } |
28 | 28 | /* End of file session.admin.controller.php */ |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | function write($session_key, $val) |
28 | 28 | { |
29 | - if(!$session_key || !$this->session_started) return; |
|
29 | + if (!$session_key || !$this->session_started) return; |
|
30 | 30 | |
31 | 31 | $args = new stdClass; |
32 | 32 | $args->session_key = $session_key; |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $session_info = $output->data; |
36 | 36 | |
37 | 37 | //if ip has changed delete the session from db |
38 | - if($session_info->session_key == $session_key && $session_info->ipaddress != $_SERVER['REMOTE_ADDR']) |
|
38 | + if ($session_info->session_key == $session_key && $session_info->ipaddress != $_SERVER['REMOTE_ADDR']) |
|
39 | 39 | { |
40 | 40 | executeQuery('session.deleteSession', $args); |
41 | 41 | |
@@ -46,13 +46,13 @@ discard block |
||
46 | 46 | $args->val = $val; |
47 | 47 | $args->cur_mid = Context::get('mid'); |
48 | 48 | |
49 | - if(!$args->cur_mid) |
|
49 | + if (!$args->cur_mid) |
|
50 | 50 | { |
51 | 51 | $module_info = Context::get('current_module_info'); |
52 | 52 | $args->cur_mid = $module_info->mid; |
53 | 53 | } |
54 | 54 | |
55 | - if(Context::get('is_logged')) |
|
55 | + if (Context::get('is_logged')) |
|
56 | 56 | { |
57 | 57 | $logged_info = Context::get('logged_info'); |
58 | 58 | $args->member_srl = $logged_info->member_srl; |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $args->last_update = date("YmdHis", $_SERVER['REQUEST_TIME']); |
66 | 66 | |
67 | 67 | //put session into db |
68 | - if($session_info->session_key) |
|
68 | + if ($session_info->session_key) |
|
69 | 69 | { |
70 | 70 | $output = executeQuery('session.updateSession', $args); |
71 | 71 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | |
80 | 80 | function destroy($session_key) |
81 | 81 | { |
82 | - if(!$session_key || !$this->session_started) return; |
|
82 | + if (!$session_key || !$this->session_started) return; |
|
83 | 83 | |
84 | 84 | //remove session from db |
85 | 85 | $args = new stdClass(); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | |
92 | 92 | function gc($maxlifetime) |
93 | 93 | { |
94 | - if(!$this->session_started) return; |
|
94 | + if (!$this->session_started) return; |
|
95 | 95 | |
96 | 96 | executeQuery('session.gcSession'); |
97 | 97 | return true; |
@@ -26,7 +26,9 @@ discard block |
||
26 | 26 | |
27 | 27 | function write($session_key, $val) |
28 | 28 | { |
29 | - if(!$session_key || !$this->session_started) return; |
|
29 | + if(!$session_key || !$this->session_started) { |
|
30 | + return; |
|
31 | + } |
|
30 | 32 | |
31 | 33 | $args = new stdClass; |
32 | 34 | $args->session_key = $session_key; |
@@ -56,8 +58,7 @@ discard block |
||
56 | 58 | { |
57 | 59 | $logged_info = Context::get('logged_info'); |
58 | 60 | $args->member_srl = $logged_info->member_srl; |
59 | - } |
|
60 | - else |
|
61 | + } else |
|
61 | 62 | { |
62 | 63 | $args->member_srl = 0; |
63 | 64 | } |
@@ -68,8 +69,7 @@ discard block |
||
68 | 69 | if($session_info->session_key) |
69 | 70 | { |
70 | 71 | $output = executeQuery('session.updateSession', $args); |
71 | - } |
|
72 | - else |
|
72 | + } else |
|
73 | 73 | { |
74 | 74 | $output = executeQuery('session.insertSession', $args); |
75 | 75 | } |
@@ -79,7 +79,9 @@ discard block |
||
79 | 79 | |
80 | 80 | function destroy($session_key) |
81 | 81 | { |
82 | - if(!$session_key || !$this->session_started) return; |
|
82 | + if(!$session_key || !$this->session_started) { |
|
83 | + return; |
|
84 | + } |
|
83 | 85 | |
84 | 86 | //remove session from db |
85 | 87 | $args = new stdClass(); |
@@ -91,7 +93,9 @@ discard block |
||
91 | 93 | |
92 | 94 | function gc($maxlifetime) |
93 | 95 | { |
94 | - if(!$this->session_started) return; |
|
96 | + if(!$this->session_started) { |
|
97 | + return; |
|
98 | + } |
|
95 | 99 | |
96 | 100 | executeQuery('session.gcSession'); |
97 | 101 | return true; |
@@ -33,8 +33,12 @@ discard block |
||
33 | 33 | $args->sort_index = "regdate"; |
34 | 34 | $args->page = Context::get('page')?Context::get('page'):1; |
35 | 35 | $output = executeQuery('spamfilter.getDeniedIPList', $args); |
36 | - if(!$output->data) return; |
|
37 | - if(!is_array($output->data)) return array($output->data); |
|
36 | + if(!$output->data) { |
|
37 | + return; |
|
38 | + } |
|
39 | + if(!is_array($output->data)) { |
|
40 | + return array($output->data); |
|
41 | + } |
|
38 | 42 | return $output->data; |
39 | 43 | } |
40 | 44 | |
@@ -46,13 +50,17 @@ discard block |
||
46 | 50 | $ipaddress = $_SERVER['REMOTE_ADDR']; |
47 | 51 | |
48 | 52 | $ip_list = $this->getDeniedIPList(); |
49 | - if(!count($ip_list)) return new Object(); |
|
53 | + if(!count($ip_list)) { |
|
54 | + return new Object(); |
|
55 | + } |
|
50 | 56 | |
51 | 57 | $count = count($ip_list); |
52 | 58 | for($i=0;$i<$count;$i++) |
53 | 59 | { |
54 | 60 | $ip = str_replace('.', '\.', str_replace('*','(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)',$ip_list[$i]->ipaddress)); |
55 | - if(preg_match('/^'.$ip.'$/', $ipaddress, $matches)) return new Object(-1,'msg_alert_registered_denied_ip'); |
|
61 | + if(preg_match('/^'.$ip.'$/', $ipaddress, $matches)) { |
|
62 | + return new Object(-1,'msg_alert_registered_denied_ip'); |
|
63 | + } |
|
56 | 64 | } |
57 | 65 | |
58 | 66 | return new Object(); |
@@ -66,8 +74,12 @@ discard block |
||
66 | 74 | $args = new stdClass(); |
67 | 75 | $args->sort_index = "hit"; |
68 | 76 | $output = executeQuery('spamfilter.getDeniedWordList', $args); |
69 | - if(!$output->data) return; |
|
70 | - if(!is_array($output->data)) return array($output->data); |
|
77 | + if(!$output->data) { |
|
78 | + return; |
|
79 | + } |
|
80 | + if(!is_array($output->data)) { |
|
81 | + return array($output->data); |
|
82 | + } |
|
71 | 83 | return $output->data; |
72 | 84 | } |
73 | 85 | |
@@ -77,7 +89,9 @@ discard block |
||
77 | 89 | function isDeniedWord($text) |
78 | 90 | { |
79 | 91 | $word_list = $this->getDeniedWordList(); |
80 | - if(!count($word_list)) return new Object(); |
|
92 | + if(!count($word_list)) { |
|
93 | + return new Object(); |
|
94 | + } |
|
81 | 95 | |
82 | 96 | $count = count($word_list); |
83 | 97 | for($i=0;$i<$count;$i++) |
@@ -101,7 +115,9 @@ discard block |
||
101 | 115 | { |
102 | 116 | $config = $this->getConfig(); |
103 | 117 | |
104 | - if($config->limits != 'Y') return new Object(); |
|
118 | + if($config->limits != 'Y') { |
|
119 | + return new Object(); |
|
120 | + } |
|
105 | 121 | $limit_count = '3'; |
106 | 122 | $interval = '10'; |
107 | 123 | |
@@ -121,8 +137,7 @@ discard block |
||
121 | 137 | if($isMessage) |
122 | 138 | { |
123 | 139 | $message = sprintf(Context::getLang('msg_alert_limited_message_by_config'), $interval); |
124 | - } |
|
125 | - else |
|
140 | + } else |
|
126 | 141 | { |
127 | 142 | $message = sprintf(Context::getLang('msg_alert_limited_by_config'), $interval); |
128 | 143 | } |
@@ -142,7 +157,9 @@ discard block |
||
142 | 157 | { |
143 | 158 | $oTrackbackModel = getModel('trackback'); |
144 | 159 | $count = $oTrackbackModel->getTrackbackCountByIPAddress($document_srl, $_SERVER['REMOTE_ADDR']); |
145 | - if($count>0) return new Object(-1, 'msg_alert_trackback_denied'); |
|
160 | + if($count>0) { |
|
161 | + return new Object(-1, 'msg_alert_trackback_denied'); |
|
162 | + } |
|
146 | 163 | |
147 | 164 | return new Object(); |
148 | 165 | } |
@@ -152,7 +169,9 @@ discard block |
||
152 | 169 | */ |
153 | 170 | function getLogCount($time = 60, $ipaddress='') |
154 | 171 | { |
155 | - if(!$ipaddress) $ipaddress = $_SERVER['REMOTE_ADDR']; |
|
172 | + if(!$ipaddress) { |
|
173 | + $ipaddress = $_SERVER['REMOTE_ADDR']; |
|
174 | + } |
|
156 | 175 | |
157 | 176 | $args->ipaddress = $ipaddress; |
158 | 177 | $args->regdate = date("YmdHis", $_SERVER['REQUEST_TIME']-$time); |
@@ -31,10 +31,10 @@ discard block |
||
31 | 31 | { |
32 | 32 | $args = new stdClass(); |
33 | 33 | $args->sort_index = "regdate"; |
34 | - $args->page = Context::get('page')?Context::get('page'):1; |
|
34 | + $args->page = Context::get('page') ? Context::get('page') : 1; |
|
35 | 35 | $output = executeQuery('spamfilter.getDeniedIPList', $args); |
36 | - if(!$output->data) return; |
|
37 | - if(!is_array($output->data)) return array($output->data); |
|
36 | + if (!$output->data) return; |
|
37 | + if (!is_array($output->data)) return array($output->data); |
|
38 | 38 | return $output->data; |
39 | 39 | } |
40 | 40 | |
@@ -46,13 +46,13 @@ discard block |
||
46 | 46 | $ipaddress = $_SERVER['REMOTE_ADDR']; |
47 | 47 | |
48 | 48 | $ip_list = $this->getDeniedIPList(); |
49 | - if(!count($ip_list)) return new Object(); |
|
49 | + if (!count($ip_list)) return new Object(); |
|
50 | 50 | |
51 | 51 | $count = count($ip_list); |
52 | - for($i=0;$i<$count;$i++) |
|
52 | + for ($i = 0; $i < $count; $i++) |
|
53 | 53 | { |
54 | - $ip = str_replace('.', '\.', str_replace('*','(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)',$ip_list[$i]->ipaddress)); |
|
55 | - if(preg_match('/^'.$ip.'$/', $ipaddress, $matches)) return new Object(-1,'msg_alert_registered_denied_ip'); |
|
54 | + $ip = str_replace('.', '\.', str_replace('*', '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)', $ip_list[$i]->ipaddress)); |
|
55 | + if (preg_match('/^'.$ip.'$/', $ipaddress, $matches)) return new Object(-1, 'msg_alert_registered_denied_ip'); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | return new Object(); |
@@ -66,8 +66,8 @@ discard block |
||
66 | 66 | $args = new stdClass(); |
67 | 67 | $args->sort_index = "hit"; |
68 | 68 | $output = executeQuery('spamfilter.getDeniedWordList', $args); |
69 | - if(!$output->data) return; |
|
70 | - if(!is_array($output->data)) return array($output->data); |
|
69 | + if (!$output->data) return; |
|
70 | + if (!is_array($output->data)) return array($output->data); |
|
71 | 71 | return $output->data; |
72 | 72 | } |
73 | 73 | |
@@ -77,17 +77,17 @@ discard block |
||
77 | 77 | function isDeniedWord($text) |
78 | 78 | { |
79 | 79 | $word_list = $this->getDeniedWordList(); |
80 | - if(!count($word_list)) return new Object(); |
|
80 | + if (!count($word_list)) return new Object(); |
|
81 | 81 | |
82 | 82 | $count = count($word_list); |
83 | - for($i=0;$i<$count;$i++) |
|
83 | + for ($i = 0; $i < $count; $i++) |
|
84 | 84 | { |
85 | 85 | $word = $word_list[$i]->word; |
86 | - if(preg_match('/'.preg_quote($word,'/').'/is', $text)) |
|
86 | + if (preg_match('/'.preg_quote($word, '/').'/is', $text)) |
|
87 | 87 | { |
88 | 88 | $args->word = $word; |
89 | 89 | $output = executeQuery('spamfilter.updateDeniedWordHit', $args); |
90 | - return new Object(-1,sprintf(Context::getLang('msg_alert_denied_word'), $word)); |
|
90 | + return new Object(-1, sprintf(Context::getLang('msg_alert_denied_word'), $word)); |
|
91 | 91 | } |
92 | 92 | } |
93 | 93 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | { |
102 | 102 | $config = $this->getConfig(); |
103 | 103 | |
104 | - if($config->limits != 'Y') return new Object(); |
|
104 | + if ($config->limits != 'Y') return new Object(); |
|
105 | 105 | $limit_count = '3'; |
106 | 106 | $interval = '10'; |
107 | 107 | |
@@ -109,16 +109,16 @@ discard block |
||
109 | 109 | |
110 | 110 | $ipaddress = $_SERVER['REMOTE_ADDR']; |
111 | 111 | // Ban the IP address if the interval is exceeded |
112 | - if($count>=$limit_count) |
|
112 | + if ($count >= $limit_count) |
|
113 | 113 | { |
114 | 114 | $oSpamFilterController = getController('spamfilter'); |
115 | 115 | $oSpamFilterController->insertIP($ipaddress, 'AUTO-DENIED : Over limit'); |
116 | 116 | return new Object(-1, 'msg_alert_registered_denied_ip'); |
117 | 117 | } |
118 | 118 | // If the number of limited posts is not reached, keep creating. |
119 | - if($count) |
|
119 | + if ($count) |
|
120 | 120 | { |
121 | - if($isMessage) |
|
121 | + if ($isMessage) |
|
122 | 122 | { |
123 | 123 | $message = sprintf(Context::getLang('msg_alert_limited_message_by_config'), $interval); |
124 | 124 | } |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | { |
143 | 143 | $oTrackbackModel = getModel('trackback'); |
144 | 144 | $count = $oTrackbackModel->getTrackbackCountByIPAddress($document_srl, $_SERVER['REMOTE_ADDR']); |
145 | - if($count>0) return new Object(-1, 'msg_alert_trackback_denied'); |
|
145 | + if ($count > 0) return new Object(-1, 'msg_alert_trackback_denied'); |
|
146 | 146 | |
147 | 147 | return new Object(); |
148 | 148 | } |
@@ -150,12 +150,12 @@ discard block |
||
150 | 150 | /** |
151 | 151 | * @brief Return the number of logs recorded within the interval for the specified IPaddress |
152 | 152 | */ |
153 | - function getLogCount($time = 60, $ipaddress='') |
|
153 | + function getLogCount($time = 60, $ipaddress = '') |
|
154 | 154 | { |
155 | - if(!$ipaddress) $ipaddress = $_SERVER['REMOTE_ADDR']; |
|
155 | + if (!$ipaddress) $ipaddress = $_SERVER['REMOTE_ADDR']; |
|
156 | 156 | |
157 | 157 | $args->ipaddress = $ipaddress; |
158 | - $args->regdate = date("YmdHis", $_SERVER['REQUEST_TIME']-$time); |
|
158 | + $args->regdate = date("YmdHis", $_SERVER['REQUEST_TIME'] - $time); |
|
159 | 159 | $output = executeQuery('spamfilter.getLogCount', $args); |
160 | 160 | $count = $output->data->count; |
161 | 161 | return $count; |
@@ -19,20 +19,20 @@ discard block |
||
19 | 19 | */ |
20 | 20 | function triggerArrangeTag(&$obj) |
21 | 21 | { |
22 | - if(!$obj->tags) return new Object(); |
|
22 | + if (!$obj->tags) return new Object(); |
|
23 | 23 | // tags by variable |
24 | 24 | $tag_list = explode(',', $obj->tags); |
25 | 25 | $tag_count = count($tag_list); |
26 | 26 | $tag_list = array_unique($tag_list); |
27 | - if(!count($tag_list)) return new Object(); |
|
27 | + if (!count($tag_list)) return new Object(); |
|
28 | 28 | |
29 | - foreach($tag_list as $tag) |
|
29 | + foreach ($tag_list as $tag) |
|
30 | 30 | { |
31 | - if(!trim($tag)) continue; |
|
31 | + if (!trim($tag)) continue; |
|
32 | 32 | $arranged_tag_list[] = trim($tag); |
33 | 33 | } |
34 | - if(!count($arranged_tag_list)) $obj->tags = null; |
|
35 | - else $obj->tags = implode(',',$arranged_tag_list); |
|
34 | + if (!count($arranged_tag_list)) $obj->tags = null; |
|
35 | + else $obj->tags = implode(',', $arranged_tag_list); |
|
36 | 36 | return new Object(); |
37 | 37 | } |
38 | 38 | |
@@ -45,24 +45,24 @@ discard block |
||
45 | 45 | $module_srl = $obj->module_srl; |
46 | 46 | $document_srl = $obj->document_srl; |
47 | 47 | $tags = $obj->tags; |
48 | - if(!$document_srl) return new Object(); |
|
48 | + if (!$document_srl) return new Object(); |
|
49 | 49 | // Remove all tags that article |
50 | 50 | $output = $this->triggerDeleteTag($obj); |
51 | - if(!$output->toBool()) return $output; |
|
51 | + if (!$output->toBool()) return $output; |
|
52 | 52 | // Re-enter the tag |
53 | 53 | $args = new stdClass(); |
54 | 54 | $args->module_srl = $module_srl; |
55 | 55 | $args->document_srl = $document_srl; |
56 | 56 | |
57 | - $tag_list = explode(',',$tags); |
|
57 | + $tag_list = explode(',', $tags); |
|
58 | 58 | $tag_count = count($tag_list); |
59 | - for($i=0;$i<$tag_count;$i++) |
|
59 | + for ($i = 0; $i < $tag_count; $i++) |
|
60 | 60 | { |
61 | 61 | unset($args->tag); |
62 | 62 | $args->tag = trim($tag_list[$i]); |
63 | - if(!$args->tag) continue; |
|
63 | + if (!$args->tag) continue; |
|
64 | 64 | $output = executeQuery('tag.insertTag', $args); |
65 | - if(!$output->toBool()) return $output; |
|
65 | + if (!$output->toBool()) return $output; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | return new Object(); |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | function triggerDeleteTag(&$obj) |
76 | 76 | { |
77 | 77 | $document_srl = $obj->document_srl; |
78 | - if(!$document_srl) return new Object(); |
|
78 | + if (!$document_srl) return new Object(); |
|
79 | 79 | |
80 | 80 | $args = new stdClass(); |
81 | 81 | $args->document_srl = $document_srl; |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | function triggerDeleteModuleTags(&$obj) |
89 | 89 | { |
90 | 90 | $module_srl = $obj->module_srl; |
91 | - if(!$module_srl) return new Object(); |
|
91 | + if (!$module_srl) return new Object(); |
|
92 | 92 | |
93 | 93 | $oTagController = getAdminController('tag'); |
94 | 94 | return $oTagController->deleteModuleTags($module_srl); |
@@ -19,20 +19,29 @@ discard block |
||
19 | 19 | */ |
20 | 20 | function triggerArrangeTag(&$obj) |
21 | 21 | { |
22 | - if(!$obj->tags) return new Object(); |
|
22 | + if(!$obj->tags) { |
|
23 | + return new Object(); |
|
24 | + } |
|
23 | 25 | // tags by variable |
24 | 26 | $tag_list = explode(',', $obj->tags); |
25 | 27 | $tag_count = count($tag_list); |
26 | 28 | $tag_list = array_unique($tag_list); |
27 | - if(!count($tag_list)) return new Object(); |
|
29 | + if(!count($tag_list)) { |
|
30 | + return new Object(); |
|
31 | + } |
|
28 | 32 | |
29 | 33 | foreach($tag_list as $tag) |
30 | 34 | { |
31 | - if(!trim($tag)) continue; |
|
35 | + if(!trim($tag)) { |
|
36 | + continue; |
|
37 | + } |
|
32 | 38 | $arranged_tag_list[] = trim($tag); |
33 | 39 | } |
34 | - if(!count($arranged_tag_list)) $obj->tags = null; |
|
35 | - else $obj->tags = implode(',',$arranged_tag_list); |
|
40 | + if(!count($arranged_tag_list)) { |
|
41 | + $obj->tags = null; |
|
42 | + } else { |
|
43 | + $obj->tags = implode(',',$arranged_tag_list); |
|
44 | + } |
|
36 | 45 | return new Object(); |
37 | 46 | } |
38 | 47 | |
@@ -45,10 +54,14 @@ discard block |
||
45 | 54 | $module_srl = $obj->module_srl; |
46 | 55 | $document_srl = $obj->document_srl; |
47 | 56 | $tags = $obj->tags; |
48 | - if(!$document_srl) return new Object(); |
|
57 | + if(!$document_srl) { |
|
58 | + return new Object(); |
|
59 | + } |
|
49 | 60 | // Remove all tags that article |
50 | 61 | $output = $this->triggerDeleteTag($obj); |
51 | - if(!$output->toBool()) return $output; |
|
62 | + if(!$output->toBool()) { |
|
63 | + return $output; |
|
64 | + } |
|
52 | 65 | // Re-enter the tag |
53 | 66 | $args = new stdClass(); |
54 | 67 | $args->module_srl = $module_srl; |
@@ -60,9 +73,13 @@ discard block |
||
60 | 73 | { |
61 | 74 | unset($args->tag); |
62 | 75 | $args->tag = trim($tag_list[$i]); |
63 | - if(!$args->tag) continue; |
|
76 | + if(!$args->tag) { |
|
77 | + continue; |
|
78 | + } |
|
64 | 79 | $output = executeQuery('tag.insertTag', $args); |
65 | - if(!$output->toBool()) return $output; |
|
80 | + if(!$output->toBool()) { |
|
81 | + return $output; |
|
82 | + } |
|
66 | 83 | } |
67 | 84 | |
68 | 85 | return new Object(); |
@@ -75,7 +92,9 @@ discard block |
||
75 | 92 | function triggerDeleteTag(&$obj) |
76 | 93 | { |
77 | 94 | $document_srl = $obj->document_srl; |
78 | - if(!$document_srl) return new Object(); |
|
95 | + if(!$document_srl) { |
|
96 | + return new Object(); |
|
97 | + } |
|
79 | 98 | |
80 | 99 | $args = new stdClass(); |
81 | 100 | $args->document_srl = $document_srl; |
@@ -88,7 +107,9 @@ discard block |
||
88 | 107 | function triggerDeleteModuleTags(&$obj) |
89 | 108 | { |
90 | 109 | $module_srl = $obj->module_srl; |
91 | - if(!$module_srl) return new Object(); |
|
110 | + if(!$module_srl) { |
|
111 | + return new Object(); |
|
112 | + } |
|
92 | 113 | |
93 | 114 | $oTagController = getAdminController('tag'); |
94 | 115 | return $oTagController->deleteModuleTags($module_srl); |