Completed
Push — master ( a50592...10bab4 )
by Michael
01:56
created
view.archive.php 1 patch
Spacing   +59 added lines, -59 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
 if (PlanetUtility::planetParseArguments($args_num, $args, $args_str)) {
32 32
     $args['year']  = @$args_num[0];
@@ -45,26 +45,26 @@  discard block
 block discarded – undo
45 45
 $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']);
46 46
 $blogHandler    = xoops_getModuleHandler('blog', $GLOBALS['moddirname']);
47 47
 
48
-$xoopsOption['xoops_pagetitle'] = $xoopsModule->getVar('name') . ' - ' . planet_constant('MD_ACHIVE');
48
+$xoopsOption['xoops_pagetitle'] = $xoopsModule->getVar('name').' - '.planet_constant('MD_ACHIVE');
49 49
 $xoopsOption['template_main']   = PlanetUtility::planetGetTemplate('archive');
50
-require_once XOOPS_ROOT_PATH . '/header.php';
51
-include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php';
50
+require_once XOOPS_ROOT_PATH.'/header.php';
51
+include XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/vars.php';
52 52
 
53 53
 $year = empty($year) ? date('Y') : $year;
54
-if ($month < 1) {
54
+if ($month<1) {
55 55
     $month        = $day = 0;
56 56
     $page['time'] = sprintf(planet_constant('MD_TIME_Y'), $year);
57
-} elseif ($day < 1) {
57
+} elseif ($day<1) {
58 58
     $day          = 0;
59 59
     $page['time'] = sprintf(planet_constant('MD_TIME_YM'), $year, $month);
60
-} else {
60
+}else {
61 61
     $page['time'] = sprintf(planet_constant('MD_TIME_YMD'), $year, $month, $day);
62 62
 }
63 63
 $time = ['year' => $year, 'month' => $month, 'day' => $day];
64 64
 if ($xoopsUser) {
65
-    $timeoffset = ($xoopsUser->getVar('timezone_offset') - $xoopsConfig['server_TZ']) * 3600;
66
-} else {
67
-    $timeoffset = ($xoopsConfig['default_TZ'] - $xoopsConfig['server_TZ']) * 3600;
65
+    $timeoffset = ($xoopsUser->getVar('timezone_offset')-$xoopsConfig['server_TZ'])*3600;
66
+}else {
67
+    $timeoffset = ($xoopsConfig['default_TZ']-$xoopsConfig['server_TZ'])*3600;
68 68
 }
69 69
 
70 70
 $criteria = new CriteriaCompo();
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 $articles = [];
88 88
 $blogs_id = [];
89 89
 foreach ($articles_obj as $id => $article) {
90
-    $articles[]                            = [
90
+    $articles[] = [
91 91
         'id'      => $id,
92 92
         'blog'    => ['id' => $article->getVar('blog_id'), 'title' => ''],
93 93
         'title'   => $article->getVar('art_title'),
@@ -98,20 +98,20 @@  discard block
 block discarded – undo
98 98
     $blogs_id[$article->getVar('blog_id')] = 1;
99 99
     unset($_article);
100 100
 }
101
-$criteria_blog = new Criteria('blog_id', '(' . implode(',', array_keys($blog_array)) . ')', 'IN');
101
+$criteria_blog = new Criteria('blog_id', '('.implode(',', array_keys($blog_array)).')', 'IN');
102 102
 $blogs         = $blogHandler->getList($criteria_blog);
103 103
 foreach (array_keys($articles) as $key) {
104 104
     $articles[$key]['blog']['title'] = $blogs[$articles[$key]['blog']['id']];
105 105
 }
106
-if ($blog_id > 0) {
106
+if ($blog_id>0) {
107 107
     $page['blog'] = $blogs[$blog_id];
108 108
 }
109 109
 
110
-if ($articles_count > $xoopsModuleConfig['articles_perpage']) {
111
-    include XOOPS_ROOT_PATH . '/class/pagenav.php';
112
-    $nav     = new XoopsPageNav($articles_count, $xoopsModuleConfig['articles_perpage'], $start, 'start', 'month=' . $month . '&amp;day=' . $day . '&amp;year=' . $year . '&amp;blog=' . (int)$blog_id);
110
+if ($articles_count>$xoopsModuleConfig['articles_perpage']) {
111
+    include XOOPS_ROOT_PATH.'/class/pagenav.php';
112
+    $nav     = new XoopsPageNav($articles_count, $xoopsModuleConfig['articles_perpage'], $start, 'start', 'month='.$month.'&amp;day='.$day.'&amp;year='.$year.'&amp;blog='.(int) $blog_id);
113 113
     $pagenav = $nav->renderNav(4);
114
-} else {
114
+}else {
115 115
     $pagenav = '';
116 116
 }
117 117
 
@@ -120,43 +120,43 @@  discard block
 block discarded – undo
120 120
 $months   = null;
121 121
 if (empty($start)) {
122 122
     if ($blog_id) {
123
-        $blog_criteria = ' AND blog_id=' . $blog_id;
124
-    } else {
123
+        $blog_criteria = ' AND blog_id='.$blog_id;
124
+    }else {
125 125
         $blog_criteria = '';
126 126
     }
127 127
     // Get monthly list
128 128
     if (empty($month)) {
129
-        $sql    = "SELECT MONTH(FROM_UNIXTIME(art_time - $timeoffset)) AS mon, COUNT(DISTINCT art_id) AS count
130
-            FROM " . planet_DB_prefix('article') . "
129
+        $sql = "SELECT MONTH(FROM_UNIXTIME(art_time - $timeoffset)) AS mon, COUNT(DISTINCT art_id) AS count
130
+            FROM ".planet_DB_prefix('article')."
131 131
             WHERE YEAR(FROM_UNIXTIME(art_time - $timeoffset)) = $year
132
-            " . $blog_criteria . '
132
+            ".$blog_criteria.'
133 133
             GROUP BY mon
134 134
             ';
135 135
         $result = $xoopsDB->query($sql);
136 136
         $months = [];
137 137
         while ($myrow = $xoopsDB->fetchArray($result)) {
138 138
             $months[] = [
139
-                'title' => planet_constant('MD_MONTH_' . (int)$myrow['mon']) . ' (' . (int)$myrow['count'] . ')',
140
-                'url'   => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . '' . $year . '/' . $myrow['mon'] . '/b' . $blog_id
139
+                'title' => planet_constant('MD_MONTH_'.(int) $myrow['mon']).' ('.(int) $myrow['count'].')',
140
+                'url'   => XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.archive.php'.URL_DELIMITER.''.$year.'/'.$myrow['mon'].'/b'.$blog_id
141 141
             ];
142 142
         }
143 143
         $timenav['prev'] = [
144
-            'url'   => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . '' . ($year - 1) . '/b' . $blog_id,
145
-            'title' => sprintf(planet_constant('MD_TIME_Y'), $year - 1)
144
+            'url'   => XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.archive.php'.URL_DELIMITER.''.($year-1).'/b'.$blog_id,
145
+            'title' => sprintf(planet_constant('MD_TIME_Y'), $year-1)
146 146
         ];
147
-        if ($year < date('Y')) {
147
+        if ($year<date('Y')) {
148 148
             $timenav['next'] = [
149
-                'url'   => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . '' . ($year + 1) . '/b' . $blog_id,
150
-                'title' => sprintf(planet_constant('MD_TIME_Y'), $year + 1)
149
+                'url'   => XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.archive.php'.URL_DELIMITER.''.($year+1).'/b'.$blog_id,
150
+                'title' => sprintf(planet_constant('MD_TIME_Y'), $year+1)
151 151
             ];
152 152
         }
153 153
     } // Get daily list
154 154
     elseif (empty($day)) {
155
-        $sql    = "SELECT DAY(FROM_UNIXTIME(art_time - $timeoffset)) AS day, COUNT(DISTINCT a.art_id) AS count
156
-            FROM " . planet_DB_prefix('article') . "
155
+        $sql = "SELECT DAY(FROM_UNIXTIME(art_time - $timeoffset)) AS day, COUNT(DISTINCT a.art_id) AS count
156
+            FROM ".planet_DB_prefix('article')."
157 157
             WHERE YEAR(FROM_UNIXTIME(art_time - $timeoffset)) = $year
158 158
             AND MONTH(FROM_UNIXTIME(art_time - $timeoffset)) = $month
159
-            " . $blog_criteria . '
159
+            ".$blog_criteria.'
160 160
             GROUP BY day
161 161
             ';
162 162
         $result = $xoopsDB->query($sql);
@@ -164,35 +164,35 @@  discard block
 block discarded – undo
164 164
         while ($myrow = $xoopsDB->fetchArray($result)) {
165 165
             $days[$myrow['day']]['count'] = $myrow['count'];
166 166
         }
167
-        for ($i = 1; $i <= 31; ++$i) {
167
+        for ($i = 1; $i<=31; ++$i) {
168 168
             if (!isset($days[$i])) {
169 169
                 continue;
170 170
             }
171 171
             $days[$i] = [
172 172
                 'title' => $days[$i]['count'],
173
-                'url'   => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . '' . $year . '/' . $month . '/' . $i . '/b' . $blog_id
173
+                'url'   => XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.archive.php'.URL_DELIMITER.''.$year.'/'.$month.'/'.$i.'/b'.$blog_id
174 174
             ];
175 175
         }
176 176
         $calendar   = planet_getCalendar($year, $month, $days);
177
-        $month_next = $month + 1;
178
-        $month_prev = $month - 1;
177
+        $month_next = $month+1;
178
+        $month_prev = $month-1;
179 179
         $_year      = $year;
180 180
         if (12 == $month) {
181 181
             $month_next = 1;
182
-            $_year      = $year + 1;
182
+            $_year      = $year+1;
183 183
         }
184 184
         if (1 == $month) {
185 185
             $month_pre = 12;
186
-            $_year     = $year - 1;
186
+            $_year     = $year-1;
187 187
         }
188 188
         $timenav['prev'] = [
189
-            'url'   => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . '' . $_year . '/' . $month_prev . '/b' . $blog_id,
190
-            'title' => planet_constant('MD_MONTH_' . $month_prev)
189
+            'url'   => XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.archive.php'.URL_DELIMITER.''.$_year.'/'.$month_prev.'/b'.$blog_id,
190
+            'title' => planet_constant('MD_MONTH_'.$month_prev)
191 191
         ];
192
-        if ($year < date('Y') || $month < date('n')) {
192
+        if ($year<date('Y') || $month<date('n')) {
193 193
             $timenav['next'] = [
194
-                'url'   => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . '' . $_year . '/' . $month_next . '/b' . $blog_id,
195
-                'title' => planet_constant('MD_MONTH_' . $month_next)
194
+                'url'   => XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.archive.php'.URL_DELIMITER.''.$_year.'/'.$month_next.'/b'.$blog_id,
195
+                'title' => planet_constant('MD_MONTH_'.$month_next)
196 196
             ];
197 197
         }
198 198
     }
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 $xoopsTpl->assign('timenav', $timenav);
213 213
 $xoopsTpl->assign('pagenav', $pagenav);
214 214
 
215
-require_once __DIR__ . '/footer.php';
215
+require_once __DIR__.'/footer.php';
216 216
 
217 217
 /**
218 218
  * @param null $year
@@ -229,24 +229,24 @@  discard block
 block discarded – undo
229 229
     ob_start();
230 230
     echo '<table id="calendar">';
231 231
     echo '<caption>';
232
-    printf(planet_constant('MD_TIME_YM'), $year, planet_constant('MD_MONTH_' . $month));
232
+    printf(planet_constant('MD_TIME_YM'), $year, planet_constant('MD_MONTH_'.$month));
233 233
     echo '</caption>';
234 234
 
235
-    for ($i = 1; $i <= 7; ++$i) {
236
-        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>';
235
+    for ($i = 1; $i<=7; ++$i) {
236
+        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>';
237 237
     }
238 238
 
239 239
     echo '<tr>';
240 240
 
241 241
     // See how much we should pad in the beginning
242 242
     $week_begins = 1;
243
-    $pad         = planet_calendar_week_mod(date('w', $unixmonth) - $week_begins);
243
+    $pad         = planet_calendar_week_mod(date('w', $unixmonth)-$week_begins);
244 244
     if (0 != $pad) {
245
-        echo "\n\t\t" . '<td colspan="' . $pad . '">&nbsp;</td>';
245
+        echo "\n\t\t".'<td colspan="'.$pad.'">&nbsp;</td>';
246 246
     }
247 247
 
248
-    $daysinmonth = (int)date('t', $unixmonth);
249
-    for ($day = 1; $day <= $daysinmonth; ++$day) {
248
+    $daysinmonth = (int) date('t', $unixmonth);
249
+    for ($day = 1; $day<=$daysinmonth; ++$day) {
250 250
         if (isset($newrow) && $newrow) {
251 251
             echo "\n\t</tr>\n\t<tr>\n\t\t";
252 252
         }
@@ -255,26 +255,26 @@  discard block
 block discarded – undo
255 255
         echo '<td>';
256 256
 
257 257
         if (!empty($days[$day]['url'])) {
258
-            echo '<a href="' . $days[$day]['url'] . "\"";
258
+            echo '<a href="'.$days[$day]['url']."\"";
259 259
             if (!empty($days[$day]['title'])) {
260
-                echo "title=\"" . $days[$day]['title'] . "\"";
260
+                echo "title=\"".$days[$day]['title']."\"";
261 261
             }
262 262
             echo ">$day</a>";
263 263
         } elseif (!empty($days[$day]['title'])) {
264
-            echo "<acronym title=\"" . $days[$day]['title'] . "\">$day</acronym>";
265
-        } else {
264
+            echo "<acronym title=\"".$days[$day]['title']."\">$day</acronym>";
265
+        }else {
266 266
             echo $day;
267 267
         }
268 268
         echo '</td>';
269 269
 
270
-        if (6 == planet_calendar_week_mod(date('w', mktime(0, 0, 0, $month, $day, $year)) - $week_begins)) {
270
+        if (6 == planet_calendar_week_mod(date('w', mktime(0, 0, 0, $month, $day, $year))-$week_begins)) {
271 271
             $newrow = true;
272 272
         }
273 273
     }
274 274
 
275
-    $pad = 7 - planet_calendar_week_mod(date('w', mktime(0, 0, 0, $month, $day, $year)) - $week_begins);
275
+    $pad = 7-planet_calendar_week_mod(date('w', mktime(0, 0, 0, $month, $day, $year))-$week_begins);
276 276
     if (0 != $pad && 7 != $pad) {
277
-        echo "\n\t\t" . '<td class="pad" colspan="' . $pad . '">&nbsp;</td>';
277
+        echo "\n\t\t".'<td class="pad" colspan="'.$pad.'">&nbsp;</td>';
278 278
     }
279 279
 
280 280
     echo "\n\t</tr>\n\t</tbody>\n\t</table>";
@@ -293,5 +293,5 @@  discard block
 block discarded – undo
293 293
 {
294 294
     $base = 7;
295 295
 
296
-    return ($num - $base * floor($num / $base));
296
+    return ($num-$base*floor($num/$base));
297 297
 }
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
@@ -26,11 +26,11 @@  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
-$op      = Request::getString('op', Request::getString('op', '', 'POST'), 'GET');//!empty($_POST['op']) ? $_POST['op'] : (!empty($_GET['op']) ? $_GET['op'] : '');
32
-$blog_id = Request::getArray('blog', Request::getArray('blog', [], 'POST'), 'GET');//!empty($_POST['blog']) ? $_POST['blog'] : (!empty($_GET['blog']) ? $_GET['blog'] : 0);
33
-$blog_id = is_array($blog_id) ? array_map('intval', $blog_id) : (int)$blog_id;
31
+$op      = Request::getString('op', Request::getString('op', '', 'POST'), 'GET'); //!empty($_POST['op']) ? $_POST['op'] : (!empty($_GET['op']) ? $_GET['op'] : '');
32
+$blog_id = Request::getArray('blog', Request::getArray('blog', [], 'POST'), 'GET'); //!empty($_POST['blog']) ? $_POST['blog'] : (!empty($_GET['blog']) ? $_GET['blog'] : 0);
33
+$blog_id = is_array($blog_id) ? array_map('intval', $blog_id) : (int) $blog_id;
34 34
 
35 35
 if (empty($xoopsModuleConfig['newblog_submit']) && (!is_object($xoopsUser) || !$xoopsUser->isAdmin())) {
36 36
     redirect_header('index.php', 2, _NOPERM);
@@ -41,10 +41,10 @@  discard block
 block discarded – undo
41 41
 }
42 42
 
43 43
 if ('save' === $op && !$GLOBALS['xoopsSecurity']->check()) {
44
-    redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_INVALID') . ': security check failed');
44
+    redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_INVALID').': security check failed');
45 45
 }
46
-include XOOPS_ROOT_PATH . '/header.php';
47
-include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php';
46
+include XOOPS_ROOT_PATH.'/header.php';
47
+include XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/vars.php';
48 48
 
49 49
 $blogHandler     = xoops_getModuleHandler('blog', $GLOBALS['moddirname']);
50 50
 $categoryHandler = xoops_getModuleHandler('category', $GLOBALS['moddirname']);
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
         if ($blog_id) {
57 57
             $blog_obj = $blogHandler->get($blog_id);
58 58
             if ($xoopsUser->isAdmin()) {
59
-                $blog_obj->setVar('blog_status', Request::getInt('blog_status', 0, 'POST'));// @$_POST['blog_status']);
59
+                $blog_obj->setVar('blog_status', Request::getInt('blog_status', 0, 'POST')); // @$_POST['blog_status']);
60 60
             }
61
-        } else {
61
+        }else {
62 62
             if ($blog_exists = $blogHandler->getCount(new Criteria('blog_feed', $myts->addSlashes(trim(Request::getText('blog_feed', '', 'POST')))))  //$_POST['blog_feed']))))
63 63
             ) {
64 64
                 redirect_header('index.php', 2, planet_constant('MD_BLOGEXISTS'));
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
                 case 2:
72 72
                     if (!is_object($xoopsUser)) {
73 73
                         $status = 0;
74
-                    } else {
74
+                    }else {
75 75
                         $status = 1;
76 76
                     }
77 77
                     break;
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
                 default:
84 84
                     if (!is_object($xoopsUser) || !$xoopsUser->isAdmin()) {
85 85
                         $status = 0;
86
-                    } else {
86
+                    }else {
87 87
                         $status = 1;
88 88
                     }
89 89
                     break;
@@ -92,14 +92,14 @@  discard block
 block discarded – undo
92 92
             $blog_obj->setVar('blog_status', $status);
93 93
         }
94 94
 
95
-        $blog_obj->setVar('blog_title', Request::getString('blog_title', '', 'POST'));//$_POST['blog_title']);
96
-        $blog_obj->setVar('blog_desc', Request::getString('blog_desc', '', 'POST'));//$_POST['blog_desc']);
97
-        $blog_obj->setVar('blog_image', Request::getString('blog_image', '', 'POST'));//$_POST['blog_image']);
98
-        $blog_obj->setVar('blog_feed', Request::getText('blog_feed', '', 'POST'));//$_POST['blog_feed']);
99
-        $blog_obj->setVar('blog_link', Request::getString('blog_link', '', 'POST'));//$_POST['blog_link']);
100
-        $blog_obj->setVar('blog_language', Request::getString('blog_language', '', 'POST'));//$_POST['blog_language']);
101
-        $blog_obj->setVar('blog_charset', Request::getString('blog_charset', '', 'POST'));//$_POST['blog_charset']);
102
-        $blog_obj->setVar('blog_trackback', Request::getString('blog_trackback', '', 'POST'));//$_POST['blog_trackback']);
95
+        $blog_obj->setVar('blog_title', Request::getString('blog_title', '', 'POST')); //$_POST['blog_title']);
96
+        $blog_obj->setVar('blog_desc', Request::getString('blog_desc', '', 'POST')); //$_POST['blog_desc']);
97
+        $blog_obj->setVar('blog_image', Request::getString('blog_image', '', 'POST')); //$_POST['blog_image']);
98
+        $blog_obj->setVar('blog_feed', Request::getText('blog_feed', '', 'POST')); //$_POST['blog_feed']);
99
+        $blog_obj->setVar('blog_link', Request::getString('blog_link', '', 'POST')); //$_POST['blog_link']);
100
+        $blog_obj->setVar('blog_language', Request::getString('blog_language', '', 'POST')); //$_POST['blog_language']);
101
+        $blog_obj->setVar('blog_charset', Request::getString('blog_charset', '', 'POST')); //$_POST['blog_charset']);
102
+        $blog_obj->setVar('blog_trackback', Request::getString('blog_trackback', '', 'POST')); //$_POST['blog_trackback']);
103 103
         if ($blog_obj->isNew()) {
104 104
             $blog_obj->setVar('blog_submitter', is_object($xoopsUser) ? $xoopsUser->getVar('uid') : PlanetUtility::planetGetIP(true));
105 105
         }
@@ -110,10 +110,10 @@  discard block
 block discarded – undo
110 110
             if (in_array(0, $_POST['categories'])) {
111 111
                 $_POST['categories'] = [];
112 112
             }
113
-            $blogHandler->setCategories($blog_id, Request::getString('andor', '', 'POST'));//$_POST['categories']);
113
+            $blogHandler->setCategories($blog_id, Request::getString('andor', '', 'POST')); //$_POST['categories']);
114 114
         }
115 115
         $message = planet_constant('MD_DBUPDATED');
116
-        redirect_header('index.php' . URL_DELIMITER . 'b' . $blog_id, 2, $message);
116
+        redirect_header('index.php'.URL_DELIMITER.'b'.$blog_id, 2, $message);
117 117
 
118 118
     /* edit a single blog */
119 119
     // no break
@@ -122,14 +122,14 @@  discard block
 block discarded – undo
122 122
         if (!empty(Request::getString('fetch', '', 'POST'))) {
123 123
             $blog_obj = $blogHandler->fetch(Request::getText('blog_feed', '', 'POST'));
124 124
             $blog_obj->setVar('blog_id', $blog_id);
125
-        } else {
125
+        }else {
126 126
             $blog_obj = $blogHandler->get($blog_id);
127 127
         }
128
-        $categories = Request::getArray('categories', [], 'POST');//isset($_POST['categories']) ? $_POST['categories'] : array();
128
+        $categories = Request::getArray('categories', [], 'POST'); //isset($_POST['categories']) ? $_POST['categories'] : array();
129 129
         if (in_array('-1', $categories)) {
130 130
             $categories = [];
131 131
         }
132
-        if (empty($categories) && $blog_id > 0) {
132
+        if (empty($categories) && $blog_id>0) {
133 133
             $crit       = new Criteria('bc.blog_id', $blog_id);
134 134
             $categories = array_keys($categoryHandler->getByBlog($crit));
135 135
         }
@@ -137,23 +137,23 @@  discard block
 block discarded – undo
137 137
             $categories = [0 => _NONE];
138 138
         }
139 139
 
140
-        echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _EDIT . '</legend>';
140
+        echo "<fieldset><legend style='font-weight: bold; color: #900;'>"._EDIT.'</legend>';
141 141
         echo '<br>';
142 142
         if (empty($blog_id) && $blog_obj->getVar('blog_feed')) {
143 143
             $criteria  = new Criteria('blog_feed', $blog_obj->getVar('blog_feed'));
144 144
             $blogs_obj = $blogHandler->getList($criteria);
145
-            if (count($blogs_obj) > 0) {
146
-                echo "<div class=\"errorMsg\">" . planet_constant('MD_BLOGEXISTS');
145
+            if (count($blogs_obj)>0) {
146
+                echo "<div class=\"errorMsg\">".planet_constant('MD_BLOGEXISTS');
147 147
                 foreach (array_keys($blogs_obj) as $bid) {
148
-                    echo "<br><a href=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'b' . $bid . "\" target=\"_blank\">" . $blogs_obj[$bid] . '</a>';
148
+                    echo "<br><a href=\"".XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php'.URL_DELIMITER.'b'.$bid."\" target=\"_blank\">".$blogs_obj[$bid].'</a>';
149 149
                 }
150 150
                 echo '</div>';
151 151
                 unset($blogs_obj, $criteria);
152 152
             }
153 153
         }
154
-        include XOOPS_ROOT_PATH . '/modules/' . $GLOBALS['moddirname'] . '/include/form.blog.php';
154
+        include XOOPS_ROOT_PATH.'/modules/'.$GLOBALS['moddirname'].'/include/form.blog.php';
155 155
         echo '</fieldset>';
156 156
         break;
157 157
 }
158 158
 
159
-include XOOPS_ROOT_PATH . '/footer.php';
159
+include XOOPS_ROOT_PATH.'/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
@@ -26,21 +26,21 @@  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
 // trackback is done by a POST
32 32
 $art_id     = explode('/', Request::getString('REQUEST_URI', '', 'SERVER'));
33
-$article_id = (int)$art_id[count($art_id) - 1];
34
-$url        = Request::getString('url', '', 'POST');//$_POST['url'];
35
-$title      = Request::getString('title', '', 'POST');//$_POST['title'];
36
-$excerpt    = Request::getString('excerpt', '', 'POST');//$_POST['excerpt'];
37
-$blog_name  = Request::getString('blog_name', '', 'POST');//$_POST['blog_name'];
38
-$charset    = trim(Request::getString('charset', '', 'POST'));//trim($_POST['charset']);
33
+$article_id = (int) $art_id[count($art_id)-1];
34
+$url        = Request::getString('url', '', 'POST'); //$_POST['url'];
35
+$title      = Request::getString('title', '', 'POST'); //$_POST['title'];
36
+$excerpt    = Request::getString('excerpt', '', 'POST'); //$_POST['excerpt'];
37
+$blog_name  = Request::getString('blog_name', '', 'POST'); //$_POST['blog_name'];
38
+$charset    = trim(Request::getString('charset', '', 'POST')); //trim($_POST['charset']);
39 39
 
40 40
 if (empty($xoopsModuleConfig['trackback_option'])) {
41 41
     PlanetUtility::planetRespondToTrackback(1, 'Trackback is closed');
42 42
 }
43
-if (!strlen($title . $url . $blog_name)) {
43
+if (!strlen($title.$url.$blog_name)) {
44 44
     PlanetUtility::planetRespondToTrackback(1, planet_constant('MD_INVALID'));
45 45
 }
46 46
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
     $trackbackHandler = xoops_getModuleHandler('trackback', $GLOBALS['moddirname']);
49 49
     $criteria         = new CriteriaCompo(new Criteria('art_id', $article_id));
50 50
     $criteria->add(new Criteria('tb_url', $url));
51
-    if ($trackbackHandler->getCount($criteria) > 0) {
51
+    if ($trackbackHandler->getCount($criteria)>0) {
52 52
         PlanetUtility::planetRespondToTrackback(1, 'We already have a ping from that URI for this article.');
53 53
     }
54 54
 
@@ -56,17 +56,17 @@  discard block
 block discarded – undo
56 56
     $title     = XoopsLocal::convert_encoding($title, _CHARSET, $charset);
57 57
     $excerpt   = XoopsLocal::convert_encoding($excerpt, _CHARSET, $charset);
58 58
     $blog_name = XoopsLocal::convert_encoding($blog_name, _CHARSET, $charset);
59
-    $tb_status = (int)$xoopsModuleConfig['trackback_option'];
59
+    $tb_status = (int) $xoopsModuleConfig['trackback_option'];
60 60
 
61 61
     $com_pid    = 0;
62 62
     $com_itemid = $article_id;
63 63
     $com_rootid = 0;
64 64
     $com_title  = $title;
65 65
     $com_text   = $excerpt;
66
-    $com_text   .= "\n\n[TRACKBACK]" . _POSTEDBY . ': ';
66
+    $com_text .= "\n\n[TRACKBACK]"._POSTEDBY.': ';
67 67
     if (!empty($url)) {
68
-        $com_text .= '[url=' . $url . ']' . $blog_name . '[/url]';
69
-    } else {
68
+        $com_text .= '[url='.$url.']'.$blog_name.'[/url]';
69
+    }else {
70 70
         $com_text .= $blog_name;
71 71
     }
72 72
     $com_modid = $xoopsModule->getVar('mid');
@@ -122,13 +122,13 @@  discard block
 block discarded – undo
122 122
                 if (isset($comment_config['callbackFile'])) {
123 123
                     $callbackfile = trim($comment_config['callbackFile']);
124 124
                     if ('' != $callbackfile
125
-                        && file_exists(XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile)) {
126
-                        require_once XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile;
125
+                        && file_exists(XOOPS_ROOT_PATH.'/modules/'.$moddir.'/'.$callbackfile)) {
126
+                        require_once XOOPS_ROOT_PATH.'/modules/'.$moddir.'/'.$callbackfile;
127 127
                     }
128 128
                     if (!function_exists($comment_config['callback']['approve'])) {
129 129
                         $skip = true;
130 130
                     }
131
-                } else {
131
+                }else {
132 132
                     $skip = true;
133 133
                 }
134 134
             }
@@ -145,13 +145,13 @@  discard block
 block discarded – undo
145 145
                 if (isset($comment_config['callbackFile'])) {
146 146
                     $callbackfile = trim($comment_config['callbackFile']);
147 147
                     if ('' != $callbackfile
148
-                        && file_exists(XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile)) {
149
-                        require_once XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile;
148
+                        && file_exists(XOOPS_ROOT_PATH.'/modules/'.$moddir.'/'.$callbackfile)) {
149
+                        require_once XOOPS_ROOT_PATH.'/modules/'.$moddir.'/'.$callbackfile;
150 150
                     }
151 151
                     if (!function_exists($comment_config['callback']['update'])) {
152 152
                         $skip = true;
153 153
                     }
154
-                } else {
154
+                }else {
155 155
                     $skip = true;
156 156
                 }
157 157
             }
@@ -181,16 +181,16 @@  discard block
 block discarded – undo
181 181
             $not_module   = $xoopsModule;
182 182
             if (!isset($comment_url)) {
183 183
                 $com_config  = $not_module->getInfo('comments');
184
-                $comment_url = $com_config['pageName'] . '?';
184
+                $comment_url = $com_config['pageName'].'?';
185 185
                 $comment_url .= $com_config['itemName'];
186 186
             }
187
-            $comment_tags['X_COMMENT_URL'] = XOOPS_URL . '/modules/' . $not_module->getVar('dirname') . '/' . $comment_url . '=' . $com_itemid . '&amp;com_id=' . $newcid . '&amp;com_rootid=' . $com_rootid . '&amp;com_mode=' . $com_mode . '&amp;com_order=' . $com_order . '#comment' . $newcid;
187
+            $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;
188 188
             $notificationHandler           = xoops_getHandler('notification');
189 189
             $notificationHandler->triggerEvent($not_category, $not_itemid, $not_event, $comment_tags, false, $not_modid);
190 190
         }
191 191
 
192 192
         PlanetUtility::planetRespondToTrackback(0);
193
-    } else {
193
+    }else {
194 194
         PlanetUtility::planetRespondToTrackback(1, xoops_error($comment->getHtmlErrors()));
195 195
     }
196 196
 }
Please login to merge, or discard this patch.
view.blogs.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -26,10 +26,10 @@  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
 if (preg_match("/\/notification_update\.php/i", Request::getUrl('REQUEST_URI', '', 'SERVER'), $matches)) {
32
-    include XOOPS_ROOT_PATH . '/include/notification_update.php';
32
+    include XOOPS_ROOT_PATH.'/include/notification_update.php';
33 33
     exit();
34 34
 }
35 35
 
@@ -66,10 +66,10 @@  discard block
 block discarded – undo
66 66
 }
67 67
 */
68 68
 
69
-$xoopsOption['xoops_pagetitle'] = $xoopsModule->getVar('name') . ' - ' . planet_constant('MD_BLOGS');
69
+$xoopsOption['xoops_pagetitle'] = $xoopsModule->getVar('name').' - '.planet_constant('MD_BLOGS');
70 70
 $xoopsOption['template_main']   = PlanetUtility::planetGetTemplate('blogs');
71
-require_once XOOPS_ROOT_PATH . '/header.php';
72
-include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php';
71
+require_once XOOPS_ROOT_PATH.'/header.php';
72
+include XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/vars.php';
73 73
 
74 74
 // Following part will not be executed after cache
75 75
 $categoryHandler = xoops_getModuleHandler('category', $GLOBALS['moddirname']);
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 $criteria    = new CriteriaCompo();
82 82
 $blog_prefix = '';
83 83
 /* Specific category */
84
-if ($category_id > 0) {
84
+if ($category_id>0) {
85 85
     $category_obj = $categoryHandler->get($category_id);
86 86
     $criteria->add(new Criteria('bc.cat_id', $category_id));
87 87
     $uid           = 0;
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 }
93 93
 
94 94
 /* User bookmarks(favorites) */
95
-if ($uid > 0) {
95
+if ($uid>0) {
96 96
     $criteria->add(new Criteria('bm.bm_uid', $uid));
97 97
     $category_id     = 0;
98 98
     $blog_id         = 0;
@@ -106,25 +106,25 @@  discard block
 block discarded – undo
106 106
     $blog_prefix     = 'b.';
107 107
 }
108 108
 
109
-$criteria->add(new Criteria($blog_prefix . 'blog_status', 0, '>'));
109
+$criteria->add(new Criteria($blog_prefix.'blog_status', 0, '>'));
110 110
 
111 111
 /* Sort */
112 112
 $order = 'DESC';
113 113
 $sort  = empty($sort) ? 'default' : $sort;
114 114
 switch ($sort) {
115 115
     case 'marks':
116
-        $sortby = $blog_prefix . 'blog_marks';
116
+        $sortby = $blog_prefix.'blog_marks';
117 117
         break;
118 118
     case 'rating':
119
-        $sortby = $blog_prefix . 'blog_rating';
119
+        $sortby = $blog_prefix.'blog_rating';
120 120
         break;
121 121
     case 'time':
122
-        $sortby = $blog_prefix . 'blog_time';
122
+        $sortby = $blog_prefix.'blog_time';
123 123
         break;
124 124
     case 'default':
125 125
     default:
126 126
         $sort   = 'default';
127
-        $sortby = $blog_prefix . 'blog_id';
127
+        $sortby = $blog_prefix.'blog_id';
128 128
         break;
129 129
 }
130 130
 $criteria->setSort($sortby);
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 $criteria->setStart($start);
133 133
 $criteria->setLimit($limit);
134 134
 
135
-$tags = empty($list) ? '' : [$blog_prefix . 'blog_title', $blog_prefix . 'blog_time'];
135
+$tags = empty($list) ? '' : [$blog_prefix.'blog_title', $blog_prefix.'blog_time'];
136 136
 switch ($query_type) {
137 137
     case 'category':
138 138
         $blogs_obj  = $blogHandler->getByCategory($criteria, $tags);
@@ -172,31 +172,31 @@  discard block
 block discarded – undo
172 172
 }
173 173
 unset($blogs_obj);
174 174
 
175
-if ($count_blog > $limit) {
176
-    include XOOPS_ROOT_PATH . '/class/pagenav.php';
175
+if ($count_blog>$limit) {
176
+    include XOOPS_ROOT_PATH.'/class/pagenav.php';
177 177
     $start_link = [];
178 178
     if ($sort) {
179
-        $start_link[] = 'sort=' . $sort;
179
+        $start_link[] = 'sort='.$sort;
180 180
     }
181 181
     if ($category_id) {
182
-        $start_link[] = 'category=' . $category_id;
182
+        $start_link[] = 'category='.$category_id;
183 183
     }
184 184
     if ($list) {
185
-        $start_link[] = 'list=' . $list;
185
+        $start_link[] = 'list='.$list;
186 186
     }
187 187
     $nav     = new XoopsPageNav($count_blog, $limit, $start, 'start', implode('&amp;', $start_link));
188 188
     $pagenav = $nav->renderNav(4);
189
-} else {
189
+}else {
190 190
     $pagenav = '';
191 191
 }
192 192
 
193 193
 $xoopsTpl->assign('xoops_pagetitle', $xoopsOption['xoops_pagetitle']);
194
-$xoopsTpl->assign('link_home', "<a href=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . "/index.php\" title=\"" . planet_constant('MD_HOME') . "\" target=\"_self\">" . planet_constant('MD_HOME') . '</a>');
194
+$xoopsTpl->assign('link_home', "<a href=\"".XOOPS_URL.'/modules/'.$GLOBALS['moddirname']."/index.php\" title=\"".planet_constant('MD_HOME')."\" target=\"_self\">".planet_constant('MD_HOME').'</a>');
195 195
 
196 196
 if ($category_id || $uid) {
197
-    $xoopsTpl->assign('link_index', "<a href=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . "/view.blogs.php\" title=\"" . planet_constant('MD_INDEX') . "\" target=\"_self\">" . planet_constant('MD_INDEX') . '</a>');
197
+    $xoopsTpl->assign('link_index', "<a href=\"".XOOPS_URL.'/modules/'.$GLOBALS['moddirname']."/view.blogs.php\" title=\"".planet_constant('MD_INDEX')."\" target=\"_self\">".planet_constant('MD_INDEX').'</a>');
198 198
 
199
-    $link_articles = "<a href=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . (empty($category_id) ? '' : '/c' . $category_id) . (empty($uid) ? '' : '/u' . $uid) . "\" title=\"" . planet_constant('MD_ARTICLES') . "\">" . planet_constant('MD_ARTICLES') . '</a>';
199
+    $link_articles = "<a href=\"".XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php'.(empty($category_id) ? '' : '/c'.$category_id).(empty($uid) ? '' : '/u'.$uid)."\" title=\"".planet_constant('MD_ARTICLES')."\">".planet_constant('MD_ARTICLES').'</a>';
200 200
     $xoopsTpl->assign('link_articles', $link_articles);
201 201
 }
202 202
 
@@ -205,8 +205,8 @@  discard block
 block discarded – undo
205 205
                . '/modules/'
206 206
                . $GLOBALS['moddirname']
207 207
                . '/view.blogs.php'
208
-               . (empty($category_id) ? '' : '/c' . $category_id)
209
-               . (empty($uid) ? '' : '/u' . $uid)
208
+               . (empty($category_id) ? '' : '/c'.$category_id)
209
+               . (empty($uid) ? '' : '/u'.$uid)
210 210
                . (empty($list) ? '/l1' : '')
211 211
                . "\" title=\""
212 212
                . (empty($list) ? planet_constant('MD_LISTVIEW') : planet_constant('MD_FULLVIEW'))
@@ -216,14 +216,14 @@  discard block
 block discarded – undo
216 216
 $xoopsTpl->assign('link_switch', $link_switch);
217 217
 
218 218
 if (empty($uid) && is_object($xoopsUser)) {
219
-    $xoopsTpl->assign('link_bookmark', "<a href=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.blogs.php' . URL_DELIMITER . 'u' . $xoopsUser->getVar('uid') . "\" title=\"" . planet_constant('MD_BOOKMARKS') . "\" target=\"_self\">" . planet_constant('MD_BOOKMARKS') . '</a>');
219
+    $xoopsTpl->assign('link_bookmark', "<a href=\"".XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.blogs.php'.URL_DELIMITER.'u'.$xoopsUser->getVar('uid')."\" title=\"".planet_constant('MD_BOOKMARKS')."\" target=\"_self\">".planet_constant('MD_BOOKMARKS').'</a>');
220 220
 }
221 221
 
222 222
 if (1 == $xoopsModuleConfig['newblog_submit'] || is_object($xoopsUser)) {
223
-    $xoopsTpl->assign('link_submit', "<a href=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . "/action.blog.php\" title=\"" . _SUBMIT . "\" target=\"_blank\">" . _SUBMIT . '</a>');
223
+    $xoopsTpl->assign('link_submit', "<a href=\"".XOOPS_URL.'/modules/'.$GLOBALS['moddirname']."/action.blog.php\" title=\""._SUBMIT."\" target=\"_blank\">"._SUBMIT.'</a>');
224 224
 }
225 225
 
226
-$xoopsTpl->assign('pagetitle', $xoopsModule->getVar('name') . '::' . planet_constant('MD_BLOGS'));
226
+$xoopsTpl->assign('pagetitle', $xoopsModule->getVar('name').'::'.planet_constant('MD_BLOGS'));
227 227
 $xoopsTpl->assign('category', @$category_data);
228 228
 $xoopsTpl->assign('user', @$user_data);
229 229
 $xoopsTpl->assign('blogs', $blogs);
@@ -237,19 +237,19 @@  discard block
 block discarded – undo
237 237
     $xoopsTpl->assign('canrate', 1);
238 238
 }
239 239
 
240
-$sort_link = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.blogs.php' . URL_DELIMITER;
240
+$sort_link = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.blogs.php'.URL_DELIMITER;
241 241
 $vars      = [];
242 242
 if (!empty($category_id)) {
243
-    $vars[] = 'c' . $category_id;
243
+    $vars[] = 'c'.$category_id;
244 244
 }
245 245
 if (!empty($uid)) {
246
-    $vars[] = 'u' . $uid;
246
+    $vars[] = 'u'.$uid;
247 247
 }
248 248
 if (!empty($list)) {
249 249
     $vars[] = 'li';
250 250
 }
251 251
 if (!empty($vars)) {
252
-    $sort_link .= implode('/', $vars) . '/';
252
+    $sort_link .= implode('/', $vars).'/';
253 253
 }
254 254
 $sortlinks   = [];
255 255
 $valid_sorts = [
@@ -262,8 +262,8 @@  discard block
 block discarded – undo
262 262
     if ($val == $sort) {
263 263
         continue;
264 264
     }
265
-    $sortlinks[] = "<a href=\"" . $sort_link . $val . "\">" . $name . '</a>';
265
+    $sortlinks[] = "<a href=\"".$sort_link.$val."\">".$name.'</a>';
266 266
 }
267 267
 $xoopsTpl->assign('link_sort', implode(' | ', $sortlinks));
268 268
 
269
-require_once __DIR__ . '/footer.php';
269
+require_once __DIR__.'/footer.php';
Please login to merge, or discard this patch.
index.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -24,10 +24,10 @@  discard block
 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
 
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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('&amp;', $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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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 (1 == $xoopsModuleConfig['newblog_submit'] || 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
 block discarded – undo
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
 block discarded – undo
318 318
     $_GET['blog'] = $blog_id;
319 319
 }
320 320
 
321
-require_once __DIR__ . '/footer.php';
321
+require_once __DIR__.'/footer.php';
Please login to merge, or discard this patch.
search.php 1 patch
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -27,35 +27,35 @@  discard block
 block discarded – undo
27 27
 use Xmf\Request;
28 28
 
29 29
 $xoopsOption['pagetype'] = 'search';
30
-include __DIR__ . '/header.php';
30
+include __DIR__.'/header.php';
31 31
 $xoopsModule->loadLanguage('main');
32 32
 $configHandler     = xoops_getHandler('config');
33 33
 $xoopsConfigSearch = $configHandler->getConfigsByCat(XOOPS_CONF_SEARCH);
34 34
 if (empty($xoopsConfigSearch['enable_search'])) {
35
-    redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php', 2, planet_constant('MD_NOACCESS'));
35
+    redirect_header(XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php', 2, planet_constant('MD_NOACCESS'));
36 36
 }
37 37
 
38 38
 $xoopsConfig['module_cache'][$xoopsModule->getVar('mid')] = 0;
39 39
 $xoopsOption['template_main']                             = PlanetUtility::planetGetTemplate('search');
40
-include XOOPS_ROOT_PATH . '/header.php';
41
-include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php';
40
+include XOOPS_ROOT_PATH.'/header.php';
41
+include XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/vars.php';
42 42
 
43
-require_once XOOPS_ROOT_PATH . '/modules/' . $GLOBALS['moddirname'] . '/include/search.inc.php';
43
+require_once XOOPS_ROOT_PATH.'/modules/'.$GLOBALS['moddirname'].'/include/search.inc.php';
44 44
 $limit = $xoopsModuleConfig['articles_perpage'];
45 45
 
46 46
 $queries  = [];
47
-$andor    = Request::getString('andor', Request::getString('andor', '', 'GET'), 'POST');//isset($_POST['andor']) ? $_POST['andor'] : (isset($_GET['andor']) ? $_GET['andor'] : '');
48
-$start    = Request::getInt('start', 0, 'GET');//isset($_GET['start']) ? $_GET['start'] : 0;
47
+$andor    = Request::getString('andor', Request::getString('andor', '', 'GET'), 'POST'); //isset($_POST['andor']) ? $_POST['andor'] : (isset($_GET['andor']) ? $_GET['andor'] : '');
48
+$start    = Request::getInt('start', 0, 'GET'); //isset($_GET['start']) ? $_GET['start'] : 0;
49 49
 $category = Request::getInt('category', Request::getInt('category', 0, 'GET'), 'POST'); //(int)(isset($_POST['category']) ? $_POST['category'] : (isset($_GET['category']) ? $_GET['category'] : null));
50
-$blog     = Request::getInt('blog', Request::getInt('blog', 0, 'GET'), 'POST');//(int)(isset($_POST['blog']) ? $_POST['blog'] : (isset($_GET['blog']) ? $_GET['blog'] : null));
51
-$uid      = Request::getInt('uid', Request::getInt('uid', 0, 'GET'), 'POST');//(int)(isset($_POST['uid']) ? $_POST['uid'] : (isset($_GET['uid']) ? $_GET['uid'] : null));
50
+$blog     = Request::getInt('blog', Request::getInt('blog', 0, 'GET'), 'POST'); //(int)(isset($_POST['blog']) ? $_POST['blog'] : (isset($_GET['blog']) ? $_GET['blog'] : null));
51
+$uid      = Request::getInt('uid', Request::getInt('uid', 0, 'GET'), 'POST'); //(int)(isset($_POST['uid']) ? $_POST['uid'] : (isset($_GET['uid']) ? $_GET['uid'] : null));
52 52
 $searchin = Request::getArray(
53 53
     'searchin',
54 54
     0 !== count(Request::getArray('searchin', [], 'GET')) ? explode('|', Request::getArray('searchin', [], 'GET')) : [],
55 55
                               'POST'
56 56
 ); //isset($_POST['searchin']) ? $_POST['searchin'] : (isset($_GET['searchin']) ? explode('|', $_GET['searchin']) : array());
57
-$sortby   = Request::getString('sortby', Request::getString('sortby', null, 'GET'), 'POST');//isset($_POST['sortby']) ? $_POST['sortby'] : (isset($_GET['sortby']) ? $_GET['sortby'] : null);
58
-$term     = Request::getString('term', Request::getString('term', '', 'GET'), 'POST');//isset($_POST['term']) ? $_POST['term'] : (isset($_GET['term']) ? $_GET['term'] : '');
57
+$sortby   = Request::getString('sortby', Request::getString('sortby', null, 'GET'), 'POST'); //isset($_POST['sortby']) ? $_POST['sortby'] : (isset($_GET['sortby']) ? $_GET['sortby'] : null);
58
+$term     = Request::getString('term', Request::getString('term', '', 'GET'), 'POST'); //isset($_POST['term']) ? $_POST['term'] : (isset($_GET['term']) ? $_GET['term'] : '');
59 59
 
60 60
 $andor  = in_array(strtoupper($andor), ['OR', 'AND', 'EXACT']) ? strtoupper($andor) : 'OR';
61 61
 $sortby = in_array(strtolower($sortby), [
@@ -83,18 +83,18 @@  discard block
 block discarded – undo
83 83
         $temp_queries    = preg_split("/[\s,]+/", $query);
84 84
         foreach ($temp_queries as $q) {
85 85
             $q = trim($q);
86
-            if (strlen($q) >= $xoopsConfigSearch['keyword_min']) {
86
+            if (strlen($q)>=$xoopsConfigSearch['keyword_min']) {
87 87
                 $queries[] = $myts->addSlashes($q);
88
-            } else {
88
+            }else {
89 89
                 $ignored_queries[] = $myts->addSlashes($q);
90 90
             }
91 91
         }
92 92
         if (0 == count($queries)) {
93
-            redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/search.php', 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min']));
93
+            redirect_header(XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/search.php', 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min']));
94 94
         }
95
-    } else {
96
-        if (strlen($query) < $xoopsConfigSearch['keyword_min']) {
97
-            redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/search.php', 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min']));
95
+    }else {
96
+        if (strlen($query)<$xoopsConfigSearch['keyword_min']) {
97
+            redirect_header(XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/search.php', 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch['keyword_min']));
98 98
         }
99 99
         $queries = [$myts->addSlashes($query)];
100 100
     }
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
      */
108 108
     if (!empty($time)) {
109 109
         $extra = '';
110
-    } else {
110
+    }else {
111 111
         $extra = '';
112 112
     }
113 113
 
@@ -121,20 +121,20 @@  discard block
 block discarded – undo
121 121
     {
122 122
         $xoopsTpl->assign('results', $results);
123 123
 
124
-        if (count($next_search) > 0) {
124
+        if (count($next_search)>0) {
125 125
             $items = [];
126 126
             foreach ($next_search as $para => $val) {
127 127
                 if (!empty($val)) {
128 128
                     $items[] = "$para=$val";
129 129
                 }
130 130
             }
131
-            if (count($items) > 0) {
131
+            if (count($items)>0) {
132 132
                 $paras = implode('&', $items);
133 133
             }
134 134
             unset($next_search);
135 135
             unset($items);
136 136
         }
137
-        $search_url = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/search.php?' . $paras;
137
+        $search_url = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/search.php?'.$paras;
138 138
 
139 139
         /*
140 140
          $next_results =& planet_search($queries, $andor, 1, $start + $limit, $uid, $category, $sortby, $searchin, $extra);
@@ -146,22 +146,22 @@  discard block
 block discarded – undo
146 146
       if (false != $has_next)
147 147
       */
148 148
         if (count($results)) {
149
-            $next            = $start + $limit;
149
+            $next            = $start+$limit;
150 150
             $queries         = implode(',', $queries);
151
-            $search_url_next = $search_url . "&start=$next";
152
-            $search_next     = "<a href=\"" . htmlspecialchars($search_url_next) . "\">" . _SR_NEXT . '</a>';
151
+            $search_url_next = $search_url."&start=$next";
152
+            $search_next     = "<a href=\"".htmlspecialchars($search_url_next)."\">"._SR_NEXT.'</a>';
153 153
             $xoopsTpl->assign('search_next', $search_next);
154 154
         }
155
-        if ($start > 0) {
156
-            $prev            = $start - $limit;
157
-            $search_url_prev = $search_url . "&start=$prev";
158
-            $search_prev     = "<a href=\"" . htmlspecialchars($search_url_prev) . "\">" . _SR_PREVIOUS . '</a>';
155
+        if ($start>0) {
156
+            $prev            = $start-$limit;
157
+            $search_url_prev = $search_url."&start=$prev";
158
+            $search_prev     = "<a href=\"".htmlspecialchars($search_url_prev)."\">"._SR_PREVIOUS.'</a>';
159 159
             $xoopsTpl->assign('search_prev', $search_prev);
160 160
         }
161 161
     }
162 162
 
163 163
     unset($results);
164
-    $search_info = _SR_KEYWORDS . ': ' . $myts->htmlSpecialChars($term);
164
+    $search_info = _SR_KEYWORDS.': '.$myts->htmlSpecialChars($term);
165 165
     $xoopsTpl->assign('search_info', $search_info);
166 166
 }
167 167
 
@@ -171,17 +171,17 @@  discard block
 block discarded – undo
171 171
 if ('OR' === $andor) {
172 172
     $type_select .= " selected=\"selected\"";
173 173
 }
174
-$type_select .= '>' . _SR_ANY . '</option>';
174
+$type_select .= '>'._SR_ANY.'</option>';
175 175
 $type_select .= "<option value=\"AND\"";
176 176
 if ('AND' === $andor) {
177 177
     $type_select .= " selected=\"selected\"";
178 178
 }
179
-$type_select .= '>' . _SR_ALL . '</option>';
179
+$type_select .= '>'._SR_ALL.'</option>';
180 180
 $type_select .= "<option value=\"EXACT\"";
181 181
 if ('exact' === $andor) {
182 182
     $type_select .= " selected=\"selected\"";
183 183
 }
184
-$type_select .= '>' . _SR_EXACT . '</option>';
184
+$type_select .= '>'._SR_EXACT.'</option>';
185 185
 $type_select .= '</select>';
186 186
 
187 187
 /* scope */
@@ -190,32 +190,32 @@  discard block
 block discarded – undo
190 190
 if (in_array('title', $searchin)) {
191 191
     $searchin_select .= ' checked';
192 192
 }
193
-$searchin_select .= '>' . planet_constant('MD_TITLE') . '&nbsp;&nbsp;';
193
+$searchin_select .= '>'.planet_constant('MD_TITLE').'&nbsp;&nbsp;';
194 194
 $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"text\"";
195 195
 if (in_array('text', $searchin)) {
196 196
     $searchin_select .= ' checked';
197 197
 }
198
-$searchin_select .= '>' . planet_constant('MD_BODY') . '&nbsp;&nbsp;||&nbsp;&nbsp;';
198
+$searchin_select .= '>'.planet_constant('MD_BODY').'&nbsp;&nbsp;||&nbsp;&nbsp;';
199 199
 $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"blog\"";
200 200
 if (in_array('blog', $searchin)) {
201 201
     $searchin_select .= ' checked';
202 202
 }
203
-$searchin_select .= '>' . planet_constant('MD_BLOG') . '&nbsp;&nbsp;';
203
+$searchin_select .= '>'.planet_constant('MD_BLOG').'&nbsp;&nbsp;';
204 204
 $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"feed\"";
205 205
 if (in_array('feed', $searchin)) {
206 206
     $searchin_select .= ' checked';
207 207
 }
208
-$searchin_select .= '>' . planet_constant('MD_FEED') . '&nbsp;&nbsp;';
208
+$searchin_select .= '>'.planet_constant('MD_FEED').'&nbsp;&nbsp;';
209 209
 $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"desc\"";
210 210
 if (in_array('desc', $searchin)) {
211 211
     $searchin_select .= ' checked';
212 212
 }
213
-$searchin_select .= '>' . planet_constant('MD_DESC') . '&nbsp;&nbsp;';
213
+$searchin_select .= '>'.planet_constant('MD_DESC').'&nbsp;&nbsp;';
214 214
 $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"all\"";
215 215
 if (empty($searchin)) {
216 216
     $searchin_select .= ' checked';
217 217
 }
218
-$searchin_select .= '>' . _ALL . '&nbsp;&nbsp;';
218
+$searchin_select .= '>'._ALL.'&nbsp;&nbsp;';
219 219
 
220 220
 /* sortby */
221 221
 $sortby_select = "<select name=\"sortby\">";
@@ -223,28 +223,28 @@  discard block
 block discarded – undo
223 223
 if (empty($sortby)) {
224 224
     $sortby_select .= " selected=\"selected\"";
225 225
 }
226
-$sortby_select .= '>' . _NONE . '</option>';
226
+$sortby_select .= '>'._NONE.'</option>';
227 227
 $sortby_select .= "<option value=\"a.art_time\"";
228 228
 if ('a.art_time' === $sortby) {
229 229
     $sortby_select .= " selected=\"selected\"";
230 230
 }
231
-$sortby_select .= '>' . planet_constant('MD_TIME') . '</option>';
231
+$sortby_select .= '>'.planet_constant('MD_TIME').'</option>';
232 232
 $sortby_select .= "<option value=\"a.art_title\"";
233 233
 if ('a.art_title' === $sortby) {
234 234
     $sortby_select .= " selected=\"selected\"";
235 235
 }
236
-$sortby_select .= '>' . planet_constant('MD_TITLE') . '</option>';
236
+$sortby_select .= '>'.planet_constant('MD_TITLE').'</option>';
237 237
 $sortby_select .= "<option value=\"\">&nbsp;&nbsp;----&nbsp;&nbsp;</option>";
238 238
 $sortby_select .= "<option value=\"a.blog_title\"";
239 239
 if ('a.blog_title' === $sortby) {
240 240
     $sortby_select .= " selected=\"selected\"";
241 241
 }
242
-$sortby_select .= '>' . planet_constant('MD_BLOG') . '</option>';
242
+$sortby_select .= '>'.planet_constant('MD_BLOG').'</option>';
243 243
 $sortby_select .= "<option value=\"a.blog_time\"";
244 244
 if ('b.blog_time' === $sortby) {
245 245
     $sortby_select .= " selected=\"selected\"";
246 246
 }
247
-$sortby_select .= '>' . planet_constant('MD_UPDATE') . '</option>';
247
+$sortby_select .= '>'.planet_constant('MD_UPDATE').'</option>';
248 248
 $sortby_select .= '</select>';
249 249
 
250 250
 $xoopsTpl->assign('type_select', $type_select);
@@ -258,8 +258,8 @@  discard block
 block discarded – undo
258 258
 $xoopsTpl->assign('blog', $blog);
259 259
 $xoopsTpl->assign('uid', $uid);
260 260
 
261
-if ($xoopsConfigSearch['keyword_min'] > 0) {
261
+if ($xoopsConfigSearch['keyword_min']>0) {
262 262
     $xoopsTpl->assign('search_rule', sprintf(_SR_KEYIGNORE, $xoopsConfigSearch['keyword_min']));
263 263
 }
264 264
 
265
-include XOOPS_ROOT_PATH . '/footer.php';
265
+include XOOPS_ROOT_PATH.'/footer.php';
Please login to merge, or discard this patch.
admin/menu.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 $moduleDirName = basename(dirname(__DIR__));
29 29
 
30 30
 if (false !== ($moduleHelper = Xmf\Module\Helper::getHelper($moduleDirName))) {
31
-} else {
31
+}else {
32 32
     $moduleHelper = Xmf\Module\Helper::getHelper('system');
33 33
 }
34 34
 
@@ -40,31 +40,31 @@  discard block
 block discarded – undo
40 40
 $adminmenu[] = [
41 41
     'title' => _AM_MODULEADMIN_HOME,
42 42
     'link'  => 'admin/index.php',
43
-    'icon'  => $pathIcon32 . '/home.png',
43
+    'icon'  => $pathIcon32.'/home.png',
44 44
 ];
45 45
 
46 46
 $adminmenu[] = [
47 47
     'title' => planet_constant('MI_ADMENU_INDEX'),
48 48
     'link'  => 'admin/main.php',
49
-    'icon'  => $pathIcon32 . '/manage.png',
49
+    'icon'  => $pathIcon32.'/manage.png',
50 50
 ];
51 51
 
52 52
 $adminmenu[] = [
53 53
     'title' => planet_constant('MI_ADMENU_CATEGORY'),
54 54
     'link'  => 'admin/admin.category.php',
55
-    'icon'  => $pathIcon32 . '/category.png',
55
+    'icon'  => $pathIcon32.'/category.png',
56 56
 ];
57 57
 
58 58
 $adminmenu[] = [
59 59
     'title' => planet_constant('MI_ADMENU_BLOG'),
60 60
     'link'  => 'admin/admin.blog.php',
61
-    'icon'  => $pathIcon32 . '/translations.png',
61
+    'icon'  => $pathIcon32.'/translations.png',
62 62
 ];
63 63
 
64 64
 $adminmenu[] = [
65 65
     'title' => planet_constant('MI_ADMENU_ARTICLE'),
66 66
     'link'  => 'admin/admin.article.php',
67
-    'icon'  => $pathIcon32 . '/content.png',
67
+    'icon'  => $pathIcon32.'/content.png',
68 68
 ];
69 69
 
70 70
 //$adminmenu[] = [
@@ -76,5 +76,5 @@  discard block
 block discarded – undo
76 76
 $adminmenu[] = [
77 77
     'title' => _AM_MODULEADMIN_ABOUT,
78 78
     'link'  => 'admin/about.php',
79
-    'icon'  => $pathIcon32 . '/about.png',
79
+    'icon'  => $pathIcon32.'/about.png',
80 80
 ];
Please login to merge, or discard this patch.
admin/admin.blog.php 1 patch
Spacing   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
 // ------------------------------------------------------------------------ //
27 27
 use Xmf\Request;
28 28
 
29
-require_once __DIR__ . '/admin_header.php';
30
-require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
29
+require_once __DIR__.'/admin_header.php';
30
+require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
31 31
 
32 32
 xoops_cp_header();
33 33
 $adminObject = \Xmf\Module\Admin::getInstance();
@@ -39,14 +39,14 @@  discard block
 block discarded – undo
39 39
  * This is a tricky fix for incomplete solution of module cone
40 40
  * it is expected to have a better solution in article 1.0
41 41
  */
42
-require XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php';
42
+require XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/vars.php';
43 43
 //planet_adminmenu(2);
44 44
 
45
-$op          = Request::getString('op', Request::getString('op', '', 'POST'), 'GET');//!empty($_POST['op']) ? $_POST['op'] : (!empty($_GET['op']) ? $_GET['op'] : '');
46
-$blog_id     = Request::getArray('blog', Request::getArray('blog', [], 'POST'), 'GET');//!empty($_POST['blog']) ? $_POST['blog'] : (!empty($_GET['blog']) ? $_GET['blog'] : 0);
47
-$blog_id     = is_array($blog_id) ? array_map('intval', $blog_id) : (int)$blog_id;
48
-$category_id = Request::getInt('category', Request::getInt('category', 0, 'POST'), 'GET');//(int)(!empty($_POST['category']) ? $_POST['category'] : (!empty($_GET['category']) ? $_GET['category'] : 0));
49
-$start       = Request::getInt('start', Request::getInt('start', 0, 'POST'), 'GET');//(int)(!empty($_POST['start']) ? $_POST['start'] : (!empty($_GET['start']) ? $_GET['start'] : 0));
45
+$op          = Request::getString('op', Request::getString('op', '', 'POST'), 'GET'); //!empty($_POST['op']) ? $_POST['op'] : (!empty($_GET['op']) ? $_GET['op'] : '');
46
+$blog_id     = Request::getArray('blog', Request::getArray('blog', [], 'POST'), 'GET'); //!empty($_POST['blog']) ? $_POST['blog'] : (!empty($_GET['blog']) ? $_GET['blog'] : 0);
47
+$blog_id     = is_array($blog_id) ? array_map('intval', $blog_id) : (int) $blog_id;
48
+$category_id = Request::getInt('category', Request::getInt('category', 0, 'POST'), 'GET'); //(int)(!empty($_POST['category']) ? $_POST['category'] : (!empty($_GET['category']) ? $_GET['category'] : 0));
49
+$start       = Request::getInt('start', Request::getInt('start', 0, 'POST'), 'GET'); //(int)(!empty($_POST['start']) ? $_POST['start'] : (!empty($_GET['start']) ? $_GET['start'] : 0));
50 50
 
51 51
 $blogHandler     = xoops_getModuleHandler('blog', $GLOBALS['moddirname']);
52 52
 $categoryHandler = xoops_getModuleHandler('category', $GLOBALS['moddirname']);
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
         if ($blog_id) {
63 63
             $blog_obj = $blogHandler->get($blog_id);
64
-        } else {
64
+        }else {
65 65
             if ($blog_exists = $blogHandler->getCount(new Criteria('blog_feed', Request::getString('blog_feed', '', 'POST')))) {
66 66
                 redirect_header('admin.blog.php', 2, planet_constant('AM_BLOGEXISTS'));
67 67
             }
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
             unset($blog_obj);
127 127
         }
128 128
         $message = planet_constant('AM_DBUPDATED');
129
-        redirect_header('admin.blog.php?category=' . $category_id . '&amp;start=' . $start, 2, $message);
129
+        redirect_header('admin.blog.php?category='.$category_id.'&amp;start='.$start, 2, $message);
130 130
 
131 131
     /* add a list of blogs to a category */
132 132
     // no break
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
             $categoryHandler->addBlogs(Request::getArray('category_dest', [], 'POST'), $blog_id);
140 140
         }
141 141
         $message = planet_constant('AM_DBUPDATED');
142
-        redirect_header('admin.blog.php?category=' . Request::getArray('category_dest', [], 'POST') . '&amp;start=' . $start, 2, $message);
142
+        redirect_header('admin.blog.php?category='.Request::getArray('category_dest', [], 'POST').'&amp;start='.$start, 2, $message);
143 143
 
144 144
     /* remove a list of blogs from a category */
145 145
     // no break
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
             $categoryHandler->removeBlogs($category_id, $blog_id);
153 153
         }
154 154
         $message = planet_constant('AM_DBUPDATED');
155
-        redirect_header('admin.blog.php?category=' . $category_id . '&amp;start=' . $start, 2, $message);
155
+        redirect_header('admin.blog.php?category='.$category_id.'&amp;start='.$start, 2, $message);
156 156
 
157 157
     /* delete a single blog or a list blogs */
158 158
     // no break
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
             unset($blog_obj);
168 168
         }
169 169
         $message = planet_constant('AM_DBUPDATED');
170
-        redirect_header('admin.blog.php?category=' . $category_id . '&amp;start=' . $start, 2, $message);
170
+        redirect_header('admin.blog.php?category='.$category_id.'&amp;start='.$start, 2, $message);
171 171
 
172 172
     /* empty a single blog or a list blogs */
173 173
     // no break
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
             }
182 182
         }
183 183
         $message = planet_constant('AM_DBUPDATED');
184
-        redirect_header('admin.blog.php?category=' . $category_id . '&amp;start=' . $start, 2, $message);
184
+        redirect_header('admin.blog.php?category='.$category_id.'&amp;start='.$start, 2, $message);
185 185
 
186 186
     /* approve a single blog or a list blogs */
187 187
     // no break
@@ -189,10 +189,10 @@  discard block
 block discarded – undo
189 189
         if (!is_array($blog_id)) {
190 190
             $blog_id = [$blog_id];
191 191
         }
192
-        $criteria = new Criteria('blog_id', '(' . implode(',', $blog_id) . ')', 'IN');
192
+        $criteria = new Criteria('blog_id', '('.implode(',', $blog_id).')', 'IN');
193 193
         $blogHandler->updateAll('blog_status', 1, $criteria, true);
194 194
         $message = planet_constant('AM_DBUPDATED');
195
-        redirect_header('admin.blog.php?category=' . $category_id . '&amp;start=' . $start, 2, $message);
195
+        redirect_header('admin.blog.php?category='.$category_id.'&amp;start='.$start, 2, $message);
196 196
 
197 197
     /* mark a single blog or a list blogs as featured */
198 198
     // no break
@@ -200,10 +200,10 @@  discard block
 block discarded – undo
200 200
         if (!is_array($blog_id)) {
201 201
             $blog_id = [$blog_id];
202 202
         }
203
-        $criteria = new Criteria('blog_id', '(' . implode(',', $blog_id) . ')', 'IN');
203
+        $criteria = new Criteria('blog_id', '('.implode(',', $blog_id).')', 'IN');
204 204
         $blogHandler->updateAll('blog_status', 2, $criteria, true);
205 205
         $message = planet_constant('AM_DBUPDATED');
206
-        redirect_header('admin.blog.php?category=' . $category_id . '&amp;start=' . $start, 2, $message);
206
+        redirect_header('admin.blog.php?category='.$category_id.'&amp;start='.$start, 2, $message);
207 207
 
208 208
     /* edit a single blog */
209 209
     // no break
@@ -211,11 +211,11 @@  discard block
 block discarded – undo
211 211
         if (!empty(Request::getString('fetch', '', 'POST'))) {
212 212
             $blog_obj = $blogHandler->fetch(Request::getString('blog_feed', '', 'POST'));
213 213
             $blog_obj->setVar('blog_id', $blog_id);
214
-        } else {
214
+        }else {
215 215
             $blog_obj = $blogHandler->get($blog_id);
216 216
         }
217 217
         $categories = Request::getArray('categories', [], 'POST');
218
-        if (empty($categories) && $blog_id > 0) {
218
+        if (empty($categories) && $blog_id>0) {
219 219
             $crit       = new Criteria('bc.blog_id', $blog_id);
220 220
             $categories = array_keys($categoryHandler->getByBlog($crit));
221 221
         }
@@ -223,21 +223,21 @@  discard block
 block discarded – undo
223 223
             $categories = [0 => _NONE];
224 224
         }
225 225
 
226
-        echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _EDIT . '</legend>';
226
+        echo "<fieldset><legend style='font-weight: bold; color: #900;'>"._EDIT.'</legend>';
227 227
         echo '<br>';
228 228
         if (empty($blog_id) && $blog_obj->getVar('blog_feed')) {
229 229
             $criteria  = new Criteria('blog_feed', $blog_obj->getVar('blog_feed'));
230 230
             $blogs_obj = $blogHandler->getList($criteria);
231
-            if (count($blogs_obj) > 0) {
232
-                echo "<div class=\"errorMsg\">" . planet_constant('AM_BLOGEXISTS');
231
+            if (count($blogs_obj)>0) {
232
+                echo "<div class=\"errorMsg\">".planet_constant('AM_BLOGEXISTS');
233 233
                 foreach (array_keys($blogs_obj) as $bid) {
234
-                    echo "<br><a href=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'b' . $bid . "\" target=\"_blank\">" . $blogs_obj[$bid] . '</a>';
234
+                    echo "<br><a href=\"".XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php'.URL_DELIMITER.'b'.$bid."\" target=\"_blank\">".$blogs_obj[$bid].'</a>';
235 235
                 }
236 236
                 echo '</div>';
237 237
             }
238 238
             unset($blogs_obj, $criteria);
239 239
         }
240
-        include XOOPS_ROOT_PATH . '/modules/' . $GLOBALS['moddirname'] . '/include/form.blog.php';
240
+        include XOOPS_ROOT_PATH.'/modules/'.$GLOBALS['moddirname'].'/include/form.blog.php';
241 241
         echo '</fieldset>';
242 242
         break;
243 243
 
@@ -265,14 +265,14 @@  discard block
 block discarded – undo
265 265
         $opform->addElement($op_select);
266 266
         $opform->display();
267 267
 
268
-        if ($category_id > 0) {
268
+        if ($category_id>0) {
269 269
             $criteria = new CriteriaCompo(new Criteria('b.blog_status', 0, '>'));
270 270
             $criteria->add(new Criteria('bc.cat_id', $category_id));
271 271
             $blog_count = $blogHandler->getCountByCategory($criteria);
272 272
             $criteria->setStart($start);
273 273
             $criteria->setLimit($xoopsModuleConfig['list_perpage']);
274 274
             $blog_objs = $blogHandler->getByCategory($criteria);
275
-        } else {
275
+        }else {
276 276
             /* All active blogs */
277 277
             if (0 == $category_id) {
278 278
                 $criteria = new Criteria('1', 1);
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
                 $criteria->setStart($start);
290 290
                 $criteria->setLimit($xoopsModuleConfig['list_perpage']);
291 291
                 /* Pending blogs */
292
-            } else {
292
+            }else {
293 293
                 $criteria = new Criteria('blog_status', 0);
294 294
                 $criteria->setStart($start);
295 295
                 $criteria->setLimit($xoopsModuleConfig['list_perpage']);
@@ -298,19 +298,19 @@  discard block
 block discarded – undo
298 298
             $blog_objs  = $blogHandler->getAll($criteria);
299 299
         }
300 300
 
301
-        echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . planet_constant('AM_LIST') . '</legend>';
301
+        echo "<fieldset><legend style='font-weight: bold; color: #900;'>".planet_constant('AM_LIST').'</legend>';
302 302
         echo "<br style=\"clear:both\">";
303 303
 
304
-        echo "<form name='list' id='list' method='post' action='" . xoops_getenv('PHP_SELF') . "'>";
304
+        echo "<form name='list' id='list' method='post' action='".xoops_getenv('PHP_SELF')."'>";
305 305
         echo "<table border='0' cellpadding='4' cellspacing='1' width='100%' class='outer'>";
306 306
         echo "<tr align='center'>";
307 307
         echo "<th class='bg3' width='5%'><input name='blog_check' id='blog_check' value='1' type='checkbox'  onclick=\"xoopsCheckAll('list', 'blog_check');\"></td>";
308
-        echo "<th class='bg3'>" . planet_constant('AM_TITLE') . '</td>';
309
-        echo "<th class='bg3' width='5%'>" . planet_constant('AM_STATUS') . '</td>';
310
-        echo "<th class='bg3' width='40%'>" . planet_constant('AM_FEED') . '</td>';
308
+        echo "<th class='bg3'>".planet_constant('AM_TITLE').'</td>';
309
+        echo "<th class='bg3' width='5%'>".planet_constant('AM_STATUS').'</td>';
310
+        echo "<th class='bg3' width='40%'>".planet_constant('AM_FEED').'</td>';
311 311
         //        echo "<th class='bg3' width='5%'>" . _EDIT . "</td>";
312 312
         //        echo "<th class='bg3' width='5%'>" . _DELETE . "</td>";
313
-        echo "<th class='bg3' width='10%'>" . planet_constant('AM_ACTIONS') . '</td>';
313
+        echo "<th class='bg3' width='10%'>".planet_constant('AM_ACTIONS').'</td>';
314 314
         echo '</tr>';
315 315
 
316 316
         $status = [
@@ -320,53 +320,53 @@  discard block
 block discarded – undo
320 320
         ];
321 321
         foreach (array_keys($blog_objs) as $bid) {
322 322
             echo "<tr class='odd' align='left'>";
323
-            echo "<td align='center'><input name='blog[]' value='" . $bid . "' type='checkbox'></td>";
324
-            echo "<td><a href='" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'b' . $bid . "'>" . $blog_objs[$bid]->getVar('blog_title') . '</a></td>';
325
-            echo "<td align='center'>" . $status[$blog_objs[$bid]->getVar('blog_status')] . '</td>';
326
-            echo '<td>' . $blog_objs[$bid]->getVar('blog_feed') . '</td>';
327
-            echo "<td align='center'><a href='admin.blog.php?op=edit&amp;blog=" . $bid . "' title='" . _EDIT . "'><img src='" . $pathIcon16 . "/edit.png '" . "alt='" . _EDIT . " title='" . _EDIT . " </a>
328
-                      <a href='admin.blog.php?op=del&amp;blog=" . $bid . "' title='" . _DELETE . "'><img src='" . $pathIcon16 . "/delete.png '" . " alt='" . _EDIT . " title='" . _DELETE . " </a>&nbsp;
329
-                      <a href='admin.blog.php?op=empty&amp;blog=" . $bid . "' title='" . planet_constant('MD_EMPTY_BLOG') . "'><img src='" . $pathIcon16 . "/empty.png '" . " alt='" . _EDIT . " title='" . planet_constant('MD_EMPTY_BLOG') . '</a></td>';
323
+            echo "<td align='center'><input name='blog[]' value='".$bid."' type='checkbox'></td>";
324
+            echo "<td><a href='".XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php'.URL_DELIMITER.'b'.$bid."'>".$blog_objs[$bid]->getVar('blog_title').'</a></td>';
325
+            echo "<td align='center'>".$status[$blog_objs[$bid]->getVar('blog_status')].'</td>';
326
+            echo '<td>'.$blog_objs[$bid]->getVar('blog_feed').'</td>';
327
+            echo "<td align='center'><a href='admin.blog.php?op=edit&amp;blog=".$bid."' title='"._EDIT."'><img src='".$pathIcon16."/edit.png '"."alt='"._EDIT." title='"._EDIT." </a>
328
+                      <a href='admin.blog.php?op=del&amp;blog=" . $bid."' title='"._DELETE."'><img src='".$pathIcon16."/delete.png '"." alt='"._EDIT." title='"._DELETE." </a>&nbsp;
329
+                      <a href='admin.blog.php?op=empty&amp;blog=" . $bid."' title='".planet_constant('MD_EMPTY_BLOG')."'><img src='".$pathIcon16."/empty.png '"." alt='"._EDIT." title='".planet_constant('MD_EMPTY_BLOG').'</a></td>';
330 330
 
331 331
             echo '</tr>';
332 332
         }
333 333
         echo "<tr class='even' align='center'>";
334 334
         echo "<td colspan='7'>";
335 335
         echo "<select name='op' onChange='if (this.options[this.selectedIndex].value==\"register\") {setVisible(\"catdiv\");} else {setHidden(\"catdiv\");}'>";
336
-        echo "<option value=''>" . _SELECT . '</option>';
337
-        echo "<option value='del'>" . _DELETE . '</option>';
338
-        echo "<option value='empty'>" . planet_constant('MD_EMPTY_BLOG') . '</option>';
339
-        echo "<option value='register'>" . planet_constant('AM_REGISTER') . '</option>';
340
-        if ($category_id > 0) {
341
-            echo "<option value='remove'>" . planet_constant('AM_REMOVE') . '</option>';
336
+        echo "<option value=''>"._SELECT.'</option>';
337
+        echo "<option value='del'>"._DELETE.'</option>';
338
+        echo "<option value='empty'>".planet_constant('MD_EMPTY_BLOG').'</option>';
339
+        echo "<option value='register'>".planet_constant('AM_REGISTER').'</option>';
340
+        if ($category_id>0) {
341
+            echo "<option value='remove'>".planet_constant('AM_REMOVE').'</option>';
342 342
         }
343
-        echo "<option value='approve'>" . planet_constant('AM_APPROVE') . '</option>';
344
-        echo "<option value='feature'>" . planet_constant('AM_FEATURE') . '</option>';
345
-        echo "<option value='update'>" . planet_constant('AM_UPDATE') . '</option>';
343
+        echo "<option value='approve'>".planet_constant('AM_APPROVE').'</option>';
344
+        echo "<option value='feature'>".planet_constant('AM_FEATURE').'</option>';
345
+        echo "<option value='update'>".planet_constant('AM_UPDATE').'</option>';
346 346
 
347
-        echo "<option value='pending'>" . planet_constant('AM_PENDING') . '</option>';
348
-        echo "<option value='active'>" . planet_constant('AM_ACTIVE') . '</option>';
347
+        echo "<option value='pending'>".planet_constant('AM_PENDING').'</option>';
348
+        echo "<option value='active'>".planet_constant('AM_ACTIVE').'</option>';
349 349
 
350 350
         echo '</select>';
351 351
         echo "<div id='catdiv' style='visibility:hidden;display:inline;'>";
352 352
         echo "<select name='category_dest'>";
353
-        echo "<option value=''>" . _SELECT . '</option>';
353
+        echo "<option value=''>"._SELECT.'</option>';
354 354
         foreach ($categories as $cid => $name) {
355
-            echo "<option value='" . $cid . "'>" . $name . '</option>';
355
+            echo "<option value='".$cid."'>".$name.'</option>';
356 356
         }
357 357
         echo '</select>';
358 358
         echo '</div>';
359
-        echo "<input name='start' value='" . $start . "' type='hidden'>";
360
-        echo "<input name='category' value='" . $category_id . "' type='hidden'>";
361
-        echo "<input name='submit' value='" . _SUBMIT . "' type='submit'>";
362
-        echo "<input name='' value='" . _CANCEL . "' type='reset'>";
359
+        echo "<input name='start' value='".$start."' type='hidden'>";
360
+        echo "<input name='category' value='".$category_id."' type='hidden'>";
361
+        echo "<input name='submit' value='"._SUBMIT."' type='submit'>";
362
+        echo "<input name='' value='"._CANCEL."' type='reset'>";
363 363
         echo '</td>';
364 364
         echo '</tr>';
365
-        if ($blog_count > $xoopsModuleConfig['list_perpage']) {
366
-            include XOOPS_ROOT_PATH . '/class/pagenav.php';
367
-            $nav     = new XoopsPageNav($blog_count, $xoopsModuleConfig['list_perpage'], $start, 'start', 'category=' . $category_id);
365
+        if ($blog_count>$xoopsModuleConfig['list_perpage']) {
366
+            include XOOPS_ROOT_PATH.'/class/pagenav.php';
367
+            $nav     = new XoopsPageNav($blog_count, $xoopsModuleConfig['list_perpage'], $start, 'start', 'category='.$category_id);
368 368
             $pagenav = $nav->renderNav(4);
369
-            echo "<tr align='right'><td colspan='6'>" . $pagenav . '</td></tr>';
369
+            echo "<tr align='right'><td colspan='6'>".$pagenav.'</td></tr>';
370 370
         }
371 371
         echo '</table></form>';
372 372
         echo "</fieldset><br style='clear:both;'>";
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
             $button_tray->addElement($butt_cancel);
393 393
             $form_add->addElement($button_tray);
394 394
 
395
-            echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _ADD . '</legend>';
395
+            echo "<fieldset><legend style='font-weight: bold; color: #900;'>"._ADD.'</legend>';
396 396
             echo '<br>';
397 397
             $form->display();
398 398
             $form_add->display();
Please login to merge, or discard this patch.
include/functions.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -38,9 +38,9 @@  discard block
 block discarded – undo
38 38
 if (!defined('planet_FUNCTIONS')):
39 39
     define('planet_FUNCTIONS', 1);
40 40
 
41
-    require XOOPS_ROOT_PATH . '/modules/' . $GLOBALS['moddirname'] . '/include/vars.php';
42
-    require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
43
-    require_once XOOPS_ROOT_PATH . '/Frameworks/art/functions.php';
41
+    require XOOPS_ROOT_PATH.'/modules/'.$GLOBALS['moddirname'].'/include/vars.php';
42
+    require_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
43
+    require_once XOOPS_ROOT_PATH.'/Frameworks/art/functions.php';
44 44
 
45 45
     /**
46 46
      * Function to display messages
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     */
70 70
     function planetParseArguments(&$args_numeric, &$args, &$args_string)
71 71
     {
72
-        $args_abb     = [
72
+        $args_abb = [
73 73
             'a' => 'article',
74 74
             'b' => 'blog',
75 75
             'c' => 'category',
@@ -84,24 +84,24 @@  discard block
 block discarded – undo
84 84
         if (preg_match("/[^\?]*\.php[\/|\?]([^\?]*)/i", Request::getUrl('REQUEST_URI', '', 'SERVER'), $matches)) {
85 85
             $vars = preg_split("/[\/|&]/", $matches[1]);
86 86
             $vars = array_map('trim', $vars);
87
-            if (count($vars) > 0) {
87
+            if (count($vars)>0) {
88 88
                 foreach ($vars as $var) {
89 89
                     if (is_numeric($var)) {
90 90
                         $args_numeric[] = $var;
91 91
                     } elseif (false === strpos($var, '=')) {
92 92
                         if (is_numeric(substr($var, 1))) {
93
-                            $args[$args_abb[strtolower($var{0})]] = (int)substr($var, 1);
94
-                        } else {
93
+                            $args[$args_abb[strtolower($var{0})]] = (int) substr($var, 1);
94
+                        }else {
95 95
                             $args_string[] = urldecode($var);
96 96
                         }
97
-                    } else {
97
+                    }else {
98 98
                         parse_str($var, $args);
99 99
                     }
100 100
                 }
101 101
             }
102 102
         }
103 103
 
104
-        return (0 == count($args) + count($args_numeric) + count($args_string)) ? null : true;
104
+        return (0 == count($args)+count($args_numeric)+count($args_string)) ? null : true;
105 105
     }
106 106
 
107 107
     /**
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
             $pattern     = [$pattern];
125 125
             $replacement = [$replacement];
126 126
         }
127
-        if (is_array($pattern) && count($pattern) > 0) {
127
+        if (is_array($pattern) && count($pattern)>0) {
128 128
             $ii = 0;
129 129
             foreach ($pattern as $pat) {
130 130
                 if (!in_array($pat, $patterns)) {
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
             $pattern     = [$pattern];
161 161
             $replacement = [$replacement];
162 162
         }
163
-        if (is_array($pattern) && count($pattern) > 0) {
163
+        if (is_array($pattern) && count($pattern)>0) {
164 164
             $ii = 0;
165 165
             foreach ($pattern as $pat) {
166 166
                 if (!in_array($pat, $patterns)) {
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
         if (!is_array($userid)) {
204 204
             $userid = [$userid];
205 205
         }
206
-        $users =& mod_getUnameFromIds($userid, $usereal, $linked);
206
+        $users = & mod_getUnameFromIds($userid, $usereal, $linked);
207 207
 
208 208
         return $users;
209 209
     }
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
         $myts       = MyTextSanitizer::getInstance();
221 221
         $link_array = preg_split("/(\r\n|\r|\n)( *)/", $text);
222 222
         $links      = [];
223
-        if (count($link_array) > 0) {
223
+        if (count($link_array)>0) {
224 224
             foreach ($link_array as $link) {
225 225
                 @list($url, $title) = array_map('trim', preg_split('/ /', $link, 2));
226 226
                 if (empty($url)) {
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
      */
241 241
     function planetGetTemplate($pagename)
242 242
     {
243
-        return $GLOBALS['VAR_PREFIX'] . '_' . $pagename . '.tpl';
243
+        return $GLOBALS['VAR_PREFIX'].'_'.$pagename.'.tpl';
244 244
     }
245 245
 
246 246
     /**
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
             return false;
269 269
         }
270 270
         @list($pat, $rep) = array_map('trim', preg_split("#[\s]+#", $pattern));
271
-        $trackback_url = preg_replace('#' . $pat . '#', $rep, $article_obj->getVar('art_link'));
271
+        $trackback_url = preg_replace('#'.$pat.'#', $rep, $article_obj->getVar('art_link'));
272 272
 
273 273
         return planetTrackback($trackback_url, $article);
274 274
     }
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 
285 285
         $title         = $article->getVar('art_title');
286 286
         $excerpt       = $article->getVar('art_content');
287
-        $blog_name     = $xoopsConfig['sitename'] . '-' . $xoopsModule->getVar('name');
287
+        $blog_name     = $xoopsConfig['sitename'].'-'.$xoopsModule->getVar('name');
288 288
         $title         = xoops_utf8_encode($title);
289 289
         $excerpt       = xoops_utf8_encode($excerpt);
290 290
         $blog_name     = xoops_utf8_encode($blog_name);
@@ -292,15 +292,15 @@  discard block
 block discarded – undo
292 292
         $title1        = urlencode($title);
293 293
         $excerpt1      = urlencode($excerpt);
294 294
         $name1         = urlencode($blog_name);
295
-        $url           = urlencode(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' . $article->getVar('art_id'));
295
+        $url           = urlencode(XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.article.php'.URL_DELIMITER.''.$article->getVar('art_id'));
296 296
         $query_string  = "title=$title1&url=$url&blog_name=$name1&excerpt=$excerpt1&charset=$charset";
297 297
         $trackback_url = parse_url($trackback_url);
298 298
 
299
-        $http_request = 'POST ' . $trackback_url['path'] . ($trackback_url['query'] ? '?' . $trackback_url['query'] : '') . " HTTP/1.0\r\n";
300
-        $http_request .= 'Host: ' . $trackback_url['host'] . "\r\n";
301
-        $http_request .= 'Content-Type: application/x-www-form-urlencoded; charset=' . $charset . "\r\n";
302
-        $http_request .= 'Content-Length: ' . strlen($query_string) . "\r\n";
303
-        $http_request .= 'User-Agent: XOOPS Blogs/' . XOOPS_VERSION;
299
+        $http_request = 'POST '.$trackback_url['path'].($trackback_url['query'] ? '?'.$trackback_url['query'] : '')." HTTP/1.0\r\n";
300
+        $http_request .= 'Host: '.$trackback_url['host']."\r\n";
301
+        $http_request .= 'Content-Type: application/x-www-form-urlencoded; charset='.$charset."\r\n";
302
+        $http_request .= 'Content-Length: '.strlen($query_string)."\r\n";
303
+        $http_request .= 'User-Agent: XOOPS Blogs/'.XOOPS_VERSION;
304 304
         $http_request .= "\r\n\r\n";
305 305
         $http_request .= $query_string;
306 306
         if ('' == $trackback_url['port']) {
@@ -309,11 +309,11 @@  discard block
 block discarded – undo
309 309
         $fs = @fsockopen($trackback_url['host'], $trackback_url['port'], $errno, $errstr, 4);
310 310
         @fwrite($fs, $http_request);
311 311
         if ($xoopsModuleConfig['do_debug']) {
312
-            $debug_file = XOOPS_CACHE_PATH . '/' . $GLOBALS['moddirname'] . '_trackback.log';
312
+            $debug_file = XOOPS_CACHE_PATH.'/'.$GLOBALS['moddirname'].'_trackback.log';
313 313
             $fr         = "\n*****\nRequest:\n\n$http_request\n\nResponse:\n\n";
314 314
             $fr         .= "CHARSET:$charset\n";
315 315
             $fr         .= "NAME:$blog_name\n";
316
-            $fr         .= 'TITLE:' . $title . "\n";
316
+            $fr         .= 'TITLE:'.$title."\n";
317 317
             $fr         .= "EXCERPT:$excerpt\n\n";
318 318
             while (!@feof($fs)) {
319 319
                 $fr .= @fgets($fs, 4096);
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
             if ($fp = fopen($debug_file, 'a')) {
324 324
                 fwrite($fp, $fr);
325 325
                 fclose($fp);
326
-            } else {
326
+            }else {
327 327
             }
328 328
         }
329 329
         @fclose($fs);
@@ -343,19 +343,19 @@  discard block
 block discarded – undo
343 343
                 planetGetPing($serv, $id);
344 344
             }
345 345
         }
346
-        require_once XOOPS_ROOT_PATH . '/modules/' . $GLOBALS['moddirname'] . '/class-IXR.php';
346
+        require_once XOOPS_ROOT_PATH.'/modules/'.$GLOBALS['moddirname'].'/class-IXR.php';
347 347
 
348 348
         // using a timeout of 3 seconds should be enough to cover slow servers
349 349
         $client            = new IXR_Client($server, false);
350 350
         $client->timeout   = 3;
351
-        $client->useragent .= ' -- XOOPS Article/' . XOOPS_VERSION;
351
+        $client->useragent .= ' -- XOOPS Article/'.XOOPS_VERSION;
352 352
 
353 353
         // when set to true, this outputs debug messages by itself
354 354
         $client->debug = false;
355 355
 
356 356
         $blogname = xoops_utf8_encode($GLOBALS['xoopsModule']->getVar('name'));
357
-        $home     = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/';
358
-        $rss2_url = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/xml.php' . URL_DELIMITER . 'rss2.0/' . $id;
357
+        $home     = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/';
358
+        $rss2_url = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/xml.php'.URL_DELIMITER.'rss2.0/'.$id;
359 359
 
360 360
         if (!$client->query('weblogUpdates.extendedPing', $blogname, $home, $rss2_url)) { // then try a normal ping
361 361
             $client->query('weblogUpdates.ping', $blogname, $home);
@@ -371,16 +371,16 @@  discard block
 block discarded – undo
371 371
     {
372 372
         $charset       = 'utf-8';
373 373
         $error_message = xoops_utf8_encode($error_message);
374
-        header('Content-Type: text/xml; charset="' . $charset . '"');
374
+        header('Content-Type: text/xml; charset="'.$charset.'"');
375 375
         if ($error) {
376
-            echo '<?xml version="1.0" encoding="' . $charset . '"?' . ">\n";
376
+            echo '<?xml version="1.0" encoding="'.$charset.'"?'.">\n";
377 377
             echo "<response>\n";
378 378
             echo "<error>1</error>\n";
379 379
             echo "<message>$error_message</message>\n";
380 380
             echo '</response>';
381 381
             die();
382
-        } else {
383
-            echo '<?xml version="1.0" encoding="' . $charset . '"?' . ">\n";
382
+        }else {
383
+            echo '<?xml version="1.0" encoding="'.$charset.'"?'.">\n";
384 384
             echo "<response>\n";
385 385
             echo "<error>0</error>\n";
386 386
             echo '</response>';
@@ -400,11 +400,11 @@  discard block
 block discarded – undo
400 400
         if (is_array($string)) {
401 401
             $value = [];
402 402
             foreach ($string as $key => $val) {
403
-                $value[] = $key . '|' . $val;
403
+                $value[] = $key.'|'.$val;
404 404
             }
405 405
             $string = implode(',', $value);
406 406
         }
407
-        setcookie($GLOBALS['VAR_PREFIX'] . $name, $string, (int)$expire, '/');
407
+        setcookie($GLOBALS['VAR_PREFIX'].$name, $string, (int) $expire, '/');
408 408
     }
409 409
 
410 410
     /**
@@ -414,14 +414,14 @@  discard block
 block discarded – undo
414 414
      */
415 415
     function planetGetCookie($name, $isArray = false)
416 416
     {
417
-        $value = isset($_COOKIE[$GLOBALS['VAR_PREFIX'] . $name]) ? $_COOKIE[$GLOBALS['VAR_PREFIX'] . $name] : null;
417
+        $value = isset($_COOKIE[$GLOBALS['VAR_PREFIX'].$name]) ? $_COOKIE[$GLOBALS['VAR_PREFIX'].$name] : null;
418 418
         if ($isArray) {
419 419
             $_value = $value ? explode(',', $value) : [];
420 420
             $value  = [];
421
-            if (count($_value) > 0) {
421
+            if (count($_value)>0) {
422 422
                 foreach ($_value as $string) {
423 423
                     $key         = substr($string, 0, strpos($string, '|'));
424
-                    $val         = substr($string, strpos($string, '|') + 1);
424
+                    $val         = substr($string, strpos($string, '|')+1);
425 425
                     $value[$key] = $val;
426 426
                 }
427 427
             }
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
      */
480 480
     function planet_fetch_snoopy($url)
481 481
     {
482
-        require_once XOOPS_ROOT_PATH . '/class/snoopy.php';
482
+        require_once XOOPS_ROOT_PATH.'/class/snoopy.php';
483 483
         $snoopy = new Snoopy;
484 484
         $data   = '';
485 485
         if (@$snoopy->fetch($url)) {
@@ -498,10 +498,10 @@  discard block
 block discarded – undo
498 498
         if (!function_exists('curl_init')) {
499 499
             return false;
500 500
         }
501
-        $ch = curl_init();    // initialize curl handle
501
+        $ch = curl_init(); // initialize curl handle
502 502
         curl_setopt($ch, CURLOPT_URL, $url); // set url to post to
503 503
         curl_setopt($ch, CURLOPT_FAILONERROR, 1);
504
-        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirects
504
+        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); // allow redirects
505 505
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // return into a variable
506 506
         curl_setopt($ch, CURLOPT_TIMEOUT, 30); // times out after 31s
507 507
         $data = curl_exec($ch); // run the whole process
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
         if (false === $index) {
544 544
             return false;
545 545
         }
546
-        $index = strlen($haystack) - strlen($needle) - $index;
546
+        $index = strlen($haystack)-strlen($needle)-$index;
547 547
 
548 548
         return $index;
549 549
     }
Please login to merge, or discard this patch.