Completed
Push — master ( 10bab4...a0a78b )
by Michael
02:06
created
view.archive.php 1 patch
Spacing   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 /** @var Planet\Helper $helper */
30 30
 $helper = Planet\Helper::getInstance();
31 31
 
32
-include __DIR__ . '/header.php';
32
+include __DIR__.'/header.php';
33 33
 
34 34
 if (PlanetUtility::planetParseArguments($args_num, $args, $args_str)) {
35 35
     $args['year']  = @$args_num[0];
@@ -48,26 +48,26 @@  discard block
 block discarded – undo
48 48
 $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']);
49 49
 $blogHandler    = xoops_getModuleHandler('blog', $GLOBALS['moddirname']);
50 50
 
51
-$xoopsOption['xoops_pagetitle'] = $xoopsModule->getVar('name') . ' - ' . planet_constant('MD_ACHIVE');
51
+$xoopsOption['xoops_pagetitle'] = $xoopsModule->getVar('name').' - '.planet_constant('MD_ACHIVE');
52 52
 $xoopsOption['template_main']   = PlanetUtility::planetGetTemplate('archive');
53
-require_once XOOPS_ROOT_PATH . '/header.php';
54
-include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php';
53
+require_once XOOPS_ROOT_PATH.'/header.php';
54
+include XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/vars.php';
55 55
 
56 56
 $year = empty($year) ? date('Y') : $year;
57
-if ($month < 1) {
57
+if ($month<1) {
58 58
     $month        = $day = 0;
59 59
     $page['time'] = sprintf(planet_constant('MD_TIME_Y'), $year);
60
-} elseif ($day < 1) {
60
+} elseif ($day<1) {
61 61
     $day          = 0;
62 62
     $page['time'] = sprintf(planet_constant('MD_TIME_YM'), $year, $month);
63
-} else {
63
+}else {
64 64
     $page['time'] = sprintf(planet_constant('MD_TIME_YMD'), $year, $month, $day);
65 65
 }
66 66
 $time = ['year' => $year, 'month' => $month, 'day' => $day];
67 67
 if ($xoopsUser) {
68
-    $timeoffset = ($xoopsUser->getVar('timezone_offset') - $xoopsConfig['server_TZ']) * 3600;
69
-} else {
70
-    $timeoffset = ($xoopsConfig['default_TZ'] - $xoopsConfig['server_TZ']) * 3600;
68
+    $timeoffset = ($xoopsUser->getVar('timezone_offset')-$xoopsConfig['server_TZ'])*3600;
69
+}else {
70
+    $timeoffset = ($xoopsConfig['default_TZ']-$xoopsConfig['server_TZ'])*3600;
71 71
 }
72 72
 
73 73
 $criteria = new \CriteriaCompo();
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 $articles = [];
91 91
 $blogs_id = [];
92 92
 foreach ($articles_obj as $id => $article) {
93
-    $articles[]                            = [
93
+    $articles[] = [
94 94
         'id'      => $id,
95 95
         'blog'    => ['id' => $article->getVar('blog_id'), 'title' => ''],
96 96
         'title'   => $article->getVar('art_title'),
@@ -101,20 +101,20 @@  discard block
 block discarded – undo
101 101
     $blogs_id[$article->getVar('blog_id')] = 1;
102 102
     unset($_article);
103 103
 }
104
-$criteria_blog = new \Criteria('blog_id', '(' . implode(',', array_keys($blog_array)) . ')', 'IN');
104
+$criteria_blog = new \Criteria('blog_id', '('.implode(',', array_keys($blog_array)).')', 'IN');
105 105
 $blogs         = $blogHandler->getList($criteria_blog);
106 106
 foreach (array_keys($articles) as $key) {
107 107
     $articles[$key]['blog']['title'] = $blogs[$articles[$key]['blog']['id']];
108 108
 }
109
-if ($blog_id > 0) {
109
+if ($blog_id>0) {
110 110
     $page['blog'] = $blogs[$blog_id];
111 111
 }
112 112
 
113
-if ($articles_count > $helper->getConfig('articles_perpage')) {
114
-    include XOOPS_ROOT_PATH . '/class/pagenav.php';
115
-    $nav     = new \XoopsPageNav($articles_count, $helper->getConfig('articles_perpage'), $start, 'start', 'month=' . $month . '&amp;day=' . $day . '&amp;year=' . $year . '&amp;blog=' . $blog_id);
113
+if ($articles_count>$helper->getConfig('articles_perpage')) {
114
+    include XOOPS_ROOT_PATH.'/class/pagenav.php';
115
+    $nav     = new \XoopsPageNav($articles_count, $helper->getConfig('articles_perpage'), $start, 'start', 'month='.$month.'&amp;day='.$day.'&amp;year='.$year.'&amp;blog='.$blog_id);
116 116
     $pagenav = $nav->renderNav(4);
117
-} else {
117
+}else {
118 118
     $pagenav = '';
119 119
 }
120 120
 
@@ -123,43 +123,43 @@  discard block
 block discarded – undo
123 123
 $months   = null;
124 124
 if (empty($start)) {
125 125
     if ($blog_id) {
126
-        $blog_criteria = ' AND blog_id=' . $blog_id;
127
-    } else {
126
+        $blog_criteria = ' AND blog_id='.$blog_id;
127
+    }else {
128 128
         $blog_criteria = '';
129 129
     }
130 130
     // Get monthly list
131 131
     if (empty($month)) {
132
-        $sql    = "SELECT MONTH(FROM_UNIXTIME(art_time - $timeoffset)) AS mon, COUNT(DISTINCT art_id) AS count
133
-            FROM " . planet_DB_prefix('article') . "
132
+        $sql = "SELECT MONTH(FROM_UNIXTIME(art_time - $timeoffset)) AS mon, COUNT(DISTINCT art_id) AS count
133
+            FROM ".planet_DB_prefix('article')."
134 134
             WHERE YEAR(FROM_UNIXTIME(art_time - $timeoffset)) = $year
135
-            " . $blog_criteria . '
135
+            ".$blog_criteria.'
136 136
             GROUP BY mon
137 137
             ';
138 138
         $result = $xoopsDB->query($sql);
139 139
         $months = [];
140 140
         while (false !== ($myrow = $xoopsDB->fetchArray($result))) {
141 141
             $months[] = [
142
-                'title' => planet_constant('MD_MONTH_' . (int)$myrow['mon']) . ' (' . (int)$myrow['count'] . ')',
143
-                'url'   => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . '' . $year . '/' . $myrow['mon'] . '/b' . $blog_id
142
+                'title' => planet_constant('MD_MONTH_'.(int) $myrow['mon']).' ('.(int) $myrow['count'].')',
143
+                'url'   => XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.archive.php'.URL_DELIMITER.''.$year.'/'.$myrow['mon'].'/b'.$blog_id
144 144
             ];
145 145
         }
146 146
         $timenav['prev'] = [
147
-            'url'   => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . '' . ($year - 1) . '/b' . $blog_id,
148
-            'title' => sprintf(planet_constant('MD_TIME_Y'), $year - 1)
147
+            'url'   => XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.archive.php'.URL_DELIMITER.''.($year-1).'/b'.$blog_id,
148
+            'title' => sprintf(planet_constant('MD_TIME_Y'), $year-1)
149 149
         ];
150
-        if ($year < date('Y')) {
150
+        if ($year<date('Y')) {
151 151
             $timenav['next'] = [
152
-                'url'   => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . '' . ($year + 1) . '/b' . $blog_id,
153
-                'title' => sprintf(planet_constant('MD_TIME_Y'), $year + 1)
152
+                'url'   => XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.archive.php'.URL_DELIMITER.''.($year+1).'/b'.$blog_id,
153
+                'title' => sprintf(planet_constant('MD_TIME_Y'), $year+1)
154 154
             ];
155 155
         }
156 156
     } // Get daily list
157 157
     elseif (empty($day)) {
158
-        $sql    = "SELECT DAY(FROM_UNIXTIME(art_time - $timeoffset)) AS day, COUNT(DISTINCT a.art_id) AS count
159
-            FROM " . planet_DB_prefix('article') . "
158
+        $sql = "SELECT DAY(FROM_UNIXTIME(art_time - $timeoffset)) AS day, COUNT(DISTINCT a.art_id) AS count
159
+            FROM ".planet_DB_prefix('article')."
160 160
             WHERE YEAR(FROM_UNIXTIME(art_time - $timeoffset)) = $year
161 161
             AND MONTH(FROM_UNIXTIME(art_time - $timeoffset)) = $month
162
-            " . $blog_criteria . '
162
+            ".$blog_criteria.'
163 163
             GROUP BY day
164 164
             ';
165 165
         $result = $xoopsDB->query($sql);
@@ -167,35 +167,35 @@  discard block
 block discarded – undo
167 167
         while (false !== ($myrow = $xoopsDB->fetchArray($result))) {
168 168
             $days[$myrow['day']]['count'] = $myrow['count'];
169 169
         }
170
-        for ($i = 1; $i <= 31; ++$i) {
170
+        for ($i = 1; $i<=31; ++$i) {
171 171
             if (!isset($days[$i])) {
172 172
                 continue;
173 173
             }
174 174
             $days[$i] = [
175 175
                 'title' => $days[$i]['count'],
176
-                'url'   => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . '' . $year . '/' . $month . '/' . $i . '/b' . $blog_id
176
+                'url'   => XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.archive.php'.URL_DELIMITER.''.$year.'/'.$month.'/'.$i.'/b'.$blog_id
177 177
             ];
178 178
         }
179 179
         $calendar   = planet_getCalendar($year, $month, $days);
180
-        $month_next = $month + 1;
181
-        $month_prev = $month - 1;
180
+        $month_next = $month+1;
181
+        $month_prev = $month-1;
182 182
         $_year      = $year;
183 183
         if (12 == $month) {
184 184
             $month_next = 1;
185
-            $_year      = $year + 1;
185
+            $_year      = $year+1;
186 186
         }
187 187
         if (1 == $month) {
188 188
             $month_pre = 12;
189
-            $_year     = $year - 1;
189
+            $_year     = $year-1;
190 190
         }
191 191
         $timenav['prev'] = [
192
-            'url'   => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . '' . $_year . '/' . $month_prev . '/b' . $blog_id,
193
-            'title' => planet_constant('MD_MONTH_' . $month_prev)
192
+            'url'   => XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.archive.php'.URL_DELIMITER.''.$_year.'/'.$month_prev.'/b'.$blog_id,
193
+            'title' => planet_constant('MD_MONTH_'.$month_prev)
194 194
         ];
195
-        if ($year < date('Y') || $month < date('n')) {
195
+        if ($year<date('Y') || $month<date('n')) {
196 196
             $timenav['next'] = [
197
-                'url'   => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . '' . $_year . '/' . $month_next . '/b' . $blog_id,
198
-                'title' => planet_constant('MD_MONTH_' . $month_next)
197
+                'url'   => XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.archive.php'.URL_DELIMITER.''.$_year.'/'.$month_next.'/b'.$blog_id,
198
+                'title' => planet_constant('MD_MONTH_'.$month_next)
199 199
             ];
200 200
         }
201 201
     }
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 $xoopsTpl->assign('timenav', $timenav);
216 216
 $xoopsTpl->assign('pagenav', $pagenav);
217 217
 
218
-require_once __DIR__ . '/footer.php';
218
+require_once __DIR__.'/footer.php';
219 219
 
220 220
 /**
221 221
  * @param null $year
@@ -232,24 +232,24 @@  discard block
 block discarded – undo
232 232
     ob_start();
233 233
     echo '<table id="calendar">';
234 234
     echo '<caption>';
235
-    printf(planet_constant('MD_TIME_YM'), $year, planet_constant('MD_MONTH_' . $month));
235
+    printf(planet_constant('MD_TIME_YM'), $year, planet_constant('MD_MONTH_'.$month));
236 236
     echo '</caption>';
237 237
 
238
-    for ($i = 1; $i <= 7; ++$i) {
239
-        echo "\n\t\t<th abbr=\"" . planet_constant('MD_WEEK_' . $i) . '" scope="col" title="' . planet_constant('MD_WEEK_' . $i) . '">' . planet_constant('MD_WEEK_' . $i) . '</th>';
238
+    for ($i = 1; $i<=7; ++$i) {
239
+        echo "\n\t\t<th abbr=\"".planet_constant('MD_WEEK_'.$i).'" scope="col" title="'.planet_constant('MD_WEEK_'.$i).'">'.planet_constant('MD_WEEK_'.$i).'</th>';
240 240
     }
241 241
 
242 242
     echo '<tr>';
243 243
 
244 244
     // See how much we should pad in the beginning
245 245
     $week_begins = 1;
246
-    $pad         = planet_calendar_week_mod(date('w', $unixmonth) - $week_begins);
246
+    $pad         = planet_calendar_week_mod(date('w', $unixmonth)-$week_begins);
247 247
     if (0 != $pad) {
248
-        echo "\n\t\t" . '<td colspan="' . $pad . '">&nbsp;</td>';
248
+        echo "\n\t\t".'<td colspan="'.$pad.'">&nbsp;</td>';
249 249
     }
250 250
 
251
-    $daysinmonth = (int)date('t', $unixmonth);
252
-    for ($day = 1; $day <= $daysinmonth; ++$day) {
251
+    $daysinmonth = (int) date('t', $unixmonth);
252
+    for ($day = 1; $day<=$daysinmonth; ++$day) {
253 253
         if (isset($newrow) && $newrow) {
254 254
             echo "\n\t</tr>\n\t<tr>\n\t\t";
255 255
         }
@@ -258,26 +258,26 @@  discard block
 block discarded – undo
258 258
         echo '<td>';
259 259
 
260 260
         if (!empty($days[$day]['url'])) {
261
-            echo '<a href="' . $days[$day]['url'] . '"';
261
+            echo '<a href="'.$days[$day]['url'].'"';
262 262
             if (!empty($days[$day]['title'])) {
263
-                echo 'title="' . $days[$day]['title'] . '"';
263
+                echo 'title="'.$days[$day]['title'].'"';
264 264
             }
265 265
             echo ">$day</a>";
266 266
         } elseif (!empty($days[$day]['title'])) {
267
-            echo '<acronym title="' . $days[$day]['title'] . "\">$day</acronym>";
268
-        } else {
267
+            echo '<acronym title="'.$days[$day]['title']."\">$day</acronym>";
268
+        }else {
269 269
             echo $day;
270 270
         }
271 271
         echo '</td>';
272 272
 
273
-        if (6 == planet_calendar_week_mod(date('w', mktime(0, 0, 0, $month, $day, $year)) - $week_begins)) {
273
+        if (6 == planet_calendar_week_mod(date('w', mktime(0, 0, 0, $month, $day, $year))-$week_begins)) {
274 274
             $newrow = true;
275 275
         }
276 276
     }
277 277
 
278
-    $pad = 7 - planet_calendar_week_mod(date('w', mktime(0, 0, 0, $month, $day, $year)) - $week_begins);
278
+    $pad = 7-planet_calendar_week_mod(date('w', mktime(0, 0, 0, $month, $day, $year))-$week_begins);
279 279
     if (0 != $pad && 7 != $pad) {
280
-        echo "\n\t\t" . '<td class="pad" colspan="' . $pad . '">&nbsp;</td>';
280
+        echo "\n\t\t".'<td class="pad" colspan="'.$pad.'">&nbsp;</td>';
281 281
     }
282 282
 
283 283
     echo "\n\t</tr>\n\t</tbody>\n\t</table>";
@@ -296,5 +296,5 @@  discard block
 block discarded – undo
296 296
 {
297 297
     $base = 7;
298 298
 
299
-    return ($num - $base * floor($num / $base));
299
+    return ($num-$base*floor($num/$base));
300 300
 }
Please login to merge, or discard this patch.
action.article.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -26,26 +26,26 @@  discard block
 block discarded – undo
26 26
 // ------------------------------------------------------------------------ //
27 27
 use Xmf\Request;
28 28
 
29
-include __DIR__ . '/header.php';
29
+include __DIR__.'/header.php';
30 30
 
31
-$art_id = Request::getInt('article', Request::getInt('article', 0, 'POST'), 'GET');//(int)(isset($_GET['article']) ? $_GET['article'] : (isset($_POST['article']) ? $_POST['article'] : 0));
31
+$art_id = Request::getInt('article', Request::getInt('article', 0, 'POST'), 'GET'); //(int)(isset($_GET['article']) ? $_GET['article'] : (isset($_POST['article']) ? $_POST['article'] : 0));
32 32
 if (empty($art_id)) {
33 33
     redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_INVALID'));
34 34
 }
35 35
 if (!$xoopsUser->isAdmin()) {
36 36
     redirect_header('javascript:history.go(-1);', 2, _NOPERM);
37 37
 }
38
-include XOOPS_ROOT_PATH . '/header.php';
39
-include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php';
38
+include XOOPS_ROOT_PATH.'/header.php';
39
+include XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/vars.php';
40 40
 
41 41
 $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']);
42 42
 $article_obj    = $articleHandler->get($art_id);
43 43
 
44
-$op = Request::getCmd('op', 'check', 'POST');//isset($_POST['op']) ? $_POST['op'] : '';
44
+$op = Request::getCmd('op', 'check', 'POST'); //isset($_POST['op']) ? $_POST['op'] : '';
45 45
 
46 46
 if ('del' === $op || !empty(Request::getString('del', '', 'POST'))) {
47 47
     $articleHandler->delete($article_obj);
48
-    $redirect = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php';
48
+    $redirect = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php';
49 49
     $message  = planet_constant('MD_SAVED');
50 50
     redirect_header($redirect, 2, $message);
51 51
 } elseif ('save' === $op) {
@@ -66,15 +66,15 @@  discard block
 block discarded – undo
66 66
 
67 67
     $art_id_new = $articleHandler->insert($article_obj);
68 68
     if (!$article_obj->getVar('art_id')) {
69
-        $redirect = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php';
69
+        $redirect = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php';
70 70
         $message  = planet_constant('MD_INSERTERROR');
71
-    } else {
72
-        $redirect = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' . $article_obj->getVar('art_id');
71
+    }else {
72
+        $redirect = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.article.php'.URL_DELIMITER.''.$article_obj->getVar('art_id');
73 73
         $message  = planet_constant('MD_SAVED');
74 74
     }
75 75
     redirect_header($redirect, 2, $message);
76
-} else {
77
-    require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
76
+}else {
77
+    require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
78 78
 
79 79
     $form = new \XoopsThemeForm(_EDIT, 'formarticle', xoops_getenv('PHP_SELF'), 'post', true);
80 80
 
@@ -93,9 +93,9 @@  discard block
 block discarded – undo
93 93
     $butt_del->setExtra("onClick='document.forms.formarticle.op.value=del'");
94 94
     $button_tray->addElement($butt_del);
95 95
     $butt_cancel = new \XoopsFormButton('', 'cancel', _CANCEL, 'button');
96
-    $butt_cancel->setExtra("onclick='window.document.location=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' . $art_id . "\"'");
96
+    $butt_cancel->setExtra("onclick='window.document.location=\"".XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.article.php'.URL_DELIMITER.''.$art_id."\"'");
97 97
     $button_tray->addElement($butt_cancel);
98 98
     $form->addElement($button_tray);
99 99
     $form->display();
100 100
 }
101
-include XOOPS_ROOT_PATH . '/footer.php';
101
+include XOOPS_ROOT_PATH.'/footer.php';
Please login to merge, or discard this patch.
tests/testdata/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
  * @author          Michael Beck (aka Mamba)
16 16
  */
17 17
 
18
-require_once __DIR__ . '/../../../mainfile.php';
18
+require_once __DIR__.'/../../../mainfile.php';
19 19
 
20 20
 
21 21
 $op = \Xmf\Request::getCmd('op', '');
Please login to merge, or discard this patch.
action.bookmark.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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';
Please login to merge, or discard this patch.
trackback.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -29,21 +29,21 @@  discard block
 block discarded – undo
29 29
 /** @var Planet\Helper $helper */
30 30
 $helper = Planet\Helper::getInstance();
31 31
 
32
-include __DIR__ . '/header.php';
32
+include __DIR__.'/header.php';
33 33
 
34 34
 // trackback is done by a POST
35 35
 $art_id     = explode('/', Request::getString('REQUEST_URI', '', 'SERVER'));
36
-$article_id = (int)$art_id[count($art_id) - 1];
37
-$url        = Request::getString('url', '', 'POST');//$_POST['url'];
38
-$title      = Request::getString('title', '', 'POST');//$_POST['title'];
39
-$excerpt    = Request::getString('excerpt', '', 'POST');//$_POST['excerpt'];
40
-$blog_name  = Request::getString('blog_name', '', 'POST');//$_POST['blog_name'];
41
-$charset    = trim(Request::getString('charset', '', 'POST'));//trim($_POST['charset']);
36
+$article_id = (int) $art_id[count($art_id)-1];
37
+$url        = Request::getString('url', '', 'POST'); //$_POST['url'];
38
+$title      = Request::getString('title', '', 'POST'); //$_POST['title'];
39
+$excerpt    = Request::getString('excerpt', '', 'POST'); //$_POST['excerpt'];
40
+$blog_name  = Request::getString('blog_name', '', 'POST'); //$_POST['blog_name'];
41
+$charset    = trim(Request::getString('charset', '', 'POST')); //trim($_POST['charset']);
42 42
 
43 43
 if (empty($helper->getConfig('trackback_option'))) {
44 44
     PlanetUtility::planetRespondToTrackback(1, 'Trackback is closed');
45 45
 }
46
-if (!strlen($title . $url . $blog_name)) {
46
+if (!strlen($title.$url.$blog_name)) {
47 47
     PlanetUtility::planetRespondToTrackback(1, planet_constant('MD_INVALID'));
48 48
 }
49 49
 
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
     $trackbackHandler = xoops_getModuleHandler('trackback', $GLOBALS['moddirname']);
52 52
     $criteria         = new \CriteriaCompo(new \Criteria('art_id', $article_id));
53 53
     $criteria->add(new \Criteria('tb_url', $url));
54
-    if ($trackbackHandler->getCount($criteria) > 0) {
54
+    if ($trackbackHandler->getCount($criteria)>0) {
55 55
         PlanetUtility::planetRespondToTrackback(1, 'We already have a ping from that URI for this article.');
56 56
     }
57 57
 
@@ -59,17 +59,17 @@  discard block
 block discarded – undo
59 59
     $title     = XoopsLocal::convert_encoding($title, _CHARSET, $charset);
60 60
     $excerpt   = XoopsLocal::convert_encoding($excerpt, _CHARSET, $charset);
61 61
     $blog_name = XoopsLocal::convert_encoding($blog_name, _CHARSET, $charset);
62
-    $tb_status = (int)$helper->getConfig('trackback_option');
62
+    $tb_status = (int) $helper->getConfig('trackback_option');
63 63
 
64 64
     $com_pid    = 0;
65 65
     $com_itemid = $article_id;
66 66
     $com_rootid = 0;
67 67
     $com_title  = $title;
68 68
     $com_text   = $excerpt;
69
-    $com_text   .= "\n\n[TRACKBACK]" . _POSTEDBY . ': ';
69
+    $com_text .= "\n\n[TRACKBACK]"._POSTEDBY.': ';
70 70
     if (!empty($url)) {
71
-        $com_text .= '[url=' . $url . ']' . $blog_name . '[/url]';
72
-    } else {
71
+        $com_text .= '[url='.$url.']'.$blog_name.'[/url]';
72
+    }else {
73 73
         $com_text .= $blog_name;
74 74
     }
75 75
     $com_modid = $xoopsModule->getVar('mid');
@@ -125,13 +125,13 @@  discard block
 block discarded – undo
125 125
                 if (isset($comment_config['callbackFile'])) {
126 126
                     $callbackfile = trim($comment_config['callbackFile']);
127 127
                     if ('' != $callbackfile
128
-                        && file_exists(XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile)) {
129
-                        require_once XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile;
128
+                        && file_exists(XOOPS_ROOT_PATH.'/modules/'.$moddir.'/'.$callbackfile)) {
129
+                        require_once XOOPS_ROOT_PATH.'/modules/'.$moddir.'/'.$callbackfile;
130 130
                     }
131 131
                     if (!function_exists($comment_config['callback']['approve'])) {
132 132
                         $skip = true;
133 133
                     }
134
-                } else {
134
+                }else {
135 135
                     $skip = true;
136 136
                 }
137 137
             }
@@ -148,13 +148,13 @@  discard block
 block discarded – undo
148 148
                 if (isset($comment_config['callbackFile'])) {
149 149
                     $callbackfile = trim($comment_config['callbackFile']);
150 150
                     if ('' != $callbackfile
151
-                        && file_exists(XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile)) {
152
-                        require_once XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile;
151
+                        && file_exists(XOOPS_ROOT_PATH.'/modules/'.$moddir.'/'.$callbackfile)) {
152
+                        require_once XOOPS_ROOT_PATH.'/modules/'.$moddir.'/'.$callbackfile;
153 153
                     }
154 154
                     if (!function_exists($comment_config['callback']['update'])) {
155 155
                         $skip = true;
156 156
                     }
157
-                } else {
157
+                }else {
158 158
                     $skip = true;
159 159
                 }
160 160
             }
@@ -184,16 +184,16 @@  discard block
 block discarded – undo
184 184
             $not_module   = $xoopsModule;
185 185
             if (!isset($comment_url)) {
186 186
                 $com_config  = $not_module->getInfo('comments');
187
-                $comment_url = $com_config['pageName'] . '?';
187
+                $comment_url = $com_config['pageName'].'?';
188 188
                 $comment_url .= $com_config['itemName'];
189 189
             }
190
-            $comment_tags['X_COMMENT_URL'] = XOOPS_URL . '/modules/' . $not_module->getVar('dirname') . '/' . $comment_url . '=' . $com_itemid . '&amp;com_id=' . $newcid . '&amp;com_rootid=' . $com_rootid . '&amp;com_mode=' . $com_mode . '&amp;com_order=' . $com_order . '#comment' . $newcid;
190
+            $comment_tags['X_COMMENT_URL'] = XOOPS_URL.'/modules/'.$not_module->getVar('dirname').'/'.$comment_url.'='.$com_itemid.'&amp;com_id='.$newcid.'&amp;com_rootid='.$com_rootid.'&amp;com_mode='.$com_mode.'&amp;com_order='.$com_order.'#comment'.$newcid;
191 191
             $notificationHandler           = xoops_getHandler('notification');
192 192
             $notificationHandler->triggerEvent($not_category, $not_itemid, $not_event, $comment_tags, false, $not_modid);
193 193
         }
194 194
 
195 195
         PlanetUtility::planetRespondToTrackback(0);
196
-    } else {
196
+    }else {
197 197
         PlanetUtility::planetRespondToTrackback(1, xoops_error($comment->getHtmlErrors()));
198 198
     }
199 199
 }
Please login to merge, or discard this patch.
action.rate.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 use Xmf\Request;
28 28
 use XoopsModules\Planet;
29 29
 
30
-include __DIR__ . '/header.php';
30
+include __DIR__.'/header.php';
31 31
 
32 32
 /** @var Planet\Helper $helper */
33 33
 $helper = Planet\Helper::getInstance();
@@ -44,28 +44,28 @@  discard block
 block discarded – undo
44 44
 $blogHandler    = xoops_getModuleHandler('blog', $GLOBALS['moddirname']);
45 45
 if (empty($helper->getConfig('anonymous_rate')) && !is_object($xoopsUser)) {
46 46
     $message = planet_constant('MD_NOACCESS');
47
-} else {
47
+}else {
48 48
     $uid = is_object($xoopsUser) ? $xoopsUser->getVar('uid') : 0;
49 49
     $ip  = PlanetUtility::planetGetIP();
50
-    if ($article_id > 0) {
50
+    if ($article_id>0) {
51 51
         $criteria = new \CriteriaCompo(new \Criteria('art_id', $article_id));
52
-    } else {
52
+    }else {
53 53
         $criteria = new \CriteriaCompo(new \Criteria('blog_id', $blog_id));
54 54
     }
55
-    if ($uid > 0) {
55
+    if ($uid>0) {
56 56
         $criteria->add(new \Criteria('rate_uid', $uid));
57
-    } else {
57
+    }else {
58 58
         $criteria->add(new \Criteria('rate_ip', $ip));
59
-        $criteria->add(new \Criteria('rate_time', time() - 24 * 3600, '>'));
59
+        $criteria->add(new \Criteria('rate_time', time()-24*3600, '>'));
60 60
     }
61 61
     $rateHandler = xoops_getModuleHandler('rate', $GLOBALS['moddirname']);
62 62
     if ($count = $rateHandler->getCount($criteria)) {
63 63
         $message = planet_constant('MD_ALREADYRATED');
64
-    } else {
64
+    }else {
65 65
         $rate_obj = $rateHandler->create();
66
-        if ($article_id > 0) {
66
+        if ($article_id>0) {
67 67
             $rate_obj->setVar('art_id', $article_id);
68
-        } else {
68
+        }else {
69 69
             $rate_obj->setVar('blog_id', $blog_id);
70 70
         }
71 71
         $rate_obj->setVar('rate_uid', $uid);
@@ -75,23 +75,23 @@  discard block
 block discarded – undo
75 75
         if (!$rate_id = $rateHandler->insert($rate_obj, true)) {
76 76
             redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_NOTSAVED'));
77 77
         }
78
-        if ($article_id > 0) {
78
+        if ($article_id>0) {
79 79
             $article_obj = $articleHandler->get($article_id);
80
-            $article_obj->setVar('art_rating', $article_obj->getVar('art_rating') + $rate);
81
-            $article_obj->setVar('art_rates', $article_obj->getVar('art_rates') + 1);
80
+            $article_obj->setVar('art_rating', $article_obj->getVar('art_rating')+$rate);
81
+            $article_obj->setVar('art_rates', $article_obj->getVar('art_rates')+1);
82 82
             $articleHandler->insert($article_obj, true);
83
-        } else {
83
+        }else {
84 84
             $blog_obj = $blogHandler->get($blog_id);
85
-            $blog_obj->setVar('blog_rating', $blog_obj->getVar('blog_rating') + $rate);
86
-            $blog_obj->setVar('blog_rates', $blog_obj->getVar('blog_rates') + 1);
85
+            $blog_obj->setVar('blog_rating', $blog_obj->getVar('blog_rating')+$rate);
86
+            $blog_obj->setVar('blog_rates', $blog_obj->getVar('blog_rates')+1);
87 87
             $blogHandler->insert($blog_obj, true);
88 88
         }
89 89
         $message = planet_constant('MD_ACTIONDONE');
90 90
     }
91 91
 }
92
-if ($article_id > 0) {
93
-    redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' . $article_id, 2, $message);
94
-} else {
95
-    redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'b' . $blog_id, 2, $message);
92
+if ($article_id>0) {
93
+    redirect_header(XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.article.php'.URL_DELIMITER.''.$article_id, 2, $message);
94
+}else {
95
+    redirect_header(XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php'.URL_DELIMITER.'b'.$blog_id, 2, $message);
96 96
 }
97
-include __DIR__ . '/footer.php';
97
+include __DIR__.'/footer.php';
Please login to merge, or discard this patch.
comment_new.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,11 +24,11 @@
 block discarded – undo
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
 $com_itemid = \Xmf\Request::getInt('com_itemid', 0, 'GET');
29
-if ($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
 }
Please login to merge, or discard this patch.
action.blog.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -27,14 +27,14 @@  discard block
 block discarded – undo
27 27
 use Xmf\Request;
28 28
 use XoopsModules\Planet;
29 29
 
30
-include __DIR__ . '/header.php';
30
+include __DIR__.'/header.php';
31 31
 
32 32
 /** @var Planet\Helper $helper */
33 33
 $helper = Planet\Helper::getInstance();
34 34
 
35
-$op      = Request::getString('op', Request::getString('op', '', 'POST'), 'GET');//!empty($_POST['op']) ? $_POST['op'] : (!empty($_GET['op']) ? $_GET['op'] : '');
36
-$blog_id = Request::getArray('blog', Request::getArray('blog', [], 'POST'), 'GET');//!empty($_POST['blog']) ? $_POST['blog'] : (!empty($_GET['blog']) ? $_GET['blog'] : 0);
37
-$blog_id = is_array($blog_id) ? array_map('intval', $blog_id) : (int)$blog_id;
35
+$op      = Request::getString('op', Request::getString('op', '', 'POST'), 'GET'); //!empty($_POST['op']) ? $_POST['op'] : (!empty($_GET['op']) ? $_GET['op'] : '');
36
+$blog_id = Request::getArray('blog', Request::getArray('blog', [], 'POST'), 'GET'); //!empty($_POST['blog']) ? $_POST['blog'] : (!empty($_GET['blog']) ? $_GET['blog'] : 0);
37
+$blog_id = is_array($blog_id) ? array_map('intval', $blog_id) : (int) $blog_id;
38 38
 
39 39
 if (empty($helper->getConfig('newblog_submit')) && (!is_object($xoopsUser) || !$xoopsUser->isAdmin())) {
40 40
     redirect_header('index.php', 2, _NOPERM);
@@ -45,10 +45,10 @@  discard block
 block discarded – undo
45 45
 }
46 46
 
47 47
 if ('save' === $op && !$GLOBALS['xoopsSecurity']->check()) {
48
-    redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_INVALID') . ': security check failed');
48
+    redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_INVALID').': security check failed');
49 49
 }
50
-include XOOPS_ROOT_PATH . '/header.php';
51
-include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php';
50
+include XOOPS_ROOT_PATH.'/header.php';
51
+include XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/vars.php';
52 52
 
53 53
 $blogHandler     = xoops_getModuleHandler('blog', $GLOBALS['moddirname']);
54 54
 $categoryHandler = xoops_getModuleHandler('category', $GLOBALS['moddirname']);
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
         if ($blog_id) {
61 61
             $blog_obj = $blogHandler->get($blog_id);
62 62
             if ($xoopsUser->isAdmin()) {
63
-                $blog_obj->setVar('blog_status', Request::getInt('blog_status', 0, 'POST'));// @$_POST['blog_status']);
63
+                $blog_obj->setVar('blog_status', Request::getInt('blog_status', 0, 'POST')); // @$_POST['blog_status']);
64 64
             }
65
-        } else {
65
+        }else {
66 66
             if ($blog_exists = $blogHandler->getCount(new \Criteria('blog_feed', $myts->addSlashes(trim(Request::getText('blog_feed', '', 'POST')))))  //$_POST['blog_feed']))))
67 67
             ) {
68 68
                 redirect_header('index.php', 2, planet_constant('MD_BLOGEXISTS'));
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
                 case 2:
76 76
                     if (!is_object($xoopsUser)) {
77 77
                         $status = 0;
78
-                    } else {
78
+                    }else {
79 79
                         $status = 1;
80 80
                     }
81 81
                     break;
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
                 default:
88 88
                     if (!is_object($xoopsUser) || !$xoopsUser->isAdmin()) {
89 89
                         $status = 0;
90
-                    } else {
90
+                    }else {
91 91
                         $status = 1;
92 92
                     }
93 93
                     break;
@@ -96,14 +96,14 @@  discard block
 block discarded – undo
96 96
             $blog_obj->setVar('blog_status', $status);
97 97
         }
98 98
 
99
-        $blog_obj->setVar('blog_title', Request::getString('blog_title', '', 'POST'));//$_POST['blog_title']);
100
-        $blog_obj->setVar('blog_desc', Request::getString('blog_desc', '', 'POST'));//$_POST['blog_desc']);
101
-        $blog_obj->setVar('blog_image', Request::getString('blog_image', '', 'POST'));//$_POST['blog_image']);
102
-        $blog_obj->setVar('blog_feed', Request::getText('blog_feed', '', 'POST'));//$_POST['blog_feed']);
103
-        $blog_obj->setVar('blog_link', Request::getString('blog_link', '', 'POST'));//$_POST['blog_link']);
104
-        $blog_obj->setVar('blog_language', Request::getString('blog_language', '', 'POST'));//$_POST['blog_language']);
105
-        $blog_obj->setVar('blog_charset', Request::getString('blog_charset', '', 'POST'));//$_POST['blog_charset']);
106
-        $blog_obj->setVar('blog_trackback', Request::getString('blog_trackback', '', 'POST'));//$_POST['blog_trackback']);
99
+        $blog_obj->setVar('blog_title', Request::getString('blog_title', '', 'POST')); //$_POST['blog_title']);
100
+        $blog_obj->setVar('blog_desc', Request::getString('blog_desc', '', 'POST')); //$_POST['blog_desc']);
101
+        $blog_obj->setVar('blog_image', Request::getString('blog_image', '', 'POST')); //$_POST['blog_image']);
102
+        $blog_obj->setVar('blog_feed', Request::getText('blog_feed', '', 'POST')); //$_POST['blog_feed']);
103
+        $blog_obj->setVar('blog_link', Request::getString('blog_link', '', 'POST')); //$_POST['blog_link']);
104
+        $blog_obj->setVar('blog_language', Request::getString('blog_language', '', 'POST')); //$_POST['blog_language']);
105
+        $blog_obj->setVar('blog_charset', Request::getString('blog_charset', '', 'POST')); //$_POST['blog_charset']);
106
+        $blog_obj->setVar('blog_trackback', Request::getString('blog_trackback', '', 'POST')); //$_POST['blog_trackback']);
107 107
         if ($blog_obj->isNew()) {
108 108
             $blog_obj->setVar('blog_submitter', is_object($xoopsUser) ? $xoopsUser->getVar('uid') : PlanetUtility::planetGetIP(true));
109 109
         }
@@ -114,10 +114,10 @@  discard block
 block discarded – undo
114 114
             if (in_array(0, $_POST['categories'])) {
115 115
                 $_POST['categories'] = [];
116 116
             }
117
-            $blogHandler->setCategories($blog_id, Request::getString('andor', '', 'POST'));//$_POST['categories']);
117
+            $blogHandler->setCategories($blog_id, Request::getString('andor', '', 'POST')); //$_POST['categories']);
118 118
         }
119 119
         $message = planet_constant('MD_DBUPDATED');
120
-        redirect_header('index.php' . URL_DELIMITER . 'b' . $blog_id, 2, $message);
120
+        redirect_header('index.php'.URL_DELIMITER.'b'.$blog_id, 2, $message);
121 121
 
122 122
     /* edit a single blog */
123 123
     // no break
@@ -126,14 +126,14 @@  discard block
 block discarded – undo
126 126
         if (!empty(Request::getString('fetch', '', 'POST'))) {
127 127
             $blog_obj = $blogHandler->fetch(Request::getText('blog_feed', '', 'POST'));
128 128
             $blog_obj->setVar('blog_id', $blog_id);
129
-        } else {
129
+        }else {
130 130
             $blog_obj = $blogHandler->get($blog_id);
131 131
         }
132
-        $categories = Request::getArray('categories', [], 'POST');//isset($_POST['categories']) ? $_POST['categories'] : array();
132
+        $categories = Request::getArray('categories', [], 'POST'); //isset($_POST['categories']) ? $_POST['categories'] : array();
133 133
         if (in_array('-1', $categories)) {
134 134
             $categories = [];
135 135
         }
136
-        if (empty($categories) && $blog_id > 0) {
136
+        if (empty($categories) && $blog_id>0) {
137 137
             $crit       = new \Criteria('bc.blog_id', $blog_id);
138 138
             $categories = array_keys($categoryHandler->getByBlog($crit));
139 139
         }
@@ -141,23 +141,23 @@  discard block
 block discarded – undo
141 141
             $categories = [0 => _NONE];
142 142
         }
143 143
 
144
-        echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _EDIT . '</legend>';
144
+        echo "<fieldset><legend style='font-weight: bold; color: #900;'>"._EDIT.'</legend>';
145 145
         echo '<br>';
146 146
         if (empty($blog_id) && $blog_obj->getVar('blog_feed')) {
147 147
             $criteria  = new \Criteria('blog_feed', $blog_obj->getVar('blog_feed'));
148 148
             $blogs_obj = $blogHandler->getList($criteria);
149
-            if (count($blogs_obj) > 0) {
150
-                echo '<div class="errorMsg">' . planet_constant('MD_BLOGEXISTS');
149
+            if (count($blogs_obj)>0) {
150
+                echo '<div class="errorMsg">'.planet_constant('MD_BLOGEXISTS');
151 151
                 foreach (array_keys($blogs_obj) as $bid) {
152
-                    echo '<br><a href="' . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'b' . $bid . '" target="_blank">' . $blogs_obj[$bid] . '</a>';
152
+                    echo '<br><a href="'.XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php'.URL_DELIMITER.'b'.$bid.'" target="_blank">'.$blogs_obj[$bid].'</a>';
153 153
                 }
154 154
                 echo '</div>';
155 155
                 unset($blogs_obj, $criteria);
156 156
             }
157 157
         }
158
-        include XOOPS_ROOT_PATH . '/modules/' . $GLOBALS['moddirname'] . '/include/form.blog.php';
158
+        include XOOPS_ROOT_PATH.'/modules/'.$GLOBALS['moddirname'].'/include/form.blog.php';
159 159
         echo '</fieldset>';
160 160
         break;
161 161
 }
162 162
 
163
-include XOOPS_ROOT_PATH . '/footer.php';
163
+include XOOPS_ROOT_PATH.'/footer.php';
Please login to merge, or discard this patch.
xml.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 $helper = Planet\Helper::getInstance();
31 31
 
32 32
 ob_start();
33
-include __DIR__ . '/header.php';
33
+include __DIR__.'/header.php';
34 34
 
35 35
 if (PlanetUtility::planetParseArguments($args_num, $args, $args_str)) {
36 36
     $args['article'] = @$args_num[0];
@@ -89,16 +89,16 @@  discard block
 block discarded – undo
89 89
     }
90 90
 } elseif (!empty($uid)) {
91 91
     $source = 'bookmark';
92
-} else {
92
+}else {
93 93
     $source = '';
94 94
 }
95 95
 
96 96
 $xml_charset = 'UTF-8';
97
-require_once XOOPS_ROOT_PATH . '/class/template.php';
97
+require_once XOOPS_ROOT_PATH.'/class/template.php';
98 98
 $tpl = new \XoopsTpl();
99
-$tpl->caching=(2);
99
+$tpl->caching = (2);
100 100
 $tpl->xoops_setCacheTime(3600);
101
-$xoopsCachedTemplateId = md5($xoopsModule->getVar('mid') . ',' . $article_id . ',' . $category_id . ',' . $blog_id . ',' . $uid . ',' . $type);
101
+$xoopsCachedTemplateId = md5($xoopsModule->getVar('mid').','.$article_id.','.$category_id.','.$blog_id.','.$uid.','.$type);
102 102
 if (!$tpl->is_cached('db:system_dummy.tpl', $xoopsCachedTemplateId)) {
103 103
     $criteria = new \CriteriaCompo();
104 104
     $criteria->setLimit($helper->getConfig('articles_perpage'));
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 
111 111
             $articles_obj[$article_id] = $article_obj;
112 112
 
113
-            $xml_link = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' . $article_obj->getVar('art_id');
113
+            $xml_link = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.article.php'.URL_DELIMITER.''.$article_obj->getVar('art_id');
114 114
             break;
115 115
 
116 116
         case 'category':
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
             $criteria->add(new \Criteria('bc.cat_id', $category_id));
121 121
             $articles_obj = $articleHandler->getByCategory($criteria);
122 122
 
123
-            $xml_link = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'c' . $category_id;
123
+            $xml_link = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php'.URL_DELIMITER.'c'.$category_id;
124 124
             break;
125 125
 
126 126
         case 'blog':
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
             $criteria->add(new \Criteria('blog_id', $blog_id));
131 131
             $articles_obj = $articleHandler->getAll($criteria);
132 132
 
133
-            $xml_link = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'b' . $blog_id;
133
+            $xml_link = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php'.URL_DELIMITER.'b'.$blog_id;
134 134
             break;
135 135
 
136 136
         case 'bookmark':
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
             $criteria->add(new \Criteria('bm.bm_uid', $uid));
142 142
             $articles_obj = $articleHandler->getByBookmark($criteria);
143 143
 
144
-            $xml_link = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'u' . $uid;
144
+            $xml_link = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php'.URL_DELIMITER.'u'.$uid;
145 145
 
146 146
             break;
147 147
 
@@ -151,20 +151,20 @@  discard block
 block discarded – undo
151 151
 
152 152
             $articles_obj = $articleHandler->getAll($criteria);
153 153
 
154
-            $xml_link = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php';
154
+            $xml_link = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php';
155 155
             break;
156 156
     }
157 157
     $items = [];
158 158
     foreach (array_keys($articles_obj) as $id) {
159 159
         $content = $articles_obj[$id]->getVar('art_content');
160
-        $content .= '<br>' . planet_constant('MD_SOURCE') . ': ' . $articles_obj[$id]->getVar('art_link') . ' ' . $articles_obj[$id]->getVar('art_author');
160
+        $content .= '<br>'.planet_constant('MD_SOURCE').': '.$articles_obj[$id]->getVar('art_link').' '.$articles_obj[$id]->getVar('art_author');
161 161
         $items[] = [
162 162
             'title'                     => $articles_obj[$id]->getVar('art_title'),
163
-            'link'                      => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' . $articles_obj[$id]->getVar('art_id'),
163
+            'link'                      => XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.article.php'.URL_DELIMITER.''.$articles_obj[$id]->getVar('art_id'),
164 164
             'description'               => $content,
165 165
             'descriptionHtmlSyndicated' => true,
166 166
             'date'                      => $articles_obj[$id]->getTime('rss'),
167
-            'source'                    => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/',
167
+            'source'                    => XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/',
168 168
             'author'                    => $articles_obj[$id]->getVar('art_author')
169 169
         ];
170 170
     }
@@ -173,24 +173,24 @@  discard block
 block discarded – undo
173 173
     $xmlHandler = xoops_getModuleHandler('xml', $GLOBALS['moddirname']);
174 174
     $xml        = $xmlHandler->create($type);
175 175
     $xml->setVar('encoding', $xml_charset);
176
-    $xml->setVar('title', $xoopsConfig['sitename'] . ' :: ' . $pagetitle, 'UTF-8', $xml_charset, true);
176
+    $xml->setVar('title', $xoopsConfig['sitename'].' :: '.$pagetitle, 'UTF-8', $xml_charset, true);
177 177
     $xml->setVar('description', $rssdesc, true);
178 178
     $xml->setVar('descriptionHtmlSyndicated', true);
179 179
     $xml->setVar('link', $xml_link);
180
-    $xml->setVar('syndicationURL', XOOPS_URL . '/' . xoops_getenv('PHP_SELF'), 'post', true);
180
+    $xml->setVar('syndicationURL', XOOPS_URL.'/'.xoops_getenv('PHP_SELF'), 'post', true);
181 181
     $xml->setVar('webmaster', checkEmail($xoopsConfig['adminmail'], true));
182 182
     $xml->setVar('editor', checkEmail($xoopsConfig['adminmail'], true));
183 183
     $xml->setVar('category', $xoopsModule->getVar('name'), true);
184 184
     $xml->setVar('generator', $xoopsModule->getInfo('version'));
185 185
     $xml->setVar('language', _LANGCODE);
186 186
 
187
-    $dimention = @getimagesize(XOOPS_ROOT_PATH . '/modules/' . $GLOBALS['moddirname'] . '/' . $xoopsModule->getInfo('image'));
187
+    $dimention = @getimagesize(XOOPS_ROOT_PATH.'/modules/'.$GLOBALS['moddirname'].'/'.$xoopsModule->getInfo('image'));
188 188
     $image     = [
189 189
         'width'       => $dimention[0],
190 190
         'height'      => $dimention[1],
191
-        'title'       => $xoopsConfig['sitename'] . ' :: ' . $pagetitle,
192
-        'url'         => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/' . $xoopsModule->getInfo('image'),
193
-        'link'        => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/',
191
+        'title'       => $xoopsConfig['sitename'].' :: '.$pagetitle,
192
+        'url'         => XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/'.$xoopsModule->getInfo('image'),
193
+        'link'        => XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/',
194 194
         'description' => $rssdesc
195 195
     ];
196 196
     $xml->setImage($image);
@@ -208,11 +208,11 @@  discard block
 block discarded – undo
208 208
     */
209 209
     $xml->addItems($items);
210 210
 
211
-    $dummy_content = $xmlHandler->display($xml, XOOPS_CACHE_PATH . '/' . $GLOBALS['moddirname'] . '.xml.tmp');
211
+    $dummy_content = $xmlHandler->display($xml, XOOPS_CACHE_PATH.'/'.$GLOBALS['moddirname'].'.xml.tmp');
212 212
 
213 213
     $tpl->assign_by_ref('dummy_content', $dummy_content);
214 214
 }
215 215
 //$content = ob_get_contents();
216 216
 ob_end_clean();
217
-header('Content-Type:text/xml; charset=' . $xml_charset);
217
+header('Content-Type:text/xml; charset='.$xml_charset);
218 218
 $tpl->display('db:system_dummy.tpl', $xoopsCachedTemplateId);
Please login to merge, or discard this patch.