@@ -38,159 +38,159 @@ |
||
38 | 38 | $charset = trim(Request::getString('charset', '', 'POST'));//trim($_POST['charset']); |
39 | 39 | |
40 | 40 | if (empty($xoopsModuleConfig['trackback_option'])) { |
41 | - PlanetUtility::planetRespondToTrackback(1, 'Trackback is closed'); |
|
41 | + PlanetUtility::planetRespondToTrackback(1, 'Trackback is closed'); |
|
42 | 42 | } |
43 | 43 | if (!strlen($title . $url . $blog_name)) { |
44 | - PlanetUtility::planetRespondToTrackback(1, planet_constant('MD_INVALID')); |
|
44 | + PlanetUtility::planetRespondToTrackback(1, planet_constant('MD_INVALID')); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | if (!empty($article_id) && !empty($url)) { |
48 | - $trackbackHandler = xoops_getModuleHandler('trackback', $GLOBALS['moddirname']); |
|
49 | - $criteria = new CriteriaCompo(new Criteria('art_id', $article_id)); |
|
50 | - $criteria->add(new Criteria('tb_url', $url)); |
|
51 | - if ($trackbackHandler->getCount($criteria) > 0) { |
|
52 | - PlanetUtility::planetRespondToTrackback(1, 'We already have a ping from that URI for this article.'); |
|
53 | - } |
|
48 | + $trackbackHandler = xoops_getModuleHandler('trackback', $GLOBALS['moddirname']); |
|
49 | + $criteria = new CriteriaCompo(new Criteria('art_id', $article_id)); |
|
50 | + $criteria->add(new Criteria('tb_url', $url)); |
|
51 | + if ($trackbackHandler->getCount($criteria) > 0) { |
|
52 | + PlanetUtility::planetRespondToTrackback(1, 'We already have a ping from that URI for this article.'); |
|
53 | + } |
|
54 | 54 | |
55 | - $charset = empty($charset) ? 'utf-8' : $charset; |
|
56 | - $title = XoopsLocal::convert_encoding($title, _CHARSET, $charset); |
|
57 | - $excerpt = XoopsLocal::convert_encoding($excerpt, _CHARSET, $charset); |
|
58 | - $blog_name = XoopsLocal::convert_encoding($blog_name, _CHARSET, $charset); |
|
59 | - $tb_status = (int)$xoopsModuleConfig['trackback_option']; |
|
55 | + $charset = empty($charset) ? 'utf-8' : $charset; |
|
56 | + $title = XoopsLocal::convert_encoding($title, _CHARSET, $charset); |
|
57 | + $excerpt = XoopsLocal::convert_encoding($excerpt, _CHARSET, $charset); |
|
58 | + $blog_name = XoopsLocal::convert_encoding($blog_name, _CHARSET, $charset); |
|
59 | + $tb_status = (int)$xoopsModuleConfig['trackback_option']; |
|
60 | 60 | |
61 | - $com_pid = 0; |
|
62 | - $com_itemid = $article_id; |
|
63 | - $com_rootid = 0; |
|
64 | - $com_title = $title; |
|
65 | - $com_text = $excerpt; |
|
66 | - $com_text .= "\n\n[TRACKBACK]" . _POSTEDBY . ': '; |
|
67 | - if (!empty($url)) { |
|
68 | - $com_text .= '[url=' . $url . ']' . $blog_name . '[/url]'; |
|
69 | - } else { |
|
70 | - $com_text .= $blog_name; |
|
71 | - } |
|
72 | - $com_modid = $xoopsModule->getVar('mid'); |
|
61 | + $com_pid = 0; |
|
62 | + $com_itemid = $article_id; |
|
63 | + $com_rootid = 0; |
|
64 | + $com_title = $title; |
|
65 | + $com_text = $excerpt; |
|
66 | + $com_text .= "\n\n[TRACKBACK]" . _POSTEDBY . ': '; |
|
67 | + if (!empty($url)) { |
|
68 | + $com_text .= '[url=' . $url . ']' . $blog_name . '[/url]'; |
|
69 | + } else { |
|
70 | + $com_text .= $blog_name; |
|
71 | + } |
|
72 | + $com_modid = $xoopsModule->getVar('mid'); |
|
73 | 73 | |
74 | - $commentHandler = xoops_getHandler('comment'); |
|
75 | - $comment = $commentHandler->create(); |
|
76 | - $comment->setVar('com_created', time()); |
|
77 | - $comment->setVar('com_pid', $com_pid); |
|
78 | - $comment->setVar('com_itemid', $com_itemid); |
|
79 | - $comment->setVar('com_rootid', $com_rootid); |
|
80 | - $comment->setVar('com_ip', xoops_getenv('REMOTE_ADDR')); |
|
81 | - switch ($tb_status) { |
|
82 | - case 2: |
|
83 | - $comment->setVar('com_status', 2); |
|
84 | - $call_approvefunc = true; |
|
85 | - $call_updatefunc = true; |
|
86 | - $notify_event = 'comment'; |
|
87 | - break; |
|
88 | - case 1: |
|
89 | - default: |
|
90 | - $comment->setVar('com_status', 1); |
|
91 | - $notify_event = 'comment_submit'; |
|
92 | - break; |
|
93 | - } |
|
94 | - $comment->setVar('com_uid', 0); |
|
95 | - $com_title = xoops_trim($com_title); |
|
96 | - $com_title = empty($com_title) ? _NOTITLE : $com_title; |
|
97 | - $comment->setVar('com_title', $com_title); |
|
98 | - $comment->setVar('com_text', $com_text); |
|
99 | - $comment->setVar('dohtml', 0); |
|
100 | - $comment->setVar('dosmiley', 0); |
|
101 | - $comment->setVar('doxcode', 1); |
|
102 | - $comment->setVar('doimage', 0); |
|
103 | - $comment->setVar('dobr', 1); |
|
104 | - $comment->setVar('com_icon', ''); |
|
105 | - $comment->setVar('com_modified', time()); |
|
106 | - $comment->setVar('com_modid', $com_modid); |
|
107 | - if (false != $commentHandler->insert($comment)) { |
|
108 | - $newcid = $comment->getVar('com_id'); |
|
74 | + $commentHandler = xoops_getHandler('comment'); |
|
75 | + $comment = $commentHandler->create(); |
|
76 | + $comment->setVar('com_created', time()); |
|
77 | + $comment->setVar('com_pid', $com_pid); |
|
78 | + $comment->setVar('com_itemid', $com_itemid); |
|
79 | + $comment->setVar('com_rootid', $com_rootid); |
|
80 | + $comment->setVar('com_ip', xoops_getenv('REMOTE_ADDR')); |
|
81 | + switch ($tb_status) { |
|
82 | + case 2: |
|
83 | + $comment->setVar('com_status', 2); |
|
84 | + $call_approvefunc = true; |
|
85 | + $call_updatefunc = true; |
|
86 | + $notify_event = 'comment'; |
|
87 | + break; |
|
88 | + case 1: |
|
89 | + default: |
|
90 | + $comment->setVar('com_status', 1); |
|
91 | + $notify_event = 'comment_submit'; |
|
92 | + break; |
|
93 | + } |
|
94 | + $comment->setVar('com_uid', 0); |
|
95 | + $com_title = xoops_trim($com_title); |
|
96 | + $com_title = empty($com_title) ? _NOTITLE : $com_title; |
|
97 | + $comment->setVar('com_title', $com_title); |
|
98 | + $comment->setVar('com_text', $com_text); |
|
99 | + $comment->setVar('dohtml', 0); |
|
100 | + $comment->setVar('dosmiley', 0); |
|
101 | + $comment->setVar('doxcode', 1); |
|
102 | + $comment->setVar('doimage', 0); |
|
103 | + $comment->setVar('dobr', 1); |
|
104 | + $comment->setVar('com_icon', ''); |
|
105 | + $comment->setVar('com_modified', time()); |
|
106 | + $comment->setVar('com_modid', $com_modid); |
|
107 | + if (false != $commentHandler->insert($comment)) { |
|
108 | + $newcid = $comment->getVar('com_id'); |
|
109 | 109 | |
110 | - // set own id as root id |
|
111 | - $com_rootid = $newcid; |
|
112 | - if (!$commentHandler->updateByField($comment, 'com_rootid', $com_rootid)) { |
|
113 | - $commentHandler->delete($comment); |
|
114 | - PlanetUtility::planetRespondToTrackback(1, xoops_error()); |
|
115 | - } |
|
110 | + // set own id as root id |
|
111 | + $com_rootid = $newcid; |
|
112 | + if (!$commentHandler->updateByField($comment, 'com_rootid', $com_rootid)) { |
|
113 | + $commentHandler->delete($comment); |
|
114 | + PlanetUtility::planetRespondToTrackback(1, xoops_error()); |
|
115 | + } |
|
116 | 116 | |
117 | - // call custom approve function if any |
|
118 | - if (false != $call_approvefunc && isset($comment_config['callback']['approve']) |
|
119 | - && trim($comment_config['callback']['approve']) != '') { |
|
120 | - $skip = false; |
|
121 | - if (!function_exists($comment_config['callback']['approve'])) { |
|
122 | - if (isset($comment_config['callbackFile'])) { |
|
123 | - $callbackfile = trim($comment_config['callbackFile']); |
|
124 | - if ($callbackfile != '' |
|
125 | - && file_exists(XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile)) { |
|
126 | - require_once XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile; |
|
127 | - } |
|
128 | - if (!function_exists($comment_config['callback']['approve'])) { |
|
129 | - $skip = true; |
|
130 | - } |
|
131 | - } else { |
|
132 | - $skip = true; |
|
133 | - } |
|
134 | - } |
|
135 | - if (!$skip) { |
|
136 | - $comment_config['callback']['approve']($comment); |
|
137 | - } |
|
138 | - } |
|
117 | + // call custom approve function if any |
|
118 | + if (false != $call_approvefunc && isset($comment_config['callback']['approve']) |
|
119 | + && trim($comment_config['callback']['approve']) != '') { |
|
120 | + $skip = false; |
|
121 | + if (!function_exists($comment_config['callback']['approve'])) { |
|
122 | + if (isset($comment_config['callbackFile'])) { |
|
123 | + $callbackfile = trim($comment_config['callbackFile']); |
|
124 | + if ($callbackfile != '' |
|
125 | + && file_exists(XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile)) { |
|
126 | + require_once XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile; |
|
127 | + } |
|
128 | + if (!function_exists($comment_config['callback']['approve'])) { |
|
129 | + $skip = true; |
|
130 | + } |
|
131 | + } else { |
|
132 | + $skip = true; |
|
133 | + } |
|
134 | + } |
|
135 | + if (!$skip) { |
|
136 | + $comment_config['callback']['approve']($comment); |
|
137 | + } |
|
138 | + } |
|
139 | 139 | |
140 | - // call custom update function if any |
|
141 | - if (false != $call_updatefunc && isset($comment_config['callback']['update']) |
|
142 | - && trim($comment_config['callback']['update']) != '') { |
|
143 | - $skip = false; |
|
144 | - if (!function_exists($comment_config['callback']['update'])) { |
|
145 | - if (isset($comment_config['callbackFile'])) { |
|
146 | - $callbackfile = trim($comment_config['callbackFile']); |
|
147 | - if ($callbackfile != '' |
|
148 | - && file_exists(XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile)) { |
|
149 | - require_once XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile; |
|
150 | - } |
|
151 | - if (!function_exists($comment_config['callback']['update'])) { |
|
152 | - $skip = true; |
|
153 | - } |
|
154 | - } else { |
|
155 | - $skip = true; |
|
156 | - } |
|
157 | - } |
|
158 | - if (!$skip) { |
|
159 | - $criteria = new CriteriaCompo(new Criteria('com_modid', $com_modid)); |
|
160 | - $criteria->add(new Criteria('com_itemid', $com_itemid)); |
|
161 | - $criteria->add(new Criteria('com_status', XOOPS_COMMENT_ACTIVE)); |
|
162 | - $comment_count = $commentHandler->getCount($criteria); |
|
163 | - $func = $comment_config['callback']['update']; |
|
164 | - call_user_func_array($func, array($com_itemid, $comment_count, $comment->getVar('com_id'))); |
|
165 | - } |
|
166 | - } |
|
140 | + // call custom update function if any |
|
141 | + if (false != $call_updatefunc && isset($comment_config['callback']['update']) |
|
142 | + && trim($comment_config['callback']['update']) != '') { |
|
143 | + $skip = false; |
|
144 | + if (!function_exists($comment_config['callback']['update'])) { |
|
145 | + if (isset($comment_config['callbackFile'])) { |
|
146 | + $callbackfile = trim($comment_config['callbackFile']); |
|
147 | + if ($callbackfile != '' |
|
148 | + && file_exists(XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile)) { |
|
149 | + require_once XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile; |
|
150 | + } |
|
151 | + if (!function_exists($comment_config['callback']['update'])) { |
|
152 | + $skip = true; |
|
153 | + } |
|
154 | + } else { |
|
155 | + $skip = true; |
|
156 | + } |
|
157 | + } |
|
158 | + if (!$skip) { |
|
159 | + $criteria = new CriteriaCompo(new Criteria('com_modid', $com_modid)); |
|
160 | + $criteria->add(new Criteria('com_itemid', $com_itemid)); |
|
161 | + $criteria->add(new Criteria('com_status', XOOPS_COMMENT_ACTIVE)); |
|
162 | + $comment_count = $commentHandler->getCount($criteria); |
|
163 | + $func = $comment_config['callback']['update']; |
|
164 | + call_user_func_array($func, array($com_itemid, $comment_count, $comment->getVar('com_id'))); |
|
165 | + } |
|
166 | + } |
|
167 | 167 | |
168 | - // RMV-NOTIFY |
|
169 | - // trigger notification event if necessary |
|
170 | - if ($notify_event) { |
|
171 | - $not_modid = $com_modid; |
|
172 | - // require_once XOOPS_ROOT_PATH . '/include/notification_functions.php'; |
|
173 | - $not_catinfo = notificationCommentCategoryInfo($not_modid); |
|
174 | - $not_category = $not_catinfo['name']; |
|
175 | - $not_itemid = $com_itemid; |
|
176 | - $not_event = $notify_event; |
|
177 | - // Build an ABSOLUTE URL to view the comment. Make sure we |
|
178 | - // point to a viewable page (i.e. not the system administration |
|
179 | - // module). |
|
180 | - $comment_tags = array(); |
|
181 | - $not_module = $xoopsModule; |
|
182 | - if (!isset($comment_url)) { |
|
183 | - $com_config = $not_module->getInfo('comments'); |
|
184 | - $comment_url = $com_config['pageName'] . '?'; |
|
185 | - $comment_url .= $com_config['itemName']; |
|
186 | - } |
|
187 | - $comment_tags['X_COMMENT_URL'] = XOOPS_URL . '/modules/' . $not_module->getVar('dirname') . '/' . $comment_url . '=' . $com_itemid . '&com_id=' . $newcid . '&com_rootid=' . $com_rootid . '&com_mode=' . $com_mode . '&com_order=' . $com_order . '#comment' . $newcid; |
|
188 | - $notificationHandler = xoops_getHandler('notification'); |
|
189 | - $notificationHandler->triggerEvent($not_category, $not_itemid, $not_event, $comment_tags, false, $not_modid); |
|
190 | - } |
|
168 | + // RMV-NOTIFY |
|
169 | + // trigger notification event if necessary |
|
170 | + if ($notify_event) { |
|
171 | + $not_modid = $com_modid; |
|
172 | + // require_once XOOPS_ROOT_PATH . '/include/notification_functions.php'; |
|
173 | + $not_catinfo = notificationCommentCategoryInfo($not_modid); |
|
174 | + $not_category = $not_catinfo['name']; |
|
175 | + $not_itemid = $com_itemid; |
|
176 | + $not_event = $notify_event; |
|
177 | + // Build an ABSOLUTE URL to view the comment. Make sure we |
|
178 | + // point to a viewable page (i.e. not the system administration |
|
179 | + // module). |
|
180 | + $comment_tags = array(); |
|
181 | + $not_module = $xoopsModule; |
|
182 | + if (!isset($comment_url)) { |
|
183 | + $com_config = $not_module->getInfo('comments'); |
|
184 | + $comment_url = $com_config['pageName'] . '?'; |
|
185 | + $comment_url .= $com_config['itemName']; |
|
186 | + } |
|
187 | + $comment_tags['X_COMMENT_URL'] = XOOPS_URL . '/modules/' . $not_module->getVar('dirname') . '/' . $comment_url . '=' . $com_itemid . '&com_id=' . $newcid . '&com_rootid=' . $com_rootid . '&com_mode=' . $com_mode . '&com_order=' . $com_order . '#comment' . $newcid; |
|
188 | + $notificationHandler = xoops_getHandler('notification'); |
|
189 | + $notificationHandler->triggerEvent($not_category, $not_itemid, $not_event, $comment_tags, false, $not_modid); |
|
190 | + } |
|
191 | 191 | |
192 | - PlanetUtility::planetRespondToTrackback(0); |
|
193 | - } else { |
|
194 | - PlanetUtility::planetRespondToTrackback(1, xoops_error($comment->getHtmlErrors())); |
|
195 | - } |
|
192 | + PlanetUtility::planetRespondToTrackback(0); |
|
193 | + } else { |
|
194 | + PlanetUtility::planetRespondToTrackback(1, xoops_error($comment->getHtmlErrors())); |
|
195 | + } |
|
196 | 196 | } |
@@ -26,21 +26,21 @@ discard block |
||
26 | 26 | // ------------------------------------------------------------------------ // |
27 | 27 | use Xmf\Request; |
28 | 28 | |
29 | -include __DIR__ . '/header.php'; |
|
29 | +include __DIR__.'/header.php'; |
|
30 | 30 | |
31 | 31 | // trackback is done by a POST |
32 | 32 | $art_id = explode('/', Request::getString('REQUEST_URI', '', 'SERVER')); |
33 | -$article_id = (int)$art_id[count($art_id) - 1]; |
|
34 | -$url = Request::getString('url', '', 'POST');//$_POST['url']; |
|
35 | -$title = Request::getString('title', '', 'POST');//$_POST['title']; |
|
36 | -$excerpt = Request::getString('excerpt', '', 'POST');//$_POST['excerpt']; |
|
37 | -$blog_name = Request::getString('blog_name', '', 'POST');//$_POST['blog_name']; |
|
38 | -$charset = trim(Request::getString('charset', '', 'POST'));//trim($_POST['charset']); |
|
33 | +$article_id = (int) $art_id[count($art_id)-1]; |
|
34 | +$url = Request::getString('url', '', 'POST'); //$_POST['url']; |
|
35 | +$title = Request::getString('title', '', 'POST'); //$_POST['title']; |
|
36 | +$excerpt = Request::getString('excerpt', '', 'POST'); //$_POST['excerpt']; |
|
37 | +$blog_name = Request::getString('blog_name', '', 'POST'); //$_POST['blog_name']; |
|
38 | +$charset = trim(Request::getString('charset', '', 'POST')); //trim($_POST['charset']); |
|
39 | 39 | |
40 | 40 | if (empty($xoopsModuleConfig['trackback_option'])) { |
41 | 41 | PlanetUtility::planetRespondToTrackback(1, 'Trackback is closed'); |
42 | 42 | } |
43 | -if (!strlen($title . $url . $blog_name)) { |
|
43 | +if (!strlen($title.$url.$blog_name)) { |
|
44 | 44 | PlanetUtility::planetRespondToTrackback(1, planet_constant('MD_INVALID')); |
45 | 45 | } |
46 | 46 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $trackbackHandler = xoops_getModuleHandler('trackback', $GLOBALS['moddirname']); |
49 | 49 | $criteria = new CriteriaCompo(new Criteria('art_id', $article_id)); |
50 | 50 | $criteria->add(new Criteria('tb_url', $url)); |
51 | - if ($trackbackHandler->getCount($criteria) > 0) { |
|
51 | + if ($trackbackHandler->getCount($criteria)>0) { |
|
52 | 52 | PlanetUtility::planetRespondToTrackback(1, 'We already have a ping from that URI for this article.'); |
53 | 53 | } |
54 | 54 | |
@@ -56,17 +56,17 @@ discard block |
||
56 | 56 | $title = XoopsLocal::convert_encoding($title, _CHARSET, $charset); |
57 | 57 | $excerpt = XoopsLocal::convert_encoding($excerpt, _CHARSET, $charset); |
58 | 58 | $blog_name = XoopsLocal::convert_encoding($blog_name, _CHARSET, $charset); |
59 | - $tb_status = (int)$xoopsModuleConfig['trackback_option']; |
|
59 | + $tb_status = (int) $xoopsModuleConfig['trackback_option']; |
|
60 | 60 | |
61 | 61 | $com_pid = 0; |
62 | 62 | $com_itemid = $article_id; |
63 | 63 | $com_rootid = 0; |
64 | 64 | $com_title = $title; |
65 | 65 | $com_text = $excerpt; |
66 | - $com_text .= "\n\n[TRACKBACK]" . _POSTEDBY . ': '; |
|
66 | + $com_text .= "\n\n[TRACKBACK]"._POSTEDBY.': '; |
|
67 | 67 | if (!empty($url)) { |
68 | - $com_text .= '[url=' . $url . ']' . $blog_name . '[/url]'; |
|
69 | - } else { |
|
68 | + $com_text .= '[url='.$url.']'.$blog_name.'[/url]'; |
|
69 | + }else { |
|
70 | 70 | $com_text .= $blog_name; |
71 | 71 | } |
72 | 72 | $com_modid = $xoopsModule->getVar('mid'); |
@@ -122,13 +122,13 @@ discard block |
||
122 | 122 | if (isset($comment_config['callbackFile'])) { |
123 | 123 | $callbackfile = trim($comment_config['callbackFile']); |
124 | 124 | if ($callbackfile != '' |
125 | - && file_exists(XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile)) { |
|
126 | - require_once XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile; |
|
125 | + && file_exists(XOOPS_ROOT_PATH.'/modules/'.$moddir.'/'.$callbackfile)) { |
|
126 | + require_once XOOPS_ROOT_PATH.'/modules/'.$moddir.'/'.$callbackfile; |
|
127 | 127 | } |
128 | 128 | if (!function_exists($comment_config['callback']['approve'])) { |
129 | 129 | $skip = true; |
130 | 130 | } |
131 | - } else { |
|
131 | + }else { |
|
132 | 132 | $skip = true; |
133 | 133 | } |
134 | 134 | } |
@@ -145,13 +145,13 @@ discard block |
||
145 | 145 | if (isset($comment_config['callbackFile'])) { |
146 | 146 | $callbackfile = trim($comment_config['callbackFile']); |
147 | 147 | if ($callbackfile != '' |
148 | - && file_exists(XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile)) { |
|
149 | - require_once XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile; |
|
148 | + && file_exists(XOOPS_ROOT_PATH.'/modules/'.$moddir.'/'.$callbackfile)) { |
|
149 | + require_once XOOPS_ROOT_PATH.'/modules/'.$moddir.'/'.$callbackfile; |
|
150 | 150 | } |
151 | 151 | if (!function_exists($comment_config['callback']['update'])) { |
152 | 152 | $skip = true; |
153 | 153 | } |
154 | - } else { |
|
154 | + }else { |
|
155 | 155 | $skip = true; |
156 | 156 | } |
157 | 157 | } |
@@ -181,16 +181,16 @@ discard block |
||
181 | 181 | $not_module = $xoopsModule; |
182 | 182 | if (!isset($comment_url)) { |
183 | 183 | $com_config = $not_module->getInfo('comments'); |
184 | - $comment_url = $com_config['pageName'] . '?'; |
|
184 | + $comment_url = $com_config['pageName'].'?'; |
|
185 | 185 | $comment_url .= $com_config['itemName']; |
186 | 186 | } |
187 | - $comment_tags['X_COMMENT_URL'] = XOOPS_URL . '/modules/' . $not_module->getVar('dirname') . '/' . $comment_url . '=' . $com_itemid . '&com_id=' . $newcid . '&com_rootid=' . $com_rootid . '&com_mode=' . $com_mode . '&com_order=' . $com_order . '#comment' . $newcid; |
|
187 | + $comment_tags['X_COMMENT_URL'] = XOOPS_URL.'/modules/'.$not_module->getVar('dirname').'/'.$comment_url.'='.$com_itemid.'&com_id='.$newcid.'&com_rootid='.$com_rootid.'&com_mode='.$com_mode.'&com_order='.$com_order.'#comment'.$newcid; |
|
188 | 188 | $notificationHandler = xoops_getHandler('notification'); |
189 | 189 | $notificationHandler->triggerEvent($not_category, $not_itemid, $not_event, $comment_tags, false, $not_modid); |
190 | 190 | } |
191 | 191 | |
192 | 192 | PlanetUtility::planetRespondToTrackback(0); |
193 | - } else { |
|
193 | + }else { |
|
194 | 194 | PlanetUtility::planetRespondToTrackback(1, xoops_error($comment->getHtmlErrors())); |
195 | 195 | } |
196 | 196 | } |
@@ -27,8 +27,8 @@ |
||
27 | 27 | include __DIR__ . '/header.php'; |
28 | 28 | $com_itemid = isset($_GET['com_itemid']) ? (int)$_GET['com_itemid'] : 0; |
29 | 29 | if ($com_itemid > 0) { |
30 | - $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
|
31 | - $article_obj = $articleHandler->get($com_itemid); |
|
32 | - $com_replytitle = $article_obj->getVar('art_title'); |
|
33 | - require_once XOOPS_ROOT_PATH . '/include/comment_new.php'; |
|
30 | + $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
|
31 | + $article_obj = $articleHandler->get($com_itemid); |
|
32 | + $com_replytitle = $article_obj->getVar('art_title'); |
|
33 | + require_once XOOPS_ROOT_PATH . '/include/comment_new.php'; |
|
34 | 34 | } |
@@ -24,11 +24,11 @@ |
||
24 | 24 | // URL: https://xoops.org // |
25 | 25 | // Project: Article Project // |
26 | 26 | // ------------------------------------------------------------------------ // |
27 | -include __DIR__ . '/header.php'; |
|
28 | -$com_itemid = isset($_GET['com_itemid']) ? (int)$_GET['com_itemid'] : 0; |
|
29 | -if ($com_itemid > 0) { |
|
27 | +include __DIR__.'/header.php'; |
|
28 | +$com_itemid = isset($_GET['com_itemid']) ? (int) $_GET['com_itemid'] : 0; |
|
29 | +if ($com_itemid>0) { |
|
30 | 30 | $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
31 | 31 | $article_obj = $articleHandler->get($com_itemid); |
32 | 32 | $com_replytitle = $article_obj->getVar('art_title'); |
33 | - require_once XOOPS_ROOT_PATH . '/include/comment_new.php'; |
|
33 | + require_once XOOPS_ROOT_PATH.'/include/comment_new.php'; |
|
34 | 34 | } |
@@ -17,8 +17,8 @@ discard block |
||
17 | 17 | include __DIR__ . '/header.php'; |
18 | 18 | |
19 | 19 | if (PlanetUtility::planetParseArguments($args_num, $args, $args_str)) { |
20 | - $args['article'] = @$args_num[0]; |
|
21 | - $args['op'] = @$args_str[0]; |
|
20 | + $args['article'] = @$args_num[0]; |
|
21 | + $args['op'] = @$args_str[0]; |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | $article_id = Request::getInt('article', Request::getInt('article', @$args['article'], 'POST'), 'GET');//(int)(empty($_GET['article']) ? (empty($_POST['article']) ? @$args['article'] : $_POST['article']) : $_GET['article']); |
@@ -27,33 +27,33 @@ discard block |
||
27 | 27 | $op = strtolower(trim($op)); |
28 | 28 | |
29 | 29 | if (empty($article_id)) { |
30 | - if (empty(Request::getUrl('HTTP_REFERER', '', 'SERVER'))) { |
|
31 | - //$_SERVER['HTTP_REFERER'])) |
|
30 | + if (empty(Request::getUrl('HTTP_REFERER', '', 'SERVER'))) { |
|
31 | + //$_SERVER['HTTP_REFERER'])) |
|
32 | 32 | |
33 | - include XOOPS_ROOT_PATH . '/header.php'; |
|
34 | - xoops_error(_NOPERM); |
|
35 | - $xoopsOption['output_type'] = 'plain'; |
|
36 | - include XOOPS_ROOT_PATH . '/footer.php'; |
|
37 | - exit(); |
|
38 | - } else { |
|
39 | - $ref_parser = parse_url(Request::getUrl('HTTP_REFERER', '', 'SERVER')); //$_SERVER['HTTP_REFERER']); |
|
40 | - $uri_parser = parse_url(Request::getUrl('REQUEST_URI', '', 'SERVER'));// $_SERVER['REQUEST_URI']); |
|
41 | - if ((!empty($ref_parser['host']) && !empty($uri_parser['host']) && $uri_parser['host'] != $ref_parser['host']) |
|
42 | - || ($ref_parser['path'] != $uri_parser['path'])) { |
|
43 | - include XOOPS_ROOT_PATH . '/header.php'; |
|
44 | - include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php'; |
|
45 | - xoops_confirm(array(), 'javascript: window.close();', sprintf(planet_constant('MD_TRANSFER_DONE'), ''), _CLOSE, Request::getUrl('HTTP_REFERER', '', 'SERVER')); |
|
46 | - $xoopsOption['output_type'] = 'plain'; |
|
47 | - include XOOPS_ROOT_PATH . '/footer.php'; |
|
48 | - exit(); |
|
49 | - } else { |
|
50 | - include XOOPS_ROOT_PATH . '/header.php'; |
|
51 | - xoops_error(_NOPERM); |
|
52 | - $xoopsOption['output_type'] = 'plain'; |
|
53 | - include XOOPS_ROOT_PATH . '/footer.php'; |
|
54 | - exit(); |
|
55 | - } |
|
56 | - } |
|
33 | + include XOOPS_ROOT_PATH . '/header.php'; |
|
34 | + xoops_error(_NOPERM); |
|
35 | + $xoopsOption['output_type'] = 'plain'; |
|
36 | + include XOOPS_ROOT_PATH . '/footer.php'; |
|
37 | + exit(); |
|
38 | + } else { |
|
39 | + $ref_parser = parse_url(Request::getUrl('HTTP_REFERER', '', 'SERVER')); //$_SERVER['HTTP_REFERER']); |
|
40 | + $uri_parser = parse_url(Request::getUrl('REQUEST_URI', '', 'SERVER'));// $_SERVER['REQUEST_URI']); |
|
41 | + if ((!empty($ref_parser['host']) && !empty($uri_parser['host']) && $uri_parser['host'] != $ref_parser['host']) |
|
42 | + || ($ref_parser['path'] != $uri_parser['path'])) { |
|
43 | + include XOOPS_ROOT_PATH . '/header.php'; |
|
44 | + include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php'; |
|
45 | + xoops_confirm(array(), 'javascript: window.close();', sprintf(planet_constant('MD_TRANSFER_DONE'), ''), _CLOSE, Request::getUrl('HTTP_REFERER', '', 'SERVER')); |
|
46 | + $xoopsOption['output_type'] = 'plain'; |
|
47 | + include XOOPS_ROOT_PATH . '/footer.php'; |
|
48 | + exit(); |
|
49 | + } else { |
|
50 | + include XOOPS_ROOT_PATH . '/header.php'; |
|
51 | + xoops_error(_NOPERM); |
|
52 | + $xoopsOption['output_type'] = 'plain'; |
|
53 | + include XOOPS_ROOT_PATH . '/footer.php'; |
|
54 | + exit(); |
|
55 | + } |
|
56 | + } |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
@@ -61,37 +61,37 @@ discard block |
||
61 | 61 | |
62 | 62 | // Display option form |
63 | 63 | if (empty($op)) { |
64 | - $module_variables .= "<input type=\"hidden\" name=\"article\" id=\"article\" value=\"{$article_id}\">"; |
|
65 | - include XOOPS_ROOT_PATH . '/Frameworks/transfer/option.transfer.php'; |
|
66 | - exit(); |
|
64 | + $module_variables .= "<input type=\"hidden\" name=\"article\" id=\"article\" value=\"{$article_id}\">"; |
|
65 | + include XOOPS_ROOT_PATH . '/Frameworks/transfer/option.transfer.php'; |
|
66 | + exit(); |
|
67 | 67 | } else { |
68 | - $data = array(); |
|
69 | - $data['id'] = $article_id; |
|
70 | - $data['title'] = $article_obj->getVar('art_title'); |
|
71 | - $data['time'] = $article_obj->getTime('l'); |
|
72 | - $data['image'] = ''; |
|
73 | - $data['source'] = $article_obj->getVar('art_link'); |
|
74 | - $data['url'] = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' . $article_obj->getVar('art_id'); |
|
75 | - $data['author'] = $article_obj->getVar('art_author'); |
|
68 | + $data = array(); |
|
69 | + $data['id'] = $article_id; |
|
70 | + $data['title'] = $article_obj->getVar('art_title'); |
|
71 | + $data['time'] = $article_obj->getTime('l'); |
|
72 | + $data['image'] = ''; |
|
73 | + $data['source'] = $article_obj->getVar('art_link'); |
|
74 | + $data['url'] = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' . $article_obj->getVar('art_id'); |
|
75 | + $data['author'] = $article_obj->getVar('art_author'); |
|
76 | 76 | |
77 | - switch ($op) { |
|
77 | + switch ($op) { |
|
78 | 78 | |
79 | - // Use title |
|
80 | - case 'bookmark': |
|
81 | - break; |
|
79 | + // Use title |
|
80 | + case 'bookmark': |
|
81 | + break; |
|
82 | 82 | |
83 | - case 'print': |
|
84 | - case 'pdf': |
|
85 | - ${"{$op}_data"} =& $data; |
|
86 | - ${"{$op}_data"}['date'] = $pdf_data['time']; |
|
87 | - ${"{$op}_data"}['content'] = $article_obj->getVar('art_content'); |
|
88 | - break; |
|
83 | + case 'print': |
|
84 | + case 'pdf': |
|
85 | + ${"{$op}_data"} =& $data; |
|
86 | + ${"{$op}_data"}['date'] = $pdf_data['time']; |
|
87 | + ${"{$op}_data"}['content'] = $article_obj->getVar('art_content'); |
|
88 | + break; |
|
89 | 89 | |
90 | - case 'newbb': |
|
91 | - default: |
|
92 | - $data['content'] = $article_obj->getSummary(); |
|
93 | - break; |
|
94 | - } |
|
95 | - include XOOPS_ROOT_PATH . '/Frameworks/transfer/action.transfer.php'; |
|
96 | - exit(); |
|
90 | + case 'newbb': |
|
91 | + default: |
|
92 | + $data['content'] = $article_obj->getSummary(); |
|
93 | + break; |
|
94 | + } |
|
95 | + include XOOPS_ROOT_PATH . '/Frameworks/transfer/action.transfer.php'; |
|
96 | + exit(); |
|
97 | 97 | } |
@@ -14,43 +14,43 @@ discard block |
||
14 | 14 | |
15 | 15 | use Xmf\Request; |
16 | 16 | |
17 | -include __DIR__ . '/header.php'; |
|
17 | +include __DIR__.'/header.php'; |
|
18 | 18 | |
19 | 19 | if (PlanetUtility::planetParseArguments($args_num, $args, $args_str)) { |
20 | 20 | $args['article'] = @$args_num[0]; |
21 | 21 | $args['op'] = @$args_str[0]; |
22 | 22 | } |
23 | 23 | |
24 | -$article_id = Request::getInt('article', Request::getInt('article', @$args['article'], 'POST'), 'GET');//(int)(empty($_GET['article']) ? (empty($_POST['article']) ? @$args['article'] : $_POST['article']) : $_GET['article']); |
|
24 | +$article_id = Request::getInt('article', Request::getInt('article', @$args['article'], 'POST'), 'GET'); //(int)(empty($_GET['article']) ? (empty($_POST['article']) ? @$args['article'] : $_POST['article']) : $_GET['article']); |
|
25 | 25 | |
26 | -$op = Request::getString('op', Request::getString('op', @$args['op'], 'POST'), 'GET');//empty($_GET['op']) ? (empty($_POST['op']) ? @$args['op'] : $_POST['op']) : $_GET['op']; |
|
26 | +$op = Request::getString('op', Request::getString('op', @$args['op'], 'POST'), 'GET'); //empty($_GET['op']) ? (empty($_POST['op']) ? @$args['op'] : $_POST['op']) : $_GET['op']; |
|
27 | 27 | $op = strtolower(trim($op)); |
28 | 28 | |
29 | 29 | if (empty($article_id)) { |
30 | 30 | if (empty(Request::getUrl('HTTP_REFERER', '', 'SERVER'))) { |
31 | 31 | //$_SERVER['HTTP_REFERER'])) |
32 | 32 | |
33 | - include XOOPS_ROOT_PATH . '/header.php'; |
|
33 | + include XOOPS_ROOT_PATH.'/header.php'; |
|
34 | 34 | xoops_error(_NOPERM); |
35 | 35 | $xoopsOption['output_type'] = 'plain'; |
36 | - include XOOPS_ROOT_PATH . '/footer.php'; |
|
36 | + include XOOPS_ROOT_PATH.'/footer.php'; |
|
37 | 37 | exit(); |
38 | - } else { |
|
38 | + }else { |
|
39 | 39 | $ref_parser = parse_url(Request::getUrl('HTTP_REFERER', '', 'SERVER')); //$_SERVER['HTTP_REFERER']); |
40 | - $uri_parser = parse_url(Request::getUrl('REQUEST_URI', '', 'SERVER'));// $_SERVER['REQUEST_URI']); |
|
40 | + $uri_parser = parse_url(Request::getUrl('REQUEST_URI', '', 'SERVER')); // $_SERVER['REQUEST_URI']); |
|
41 | 41 | if ((!empty($ref_parser['host']) && !empty($uri_parser['host']) && $uri_parser['host'] != $ref_parser['host']) |
42 | 42 | || ($ref_parser['path'] != $uri_parser['path'])) { |
43 | - include XOOPS_ROOT_PATH . '/header.php'; |
|
44 | - include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php'; |
|
43 | + include XOOPS_ROOT_PATH.'/header.php'; |
|
44 | + include XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/vars.php'; |
|
45 | 45 | xoops_confirm(array(), 'javascript: window.close();', sprintf(planet_constant('MD_TRANSFER_DONE'), ''), _CLOSE, Request::getUrl('HTTP_REFERER', '', 'SERVER')); |
46 | 46 | $xoopsOption['output_type'] = 'plain'; |
47 | - include XOOPS_ROOT_PATH . '/footer.php'; |
|
47 | + include XOOPS_ROOT_PATH.'/footer.php'; |
|
48 | 48 | exit(); |
49 | - } else { |
|
50 | - include XOOPS_ROOT_PATH . '/header.php'; |
|
49 | + }else { |
|
50 | + include XOOPS_ROOT_PATH.'/header.php'; |
|
51 | 51 | xoops_error(_NOPERM); |
52 | 52 | $xoopsOption['output_type'] = 'plain'; |
53 | - include XOOPS_ROOT_PATH . '/footer.php'; |
|
53 | + include XOOPS_ROOT_PATH.'/footer.php'; |
|
54 | 54 | exit(); |
55 | 55 | } |
56 | 56 | } |
@@ -62,16 +62,16 @@ discard block |
||
62 | 62 | // Display option form |
63 | 63 | if (empty($op)) { |
64 | 64 | $module_variables .= "<input type=\"hidden\" name=\"article\" id=\"article\" value=\"{$article_id}\">"; |
65 | - include XOOPS_ROOT_PATH . '/Frameworks/transfer/option.transfer.php'; |
|
65 | + include XOOPS_ROOT_PATH.'/Frameworks/transfer/option.transfer.php'; |
|
66 | 66 | exit(); |
67 | -} else { |
|
67 | +}else { |
|
68 | 68 | $data = array(); |
69 | 69 | $data['id'] = $article_id; |
70 | 70 | $data['title'] = $article_obj->getVar('art_title'); |
71 | 71 | $data['time'] = $article_obj->getTime('l'); |
72 | 72 | $data['image'] = ''; |
73 | 73 | $data['source'] = $article_obj->getVar('art_link'); |
74 | - $data['url'] = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' . $article_obj->getVar('art_id'); |
|
74 | + $data['url'] = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.article.php'.URL_DELIMITER.''.$article_obj->getVar('art_id'); |
|
75 | 75 | $data['author'] = $article_obj->getVar('art_author'); |
76 | 76 | |
77 | 77 | switch ($op) { |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | |
83 | 83 | case 'print': |
84 | 84 | case 'pdf': |
85 | - ${"{$op}_data"} =& $data; |
|
85 | + ${"{$op}_data"} = & $data; |
|
86 | 86 | ${"{$op}_data"}['date'] = $pdf_data['time']; |
87 | 87 | ${"{$op}_data"}['content'] = $article_obj->getVar('art_content'); |
88 | 88 | break; |
@@ -92,6 +92,6 @@ discard block |
||
92 | 92 | $data['content'] = $article_obj->getSummary(); |
93 | 93 | break; |
94 | 94 | } |
95 | - include XOOPS_ROOT_PATH . '/Frameworks/transfer/action.transfer.php'; |
|
95 | + include XOOPS_ROOT_PATH.'/Frameworks/transfer/action.transfer.php'; |
|
96 | 96 | exit(); |
97 | 97 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $blog_id = Request::getInt('blog', Request::getInt('blog', 0, 'POST'), 'GET'); //(int)(isset($_GET['blog']) ? $_GET['blog'] : (isset($_POST['blog']) ? $_POST['blog'] : 0)); |
32 | 32 | |
33 | 33 | if (!is_object($xoopsUser) || empty($blog_id)) { |
34 | - redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_INVALID')); |
|
34 | + redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_INVALID')); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | $bookmarkHandler = xoops_getModuleHandler('bookmark', $GLOBALS['moddirname']); |
@@ -39,14 +39,14 @@ discard block |
||
39 | 39 | $criteria = new CriteriaCompo(new Criteria('blog_id', $blog_id)); |
40 | 40 | $criteria->add(new Criteria('bm_uid', $uid)); |
41 | 41 | if ($count = $bookmarkHandler->getCount($criteria)) { |
42 | - $message = planet_constant('MD_ALREADYBOOKMARKED'); |
|
43 | - redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'u' . $uid, 2, $message); |
|
42 | + $message = planet_constant('MD_ALREADYBOOKMARKED'); |
|
43 | + redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'u' . $uid, 2, $message); |
|
44 | 44 | } |
45 | 45 | $bookmark_obj = $bookmarkHandler->create(); |
46 | 46 | $bookmark_obj->setVar('blog_id', $blog_id); |
47 | 47 | $bookmark_obj->setVar('bm_uid', $uid); |
48 | 48 | if (!$bookmark_id = $bookmarkHandler->insert($bookmark_obj, true)) { |
49 | - redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'b' . $blog_id, 2, planet_constant('MD_NOTSAVED')); |
|
49 | + redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'b' . $blog_id, 2, planet_constant('MD_NOTSAVED')); |
|
50 | 50 | } |
51 | 51 | $blogHandler = xoops_getModuleHandler('blog', $GLOBALS['moddirname']); |
52 | 52 | $blog_obj = $blogHandler->get($blog_id); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | // ------------------------------------------------------------------------ // |
27 | 27 | use Xmf\Request; |
28 | 28 | |
29 | -include __DIR__ . '/header.php'; |
|
29 | +include __DIR__.'/header.php'; |
|
30 | 30 | |
31 | 31 | $blog_id = Request::getInt('blog', Request::getInt('blog', 0, 'POST'), 'GET'); //(int)(isset($_GET['blog']) ? $_GET['blog'] : (isset($_POST['blog']) ? $_POST['blog'] : 0)); |
32 | 32 | |
@@ -40,19 +40,19 @@ discard block |
||
40 | 40 | $criteria->add(new Criteria('bm_uid', $uid)); |
41 | 41 | if ($count = $bookmarkHandler->getCount($criteria)) { |
42 | 42 | $message = planet_constant('MD_ALREADYBOOKMARKED'); |
43 | - redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'u' . $uid, 2, $message); |
|
43 | + redirect_header(XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php'.URL_DELIMITER.'u'.$uid, 2, $message); |
|
44 | 44 | } |
45 | 45 | $bookmark_obj = $bookmarkHandler->create(); |
46 | 46 | $bookmark_obj->setVar('blog_id', $blog_id); |
47 | 47 | $bookmark_obj->setVar('bm_uid', $uid); |
48 | 48 | if (!$bookmark_id = $bookmarkHandler->insert($bookmark_obj, true)) { |
49 | - redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'b' . $blog_id, 2, planet_constant('MD_NOTSAVED')); |
|
49 | + redirect_header(XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php'.URL_DELIMITER.'b'.$blog_id, 2, planet_constant('MD_NOTSAVED')); |
|
50 | 50 | } |
51 | 51 | $blogHandler = xoops_getModuleHandler('blog', $GLOBALS['moddirname']); |
52 | 52 | $blog_obj = $blogHandler->get($blog_id); |
53 | -$marks = $blog_obj->getVar('blog_marks') + 1; |
|
54 | -$blog_obj->setVar('blog_marks', $blog_obj->getVar('blog_marks') + 1); |
|
53 | +$marks = $blog_obj->getVar('blog_marks')+1; |
|
54 | +$blog_obj->setVar('blog_marks', $blog_obj->getVar('blog_marks')+1); |
|
55 | 55 | $blogHandler->insert($blog_obj, true); |
56 | 56 | $message = planet_constant('MD_ACTIONDONE'); |
57 | -redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'b' . $blog_id, 2, $message); |
|
58 | -include __DIR__ . '/footer.php'; |
|
57 | +redirect_header(XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php'.URL_DELIMITER.'b'.$blog_id, 2, $message); |
|
58 | +include __DIR__.'/footer.php'; |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | $configHandler = xoops_getHandler('config'); |
33 | 33 | $xoopsConfigSearch = $configHandler->getConfigsByCat(XOOPS_CONF_SEARCH); |
34 | 34 | if (empty($xoopsConfigSearch['enable_search'])) { |
35 | - redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php', 2, planet_constant('MD_NOACCESS')); |
|
35 | + redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php', 2, planet_constant('MD_NOACCESS')); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | $xoopsConfig['module_cache'][$xoopsModule->getVar('mid')] = 0; |
@@ -50,90 +50,90 @@ discard block |
||
50 | 50 | $blog = Request::getInt('blog', Request::getInt('blog', 0, 'GET'), 'POST');//(int)(isset($_POST['blog']) ? $_POST['blog'] : (isset($_GET['blog']) ? $_GET['blog'] : null)); |
51 | 51 | $uid = Request::getInt('uid', Request::getInt('uid', 0, 'GET'), 'POST');//(int)(isset($_POST['uid']) ? $_POST['uid'] : (isset($_GET['uid']) ? $_GET['uid'] : null)); |
52 | 52 | $searchin = Request::getArray('searchin', 0 !== count(Request::getArray('searchin', array(), 'GET')) ? explode('|', Request::getArray('searchin', array(), 'GET')) : array(), |
53 | - 'POST'); //isset($_POST['searchin']) ? $_POST['searchin'] : (isset($_GET['searchin']) ? explode('|', $_GET['searchin']) : array()); |
|
53 | + 'POST'); //isset($_POST['searchin']) ? $_POST['searchin'] : (isset($_GET['searchin']) ? explode('|', $_GET['searchin']) : array()); |
|
54 | 54 | $sortby = Request::getString('sortby', Request::getString('sortby', null, 'GET'), 'POST');//isset($_POST['sortby']) ? $_POST['sortby'] : (isset($_GET['sortby']) ? $_GET['sortby'] : null); |
55 | 55 | $term = Request::getString('term', Request::getString('term', '', 'GET'), 'POST');//isset($_POST['term']) ? $_POST['term'] : (isset($_GET['term']) ? $_GET['term'] : ''); |
56 | 56 | |
57 | 57 | $andor = in_array(strtoupper($andor), array('OR', 'AND', 'EXACT')) ? strtoupper($andor) : 'OR'; |
58 | 58 | $sortby = in_array(strtolower($sortby), array( |
59 | - 'a.art_id desc', |
|
60 | - 'a.art_time desc', |
|
61 | - 'a.art_title', |
|
62 | - 'a.blog_id', |
|
63 | - 'b.blog_id', |
|
64 | - 'b.blog_feed', |
|
65 | - 'b.blog_title', |
|
66 | - 'b.blog_time' |
|
59 | + 'a.art_id desc', |
|
60 | + 'a.art_time desc', |
|
61 | + 'a.art_title', |
|
62 | + 'a.blog_id', |
|
63 | + 'b.blog_id', |
|
64 | + 'b.blog_feed', |
|
65 | + 'b.blog_title', |
|
66 | + 'b.blog_time' |
|
67 | 67 | )) ? strtolower($sortby) : ''; |
68 | 68 | |
69 | 69 | if (!(empty(Request::getString('submit', '', 'POST')) && empty(Request::getString('term', '', 'GET')))) { |
70 | - $next_search['category'] = $category; |
|
71 | - $next_search['blog'] = $blog; |
|
72 | - $next_search['uid'] = $uid; |
|
73 | - $next_search['andor'] = $andor; |
|
70 | + $next_search['category'] = $category; |
|
71 | + $next_search['blog'] = $blog; |
|
72 | + $next_search['uid'] = $uid; |
|
73 | + $next_search['andor'] = $andor; |
|
74 | 74 | |
75 | - $next_search['term'] = $term; |
|
76 | - $query = trim($term); |
|
75 | + $next_search['term'] = $term; |
|
76 | + $query = trim($term); |
|
77 | 77 | |
78 | - if ($andor !== 'EXACT') { |
|
79 | - $ignored_queries = array(); // holds kewords that are shorter than allowed minmum length |
|
80 | - $temp_queries = preg_split("/[\s,]+/", $query); |
|
81 | - foreach ($temp_queries as $q) { |
|
82 | - $q = trim($q); |
|
83 | - if (strlen($q) >= $xoopsConfigSearch['keyword_min']) { |
|
84 | - $queries[] = $myts->addSlashes($q); |
|
85 | - } else { |
|
86 | - $ignored_queries[] = $myts->addSlashes($q); |
|
87 | - } |
|
88 | - } |
|
89 | - if (count($queries) == 0) { |
|
90 | - redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/search.php', 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min'])); |
|
91 | - } |
|
92 | - } else { |
|
93 | - if (strlen($query) < $xoopsConfigSearch['keyword_min']) { |
|
94 | - redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/search.php', 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min'])); |
|
95 | - } |
|
96 | - $queries = array($myts->addSlashes($query)); |
|
97 | - } |
|
78 | + if ($andor !== 'EXACT') { |
|
79 | + $ignored_queries = array(); // holds kewords that are shorter than allowed minmum length |
|
80 | + $temp_queries = preg_split("/[\s,]+/", $query); |
|
81 | + foreach ($temp_queries as $q) { |
|
82 | + $q = trim($q); |
|
83 | + if (strlen($q) >= $xoopsConfigSearch['keyword_min']) { |
|
84 | + $queries[] = $myts->addSlashes($q); |
|
85 | + } else { |
|
86 | + $ignored_queries[] = $myts->addSlashes($q); |
|
87 | + } |
|
88 | + } |
|
89 | + if (count($queries) == 0) { |
|
90 | + redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/search.php', 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min'])); |
|
91 | + } |
|
92 | + } else { |
|
93 | + if (strlen($query) < $xoopsConfigSearch['keyword_min']) { |
|
94 | + redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/search.php', 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min'])); |
|
95 | + } |
|
96 | + $queries = array($myts->addSlashes($query)); |
|
97 | + } |
|
98 | 98 | |
99 | - $next_search['sortby'] = $sortby; |
|
100 | - $next_search['searchin'] = implode('|', $searchin); |
|
99 | + $next_search['sortby'] = $sortby; |
|
100 | + $next_search['searchin'] = implode('|', $searchin); |
|
101 | 101 | |
102 | - /* To be added: year-month |
|
102 | + /* To be added: year-month |
|
103 | 103 | * see view.archive.php |
104 | 104 | */ |
105 | - if (!empty($time)) { |
|
106 | - $extra = ''; |
|
107 | - } else { |
|
108 | - $extra = ''; |
|
109 | - } |
|
105 | + if (!empty($time)) { |
|
106 | + $extra = ''; |
|
107 | + } else { |
|
108 | + $extra = ''; |
|
109 | + } |
|
110 | 110 | |
111 | - $results = planet_search($queries, $andor, $limit, $start, $uid, $category, $blog, $sortby, $searchin, $extra); |
|
111 | + $results = planet_search($queries, $andor, $limit, $start, $uid, $category, $blog, $sortby, $searchin, $extra); |
|
112 | 112 | |
113 | - /* |
|
113 | + /* |
|
114 | 114 | if ( count($results) < 1 ) { |
115 | 115 | redirect_header("javascript:history.go(-1);", 2, _SR_NOMATCH); |
116 | 116 | } else |
117 | 117 | */ |
118 | - { |
|
119 | - $xoopsTpl->assign('results', $results); |
|
118 | + { |
|
119 | + $xoopsTpl->assign('results', $results); |
|
120 | 120 | |
121 | - if (count($next_search) > 0) { |
|
122 | - $items = array(); |
|
123 | - foreach ($next_search as $para => $val) { |
|
124 | - if (!empty($val)) { |
|
125 | - $items[] = "$para=$val"; |
|
126 | - } |
|
127 | - } |
|
128 | - if (count($items) > 0) { |
|
129 | - $paras = implode('&', $items); |
|
130 | - } |
|
131 | - unset($next_search); |
|
132 | - unset($items); |
|
133 | - } |
|
134 | - $search_url = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/search.php?' . $paras; |
|
121 | + if (count($next_search) > 0) { |
|
122 | + $items = array(); |
|
123 | + foreach ($next_search as $para => $val) { |
|
124 | + if (!empty($val)) { |
|
125 | + $items[] = "$para=$val"; |
|
126 | + } |
|
127 | + } |
|
128 | + if (count($items) > 0) { |
|
129 | + $paras = implode('&', $items); |
|
130 | + } |
|
131 | + unset($next_search); |
|
132 | + unset($items); |
|
133 | + } |
|
134 | + $search_url = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/search.php?' . $paras; |
|
135 | 135 | |
136 | - /* |
|
136 | + /* |
|
137 | 137 | $next_results =& planet_search($queries, $andor, 1, $start + $limit, $uid, $category, $sortby, $searchin, $extra); |
138 | 138 | $next_count = count($next_results); |
139 | 139 | $has_next = false; |
@@ -142,41 +142,41 @@ discard block |
||
142 | 142 | } |
143 | 143 | if (false != $has_next) |
144 | 144 | */ |
145 | - if (count($results)) { |
|
146 | - $next = $start + $limit; |
|
147 | - $queries = implode(',', $queries); |
|
148 | - $search_url_next = $search_url . "&start=$next"; |
|
149 | - $search_next = "<a href=\"" . htmlspecialchars($search_url_next) . "\">" . _SR_NEXT . '</a>'; |
|
150 | - $xoopsTpl->assign('search_next', $search_next); |
|
151 | - } |
|
152 | - if ($start > 0) { |
|
153 | - $prev = $start - $limit; |
|
154 | - $search_url_prev = $search_url . "&start=$prev"; |
|
155 | - $search_prev = "<a href=\"" . htmlspecialchars($search_url_prev) . "\">" . _SR_PREVIOUS . '</a>'; |
|
156 | - $xoopsTpl->assign('search_prev', $search_prev); |
|
157 | - } |
|
158 | - } |
|
145 | + if (count($results)) { |
|
146 | + $next = $start + $limit; |
|
147 | + $queries = implode(',', $queries); |
|
148 | + $search_url_next = $search_url . "&start=$next"; |
|
149 | + $search_next = "<a href=\"" . htmlspecialchars($search_url_next) . "\">" . _SR_NEXT . '</a>'; |
|
150 | + $xoopsTpl->assign('search_next', $search_next); |
|
151 | + } |
|
152 | + if ($start > 0) { |
|
153 | + $prev = $start - $limit; |
|
154 | + $search_url_prev = $search_url . "&start=$prev"; |
|
155 | + $search_prev = "<a href=\"" . htmlspecialchars($search_url_prev) . "\">" . _SR_PREVIOUS . '</a>'; |
|
156 | + $xoopsTpl->assign('search_prev', $search_prev); |
|
157 | + } |
|
158 | + } |
|
159 | 159 | |
160 | - unset($results); |
|
161 | - $search_info = _SR_KEYWORDS . ': ' . $myts->htmlSpecialChars($term); |
|
162 | - $xoopsTpl->assign('search_info', $search_info); |
|
160 | + unset($results); |
|
161 | + $search_info = _SR_KEYWORDS . ': ' . $myts->htmlSpecialChars($term); |
|
162 | + $xoopsTpl->assign('search_info', $search_info); |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | /* type */ |
166 | 166 | $type_select = "<select name=\"andor\">"; |
167 | 167 | $type_select .= "<option value=\"OR\""; |
168 | 168 | if ('OR' === $andor) { |
169 | - $type_select .= " selected=\"selected\""; |
|
169 | + $type_select .= " selected=\"selected\""; |
|
170 | 170 | } |
171 | 171 | $type_select .= '>' . _SR_ANY . '</option>'; |
172 | 172 | $type_select .= "<option value=\"AND\""; |
173 | 173 | if ('AND' === $andor) { |
174 | - $type_select .= " selected=\"selected\""; |
|
174 | + $type_select .= " selected=\"selected\""; |
|
175 | 175 | } |
176 | 176 | $type_select .= '>' . _SR_ALL . '</option>'; |
177 | 177 | $type_select .= "<option value=\"EXACT\""; |
178 | 178 | if ('exact' === $andor) { |
179 | - $type_select .= " selected=\"selected\""; |
|
179 | + $type_select .= " selected=\"selected\""; |
|
180 | 180 | } |
181 | 181 | $type_select .= '>' . _SR_EXACT . '</option>'; |
182 | 182 | $type_select .= '</select>'; |
@@ -185,32 +185,32 @@ discard block |
||
185 | 185 | $searchin_select = ''; |
186 | 186 | $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"title\""; |
187 | 187 | if (in_array('title', $searchin)) { |
188 | - $searchin_select .= ' checked'; |
|
188 | + $searchin_select .= ' checked'; |
|
189 | 189 | } |
190 | 190 | $searchin_select .= '>' . planet_constant('MD_TITLE') . ' '; |
191 | 191 | $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"text\""; |
192 | 192 | if (in_array('text', $searchin)) { |
193 | - $searchin_select .= ' checked'; |
|
193 | + $searchin_select .= ' checked'; |
|
194 | 194 | } |
195 | 195 | $searchin_select .= '>' . planet_constant('MD_BODY') . ' || '; |
196 | 196 | $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"blog\""; |
197 | 197 | if (in_array('blog', $searchin)) { |
198 | - $searchin_select .= ' checked'; |
|
198 | + $searchin_select .= ' checked'; |
|
199 | 199 | } |
200 | 200 | $searchin_select .= '>' . planet_constant('MD_BLOG') . ' '; |
201 | 201 | $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"feed\""; |
202 | 202 | if (in_array('feed', $searchin)) { |
203 | - $searchin_select .= ' checked'; |
|
203 | + $searchin_select .= ' checked'; |
|
204 | 204 | } |
205 | 205 | $searchin_select .= '>' . planet_constant('MD_FEED') . ' '; |
206 | 206 | $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"desc\""; |
207 | 207 | if (in_array('desc', $searchin)) { |
208 | - $searchin_select .= ' checked'; |
|
208 | + $searchin_select .= ' checked'; |
|
209 | 209 | } |
210 | 210 | $searchin_select .= '>' . planet_constant('MD_DESC') . ' '; |
211 | 211 | $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"all\""; |
212 | 212 | if (empty($searchin)) { |
213 | - $searchin_select .= ' checked'; |
|
213 | + $searchin_select .= ' checked'; |
|
214 | 214 | } |
215 | 215 | $searchin_select .= '>' . _ALL . ' '; |
216 | 216 | |
@@ -218,28 +218,28 @@ discard block |
||
218 | 218 | $sortby_select = "<select name=\"sortby\">"; |
219 | 219 | $sortby_select .= "<option value=\"\""; |
220 | 220 | if (empty($sortby)) { |
221 | - $sortby_select .= " selected=\"selected\""; |
|
221 | + $sortby_select .= " selected=\"selected\""; |
|
222 | 222 | } |
223 | 223 | $sortby_select .= '>' . _NONE . '</option>'; |
224 | 224 | $sortby_select .= "<option value=\"a.art_time\""; |
225 | 225 | if ('a.art_time' === $sortby) { |
226 | - $sortby_select .= " selected=\"selected\""; |
|
226 | + $sortby_select .= " selected=\"selected\""; |
|
227 | 227 | } |
228 | 228 | $sortby_select .= '>' . planet_constant('MD_TIME') . '</option>'; |
229 | 229 | $sortby_select .= "<option value=\"a.art_title\""; |
230 | 230 | if ('a.art_title' === $sortby) { |
231 | - $sortby_select .= " selected=\"selected\""; |
|
231 | + $sortby_select .= " selected=\"selected\""; |
|
232 | 232 | } |
233 | 233 | $sortby_select .= '>' . planet_constant('MD_TITLE') . '</option>'; |
234 | 234 | $sortby_select .= "<option value=\"\"> ---- </option>"; |
235 | 235 | $sortby_select .= "<option value=\"a.blog_title\""; |
236 | 236 | if ('a.blog_title' === $sortby) { |
237 | - $sortby_select .= " selected=\"selected\""; |
|
237 | + $sortby_select .= " selected=\"selected\""; |
|
238 | 238 | } |
239 | 239 | $sortby_select .= '>' . planet_constant('MD_BLOG') . '</option>'; |
240 | 240 | $sortby_select .= "<option value=\"a.blog_time\""; |
241 | 241 | if ('b.blog_time' === $sortby) { |
242 | - $sortby_select .= " selected=\"selected\""; |
|
242 | + $sortby_select .= " selected=\"selected\""; |
|
243 | 243 | } |
244 | 244 | $sortby_select .= '>' . planet_constant('MD_UPDATE') . '</option>'; |
245 | 245 | $sortby_select .= '</select>'; |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | $xoopsTpl->assign('uid', $uid); |
257 | 257 | |
258 | 258 | if ($xoopsConfigSearch['keyword_min'] > 0) { |
259 | - $xoopsTpl->assign('search_rule', sprintf(_SR_KEYIGNORE, $xoopsConfigSearch['keyword_min'])); |
|
259 | + $xoopsTpl->assign('search_rule', sprintf(_SR_KEYIGNORE, $xoopsConfigSearch['keyword_min'])); |
|
260 | 260 | } |
261 | 261 | |
262 | 262 | include XOOPS_ROOT_PATH . '/footer.php'; |
@@ -27,32 +27,32 @@ discard block |
||
27 | 27 | use Xmf\Request; |
28 | 28 | |
29 | 29 | $xoopsOption['pagetype'] = 'search'; |
30 | -include __DIR__ . '/header.php'; |
|
30 | +include __DIR__.'/header.php'; |
|
31 | 31 | $xoopsModule->loadLanguage('main'); |
32 | 32 | $configHandler = xoops_getHandler('config'); |
33 | 33 | $xoopsConfigSearch = $configHandler->getConfigsByCat(XOOPS_CONF_SEARCH); |
34 | 34 | if (empty($xoopsConfigSearch['enable_search'])) { |
35 | - redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php', 2, planet_constant('MD_NOACCESS')); |
|
35 | + redirect_header(XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php', 2, planet_constant('MD_NOACCESS')); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | $xoopsConfig['module_cache'][$xoopsModule->getVar('mid')] = 0; |
39 | 39 | $xoopsOption['template_main'] = PlanetUtility::planetGetTemplate('search'); |
40 | -include XOOPS_ROOT_PATH . '/header.php'; |
|
41 | -include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php'; |
|
40 | +include XOOPS_ROOT_PATH.'/header.php'; |
|
41 | +include XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/vars.php'; |
|
42 | 42 | |
43 | -require_once XOOPS_ROOT_PATH . '/modules/' . $GLOBALS['moddirname'] . '/include/search.inc.php'; |
|
43 | +require_once XOOPS_ROOT_PATH.'/modules/'.$GLOBALS['moddirname'].'/include/search.inc.php'; |
|
44 | 44 | $limit = $xoopsModuleConfig['articles_perpage']; |
45 | 45 | |
46 | 46 | $queries = array(); |
47 | -$andor = Request::getString('andor', Request::getString('andor', '', 'GET'), 'POST');//isset($_POST['andor']) ? $_POST['andor'] : (isset($_GET['andor']) ? $_GET['andor'] : ''); |
|
48 | -$start = Request::getInt('start', 0, 'GET');//isset($_GET['start']) ? $_GET['start'] : 0; |
|
47 | +$andor = Request::getString('andor', Request::getString('andor', '', 'GET'), 'POST'); //isset($_POST['andor']) ? $_POST['andor'] : (isset($_GET['andor']) ? $_GET['andor'] : ''); |
|
48 | +$start = Request::getInt('start', 0, 'GET'); //isset($_GET['start']) ? $_GET['start'] : 0; |
|
49 | 49 | $category = Request::getInt('category', Request::getInt('category', 0, 'GET'), 'POST'); //(int)(isset($_POST['category']) ? $_POST['category'] : (isset($_GET['category']) ? $_GET['category'] : null)); |
50 | -$blog = Request::getInt('blog', Request::getInt('blog', 0, 'GET'), 'POST');//(int)(isset($_POST['blog']) ? $_POST['blog'] : (isset($_GET['blog']) ? $_GET['blog'] : null)); |
|
51 | -$uid = Request::getInt('uid', Request::getInt('uid', 0, 'GET'), 'POST');//(int)(isset($_POST['uid']) ? $_POST['uid'] : (isset($_GET['uid']) ? $_GET['uid'] : null)); |
|
50 | +$blog = Request::getInt('blog', Request::getInt('blog', 0, 'GET'), 'POST'); //(int)(isset($_POST['blog']) ? $_POST['blog'] : (isset($_GET['blog']) ? $_GET['blog'] : null)); |
|
51 | +$uid = Request::getInt('uid', Request::getInt('uid', 0, 'GET'), 'POST'); //(int)(isset($_POST['uid']) ? $_POST['uid'] : (isset($_GET['uid']) ? $_GET['uid'] : null)); |
|
52 | 52 | $searchin = Request::getArray('searchin', 0 !== count(Request::getArray('searchin', array(), 'GET')) ? explode('|', Request::getArray('searchin', array(), 'GET')) : array(), |
53 | 53 | 'POST'); //isset($_POST['searchin']) ? $_POST['searchin'] : (isset($_GET['searchin']) ? explode('|', $_GET['searchin']) : array()); |
54 | -$sortby = Request::getString('sortby', Request::getString('sortby', null, 'GET'), 'POST');//isset($_POST['sortby']) ? $_POST['sortby'] : (isset($_GET['sortby']) ? $_GET['sortby'] : null); |
|
55 | -$term = Request::getString('term', Request::getString('term', '', 'GET'), 'POST');//isset($_POST['term']) ? $_POST['term'] : (isset($_GET['term']) ? $_GET['term'] : ''); |
|
54 | +$sortby = Request::getString('sortby', Request::getString('sortby', null, 'GET'), 'POST'); //isset($_POST['sortby']) ? $_POST['sortby'] : (isset($_GET['sortby']) ? $_GET['sortby'] : null); |
|
55 | +$term = Request::getString('term', Request::getString('term', '', 'GET'), 'POST'); //isset($_POST['term']) ? $_POST['term'] : (isset($_GET['term']) ? $_GET['term'] : ''); |
|
56 | 56 | |
57 | 57 | $andor = in_array(strtoupper($andor), array('OR', 'AND', 'EXACT')) ? strtoupper($andor) : 'OR'; |
58 | 58 | $sortby = in_array(strtolower($sortby), array( |
@@ -80,18 +80,18 @@ discard block |
||
80 | 80 | $temp_queries = preg_split("/[\s,]+/", $query); |
81 | 81 | foreach ($temp_queries as $q) { |
82 | 82 | $q = trim($q); |
83 | - if (strlen($q) >= $xoopsConfigSearch['keyword_min']) { |
|
83 | + if (strlen($q)>=$xoopsConfigSearch['keyword_min']) { |
|
84 | 84 | $queries[] = $myts->addSlashes($q); |
85 | - } else { |
|
85 | + }else { |
|
86 | 86 | $ignored_queries[] = $myts->addSlashes($q); |
87 | 87 | } |
88 | 88 | } |
89 | 89 | if (count($queries) == 0) { |
90 | - redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/search.php', 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min'])); |
|
90 | + redirect_header(XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/search.php', 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min'])); |
|
91 | 91 | } |
92 | - } else { |
|
93 | - if (strlen($query) < $xoopsConfigSearch['keyword_min']) { |
|
94 | - redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/search.php', 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min'])); |
|
92 | + }else { |
|
93 | + if (strlen($query)<$xoopsConfigSearch['keyword_min']) { |
|
94 | + redirect_header(XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/search.php', 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min'])); |
|
95 | 95 | } |
96 | 96 | $queries = array($myts->addSlashes($query)); |
97 | 97 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | */ |
105 | 105 | if (!empty($time)) { |
106 | 106 | $extra = ''; |
107 | - } else { |
|
107 | + }else { |
|
108 | 108 | $extra = ''; |
109 | 109 | } |
110 | 110 | |
@@ -118,20 +118,20 @@ discard block |
||
118 | 118 | { |
119 | 119 | $xoopsTpl->assign('results', $results); |
120 | 120 | |
121 | - if (count($next_search) > 0) { |
|
121 | + if (count($next_search)>0) { |
|
122 | 122 | $items = array(); |
123 | 123 | foreach ($next_search as $para => $val) { |
124 | 124 | if (!empty($val)) { |
125 | 125 | $items[] = "$para=$val"; |
126 | 126 | } |
127 | 127 | } |
128 | - if (count($items) > 0) { |
|
128 | + if (count($items)>0) { |
|
129 | 129 | $paras = implode('&', $items); |
130 | 130 | } |
131 | 131 | unset($next_search); |
132 | 132 | unset($items); |
133 | 133 | } |
134 | - $search_url = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/search.php?' . $paras; |
|
134 | + $search_url = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/search.php?'.$paras; |
|
135 | 135 | |
136 | 136 | /* |
137 | 137 | $next_results =& planet_search($queries, $andor, 1, $start + $limit, $uid, $category, $sortby, $searchin, $extra); |
@@ -143,22 +143,22 @@ discard block |
||
143 | 143 | if (false != $has_next) |
144 | 144 | */ |
145 | 145 | if (count($results)) { |
146 | - $next = $start + $limit; |
|
146 | + $next = $start+$limit; |
|
147 | 147 | $queries = implode(',', $queries); |
148 | - $search_url_next = $search_url . "&start=$next"; |
|
149 | - $search_next = "<a href=\"" . htmlspecialchars($search_url_next) . "\">" . _SR_NEXT . '</a>'; |
|
148 | + $search_url_next = $search_url."&start=$next"; |
|
149 | + $search_next = "<a href=\"".htmlspecialchars($search_url_next)."\">"._SR_NEXT.'</a>'; |
|
150 | 150 | $xoopsTpl->assign('search_next', $search_next); |
151 | 151 | } |
152 | - if ($start > 0) { |
|
153 | - $prev = $start - $limit; |
|
154 | - $search_url_prev = $search_url . "&start=$prev"; |
|
155 | - $search_prev = "<a href=\"" . htmlspecialchars($search_url_prev) . "\">" . _SR_PREVIOUS . '</a>'; |
|
152 | + if ($start>0) { |
|
153 | + $prev = $start-$limit; |
|
154 | + $search_url_prev = $search_url."&start=$prev"; |
|
155 | + $search_prev = "<a href=\"".htmlspecialchars($search_url_prev)."\">"._SR_PREVIOUS.'</a>'; |
|
156 | 156 | $xoopsTpl->assign('search_prev', $search_prev); |
157 | 157 | } |
158 | 158 | } |
159 | 159 | |
160 | 160 | unset($results); |
161 | - $search_info = _SR_KEYWORDS . ': ' . $myts->htmlSpecialChars($term); |
|
161 | + $search_info = _SR_KEYWORDS.': '.$myts->htmlSpecialChars($term); |
|
162 | 162 | $xoopsTpl->assign('search_info', $search_info); |
163 | 163 | } |
164 | 164 | |
@@ -168,17 +168,17 @@ discard block |
||
168 | 168 | if ('OR' === $andor) { |
169 | 169 | $type_select .= " selected=\"selected\""; |
170 | 170 | } |
171 | -$type_select .= '>' . _SR_ANY . '</option>'; |
|
171 | +$type_select .= '>'._SR_ANY.'</option>'; |
|
172 | 172 | $type_select .= "<option value=\"AND\""; |
173 | 173 | if ('AND' === $andor) { |
174 | 174 | $type_select .= " selected=\"selected\""; |
175 | 175 | } |
176 | -$type_select .= '>' . _SR_ALL . '</option>'; |
|
176 | +$type_select .= '>'._SR_ALL.'</option>'; |
|
177 | 177 | $type_select .= "<option value=\"EXACT\""; |
178 | 178 | if ('exact' === $andor) { |
179 | 179 | $type_select .= " selected=\"selected\""; |
180 | 180 | } |
181 | -$type_select .= '>' . _SR_EXACT . '</option>'; |
|
181 | +$type_select .= '>'._SR_EXACT.'</option>'; |
|
182 | 182 | $type_select .= '</select>'; |
183 | 183 | |
184 | 184 | /* scope */ |
@@ -187,32 +187,32 @@ discard block |
||
187 | 187 | if (in_array('title', $searchin)) { |
188 | 188 | $searchin_select .= ' checked'; |
189 | 189 | } |
190 | -$searchin_select .= '>' . planet_constant('MD_TITLE') . ' '; |
|
190 | +$searchin_select .= '>'.planet_constant('MD_TITLE').' '; |
|
191 | 191 | $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"text\""; |
192 | 192 | if (in_array('text', $searchin)) { |
193 | 193 | $searchin_select .= ' checked'; |
194 | 194 | } |
195 | -$searchin_select .= '>' . planet_constant('MD_BODY') . ' || '; |
|
195 | +$searchin_select .= '>'.planet_constant('MD_BODY').' || '; |
|
196 | 196 | $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"blog\""; |
197 | 197 | if (in_array('blog', $searchin)) { |
198 | 198 | $searchin_select .= ' checked'; |
199 | 199 | } |
200 | -$searchin_select .= '>' . planet_constant('MD_BLOG') . ' '; |
|
200 | +$searchin_select .= '>'.planet_constant('MD_BLOG').' '; |
|
201 | 201 | $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"feed\""; |
202 | 202 | if (in_array('feed', $searchin)) { |
203 | 203 | $searchin_select .= ' checked'; |
204 | 204 | } |
205 | -$searchin_select .= '>' . planet_constant('MD_FEED') . ' '; |
|
205 | +$searchin_select .= '>'.planet_constant('MD_FEED').' '; |
|
206 | 206 | $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"desc\""; |
207 | 207 | if (in_array('desc', $searchin)) { |
208 | 208 | $searchin_select .= ' checked'; |
209 | 209 | } |
210 | -$searchin_select .= '>' . planet_constant('MD_DESC') . ' '; |
|
210 | +$searchin_select .= '>'.planet_constant('MD_DESC').' '; |
|
211 | 211 | $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"all\""; |
212 | 212 | if (empty($searchin)) { |
213 | 213 | $searchin_select .= ' checked'; |
214 | 214 | } |
215 | -$searchin_select .= '>' . _ALL . ' '; |
|
215 | +$searchin_select .= '>'._ALL.' '; |
|
216 | 216 | |
217 | 217 | /* sortby */ |
218 | 218 | $sortby_select = "<select name=\"sortby\">"; |
@@ -220,28 +220,28 @@ discard block |
||
220 | 220 | if (empty($sortby)) { |
221 | 221 | $sortby_select .= " selected=\"selected\""; |
222 | 222 | } |
223 | -$sortby_select .= '>' . _NONE . '</option>'; |
|
223 | +$sortby_select .= '>'._NONE.'</option>'; |
|
224 | 224 | $sortby_select .= "<option value=\"a.art_time\""; |
225 | 225 | if ('a.art_time' === $sortby) { |
226 | 226 | $sortby_select .= " selected=\"selected\""; |
227 | 227 | } |
228 | -$sortby_select .= '>' . planet_constant('MD_TIME') . '</option>'; |
|
228 | +$sortby_select .= '>'.planet_constant('MD_TIME').'</option>'; |
|
229 | 229 | $sortby_select .= "<option value=\"a.art_title\""; |
230 | 230 | if ('a.art_title' === $sortby) { |
231 | 231 | $sortby_select .= " selected=\"selected\""; |
232 | 232 | } |
233 | -$sortby_select .= '>' . planet_constant('MD_TITLE') . '</option>'; |
|
233 | +$sortby_select .= '>'.planet_constant('MD_TITLE').'</option>'; |
|
234 | 234 | $sortby_select .= "<option value=\"\"> ---- </option>"; |
235 | 235 | $sortby_select .= "<option value=\"a.blog_title\""; |
236 | 236 | if ('a.blog_title' === $sortby) { |
237 | 237 | $sortby_select .= " selected=\"selected\""; |
238 | 238 | } |
239 | -$sortby_select .= '>' . planet_constant('MD_BLOG') . '</option>'; |
|
239 | +$sortby_select .= '>'.planet_constant('MD_BLOG').'</option>'; |
|
240 | 240 | $sortby_select .= "<option value=\"a.blog_time\""; |
241 | 241 | if ('b.blog_time' === $sortby) { |
242 | 242 | $sortby_select .= " selected=\"selected\""; |
243 | 243 | } |
244 | -$sortby_select .= '>' . planet_constant('MD_UPDATE') . '</option>'; |
|
244 | +$sortby_select .= '>'.planet_constant('MD_UPDATE').'</option>'; |
|
245 | 245 | $sortby_select .= '</select>'; |
246 | 246 | |
247 | 247 | $xoopsTpl->assign('type_select', $type_select); |
@@ -255,8 +255,8 @@ discard block |
||
255 | 255 | $xoopsTpl->assign('blog', $blog); |
256 | 256 | $xoopsTpl->assign('uid', $uid); |
257 | 257 | |
258 | -if ($xoopsConfigSearch['keyword_min'] > 0) { |
|
258 | +if ($xoopsConfigSearch['keyword_min']>0) { |
|
259 | 259 | $xoopsTpl->assign('search_rule', sprintf(_SR_KEYIGNORE, $xoopsConfigSearch['keyword_min'])); |
260 | 260 | } |
261 | 261 | |
262 | -include XOOPS_ROOT_PATH . '/footer.php'; |
|
262 | +include XOOPS_ROOT_PATH.'/footer.php'; |
@@ -32,51 +32,51 @@ |
||
32 | 32 | include __DIR__ . '/header.php'; |
33 | 33 | global $pdf_data; |
34 | 34 | if (!empty($_POST['pdf_data'])) { |
35 | - $pdf_data = unserialize(base64_decode(Request::getText('pdf_data', '', 'POST'))); |
|
35 | + $pdf_data = unserialize(base64_decode(Request::getText('pdf_data', '', 'POST'))); |
|
36 | 36 | } elseif (!empty($pdf_data)) { |
37 | 37 | } else { |
38 | - error_reporting(0); |
|
39 | - include __DIR__ . '/header.php'; |
|
40 | - error_reporting(0); |
|
38 | + error_reporting(0); |
|
39 | + include __DIR__ . '/header.php'; |
|
40 | + error_reporting(0); |
|
41 | 41 | |
42 | - if (PlanetUtility::planetParseArguments($args_num, $args, $args_str)) { |
|
43 | - $args['article'] = @$args_num[0]; |
|
44 | - } |
|
42 | + if (PlanetUtility::planetParseArguments($args_num, $args, $args_str)) { |
|
43 | + $args['article'] = @$args_num[0]; |
|
44 | + } |
|
45 | 45 | |
46 | - $article_id = (int)(empty($_GET['article']) ? @$args['article'] : $_GET['article']); |
|
46 | + $article_id = (int)(empty($_GET['article']) ? @$args['article'] : $_GET['article']); |
|
47 | 47 | |
48 | - $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
|
49 | - $article_obj = $articleHandler->get($article_id); |
|
48 | + $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
|
49 | + $article_obj = $articleHandler->get($article_id); |
|
50 | 50 | |
51 | - $article_data = array(); |
|
51 | + $article_data = array(); |
|
52 | 52 | |
53 | - // title |
|
54 | - $article_data['title'] = $article_obj->getVar('art_title'); |
|
53 | + // title |
|
54 | + $article_data['title'] = $article_obj->getVar('art_title'); |
|
55 | 55 | |
56 | - $article_data['author'] = $article_obj->getVar('art_author'); |
|
56 | + $article_data['author'] = $article_obj->getVar('art_author'); |
|
57 | 57 | |
58 | - // source |
|
59 | - $article_data['source'] = $article_obj->getVar('art_link'); |
|
58 | + // source |
|
59 | + $article_data['source'] = $article_obj->getVar('art_link'); |
|
60 | 60 | |
61 | - // publish time |
|
62 | - $article_data['time'] = $article_obj->getTime(); |
|
61 | + // publish time |
|
62 | + $article_data['time'] = $article_obj->getTime(); |
|
63 | 63 | |
64 | - // summary |
|
65 | - $article_data['summary'] = $article_obj->getSummary(); |
|
64 | + // summary |
|
65 | + $article_data['summary'] = $article_obj->getSummary(); |
|
66 | 66 | |
67 | - // text of page |
|
68 | - $article_data['text'] = $article_obj->getVar('art_content'); |
|
67 | + // text of page |
|
68 | + $article_data['text'] = $article_obj->getVar('art_content'); |
|
69 | 69 | |
70 | - // Build the pdf_data array |
|
71 | - $pdf_data['title'] = $article_data['title']; |
|
72 | - $pdf_data['author'] = $article_data['author']; |
|
73 | - $pdf_data['date'] = $article_data['time']; |
|
74 | - $pdf_data['content'] = ''; |
|
75 | - if ($article_data['summary']) { |
|
76 | - $pdf_data['content'] .= planet_constant('MD_SUMMARY') . ': ' . $article_data['summary'] . '<br><br>'; |
|
77 | - } |
|
78 | - $pdf_data['content'] .= $article_data['text'] . '<br>'; |
|
79 | - $pdf_data['url'] = XOOPS_URL . '/modules/' . $GLOBALS['artdirname'] . '/view.article.php' . URL_DELIMITER . $article_obj->getVar('art_id'); |
|
70 | + // Build the pdf_data array |
|
71 | + $pdf_data['title'] = $article_data['title']; |
|
72 | + $pdf_data['author'] = $article_data['author']; |
|
73 | + $pdf_data['date'] = $article_data['time']; |
|
74 | + $pdf_data['content'] = ''; |
|
75 | + if ($article_data['summary']) { |
|
76 | + $pdf_data['content'] .= planet_constant('MD_SUMMARY') . ': ' . $article_data['summary'] . '<br><br>'; |
|
77 | + } |
|
78 | + $pdf_data['content'] .= $article_data['text'] . '<br>'; |
|
79 | + $pdf_data['url'] = XOOPS_URL . '/modules/' . $GLOBALS['artdirname'] . '/view.article.php' . URL_DELIMITER . $article_obj->getVar('art_id'); |
|
80 | 80 | } |
81 | 81 | $pdf_data['filename'] = preg_replace("/[^0-9a-z\-_\.]/i", '', $pdf_data['title']); |
82 | 82 |
@@ -29,21 +29,21 @@ discard block |
||
29 | 29 | |
30 | 30 | use Xmf\Request; |
31 | 31 | |
32 | -include __DIR__ . '/header.php'; |
|
32 | +include __DIR__.'/header.php'; |
|
33 | 33 | global $pdf_data; |
34 | 34 | if (!empty($_POST['pdf_data'])) { |
35 | 35 | $pdf_data = unserialize(base64_decode(Request::getText('pdf_data', '', 'POST'))); |
36 | 36 | } elseif (!empty($pdf_data)) { |
37 | -} else { |
|
37 | +}else { |
|
38 | 38 | error_reporting(0); |
39 | - include __DIR__ . '/header.php'; |
|
39 | + include __DIR__.'/header.php'; |
|
40 | 40 | error_reporting(0); |
41 | 41 | |
42 | 42 | if (PlanetUtility::planetParseArguments($args_num, $args, $args_str)) { |
43 | 43 | $args['article'] = @$args_num[0]; |
44 | 44 | } |
45 | 45 | |
46 | - $article_id = (int)(empty($_GET['article']) ? @$args['article'] : $_GET['article']); |
|
46 | + $article_id = (int) (empty($_GET['article']) ? @$args['article'] : $_GET['article']); |
|
47 | 47 | |
48 | 48 | $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
49 | 49 | $article_obj = $articleHandler->get($article_id); |
@@ -73,14 +73,14 @@ discard block |
||
73 | 73 | $pdf_data['date'] = $article_data['time']; |
74 | 74 | $pdf_data['content'] = ''; |
75 | 75 | if ($article_data['summary']) { |
76 | - $pdf_data['content'] .= planet_constant('MD_SUMMARY') . ': ' . $article_data['summary'] . '<br><br>'; |
|
76 | + $pdf_data['content'] .= planet_constant('MD_SUMMARY').': '.$article_data['summary'].'<br><br>'; |
|
77 | 77 | } |
78 | - $pdf_data['content'] .= $article_data['text'] . '<br>'; |
|
79 | - $pdf_data['url'] = XOOPS_URL . '/modules/' . $GLOBALS['artdirname'] . '/view.article.php' . URL_DELIMITER . $article_obj->getVar('art_id'); |
|
78 | + $pdf_data['content'] .= $article_data['text'].'<br>'; |
|
79 | + $pdf_data['url'] = XOOPS_URL.'/modules/'.$GLOBALS['artdirname'].'/view.article.php'.URL_DELIMITER.$article_obj->getVar('art_id'); |
|
80 | 80 | } |
81 | 81 | $pdf_data['filename'] = preg_replace("/[^0-9a-z\-_\.]/i", '', $pdf_data['title']); |
82 | 82 | |
83 | -include XOOPS_ROOT_PATH . '/Frameworks/fpdf/init.php'; |
|
83 | +include XOOPS_ROOT_PATH.'/Frameworks/fpdf/init.php'; |
|
84 | 84 | error_reporting(0); |
85 | 85 | ob_end_clean(); |
86 | 86 |
@@ -18,6 +18,6 @@ |
||
18 | 18 | */ |
19 | 19 | |
20 | 20 | $pathIcon32 = \Xmf\Module\Admin::iconUrl('', 32); |
21 | -echo "<div class='adminfooter'>\n" . " <div style='text-align: center;'>\n" . " <a href='https://xoops.org' rel='external'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n" . " </div>\n" . ' ' . _AM_MODULEADMIN_ADMIN_FOOTER . "\n" . '</div>'; |
|
21 | +echo "<div class='adminfooter'>\n"." <div style='text-align: center;'>\n"." <a href='https://xoops.org' rel='external'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n"." </div>\n".' '._AM_MODULEADMIN_ADMIN_FOOTER."\n".'</div>'; |
|
22 | 22 | |
23 | 23 | xoops_cp_footer(); |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | if (false !== ($moduleHelper = Xmf\Module\Helper::getHelper($moduleDirName))) { |
32 | 32 | } else { |
33 | - $moduleHelper = Xmf\Module\Helper::getHelper('system'); |
|
33 | + $moduleHelper = Xmf\Module\Helper::getHelper('system'); |
|
34 | 34 | } |
35 | 35 | $adminObject = \Xmf\Module\Admin::getInstance(); |
36 | 36 | |
@@ -46,8 +46,8 @@ discard block |
||
46 | 46 | $myts = MyTextSanitizer::getInstance(); |
47 | 47 | |
48 | 48 | if (!isset($GLOBALS['xoopsTpl']) || !($GLOBALS['xoopsTpl'] instanceof XoopsTpl)) { |
49 | - require_once $GLOBALS['xoops']->path('class/template.php'); |
|
50 | - $xoopsTpl = new XoopsTpl(); |
|
49 | + require_once $GLOBALS['xoops']->path('class/template.php'); |
|
50 | + $xoopsTpl = new XoopsTpl(); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | require XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php'; |
@@ -18,10 +18,10 @@ discard block |
||
18 | 18 | */ |
19 | 19 | |
20 | 20 | $path = dirname(dirname(dirname(__DIR__))); |
21 | -require_once $path . '/mainfile.php'; |
|
22 | -require_once $path . '/include/cp_functions.php'; |
|
23 | -require_once $path . '/include/cp_header.php'; |
|
24 | -require_once __DIR__ . '/../class/utility.php'; |
|
21 | +require_once $path.'/mainfile.php'; |
|
22 | +require_once $path.'/include/cp_functions.php'; |
|
23 | +require_once $path.'/include/cp_header.php'; |
|
24 | +require_once __DIR__.'/../class/utility.php'; |
|
25 | 25 | |
26 | 26 | //require_once __DIR__ . '/../class/utility.php'; |
27 | 27 | //require_once __DIR__ . '/../include/common.php'; |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $moduleDirName = basename(dirname(__DIR__)); |
30 | 30 | |
31 | 31 | if (false !== ($moduleHelper = Xmf\Module\Helper::getHelper($moduleDirName))) { |
32 | -} else { |
|
32 | +}else { |
|
33 | 33 | $moduleHelper = Xmf\Module\Helper::getHelper('system'); |
34 | 34 | } |
35 | 35 | $adminObject = \Xmf\Module\Admin::getInstance(); |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | $xoopsTpl = new XoopsTpl(); |
51 | 51 | } |
52 | 52 | |
53 | -require XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php'; |
|
53 | +require XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/vars.php'; |
|
54 | 54 | //require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/functions.php'; |
55 | -require_once XOOPS_ROOT_PATH . '/Frameworks/art/functions.admin.php'; |
|
55 | +require_once XOOPS_ROOT_PATH.'/Frameworks/art/functions.admin.php'; |
|
56 | 56 | |
57 | 57 | planet_define_url_delimiter(); |
@@ -41,18 +41,18 @@ discard block |
||
41 | 41 | |
42 | 42 | $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
43 | 43 | if (!empty($xoopsModuleConfig['article_expire'])) { |
44 | - $criteria = new Criteria('art_time', time() - $xoopsModuleConfig['article_expire'] * 60 * 60 * 24, '<'); |
|
45 | - if (!empty($_GET['purge'])) { |
|
46 | - $crit = new CriteriaCompo($criteria); |
|
47 | - $crit->add(new Criteria('art_comments', 0)); |
|
48 | - $article_expires = $articleHandler->getObjects($criteria); |
|
49 | - foreach ($article_expires as $id => $article_obj) { |
|
50 | - $articleHandler->delete($article_obj); |
|
51 | - } |
|
52 | - } |
|
53 | - $article_count_expire = $articleHandler->getCount($criteria); |
|
44 | + $criteria = new Criteria('art_time', time() - $xoopsModuleConfig['article_expire'] * 60 * 60 * 24, '<'); |
|
45 | + if (!empty($_GET['purge'])) { |
|
46 | + $crit = new CriteriaCompo($criteria); |
|
47 | + $crit->add(new Criteria('art_comments', 0)); |
|
48 | + $article_expires = $articleHandler->getObjects($criteria); |
|
49 | + foreach ($article_expires as $id => $article_obj) { |
|
50 | + $articleHandler->delete($article_obj); |
|
51 | + } |
|
52 | + } |
|
53 | + $article_count_expire = $articleHandler->getCount($criteria); |
|
54 | 54 | } else { |
55 | - $article_count_expire = 0; |
|
55 | + $article_count_expire = 0; |
|
56 | 56 | } |
57 | 57 | $article_count = $articleHandler->getCount(); |
58 | 58 | |
@@ -61,8 +61,8 @@ discard block |
||
61 | 61 | echo "<br clear=\"all\">" . planet_constant('AM_COUNT') . ': ' . $article_count; |
62 | 62 | echo "<br clear=\"all\">"; |
63 | 63 | if ($article_count_expire > 0) { |
64 | - echo "<br clear=\"all\"><a href=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . "/admin/admin.article.php?purge=1\" >" . planet_constant('AM_EXPIRED') . ': ' . $article_count_expire . '</a>'; |
|
65 | - echo "<br clear=\"all\">"; |
|
64 | + echo "<br clear=\"all\"><a href=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . "/admin/admin.article.php?purge=1\" >" . planet_constant('AM_EXPIRED') . ': ' . $article_count_expire . '</a>'; |
|
65 | + echo "<br clear=\"all\">"; |
|
66 | 66 | } |
67 | 67 | echo '</div>'; |
68 | 68 | echo "</fieldset><br clear=\"all\">"; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | // URL: https://xoops.org // |
25 | 25 | // Project: Article Project // |
26 | 26 | // ------------------------------------------------------------------------ // |
27 | -require_once __DIR__ . '/admin_header.php'; |
|
27 | +require_once __DIR__.'/admin_header.php'; |
|
28 | 28 | |
29 | 29 | xoops_cp_header(); |
30 | 30 | $adminObject = \Xmf\Module\Admin::getInstance(); |
@@ -36,12 +36,12 @@ discard block |
||
36 | 36 | * This is a tricky fix for incomplete solution of module cone |
37 | 37 | * it is expected to have a better solution in article 1.0 |
38 | 38 | */ |
39 | -require XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php'; |
|
39 | +require XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/vars.php'; |
|
40 | 40 | //planet_adminmenu(3); |
41 | 41 | |
42 | 42 | $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
43 | 43 | if (!empty($xoopsModuleConfig['article_expire'])) { |
44 | - $criteria = new Criteria('art_time', time() - $xoopsModuleConfig['article_expire'] * 60 * 60 * 24, '<'); |
|
44 | + $criteria = new Criteria('art_time', time()-$xoopsModuleConfig['article_expire']*60*60*24, '<'); |
|
45 | 45 | if (!empty($_GET['purge'])) { |
46 | 46 | $crit = new CriteriaCompo($criteria); |
47 | 47 | $crit->add(new Criteria('art_comments', 0)); |
@@ -51,17 +51,17 @@ discard block |
||
51 | 51 | } |
52 | 52 | } |
53 | 53 | $article_count_expire = $articleHandler->getCount($criteria); |
54 | -} else { |
|
54 | +}else { |
|
55 | 55 | $article_count_expire = 0; |
56 | 56 | } |
57 | 57 | $article_count = $articleHandler->getCount(); |
58 | 58 | |
59 | -echo "<fieldset><legend style=\"font-weight: bold; color: #900;\">" . planet_constant('AM_ARTICLES') . '</legend>'; |
|
59 | +echo "<fieldset><legend style=\"font-weight: bold; color: #900;\">".planet_constant('AM_ARTICLES').'</legend>'; |
|
60 | 60 | echo "<div style=\"padding: 8px;\">"; |
61 | -echo "<br clear=\"all\">" . planet_constant('AM_COUNT') . ': ' . $article_count; |
|
61 | +echo "<br clear=\"all\">".planet_constant('AM_COUNT').': '.$article_count; |
|
62 | 62 | echo "<br clear=\"all\">"; |
63 | -if ($article_count_expire > 0) { |
|
64 | - echo "<br clear=\"all\"><a href=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . "/admin/admin.article.php?purge=1\" >" . planet_constant('AM_EXPIRED') . ': ' . $article_count_expire . '</a>'; |
|
63 | +if ($article_count_expire>0) { |
|
64 | + echo "<br clear=\"all\"><a href=\"".XOOPS_URL.'/modules/'.$GLOBALS['moddirname']."/admin/admin.article.php?purge=1\" >".planet_constant('AM_EXPIRED').': '.$article_count_expire.'</a>'; |
|
65 | 65 | echo "<br clear=\"all\">"; |
66 | 66 | } |
67 | 67 | echo '</div>'; |