@@ -43,28 +43,28 @@ |
||
43 | 43 | $categories_option = $categoryHandler->getList(); |
44 | 44 | natsort($categories_option); |
45 | 45 | if (count($categories_option)) { |
46 | - $cat_option_tray = new XoopsFormElementTray(planet_constant('MD_CATEGORY'), '<br>'); |
|
47 | - $options = [0 => _NONE]; |
|
48 | - foreach ($categories_option as $id => $title) { |
|
49 | - $options[$id] = $title; |
|
50 | - } |
|
51 | - $cat_select = new XoopsFormSelect('', 'categories', $categories, 3, true); |
|
52 | - $cat_select->addOptionArray($options); |
|
53 | - $cat_option_tray->addElement($cat_select); |
|
54 | - $form->addElement($cat_option_tray); |
|
46 | + $cat_option_tray = new XoopsFormElementTray(planet_constant('MD_CATEGORY'), '<br>'); |
|
47 | + $options = [0 => _NONE]; |
|
48 | + foreach ($categories_option as $id => $title) { |
|
49 | + $options[$id] = $title; |
|
50 | + } |
|
51 | + $cat_select = new XoopsFormSelect('', 'categories', $categories, 3, true); |
|
52 | + $cat_select->addOptionArray($options); |
|
53 | + $cat_option_tray->addElement($cat_select); |
|
54 | + $form->addElement($cat_option_tray); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | /* For admin only */ |
58 | 58 | if (is_object($xoopsUser) && $xoopsUser->isAdmin()) { |
59 | - $status_option_tray = new XoopsFormElementTray(planet_constant('MD_STATUS'), '<br>'); |
|
60 | - $status_select = new XoopsFormSelect('', 'blog_status', $blog_obj->getVar('blog_status')); |
|
61 | - $status_select->addOptionArray([ |
|
62 | - '0' => planet_constant('MD_PENDING'), |
|
63 | - '1' => planet_constant('MD_ACTIVE'), |
|
64 | - '2' => planet_constant('MD_FEATURED') |
|
65 | - ]); |
|
66 | - $status_option_tray->addElement($status_select); |
|
67 | - $form->addElement($status_option_tray); |
|
59 | + $status_option_tray = new XoopsFormElementTray(planet_constant('MD_STATUS'), '<br>'); |
|
60 | + $status_select = new XoopsFormSelect('', 'blog_status', $blog_obj->getVar('blog_status')); |
|
61 | + $status_select->addOptionArray([ |
|
62 | + '0' => planet_constant('MD_PENDING'), |
|
63 | + '1' => planet_constant('MD_ACTIVE'), |
|
64 | + '2' => planet_constant('MD_FEATURED') |
|
65 | + ]); |
|
66 | + $status_option_tray->addElement($status_select); |
|
67 | + $form->addElement($status_option_tray); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | $form->addElement(new XoopsFormHidden('blog', $blog_id)); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | // ------------------------------------------------------------------------ // |
27 | 27 | // defined('XOOPS_ROOT_PATH') || exit('Restricted access.'); |
28 | 28 | |
29 | -require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
29 | +require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
30 | 30 | $categoryHandler = xoops_getModuleHandler('category', $GLOBALS['moddirname']); |
31 | 31 | |
32 | 32 | $form = new XoopsThemeForm(_EDIT, 'formblog', xoops_getenv('PHP_SELF'), 'POST', true); |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $butt_save = new XoopsFormButton('', 'submit', _SUBMIT, 'submit'); |
77 | 77 | $button_tray->addElement($butt_save); |
78 | 78 | $butt_cancel = new XoopsFormButton('', 'cancel', _CANCEL, 'button'); |
79 | -$butt_cancel->setExtra("onclick='window.document.location=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'b' . (int)$blog_id . "\"'"); |
|
79 | +$butt_cancel->setExtra("onclick='window.document.location=\"".XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php'.URL_DELIMITER.'b'.(int) $blog_id."\"'"); |
|
80 | 80 | $button_tray->addElement($butt_cancel); |
81 | 81 | $form->addElement($button_tray); |
82 | 82 | $form->display(); |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | // defined('XOOPS_ROOT_PATH') || exit('Restricted access.'); |
16 | 16 | |
17 | 17 | if (!@require_once XOOPS_ROOT_PATH . '/Frameworks/transfer/transfer.php') { |
18 | - return null; |
|
18 | + return null; |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | // Specify the addons to skip for the module |
@@ -28,41 +28,41 @@ discard block |
||
28 | 28 | */ |
29 | 29 | class ModuleTransferHandler extends TransferHandler |
30 | 30 | { |
31 | - /** |
|
32 | - * ModuleTransferHandler constructor. |
|
33 | - */ |
|
34 | - public function __construct() |
|
35 | - { |
|
36 | - parent::__construct(); |
|
37 | - } |
|
31 | + /** |
|
32 | + * ModuleTransferHandler constructor. |
|
33 | + */ |
|
34 | + public function __construct() |
|
35 | + { |
|
36 | + parent::__construct(); |
|
37 | + } |
|
38 | 38 | |
39 | - /** |
|
40 | - * Get valid addon list |
|
41 | - * |
|
42 | - * @param array $skip Addons to skip |
|
43 | - * @param boolean $sort To sort the list upon 'level' |
|
44 | - * return array $list |
|
45 | - */ |
|
46 | - public function &getList($skip = [], $sort = true) |
|
47 | - { |
|
48 | - $list = parent::getList($skip, $sort); |
|
39 | + /** |
|
40 | + * Get valid addon list |
|
41 | + * |
|
42 | + * @param array $skip Addons to skip |
|
43 | + * @param boolean $sort To sort the list upon 'level' |
|
44 | + * return array $list |
|
45 | + */ |
|
46 | + public function &getList($skip = [], $sort = true) |
|
47 | + { |
|
48 | + $list = parent::getList($skip, $sort); |
|
49 | 49 | |
50 | - return $list; |
|
51 | - } |
|
50 | + return $list; |
|
51 | + } |
|
52 | 52 | |
53 | - /** |
|
54 | - * If need change config of an item |
|
55 | - * 1 parent::load_item |
|
56 | - * 2 $this->config |
|
57 | - * 3 $this->do_transfer |
|
58 | - * @param $item |
|
59 | - * @param $data |
|
60 | - * @return |
|
61 | - */ |
|
62 | - public function do_transfer($item, &$data) |
|
63 | - { |
|
64 | - $ret = parent::do_transfer($item, $data); |
|
53 | + /** |
|
54 | + * If need change config of an item |
|
55 | + * 1 parent::load_item |
|
56 | + * 2 $this->config |
|
57 | + * 3 $this->do_transfer |
|
58 | + * @param $item |
|
59 | + * @param $data |
|
60 | + * @return |
|
61 | + */ |
|
62 | + public function do_transfer($item, &$data) |
|
63 | + { |
|
64 | + $ret = parent::do_transfer($item, $data); |
|
65 | 65 | |
66 | - return $ret; |
|
67 | - } |
|
66 | + return $ret; |
|
67 | + } |
|
68 | 68 | } |
@@ -14,7 +14,7 @@ |
||
14 | 14 | |
15 | 15 | // defined('XOOPS_ROOT_PATH') || exit('Restricted access.'); |
16 | 16 | |
17 | -if (!@require_once XOOPS_ROOT_PATH . '/Frameworks/transfer/transfer.php') { |
|
17 | +if (!@require_once XOOPS_ROOT_PATH.'/Frameworks/transfer/transfer.php') { |
|
18 | 18 | return null; |
19 | 19 | } |
20 | 20 |
@@ -27,7 +27,7 @@ |
||
27 | 27 | |
28 | 28 | // defined('XOOPS_ROOT_PATH') || exit('Restricted access.'); |
29 | 29 | |
30 | -include __DIR__ . '/vars.php'; |
|
30 | +include __DIR__.'/vars.php'; |
|
31 | 31 | //mod_loadFunctions('', $GLOBALS['moddirname']); |
32 | 32 | |
33 | 33 | PlanetUtility::planetParseFunction(' |
@@ -19,7 +19,7 @@ |
||
19 | 19 | |
20 | 20 | // defined('XOOPS_ROOT_PATH') || exit('Restricted access.'); |
21 | 21 | |
22 | -include __DIR__ . '/vars.php'; |
|
22 | +include __DIR__.'/vars.php'; |
|
23 | 23 | //mod_loadFunctions('', $GLOBALS['moddirname']); |
24 | 24 | |
25 | 25 | PlanetUtility::planetParseFunction(' |
@@ -27,7 +27,7 @@ |
||
27 | 27 | |
28 | 28 | // defined('XOOPS_ROOT_PATH') || exit('Restricted access.'); |
29 | 29 | |
30 | -include __DIR__ . '/vars.php'; |
|
30 | +include __DIR__.'/vars.php'; |
|
31 | 31 | //mod_loadFunctions('', $GLOBALS['moddirname']); |
32 | 32 | |
33 | 33 | PlanetUtility::planetParseFunction(' |
@@ -27,7 +27,7 @@ |
||
27 | 27 | |
28 | 28 | // defined('XOOPS_ROOT_PATH') || exit('Restricted access.'); |
29 | 29 | |
30 | -include __DIR__ . '/vars.php'; |
|
30 | +include __DIR__.'/vars.php'; |
|
31 | 31 | //mod_loadFunctions('', $GLOBALS['moddirname']); |
32 | 32 | |
33 | 33 | PlanetUtility::planetParseFunction(' |
@@ -27,13 +27,13 @@ discard block |
||
27 | 27 | include __DIR__ . '/header.php'; |
28 | 28 | |
29 | 29 | if (preg_match("/\/notification_update\.php/i", $_SERVER['REQUEST_URI'], $matches)) { |
30 | - include XOOPS_ROOT_PATH . '/include/notification_update.php'; |
|
31 | - exit(); |
|
30 | + include XOOPS_ROOT_PATH . '/include/notification_update.php'; |
|
31 | + exit(); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | if ($REQUEST_URI_parsed = PlanetUtility::planetParseArguments($args_num, $args, $args_str)) { |
35 | - $args['start'] = @$args_num[0]; |
|
36 | - $args['sort'] = @$args_str[0]; |
|
35 | + $args['start'] = @$args_num[0]; |
|
36 | + $args['sort'] = @$args_str[0]; |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | /* Start */ |
@@ -51,20 +51,20 @@ discard block |
||
51 | 51 | |
52 | 52 | // restore $_SERVER['REQUEST_URI'] |
53 | 53 | if (!empty($REQUEST_URI_parsed)) { |
54 | - $args_REQUEST_URI = []; |
|
55 | - $_args = ['start', 'sort', 'uid', 'list']; |
|
56 | - foreach ($_args as $arg) { |
|
57 | - if (!empty(${$arg})) { |
|
58 | - $args_REQUEST_URI[] = $arg . '=' . ${$arg}; |
|
59 | - } |
|
60 | - } |
|
61 | - if (!empty($blog_id)) { |
|
62 | - $args_REQUEST_URI[] = 'blog=' . $blog_id; |
|
63 | - } |
|
64 | - if (!empty($category_id)) { |
|
65 | - $args_REQUEST_URI[] = 'category=' . $category_id; |
|
66 | - } |
|
67 | - $_SERVER['REQUEST_URI'] = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . (empty($args_REQUEST_URI) ? '' : '?' . implode('&', $args_REQUEST_URI)); |
|
54 | + $args_REQUEST_URI = []; |
|
55 | + $_args = ['start', 'sort', 'uid', 'list']; |
|
56 | + foreach ($_args as $arg) { |
|
57 | + if (!empty(${$arg})) { |
|
58 | + $args_REQUEST_URI[] = $arg . '=' . ${$arg}; |
|
59 | + } |
|
60 | + } |
|
61 | + if (!empty($blog_id)) { |
|
62 | + $args_REQUEST_URI[] = 'blog=' . $blog_id; |
|
63 | + } |
|
64 | + if (!empty($category_id)) { |
|
65 | + $args_REQUEST_URI[] = 'category=' . $category_id; |
|
66 | + } |
|
67 | + $_SERVER['REQUEST_URI'] = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . (empty($args_REQUEST_URI) ? '' : '?' . implode('&', $args_REQUEST_URI)); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | $GLOBALS['xoopsOption']['template_main'] = PlanetUtility::planetGetTemplate('index'); |
@@ -89,73 +89,73 @@ discard block |
||
89 | 89 | $article_prefix = ''; |
90 | 90 | /* Specific category */ |
91 | 91 | if ($category_id > 0) { |
92 | - $category_obj = $categoryHandler->get($category_id); |
|
93 | - $criteria->add(new Criteria('bc.cat_id', $category_id)); |
|
94 | - $uid = 0; |
|
95 | - $blog_id = 0; |
|
96 | - $category_data = ['id' => $category_id, 'title' => $category_obj->getVar('cat_title')]; |
|
97 | - $query_type = 'category'; |
|
98 | - $article_prefix = 'a.'; |
|
92 | + $category_obj = $categoryHandler->get($category_id); |
|
93 | + $criteria->add(new Criteria('bc.cat_id', $category_id)); |
|
94 | + $uid = 0; |
|
95 | + $blog_id = 0; |
|
96 | + $category_data = ['id' => $category_id, 'title' => $category_obj->getVar('cat_title')]; |
|
97 | + $query_type = 'category'; |
|
98 | + $article_prefix = 'a.'; |
|
99 | 99 | } |
100 | 100 | /* Specific blog */ |
101 | 101 | if ($blog_id > 0) { |
102 | - $blog_obj = $blogHandler->get($blog_id); |
|
103 | - if ($blog_obj->getVar('blog_status') |
|
104 | - || (is_object($xoopsUser) |
|
105 | - && $xoopsUser->getVar('uid') == $blog_obj->getVar('blog_submitter'))) { |
|
106 | - $criteria->add(new Criteria('blog_id', $blog_id)); |
|
107 | - $category_id = 0; |
|
108 | - $uid = 0; |
|
109 | - $bookmarkHandler = xoops_getModuleHandler('bookmark', $GLOBALS['moddirname']); |
|
110 | - $blog_data = [ |
|
111 | - 'id' => $blog_id, |
|
112 | - 'title' => $blog_obj->getVar('blog_title'), |
|
113 | - 'image' => $blog_obj->getImage(), |
|
114 | - 'title' => $blog_obj->getVar('blog_title'), |
|
115 | - 'feed' => $blog_obj->getVar('blog_feed'), |
|
116 | - 'link' => $blog_obj->getVar('blog_link'), |
|
117 | - 'desc' => $blog_obj->getVar('blog_desc'), |
|
118 | - 'time' => $blog_obj->getTime(), |
|
119 | - 'star' => $blog_obj->getStar(), |
|
120 | - 'rates' => $blog_obj->getVar('blog_rates'), |
|
121 | - 'marks' => $blog_obj->getVar('blog_marks') |
|
122 | - ]; |
|
123 | - } |
|
124 | - $query_type = 'blog'; |
|
125 | - $article_prefix = ''; |
|
102 | + $blog_obj = $blogHandler->get($blog_id); |
|
103 | + if ($blog_obj->getVar('blog_status') |
|
104 | + || (is_object($xoopsUser) |
|
105 | + && $xoopsUser->getVar('uid') == $blog_obj->getVar('blog_submitter'))) { |
|
106 | + $criteria->add(new Criteria('blog_id', $blog_id)); |
|
107 | + $category_id = 0; |
|
108 | + $uid = 0; |
|
109 | + $bookmarkHandler = xoops_getModuleHandler('bookmark', $GLOBALS['moddirname']); |
|
110 | + $blog_data = [ |
|
111 | + 'id' => $blog_id, |
|
112 | + 'title' => $blog_obj->getVar('blog_title'), |
|
113 | + 'image' => $blog_obj->getImage(), |
|
114 | + 'title' => $blog_obj->getVar('blog_title'), |
|
115 | + 'feed' => $blog_obj->getVar('blog_feed'), |
|
116 | + 'link' => $blog_obj->getVar('blog_link'), |
|
117 | + 'desc' => $blog_obj->getVar('blog_desc'), |
|
118 | + 'time' => $blog_obj->getTime(), |
|
119 | + 'star' => $blog_obj->getStar(), |
|
120 | + 'rates' => $blog_obj->getVar('blog_rates'), |
|
121 | + 'marks' => $blog_obj->getVar('blog_marks') |
|
122 | + ]; |
|
123 | + } |
|
124 | + $query_type = 'blog'; |
|
125 | + $article_prefix = ''; |
|
126 | 126 | } |
127 | 127 | /* User bookmarks(favorites) */ |
128 | 128 | if ($uid > 0) { |
129 | - $criteria->add(new Criteria('bm.bm_uid', $uid)); |
|
130 | - $category_id = 0; |
|
131 | - $blog_id = 0; |
|
132 | - $bookmarkHandler = xoops_getModuleHandler('bookmark', $GLOBALS['moddirname']); |
|
133 | - $user_data = [ |
|
134 | - 'uid' => $uid, |
|
135 | - 'name' => XoopsUser::getUnameFromId($uid), |
|
136 | - 'marks' => $bookmarkHandler->getCount(new Criteria('bm_uid', $uid)) |
|
137 | - ]; |
|
138 | - $query_type = 'bookmark'; |
|
139 | - $article_prefix = 'a.'; |
|
129 | + $criteria->add(new Criteria('bm.bm_uid', $uid)); |
|
130 | + $category_id = 0; |
|
131 | + $blog_id = 0; |
|
132 | + $bookmarkHandler = xoops_getModuleHandler('bookmark', $GLOBALS['moddirname']); |
|
133 | + $user_data = [ |
|
134 | + 'uid' => $uid, |
|
135 | + 'name' => XoopsUser::getUnameFromId($uid), |
|
136 | + 'marks' => $bookmarkHandler->getCount(new Criteria('bm_uid', $uid)) |
|
137 | + ]; |
|
138 | + $query_type = 'bookmark'; |
|
139 | + $article_prefix = 'a.'; |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | /* Sort */ |
143 | 143 | $order = 'DESC'; |
144 | 144 | $sort = empty($sort) ? 'time' : $sort; |
145 | 145 | switch ($sort) { |
146 | - case 'views': |
|
147 | - $sortby = $article_prefix . 'art_views'; |
|
148 | - break; |
|
149 | - case 'rating': |
|
150 | - $sortby = $article_prefix . 'art_rating'; |
|
151 | - break; |
|
152 | - case 'time': |
|
153 | - $sortby = $article_prefix . 'art_time'; |
|
154 | - break; |
|
155 | - case 'default': |
|
156 | - default: |
|
157 | - $sortby = ''; |
|
158 | - break; |
|
146 | + case 'views': |
|
147 | + $sortby = $article_prefix . 'art_views'; |
|
148 | + break; |
|
149 | + case 'rating': |
|
150 | + $sortby = $article_prefix . 'art_rating'; |
|
151 | + break; |
|
152 | + case 'time': |
|
153 | + $sortby = $article_prefix . 'art_time'; |
|
154 | + break; |
|
155 | + case 'default': |
|
156 | + default: |
|
157 | + $sortby = ''; |
|
158 | + break; |
|
159 | 159 | } |
160 | 160 | $criteria->setSort($sortby); |
161 | 161 | $criteria->setOrder($order); |
@@ -163,120 +163,120 @@ discard block |
||
163 | 163 | $criteria->setLimit($limit); |
164 | 164 | |
165 | 165 | $tags = empty($list) ? '' : [ |
166 | - $article_prefix . 'art_title', |
|
167 | - $article_prefix . 'blog_id', |
|
168 | - $article_prefix . 'art_time' |
|
166 | + $article_prefix . 'art_title', |
|
167 | + $article_prefix . 'blog_id', |
|
168 | + $article_prefix . 'art_time' |
|
169 | 169 | ]; |
170 | 170 | switch ($query_type) { |
171 | - case 'category': |
|
172 | - $articles_obj = $articleHandler->getByCategory($criteria, $tags); |
|
173 | - $count_article = $articleHandler->getCountByCategory($criteria); |
|
174 | - break; |
|
175 | - case 'bookmark': |
|
176 | - $articles_obj = $articleHandler->getByBookmark($criteria, $tags); |
|
177 | - $count_article = $articleHandler->getCountByBookmark($criteria); |
|
178 | - break; |
|
179 | - default: |
|
180 | - $articles_obj = $articleHandler->getAll($criteria, $tags); |
|
181 | - $count_article = $articleHandler->getCount($criteria); |
|
182 | - break; |
|
171 | + case 'category': |
|
172 | + $articles_obj = $articleHandler->getByCategory($criteria, $tags); |
|
173 | + $count_article = $articleHandler->getCountByCategory($criteria); |
|
174 | + break; |
|
175 | + case 'bookmark': |
|
176 | + $articles_obj = $articleHandler->getByBookmark($criteria, $tags); |
|
177 | + $count_article = $articleHandler->getCountByBookmark($criteria); |
|
178 | + break; |
|
179 | + default: |
|
180 | + $articles_obj = $articleHandler->getAll($criteria, $tags); |
|
181 | + $count_article = $articleHandler->getCount($criteria); |
|
182 | + break; |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | if (!empty($blog_data)) { |
186 | - $blogs[$blog_data['id']] = $blog_data['title']; |
|
186 | + $blogs[$blog_data['id']] = $blog_data['title']; |
|
187 | 187 | } else { |
188 | - $blog_array = []; |
|
189 | - foreach (array_keys($articles_obj) as $id) { |
|
190 | - $blog_array[$articles_obj[$id]->getVar('blog_id')] = 1; |
|
191 | - } |
|
192 | - $criteria_blog = new Criteria('blog_id', '(' . implode(',', array_keys($blog_array)) . ')', 'IN'); |
|
193 | - $blogs = $blogHandler->getList($criteria_blog); |
|
188 | + $blog_array = []; |
|
189 | + foreach (array_keys($articles_obj) as $id) { |
|
190 | + $blog_array[$articles_obj[$id]->getVar('blog_id')] = 1; |
|
191 | + } |
|
192 | + $criteria_blog = new Criteria('blog_id', '(' . implode(',', array_keys($blog_array)) . ')', 'IN'); |
|
193 | + $blogs = $blogHandler->getList($criteria_blog); |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | /* Objects to array */ |
197 | 197 | $articles = []; |
198 | 198 | foreach (array_keys($articles_obj) as $id) { |
199 | - $_article = [ |
|
200 | - 'id' => $id, |
|
201 | - 'title' => $articles_obj[$id]->getVar('art_title'), |
|
202 | - 'time' => $articles_obj[$id]->getTime(), |
|
203 | - 'blog' => [ |
|
204 | - 'id' => $articles_obj[$id]->getVar('blog_id'), |
|
205 | - 'title' => $blogs[$articles_obj[$id]->getVar('blog_id')] |
|
206 | - ] |
|
207 | - ]; |
|
208 | - if (empty($list)) { |
|
209 | - $_article = array_merge($_article, [ |
|
210 | - 'author' => $articles_obj[$id]->getVar('art_author'), |
|
211 | - 'views' => $articles_obj[$id]->getVar('art_views'), |
|
212 | - 'comments' => $articles_obj[$id]->getVar('art_comments'), |
|
213 | - 'star' => $articles_obj[$id]->getStar(), |
|
214 | - 'rates' => $articles_obj[$id]->getVar('art_rates') |
|
215 | - ]); |
|
216 | - if (!empty($xoopsModuleConfig['display_summary'])) { |
|
217 | - $_article['content'] = $articles_obj[$id]->getSummary(); |
|
218 | - } else { |
|
219 | - $_article['content'] = $articles_obj[$id]->getVar('art_content'); |
|
220 | - } |
|
221 | - } |
|
222 | - $articles[] = $_article; |
|
223 | - unset($_article); |
|
199 | + $_article = [ |
|
200 | + 'id' => $id, |
|
201 | + 'title' => $articles_obj[$id]->getVar('art_title'), |
|
202 | + 'time' => $articles_obj[$id]->getTime(), |
|
203 | + 'blog' => [ |
|
204 | + 'id' => $articles_obj[$id]->getVar('blog_id'), |
|
205 | + 'title' => $blogs[$articles_obj[$id]->getVar('blog_id')] |
|
206 | + ] |
|
207 | + ]; |
|
208 | + if (empty($list)) { |
|
209 | + $_article = array_merge($_article, [ |
|
210 | + 'author' => $articles_obj[$id]->getVar('art_author'), |
|
211 | + 'views' => $articles_obj[$id]->getVar('art_views'), |
|
212 | + 'comments' => $articles_obj[$id]->getVar('art_comments'), |
|
213 | + 'star' => $articles_obj[$id]->getStar(), |
|
214 | + 'rates' => $articles_obj[$id]->getVar('art_rates') |
|
215 | + ]); |
|
216 | + if (!empty($xoopsModuleConfig['display_summary'])) { |
|
217 | + $_article['content'] = $articles_obj[$id]->getSummary(); |
|
218 | + } else { |
|
219 | + $_article['content'] = $articles_obj[$id]->getVar('art_content'); |
|
220 | + } |
|
221 | + } |
|
222 | + $articles[] = $_article; |
|
223 | + unset($_article); |
|
224 | 224 | } |
225 | 225 | unset($articles_obj); |
226 | 226 | |
227 | 227 | if ($count_article > $limit) { |
228 | - include XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
229 | - $start_link = []; |
|
230 | - if ($sort) { |
|
231 | - $start_link[] = 'sort=' . $sort; |
|
232 | - } |
|
233 | - if ($category_id) { |
|
234 | - $start_link[] = 'category=' . $category_id; |
|
235 | - } |
|
236 | - if ($blog_id) { |
|
237 | - $start_link[] = 'blog=' . $blog_id; |
|
238 | - } |
|
239 | - if ($list) { |
|
240 | - $start_link[] = 'list=' . $list; |
|
241 | - } |
|
242 | - $nav = new XoopsPageNav($count_article, $limit, $start, 'start', implode('&', $start_link)); |
|
243 | - $pagenav = $nav->renderNav(4); |
|
228 | + include XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
229 | + $start_link = []; |
|
230 | + if ($sort) { |
|
231 | + $start_link[] = 'sort=' . $sort; |
|
232 | + } |
|
233 | + if ($category_id) { |
|
234 | + $start_link[] = 'category=' . $category_id; |
|
235 | + } |
|
236 | + if ($blog_id) { |
|
237 | + $start_link[] = 'blog=' . $blog_id; |
|
238 | + } |
|
239 | + if ($list) { |
|
240 | + $start_link[] = 'list=' . $list; |
|
241 | + } |
|
242 | + $nav = new XoopsPageNav($count_article, $limit, $start, 'start', implode('&', $start_link)); |
|
243 | + $pagenav = $nav->renderNav(4); |
|
244 | 244 | } else { |
245 | - $pagenav = ''; |
|
245 | + $pagenav = ''; |
|
246 | 246 | } |
247 | 247 | |
248 | 248 | $xoopsTpl->assign('xoops_module_header', $xoops_module_header); |
249 | 249 | $xoopsTpl->assign('dirname', $GLOBALS['moddirname']); |
250 | 250 | |
251 | 251 | if ($category_id || $blog_id || $uid) { |
252 | - $xoopsTpl->assign('link_index', "<a href=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . "/index.php\" title=\"" . planet_constant('MD_INDEX') . "\" target=\"_self\">" . planet_constant('MD_INDEX') . '</a>'); |
|
252 | + $xoopsTpl->assign('link_index', "<a href=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . "/index.php\" title=\"" . planet_constant('MD_INDEX') . "\" target=\"_self\">" . planet_constant('MD_INDEX') . '</a>'); |
|
253 | 253 | } |
254 | 254 | |
255 | 255 | $link_switch = "<a href=\"" |
256 | - . XOOPS_URL |
|
257 | - . '/modules/' |
|
258 | - . $GLOBALS['moddirname'] |
|
259 | - . '/index.php' |
|
260 | - . (empty($category_id) ? '' : '/c' . $category_id) |
|
261 | - . (empty($uid) ? '' : '/u' . $uid) |
|
262 | - . (empty($blog_id) ? '' : '/b' . $blog_id) |
|
263 | - . (empty($list) ? '/l1' : '') |
|
264 | - . "\" title=\"" |
|
265 | - . (empty($list) ? planet_constant('MD_LISTVIEW') : planet_constant('MD_FULLVIEW')) |
|
266 | - . "\">" |
|
267 | - . (empty($list) ? planet_constant('MD_LISTVIEW') : planet_constant('MD_FULLVIEW')) |
|
268 | - . '</a>'; |
|
256 | + . XOOPS_URL |
|
257 | + . '/modules/' |
|
258 | + . $GLOBALS['moddirname'] |
|
259 | + . '/index.php' |
|
260 | + . (empty($category_id) ? '' : '/c' . $category_id) |
|
261 | + . (empty($uid) ? '' : '/u' . $uid) |
|
262 | + . (empty($blog_id) ? '' : '/b' . $blog_id) |
|
263 | + . (empty($list) ? '/l1' : '') |
|
264 | + . "\" title=\"" |
|
265 | + . (empty($list) ? planet_constant('MD_LISTVIEW') : planet_constant('MD_FULLVIEW')) |
|
266 | + . "\">" |
|
267 | + . (empty($list) ? planet_constant('MD_LISTVIEW') : planet_constant('MD_FULLVIEW')) |
|
268 | + . '</a>'; |
|
269 | 269 | $xoopsTpl->assign('link_switch', $link_switch); |
270 | 270 | |
271 | 271 | $link_blogs = "<a href=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.blogs.php' . (empty($category_id) ? '' : '/c' . $category_id) . (empty($uid) ? '' : '/u' . $uid) . "\" title=\"" . planet_constant('MD_BLOGS') . "\">" . planet_constant('MD_BLOGS') . '</a>'; |
272 | 272 | $xoopsTpl->assign('link_blogs', $link_blogs); |
273 | 273 | |
274 | 274 | if (empty($uid) && is_object($xoopsUser)) { |
275 | - $xoopsTpl->assign('link_bookmark', "<a href=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'u' . $xoopsUser->getVar('uid') . "\" title=\"" . planet_constant('MD_BOOKMARKS') . "\" target=\"_self\">" . planet_constant('MD_BOOKMARKS') . '</a>'); |
|
275 | + $xoopsTpl->assign('link_bookmark', "<a href=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'u' . $xoopsUser->getVar('uid') . "\" title=\"" . planet_constant('MD_BOOKMARKS') . "\" target=\"_self\">" . planet_constant('MD_BOOKMARKS') . '</a>'); |
|
276 | 276 | } |
277 | 277 | |
278 | 278 | if ($xoopsModuleConfig['newblog_submit'] == 1 || is_object($xoopsUser)) { |
279 | - $xoopsTpl->assign('link_submit', "<a href=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . "/action.blog.php\" title=\"" . _SUBMIT . "\" target=\"_blank\">" . _SUBMIT . '</a>'); |
|
279 | + $xoopsTpl->assign('link_submit', "<a href=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . "/action.blog.php\" title=\"" . _SUBMIT . "\" target=\"_blank\">" . _SUBMIT . '</a>'); |
|
280 | 280 | } |
281 | 281 | |
282 | 282 | $xoopsTpl->assign('pagetitle', $xoopsModule->getVar('name') . '::' . planet_constant('MD_ARTICLES')); |
@@ -290,22 +290,22 @@ discard block |
||
290 | 290 | $xoopsTpl->assign('user_level', !is_object($xoopsUser) ? 0 : ($xoopsUser->isAdmin() ? 2 : 1)); |
291 | 291 | if (empty($xoopsModuleConfig['anonymous_rate']) && !is_object($xoopsUser)) { |
292 | 292 | } elseif ($blog_id > 0) { |
293 | - $xoopsTpl->assign('canrate', 1); |
|
293 | + $xoopsTpl->assign('canrate', 1); |
|
294 | 294 | } |
295 | 295 | |
296 | 296 | $sort_link = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . (empty($category_id) ? '' : '/c' . $category_id) . (empty($uid) ? '' : '/u' . $uid) . (empty($blog_id) ? '' : '/b' . $blog_id) . (empty($list) ? '' : '/l1'); |
297 | 297 | $valid_sorts = [ |
298 | - 'views' => planet_constant('MD_VIEWS'), |
|
299 | - 'rating' => planet_constant('MD_RATING'), |
|
300 | - 'time' => planet_constant('MD_TIME'), |
|
301 | - 'default' => planet_constant('MD_DEFAULT') |
|
298 | + 'views' => planet_constant('MD_VIEWS'), |
|
299 | + 'rating' => planet_constant('MD_RATING'), |
|
300 | + 'time' => planet_constant('MD_TIME'), |
|
301 | + 'default' => planet_constant('MD_DEFAULT') |
|
302 | 302 | ]; |
303 | 303 | $sortlinks = []; |
304 | 304 | foreach ($valid_sorts as $val => $name) { |
305 | - if ($val == $sort) { |
|
306 | - continue; |
|
307 | - } |
|
308 | - $sortlinks[] = "<a href=\"" . $sort_link . '/' . $val . "\">" . $name . '</a>'; |
|
305 | + if ($val == $sort) { |
|
306 | + continue; |
|
307 | + } |
|
308 | + $sortlinks[] = "<a href=\"" . $sort_link . '/' . $val . "\">" . $name . '</a>'; |
|
309 | 309 | } |
310 | 310 | $xoopsTpl->assign('link_sort', implode(' | ', $sortlinks)); |
311 | 311 | $xoopsTpl->assign('version', $xoopsModule->getVar('version')); |
@@ -314,8 +314,8 @@ discard block |
||
314 | 314 | |
315 | 315 | // for notification |
316 | 316 | if (!empty($blog_id)) { |
317 | - //$_SERVER['REQUEST_URI'] = XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/index.php"; |
|
318 | - $_GET['blog'] = $blog_id; |
|
317 | + //$_SERVER['REQUEST_URI'] = XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/index.php"; |
|
318 | + $_GET['blog'] = $blog_id; |
|
319 | 319 | } |
320 | 320 | |
321 | 321 | require_once __DIR__ . '/footer.php'; |
@@ -24,10 +24,10 @@ discard block |
||
24 | 24 | // URL: https://xoops.org // |
25 | 25 | // Project: Article Project // |
26 | 26 | // ------------------------------------------------------------------------ // |
27 | -include __DIR__ . '/header.php'; |
|
27 | +include __DIR__.'/header.php'; |
|
28 | 28 | |
29 | 29 | if (preg_match("/\/notification_update\.php/i", $_SERVER['REQUEST_URI'], $matches)) { |
30 | - include XOOPS_ROOT_PATH . '/include/notification_update.php'; |
|
30 | + include XOOPS_ROOT_PATH.'/include/notification_update.php'; |
|
31 | 31 | exit(); |
32 | 32 | } |
33 | 33 | |
@@ -37,17 +37,17 @@ discard block |
||
37 | 37 | } |
38 | 38 | |
39 | 39 | /* Start */ |
40 | -$start = (int)(empty($_GET['start']) ? @$args['start'] : $_GET['start']); |
|
40 | +$start = (int) (empty($_GET['start']) ? @$args['start'] : $_GET['start']); |
|
41 | 41 | /* Specified Category */ |
42 | -$category_id = (int)(empty($_GET['category']) ? @$args['category'] : $_GET['category']); |
|
42 | +$category_id = (int) (empty($_GET['category']) ? @$args['category'] : $_GET['category']); |
|
43 | 43 | /* Specified Blog */ |
44 | -$blog_id = (int)(empty($_GET['blog']) ? @$args['blog'] : $_GET['blog']); |
|
44 | +$blog_id = (int) (empty($_GET['blog']) ? @$args['blog'] : $_GET['blog']); |
|
45 | 45 | /* Specified Bookmar(Favorite) UID */ |
46 | -$uid = (int)(empty($_GET['uid']) ? @$args['uid'] : $_GET['uid']); |
|
46 | +$uid = (int) (empty($_GET['uid']) ? @$args['uid'] : $_GET['uid']); |
|
47 | 47 | /* Sort by term */ |
48 | 48 | $sort = empty($_GET['sort']) ? @$args['sort'] : $_GET['sort']; |
49 | 49 | /* Display as list */ |
50 | -$list = (int)(empty($_GET['list']) ? @$args['list'] : $_GET['list']); |
|
50 | +$list = (int) (empty($_GET['list']) ? @$args['list'] : $_GET['list']); |
|
51 | 51 | |
52 | 52 | // restore $_SERVER['REQUEST_URI'] |
53 | 53 | if (!empty($REQUEST_URI_parsed)) { |
@@ -55,28 +55,28 @@ discard block |
||
55 | 55 | $_args = ['start', 'sort', 'uid', 'list']; |
56 | 56 | foreach ($_args as $arg) { |
57 | 57 | if (!empty(${$arg})) { |
58 | - $args_REQUEST_URI[] = $arg . '=' . ${$arg}; |
|
58 | + $args_REQUEST_URI[] = $arg.'='.${$arg}; |
|
59 | 59 | } |
60 | 60 | } |
61 | 61 | if (!empty($blog_id)) { |
62 | - $args_REQUEST_URI[] = 'blog=' . $blog_id; |
|
62 | + $args_REQUEST_URI[] = 'blog='.$blog_id; |
|
63 | 63 | } |
64 | 64 | if (!empty($category_id)) { |
65 | - $args_REQUEST_URI[] = 'category=' . $category_id; |
|
65 | + $args_REQUEST_URI[] = 'category='.$category_id; |
|
66 | 66 | } |
67 | - $_SERVER['REQUEST_URI'] = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . (empty($args_REQUEST_URI) ? '' : '?' . implode('&', $args_REQUEST_URI)); |
|
67 | + $_SERVER['REQUEST_URI'] = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php'.(empty($args_REQUEST_URI) ? '' : '?'.implode('&', $args_REQUEST_URI)); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | $GLOBALS['xoopsOption']['template_main'] = PlanetUtility::planetGetTemplate('index'); |
71 | 71 | $xoops_module_header = ' |
72 | - <link rel="alternate" type="application/rss+xml" title="' . $xoopsModule->getVar('name') . ' rss" href="' . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/xml.php".URL_DELIMITER."rss/c' . $category_id . '/b' . $blog_id . '/u' . $uid . '"> |
|
73 | - <link rel="alternate" type="application/rss+xml" title="' . $xoopsModule->getVar('name') . ' rdf" href="' . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/xml.php".URL_DELIMITER."rdf/c' . $category_id . '/b' . $blog_id . '/u' . $uid . '"> |
|
74 | - <link rel="alternate" type="application/atom+xml" title="' . $xoopsModule->getVar('name') . ' atom" href="' . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/xml.php".URL_DELIMITER."atom/c' . $category_id . '/b' . $blog_id . '/u' . $uid . '"> |
|
72 | + <link rel="alternate" type="application/rss+xml" title="' . $xoopsModule->getVar('name').' rss" href="'.XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/xml.php".URL_DELIMITER."rss/c'.$category_id.'/b'.$blog_id.'/u'.$uid.'"> |
|
73 | + <link rel="alternate" type="application/rss+xml" title="' . $xoopsModule->getVar('name').' rdf" href="'.XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/xml.php".URL_DELIMITER."rdf/c'.$category_id.'/b'.$blog_id.'/u'.$uid.'"> |
|
74 | + <link rel="alternate" type="application/atom+xml" title="' . $xoopsModule->getVar('name').' atom" href="'.XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/xml.php".URL_DELIMITER."atom/c'.$category_id.'/b'.$blog_id.'/u'.$uid.'"> |
|
75 | 75 | '; |
76 | 76 | |
77 | 77 | $xoopsOption['xoops_module_header'] = $xoops_module_header; |
78 | -require_once XOOPS_ROOT_PATH . '/header.php'; |
|
79 | -include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php'; |
|
78 | +require_once XOOPS_ROOT_PATH.'/header.php'; |
|
79 | +include XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/vars.php'; |
|
80 | 80 | |
81 | 81 | // Following part will not be executed after cache |
82 | 82 | $categoryHandler = xoops_getModuleHandler('category', $GLOBALS['moddirname']); |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $criteria = new CriteriaCompo(); |
89 | 89 | $article_prefix = ''; |
90 | 90 | /* Specific category */ |
91 | -if ($category_id > 0) { |
|
91 | +if ($category_id>0) { |
|
92 | 92 | $category_obj = $categoryHandler->get($category_id); |
93 | 93 | $criteria->add(new Criteria('bc.cat_id', $category_id)); |
94 | 94 | $uid = 0; |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $article_prefix = 'a.'; |
99 | 99 | } |
100 | 100 | /* Specific blog */ |
101 | -if ($blog_id > 0) { |
|
101 | +if ($blog_id>0) { |
|
102 | 102 | $blog_obj = $blogHandler->get($blog_id); |
103 | 103 | if ($blog_obj->getVar('blog_status') |
104 | 104 | || (is_object($xoopsUser) |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | $article_prefix = ''; |
126 | 126 | } |
127 | 127 | /* User bookmarks(favorites) */ |
128 | -if ($uid > 0) { |
|
128 | +if ($uid>0) { |
|
129 | 129 | $criteria->add(new Criteria('bm.bm_uid', $uid)); |
130 | 130 | $category_id = 0; |
131 | 131 | $blog_id = 0; |
@@ -144,13 +144,13 @@ discard block |
||
144 | 144 | $sort = empty($sort) ? 'time' : $sort; |
145 | 145 | switch ($sort) { |
146 | 146 | case 'views': |
147 | - $sortby = $article_prefix . 'art_views'; |
|
147 | + $sortby = $article_prefix.'art_views'; |
|
148 | 148 | break; |
149 | 149 | case 'rating': |
150 | - $sortby = $article_prefix . 'art_rating'; |
|
150 | + $sortby = $article_prefix.'art_rating'; |
|
151 | 151 | break; |
152 | 152 | case 'time': |
153 | - $sortby = $article_prefix . 'art_time'; |
|
153 | + $sortby = $article_prefix.'art_time'; |
|
154 | 154 | break; |
155 | 155 | case 'default': |
156 | 156 | default: |
@@ -163,9 +163,9 @@ discard block |
||
163 | 163 | $criteria->setLimit($limit); |
164 | 164 | |
165 | 165 | $tags = empty($list) ? '' : [ |
166 | - $article_prefix . 'art_title', |
|
167 | - $article_prefix . 'blog_id', |
|
168 | - $article_prefix . 'art_time' |
|
166 | + $article_prefix.'art_title', |
|
167 | + $article_prefix.'blog_id', |
|
168 | + $article_prefix.'art_time' |
|
169 | 169 | ]; |
170 | 170 | switch ($query_type) { |
171 | 171 | case 'category': |
@@ -184,12 +184,12 @@ discard block |
||
184 | 184 | |
185 | 185 | if (!empty($blog_data)) { |
186 | 186 | $blogs[$blog_data['id']] = $blog_data['title']; |
187 | -} else { |
|
187 | +}else { |
|
188 | 188 | $blog_array = []; |
189 | 189 | foreach (array_keys($articles_obj) as $id) { |
190 | 190 | $blog_array[$articles_obj[$id]->getVar('blog_id')] = 1; |
191 | 191 | } |
192 | - $criteria_blog = new Criteria('blog_id', '(' . implode(',', array_keys($blog_array)) . ')', 'IN'); |
|
192 | + $criteria_blog = new Criteria('blog_id', '('.implode(',', array_keys($blog_array)).')', 'IN'); |
|
193 | 193 | $blogs = $blogHandler->getList($criteria_blog); |
194 | 194 | } |
195 | 195 | |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | ]); |
216 | 216 | if (!empty($xoopsModuleConfig['display_summary'])) { |
217 | 217 | $_article['content'] = $articles_obj[$id]->getSummary(); |
218 | - } else { |
|
218 | + }else { |
|
219 | 219 | $_article['content'] = $articles_obj[$id]->getVar('art_content'); |
220 | 220 | } |
221 | 221 | } |
@@ -224,24 +224,24 @@ discard block |
||
224 | 224 | } |
225 | 225 | unset($articles_obj); |
226 | 226 | |
227 | -if ($count_article > $limit) { |
|
228 | - include XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
227 | +if ($count_article>$limit) { |
|
228 | + include XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
229 | 229 | $start_link = []; |
230 | 230 | if ($sort) { |
231 | - $start_link[] = 'sort=' . $sort; |
|
231 | + $start_link[] = 'sort='.$sort; |
|
232 | 232 | } |
233 | 233 | if ($category_id) { |
234 | - $start_link[] = 'category=' . $category_id; |
|
234 | + $start_link[] = 'category='.$category_id; |
|
235 | 235 | } |
236 | 236 | if ($blog_id) { |
237 | - $start_link[] = 'blog=' . $blog_id; |
|
237 | + $start_link[] = 'blog='.$blog_id; |
|
238 | 238 | } |
239 | 239 | if ($list) { |
240 | - $start_link[] = 'list=' . $list; |
|
240 | + $start_link[] = 'list='.$list; |
|
241 | 241 | } |
242 | 242 | $nav = new XoopsPageNav($count_article, $limit, $start, 'start', implode('&', $start_link)); |
243 | 243 | $pagenav = $nav->renderNav(4); |
244 | -} else { |
|
244 | +}else { |
|
245 | 245 | $pagenav = ''; |
246 | 246 | } |
247 | 247 | |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | $xoopsTpl->assign('dirname', $GLOBALS['moddirname']); |
250 | 250 | |
251 | 251 | if ($category_id || $blog_id || $uid) { |
252 | - $xoopsTpl->assign('link_index', "<a href=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . "/index.php\" title=\"" . planet_constant('MD_INDEX') . "\" target=\"_self\">" . planet_constant('MD_INDEX') . '</a>'); |
|
252 | + $xoopsTpl->assign('link_index', "<a href=\"".XOOPS_URL.'/modules/'.$GLOBALS['moddirname']."/index.php\" title=\"".planet_constant('MD_INDEX')."\" target=\"_self\">".planet_constant('MD_INDEX').'</a>'); |
|
253 | 253 | } |
254 | 254 | |
255 | 255 | $link_switch = "<a href=\"" |
@@ -257,9 +257,9 @@ discard block |
||
257 | 257 | . '/modules/' |
258 | 258 | . $GLOBALS['moddirname'] |
259 | 259 | . '/index.php' |
260 | - . (empty($category_id) ? '' : '/c' . $category_id) |
|
261 | - . (empty($uid) ? '' : '/u' . $uid) |
|
262 | - . (empty($blog_id) ? '' : '/b' . $blog_id) |
|
260 | + . (empty($category_id) ? '' : '/c'.$category_id) |
|
261 | + . (empty($uid) ? '' : '/u'.$uid) |
|
262 | + . (empty($blog_id) ? '' : '/b'.$blog_id) |
|
263 | 263 | . (empty($list) ? '/l1' : '') |
264 | 264 | . "\" title=\"" |
265 | 265 | . (empty($list) ? planet_constant('MD_LISTVIEW') : planet_constant('MD_FULLVIEW')) |
@@ -268,18 +268,18 @@ discard block |
||
268 | 268 | . '</a>'; |
269 | 269 | $xoopsTpl->assign('link_switch', $link_switch); |
270 | 270 | |
271 | -$link_blogs = "<a href=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.blogs.php' . (empty($category_id) ? '' : '/c' . $category_id) . (empty($uid) ? '' : '/u' . $uid) . "\" title=\"" . planet_constant('MD_BLOGS') . "\">" . planet_constant('MD_BLOGS') . '</a>'; |
|
271 | +$link_blogs = "<a href=\"".XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.blogs.php'.(empty($category_id) ? '' : '/c'.$category_id).(empty($uid) ? '' : '/u'.$uid)."\" title=\"".planet_constant('MD_BLOGS')."\">".planet_constant('MD_BLOGS').'</a>'; |
|
272 | 272 | $xoopsTpl->assign('link_blogs', $link_blogs); |
273 | 273 | |
274 | 274 | if (empty($uid) && is_object($xoopsUser)) { |
275 | - $xoopsTpl->assign('link_bookmark', "<a href=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'u' . $xoopsUser->getVar('uid') . "\" title=\"" . planet_constant('MD_BOOKMARKS') . "\" target=\"_self\">" . planet_constant('MD_BOOKMARKS') . '</a>'); |
|
275 | + $xoopsTpl->assign('link_bookmark', "<a href=\"".XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php'.URL_DELIMITER.'u'.$xoopsUser->getVar('uid')."\" title=\"".planet_constant('MD_BOOKMARKS')."\" target=\"_self\">".planet_constant('MD_BOOKMARKS').'</a>'); |
|
276 | 276 | } |
277 | 277 | |
278 | 278 | if ($xoopsModuleConfig['newblog_submit'] == 1 || is_object($xoopsUser)) { |
279 | - $xoopsTpl->assign('link_submit', "<a href=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . "/action.blog.php\" title=\"" . _SUBMIT . "\" target=\"_blank\">" . _SUBMIT . '</a>'); |
|
279 | + $xoopsTpl->assign('link_submit', "<a href=\"".XOOPS_URL.'/modules/'.$GLOBALS['moddirname']."/action.blog.php\" title=\""._SUBMIT."\" target=\"_blank\">"._SUBMIT.'</a>'); |
|
280 | 280 | } |
281 | 281 | |
282 | -$xoopsTpl->assign('pagetitle', $xoopsModule->getVar('name') . '::' . planet_constant('MD_ARTICLES')); |
|
282 | +$xoopsTpl->assign('pagetitle', $xoopsModule->getVar('name').'::'.planet_constant('MD_ARTICLES')); |
|
283 | 283 | $xoopsTpl->assign('category', @$category_data); |
284 | 284 | $xoopsTpl->assign('blog', @$blog_data); |
285 | 285 | $xoopsTpl->assign('user', @$user_data); |
@@ -289,23 +289,23 @@ discard block |
||
289 | 289 | |
290 | 290 | $xoopsTpl->assign('user_level', !is_object($xoopsUser) ? 0 : ($xoopsUser->isAdmin() ? 2 : 1)); |
291 | 291 | if (empty($xoopsModuleConfig['anonymous_rate']) && !is_object($xoopsUser)) { |
292 | -} elseif ($blog_id > 0) { |
|
292 | +} elseif ($blog_id>0) { |
|
293 | 293 | $xoopsTpl->assign('canrate', 1); |
294 | 294 | } |
295 | 295 | |
296 | -$sort_link = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . (empty($category_id) ? '' : '/c' . $category_id) . (empty($uid) ? '' : '/u' . $uid) . (empty($blog_id) ? '' : '/b' . $blog_id) . (empty($list) ? '' : '/l1'); |
|
296 | +$sort_link = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php'.(empty($category_id) ? '' : '/c'.$category_id).(empty($uid) ? '' : '/u'.$uid).(empty($blog_id) ? '' : '/b'.$blog_id).(empty($list) ? '' : '/l1'); |
|
297 | 297 | $valid_sorts = [ |
298 | 298 | 'views' => planet_constant('MD_VIEWS'), |
299 | 299 | 'rating' => planet_constant('MD_RATING'), |
300 | 300 | 'time' => planet_constant('MD_TIME'), |
301 | 301 | 'default' => planet_constant('MD_DEFAULT') |
302 | 302 | ]; |
303 | -$sortlinks = []; |
|
303 | +$sortlinks = []; |
|
304 | 304 | foreach ($valid_sorts as $val => $name) { |
305 | 305 | if ($val == $sort) { |
306 | 306 | continue; |
307 | 307 | } |
308 | - $sortlinks[] = "<a href=\"" . $sort_link . '/' . $val . "\">" . $name . '</a>'; |
|
308 | + $sortlinks[] = "<a href=\"".$sort_link.'/'.$val."\">".$name.'</a>'; |
|
309 | 309 | } |
310 | 310 | $xoopsTpl->assign('link_sort', implode(' | ', $sortlinks)); |
311 | 311 | $xoopsTpl->assign('version', $xoopsModule->getVar('version')); |
@@ -318,4 +318,4 @@ discard block |
||
318 | 318 | $_GET['blog'] = $blog_id; |
319 | 319 | } |
320 | 320 | |
321 | -require_once __DIR__ . '/footer.php'; |
|
321 | +require_once __DIR__.'/footer.php'; |
@@ -34,17 +34,17 @@ discard block |
||
34 | 34 | * |
35 | 35 | */ |
36 | 36 | if (preg_match("/(\/comment_[^\.]*\.php\?.*=.*)/i", Request::getUrl('REQUEST_URI', '', 'SERVER'), $matches)) {//$_SERVER['REQUEST_URI'] |
37 | - header('location: ' . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . $matches[1]); |
|
38 | - exit(); |
|
37 | + header('location: ' . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . $matches[1]); |
|
38 | + exit(); |
|
39 | 39 | } |
40 | 40 | if (preg_match("/\/notification_update\.php/i", Request::getUrl('REQUEST_URI', '', 'SERVER'), $matches)) { |
41 | - include XOOPS_ROOT_PATH . '/include/notification_update.php'; |
|
42 | - exit(); |
|
41 | + include XOOPS_ROOT_PATH . '/include/notification_update.php'; |
|
42 | + exit(); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | if ($REQUEST_URI_parsed = PlanetUtility::planetParseArguments($args_num, $args, $args_str)) { |
46 | - $args['article'] = @$args_num[0]; |
|
47 | - $args['blog'] = @$args['blog']; |
|
46 | + $args['article'] = @$args_num[0]; |
|
47 | + $args['blog'] = @$args['blog']; |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | $article_id = Request::getInt('article', @$args['article'], 'POST');//(int)(empty($_GET['article']) ? @$args['article'] : $_GET['article']); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | |
58 | 58 | // restore $_SERVER['REQUEST_URI'] |
59 | 59 | if (!empty($REQUEST_URI_parsed)) { |
60 | - $_SERVER['REQUEST_URI'] = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . (empty($article_id) ? '' : '?article=' . $article_id); |
|
60 | + $_SERVER['REQUEST_URI'] = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . (empty($article_id) ? '' : '?article=' . $article_id); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | $xoopsOption['xoops_pagetitle'] = $xoopsModule->getVar('name') . ' - ' . $article_obj->getVar('art_title'); |
@@ -66,29 +66,29 @@ discard block |
||
66 | 66 | include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php'; |
67 | 67 | |
68 | 68 | $article_data = [ |
69 | - 'id' => $article_id, |
|
70 | - 'title' => $article_obj->getVar('art_title'), |
|
71 | - 'content' => $article_obj->getVar('art_content'), |
|
72 | - 'author' => $article_obj->getVar('art_author'), |
|
73 | - 'time' => $article_obj->getTime(), |
|
74 | - 'link' => $article_obj->getVar('art_link'), |
|
75 | - 'views' => $article_obj->getVar('art_views'), |
|
76 | - 'comments' => $article_obj->getVar('art_comments'), |
|
77 | - 'star' => $article_obj->getStar(), |
|
78 | - 'rates' => $article_obj->getVar('art_rates'), |
|
79 | - 'blog' => ['id' => $article_obj->getVar('blog_id'), 'title' => $blog_obj->getVar('blog_title')] |
|
69 | + 'id' => $article_id, |
|
70 | + 'title' => $article_obj->getVar('art_title'), |
|
71 | + 'content' => $article_obj->getVar('art_content'), |
|
72 | + 'author' => $article_obj->getVar('art_author'), |
|
73 | + 'time' => $article_obj->getTime(), |
|
74 | + 'link' => $article_obj->getVar('art_link'), |
|
75 | + 'views' => $article_obj->getVar('art_views'), |
|
76 | + 'comments' => $article_obj->getVar('art_comments'), |
|
77 | + 'star' => $article_obj->getStar(), |
|
78 | + 'rates' => $article_obj->getVar('art_rates'), |
|
79 | + 'blog' => ['id' => $article_obj->getVar('blog_id'), 'title' => $blog_obj->getVar('blog_title')] |
|
80 | 80 | ]; |
81 | 81 | |
82 | 82 | if (!empty($xoopsModuleConfig['do_sibling'])) { |
83 | - $articles_sibling = $articleHandler->getSibling($article_obj, $blog_id); |
|
84 | - if (!empty($articles_sibling['previous'])) { |
|
85 | - $articles_sibling['previous']['url'] = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' . $articles_sibling['previous']['id'] . '/b' . $blog_id; |
|
86 | - $articles_sibling['previous']['title'] = $articles_sibling['previous']['title']; |
|
87 | - } |
|
88 | - if (!empty($articles_sibling['next'])) { |
|
89 | - $articles_sibling['next']['url'] = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' . $articles_sibling['next']['id'] . '/b' . $blog_id; |
|
90 | - $articles_sibling['next']['title'] = $articles_sibling['next']['title']; |
|
91 | - } |
|
83 | + $articles_sibling = $articleHandler->getSibling($article_obj, $blog_id); |
|
84 | + if (!empty($articles_sibling['previous'])) { |
|
85 | + $articles_sibling['previous']['url'] = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' . $articles_sibling['previous']['id'] . '/b' . $blog_id; |
|
86 | + $articles_sibling['previous']['title'] = $articles_sibling['previous']['title']; |
|
87 | + } |
|
88 | + if (!empty($articles_sibling['next'])) { |
|
89 | + $articles_sibling['next']['url'] = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' . $articles_sibling['next']['id'] . '/b' . $blog_id; |
|
90 | + $articles_sibling['next']['title'] = $articles_sibling['next']['title']; |
|
91 | + } |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | $xoopsTpl->assign('modulename', $xoopsModule->getVar('name')); |
@@ -99,11 +99,11 @@ discard block |
||
99 | 99 | $xoopsTpl->assign('user_level', !is_object($xoopsUser) ? 0 : ($xoopsUser->isAdmin() ? 2 : 1)); |
100 | 100 | if (empty($xoopsModuleConfig['anonymous_rate']) && !is_object($xoopsUser)) { |
101 | 101 | } else { |
102 | - $xoopsTpl->assign('canrate', 1); |
|
102 | + $xoopsTpl->assign('canrate', 1); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | if ($transferbar = @include XOOPS_ROOT_PATH . '/Frameworks/transfer/bar.transfer.php') { |
106 | - $xoopsTpl->assign('transfer', $transferbar); |
|
106 | + $xoopsTpl->assign('transfer', $transferbar); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | // Loading module meta data, NOT THE RIGHT WAY DOING IT |
@@ -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 | /** |
32 | 32 | * The comment detection scripts should be removed once absolute url is used in comment_view.php |
@@ -34,11 +34,11 @@ discard block |
||
34 | 34 | * |
35 | 35 | */ |
36 | 36 | if (preg_match("/(\/comment_[^\.]*\.php\?.*=.*)/i", Request::getUrl('REQUEST_URI', '', 'SERVER'), $matches)) {//$_SERVER['REQUEST_URI'] |
37 | - header('location: ' . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . $matches[1]); |
|
37 | + header('location: '.XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].$matches[1]); |
|
38 | 38 | exit(); |
39 | 39 | } |
40 | 40 | if (preg_match("/\/notification_update\.php/i", Request::getUrl('REQUEST_URI', '', 'SERVER'), $matches)) { |
41 | - include XOOPS_ROOT_PATH . '/include/notification_update.php'; |
|
41 | + include XOOPS_ROOT_PATH.'/include/notification_update.php'; |
|
42 | 42 | exit(); |
43 | 43 | } |
44 | 44 | |
@@ -47,8 +47,8 @@ discard block |
||
47 | 47 | $args['blog'] = @$args['blog']; |
48 | 48 | } |
49 | 49 | |
50 | -$article_id = Request::getInt('article', @$args['article'], 'POST');//(int)(empty($_GET['article']) ? @$args['article'] : $_GET['article']); |
|
51 | -$blog_id = Request::getInt('blog', @$args['blog'], 'POST');//(int)(empty($_GET['blog']) ? @$args['blog'] : $_GET['blog']); |
|
50 | +$article_id = Request::getInt('article', @$args['article'], 'POST'); //(int)(empty($_GET['article']) ? @$args['article'] : $_GET['article']); |
|
51 | +$blog_id = Request::getInt('blog', @$args['blog'], 'POST'); //(int)(empty($_GET['blog']) ? @$args['blog'] : $_GET['blog']); |
|
52 | 52 | |
53 | 53 | $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
54 | 54 | $blogHandler = xoops_getModuleHandler('blog', $GLOBALS['moddirname']); |
@@ -57,13 +57,13 @@ discard block |
||
57 | 57 | |
58 | 58 | // restore $_SERVER['REQUEST_URI'] |
59 | 59 | if (!empty($REQUEST_URI_parsed)) { |
60 | - $_SERVER['REQUEST_URI'] = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . (empty($article_id) ? '' : '?article=' . $article_id); |
|
60 | + $_SERVER['REQUEST_URI'] = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.article.php'.(empty($article_id) ? '' : '?article='.$article_id); |
|
61 | 61 | } |
62 | 62 | |
63 | -$xoopsOption['xoops_pagetitle'] = $xoopsModule->getVar('name') . ' - ' . $article_obj->getVar('art_title'); |
|
63 | +$xoopsOption['xoops_pagetitle'] = $xoopsModule->getVar('name').' - '.$article_obj->getVar('art_title'); |
|
64 | 64 | $xoopsOption['template_main'] = PlanetUtility::planetGetTemplate('article'); |
65 | -require_once XOOPS_ROOT_PATH . '/header.php'; |
|
66 | -include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php'; |
|
65 | +require_once XOOPS_ROOT_PATH.'/header.php'; |
|
66 | +include XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/vars.php'; |
|
67 | 67 | |
68 | 68 | $article_data = [ |
69 | 69 | 'id' => $article_id, |
@@ -82,11 +82,11 @@ discard block |
||
82 | 82 | if (!empty($xoopsModuleConfig['do_sibling'])) { |
83 | 83 | $articles_sibling = $articleHandler->getSibling($article_obj, $blog_id); |
84 | 84 | if (!empty($articles_sibling['previous'])) { |
85 | - $articles_sibling['previous']['url'] = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' . $articles_sibling['previous']['id'] . '/b' . $blog_id; |
|
85 | + $articles_sibling['previous']['url'] = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.article.php'.URL_DELIMITER.''.$articles_sibling['previous']['id'].'/b'.$blog_id; |
|
86 | 86 | $articles_sibling['previous']['title'] = $articles_sibling['previous']['title']; |
87 | 87 | } |
88 | 88 | if (!empty($articles_sibling['next'])) { |
89 | - $articles_sibling['next']['url'] = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' . $articles_sibling['next']['id'] . '/b' . $blog_id; |
|
89 | + $articles_sibling['next']['url'] = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.article.php'.URL_DELIMITER.''.$articles_sibling['next']['id'].'/b'.$blog_id; |
|
90 | 90 | $articles_sibling['next']['title'] = $articles_sibling['next']['title']; |
91 | 91 | } |
92 | 92 | } |
@@ -98,11 +98,11 @@ discard block |
||
98 | 98 | |
99 | 99 | $xoopsTpl->assign('user_level', !is_object($xoopsUser) ? 0 : ($xoopsUser->isAdmin() ? 2 : 1)); |
100 | 100 | if (empty($xoopsModuleConfig['anonymous_rate']) && !is_object($xoopsUser)) { |
101 | -} else { |
|
101 | +}else { |
|
102 | 102 | $xoopsTpl->assign('canrate', 1); |
103 | 103 | } |
104 | 104 | |
105 | -if ($transferbar = @include XOOPS_ROOT_PATH . '/Frameworks/transfer/bar.transfer.php') { |
|
105 | +if ($transferbar = @include XOOPS_ROOT_PATH.'/Frameworks/transfer/bar.transfer.php') { |
|
106 | 106 | $xoopsTpl->assign('transfer', $transferbar); |
107 | 107 | } |
108 | 108 | |
@@ -112,6 +112,6 @@ discard block |
||
112 | 112 | // for comment and notification |
113 | 113 | //$_SERVER['REQUEST_URI'] = XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/view.article.php"; |
114 | 114 | $_GET['article'] = $article_id; |
115 | -include XOOPS_ROOT_PATH . '/include/comment_view.php'; |
|
115 | +include XOOPS_ROOT_PATH.'/include/comment_view.php'; |
|
116 | 116 | |
117 | -require_once __DIR__ . '/footer.php'; |
|
117 | +require_once __DIR__.'/footer.php'; |