Completed
Push — master ( 804154...96da4e )
by Michael
02:32
created
admin/admin_footer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@
 block discarded – undo
17 17
  * @author       XOOPS Development Team
18 18
  */
19 19
 
20
-echo "<div class='adminfooter'>\n" . "  <div style='text-align: center;'>\n"
20
+echo "<div class='adminfooter'>\n"."  <div style='text-align: center;'>\n"
21 21
      . "    <a href='http://xoops.org' rel='external'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n"
22
-     . "  </div>\n" . '  ' . _AM_MODULEADMIN_ADMIN_FOOTER . "\n" . '</div>';
22
+     . "  </div>\n".'  '._AM_MODULEADMIN_ADMIN_FOOTER."\n".'</div>';
23 23
 
24 24
 xoops_cp_footer();
Please login to merge, or discard this patch.
admin/admin.blog.php 1 patch
Spacing   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@  discard block
 block discarded – undo
24 24
 // URL: http://xoops.org                         //
25 25
 // Project: Article Project                                                 //
26 26
 // ------------------------------------------------------------------------ //
27
-include_once __DIR__ . '/admin_header.php';
28
-require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
27
+include_once __DIR__.'/admin_header.php';
28
+require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
29 29
 
30 30
 xoops_cp_header();
31 31
 $indexAdmin = new ModuleAdmin();
@@ -37,14 +37,14 @@  discard block
 block discarded – undo
37 37
  * This is a tricky fix for incomplete solution of module cone
38 38
  * it is expected to have a better solution in article 1.0
39 39
  */
40
-require XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php';
40
+require XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/vars.php';
41 41
 //planet_adminmenu(2);
42 42
 
43 43
 $op          = !empty($_POST['op']) ? $_POST['op'] : (!empty($_GET['op']) ? $_GET['op'] : '');
44 44
 $blog_id     = !empty($_POST['blog']) ? $_POST['blog'] : (!empty($_GET['blog']) ? $_GET['blog'] : 0);
45
-$blog_id     = is_array($blog_id) ? array_map('intval', $blog_id) : (int)$blog_id;
46
-$category_id = (int)(!empty($_POST['category']) ? $_POST['category'] : (!empty($_GET['category']) ? $_GET['category'] : 0));
47
-$start       = (int)(!empty($_POST['start']) ? $_POST['start'] : (!empty($_GET['start']) ? $_GET['start'] : 0));
45
+$blog_id     = is_array($blog_id) ? array_map('intval', $blog_id) : (int) $blog_id;
46
+$category_id = (int) (!empty($_POST['category']) ? $_POST['category'] : (!empty($_GET['category']) ? $_GET['category'] : 0));
47
+$start       = (int) (!empty($_POST['start']) ? $_POST['start'] : (!empty($_GET['start']) ? $_GET['start'] : 0));
48 48
 
49 49
 $blog_handler     = xoops_getModuleHandler('blog', $GLOBALS['moddirname']);
50 50
 $category_handler = xoops_getModuleHandler('category', $GLOBALS['moddirname']);
@@ -58,12 +58,12 @@  discard block
 block discarded – undo
58 58
     case 'save':
59 59
 
60 60
         if ($blog_id) {
61
-            $blog_obj =& $blog_handler->get($blog_id);
62
-        } else {
61
+            $blog_obj = & $blog_handler->get($blog_id);
62
+        }else {
63 63
             if ($blog_exists = $blog_handler->getCount(new Criteria('blog_feed', $_POST['blog_feed']))) {
64 64
                 redirect_header('admin.blog.php', 2, planet_constant('AM_BLOGEXISTS'));
65 65
             }
66
-            $blog_obj =& $blog_handler->create();
66
+            $blog_obj = & $blog_handler->create();
67 67
             $blog_obj->setVar('blog_submitter', $xoopsUser->getVar('uid'));
68 68
         }
69 69
 
@@ -90,13 +90,13 @@  discard block
 block discarded – undo
90 90
 
91 91
     /* fetch and add a list of blogs to a category */
92 92
     case 'add':
93
-        $links =& planet_parseLinks($_POST['links']);
93
+        $links = & planet_parseLinks($_POST['links']);
94 94
         $blogs = array();
95 95
         foreach ($links as $link) {
96 96
             if ($blog_exist = $blog_handler->getCount(new Criteria('blog_feed', $link['url']))) {
97 97
                 continue;
98 98
             }
99
-            $blog_obj =& $blog_handler->fetch($link['url']);
99
+            $blog_obj = & $blog_handler->fetch($link['url']);
100 100
             if (!empty($link['title'])) {
101 101
                 $blog_obj->setVar('blog_title', $link['title']);
102 102
             }
@@ -116,13 +116,13 @@  discard block
 block discarded – undo
116 116
     /* update a list of blogs */
117 117
     case 'update':
118 118
         foreach ($blog_id as $bid) {
119
-            $blog_obj =& $blog_handler->fetch($bid);
119
+            $blog_obj = & $blog_handler->fetch($bid);
120 120
             if (!$blog_handler->insert($blog_obj)) {
121 121
             }
122 122
             unset($blog_obj);
123 123
         }
124 124
         $message = planet_constant('AM_DBUPDATED');
125
-        redirect_header('admin.blog.php?category=' . $category_id . '&amp;start=' . $start, 2, $message);
125
+        redirect_header('admin.blog.php?category='.$category_id.'&amp;start='.$start, 2, $message);
126 126
 
127 127
     /* add a list of blogs to a category */
128 128
     case 'register':
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
             $category_handler->addBlogs($_POST['category_dest'], $blog_id);
135 135
         }
136 136
         $message = planet_constant('AM_DBUPDATED');
137
-        redirect_header('admin.blog.php?category=' . $_POST['category_dest'] . '&amp;start=' . $start, 2, $message);
137
+        redirect_header('admin.blog.php?category='.$_POST['category_dest'].'&amp;start='.$start, 2, $message);
138 138
 
139 139
     /* remove a list of blogs from a category */
140 140
     case 'remove':
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
             $category_handler->removeBlogs($category_id, $blog_id);
147 147
         }
148 148
         $message = planet_constant('AM_DBUPDATED');
149
-        redirect_header('admin.blog.php?category=' . $category_id . '&amp;start=' . $start, 2, $message);
149
+        redirect_header('admin.blog.php?category='.$category_id.'&amp;start='.$start, 2, $message);
150 150
 
151 151
     /* delete a single blog or a list blogs */
152 152
     case 'del':
@@ -154,13 +154,13 @@  discard block
 block discarded – undo
154 154
             $blog_id = array($blog_id);
155 155
         }
156 156
         foreach ($blog_id as $bid) {
157
-            $blog_obj =& $blog_handler->get($bid);
157
+            $blog_obj = & $blog_handler->get($bid);
158 158
             if (!$blog_handler->delete($blog_obj, true)) {
159 159
             }
160 160
             unset($blog_obj);
161 161
         }
162 162
         $message = planet_constant('AM_DBUPDATED');
163
-        redirect_header('admin.blog.php?category=' . $category_id . '&amp;start=' . $start, 2, $message);
163
+        redirect_header('admin.blog.php?category='.$category_id.'&amp;start='.$start, 2, $message);
164 164
 
165 165
     /* empty a single blog or a list blogs */
166 166
     case 'empty':
@@ -168,43 +168,43 @@  discard block
 block discarded – undo
168 168
             $blog_id = array($blog_id);
169 169
         }
170 170
         foreach ($blog_id as $bid) {
171
-            $blog_obj =& $blog_handler->get($bid);
171
+            $blog_obj = & $blog_handler->get($bid);
172 172
             if (!$blog_handler->do_empty($blog_obj)) {
173 173
             }
174 174
         }
175 175
         $message = planet_constant('AM_DBUPDATED');
176
-        redirect_header('admin.blog.php?category=' . $category_id . '&amp;start=' . $start, 2, $message);
176
+        redirect_header('admin.blog.php?category='.$category_id.'&amp;start='.$start, 2, $message);
177 177
 
178 178
     /* approve a single blog or a list blogs */
179 179
     case 'approve':
180 180
         if (!is_array($blog_id)) {
181 181
             $blog_id = array($blog_id);
182 182
         }
183
-        $criteria = new Criteria('blog_id', '(' . implode(',', $blog_id) . ')', 'IN');
183
+        $criteria = new Criteria('blog_id', '('.implode(',', $blog_id).')', 'IN');
184 184
         $blog_handler->updateAll('blog_status', 1, $criteria, true);
185 185
         $message = planet_constant('AM_DBUPDATED');
186
-        redirect_header('admin.blog.php?category=' . $category_id . '&amp;start=' . $start, 2, $message);
186
+        redirect_header('admin.blog.php?category='.$category_id.'&amp;start='.$start, 2, $message);
187 187
 
188 188
     /* mark a single blog or a list blogs as featured */
189 189
     case 'feature':
190 190
         if (!is_array($blog_id)) {
191 191
             $blog_id = array($blog_id);
192 192
         }
193
-        $criteria = new Criteria('blog_id', '(' . implode(',', $blog_id) . ')', 'IN');
193
+        $criteria = new Criteria('blog_id', '('.implode(',', $blog_id).')', 'IN');
194 194
         $blog_handler->updateAll('blog_status', 2, $criteria, true);
195 195
         $message = planet_constant('AM_DBUPDATED');
196
-        redirect_header('admin.blog.php?category=' . $category_id . '&amp;start=' . $start, 2, $message);
196
+        redirect_header('admin.blog.php?category='.$category_id.'&amp;start='.$start, 2, $message);
197 197
 
198 198
     /* edit a single blog */
199 199
     case 'edit':
200 200
         if (!empty($_POST['fetch'])) {
201
-            $blog_obj =& $blog_handler->fetch($_POST['blog_feed']);
201
+            $blog_obj = & $blog_handler->fetch($_POST['blog_feed']);
202 202
             $blog_obj->setVar('blog_id', $blog_id);
203
-        } else {
204
-            $blog_obj =& $blog_handler->get($blog_id);
203
+        }else {
204
+            $blog_obj = & $blog_handler->get($blog_id);
205 205
         }
206 206
         $categories = @$_POST['categories'];
207
-        if (empty($categories) && $blog_id > 0) {
207
+        if (empty($categories) && $blog_id>0) {
208 208
             $crit       = new Criteria('bc.blog_id', $blog_id);
209 209
             $categories = array_keys($category_handler->getByBlog($crit));
210 210
         }
@@ -212,22 +212,22 @@  discard block
 block discarded – undo
212 212
             $categories = array(0 => _NONE);
213 213
         }
214 214
 
215
-        echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _EDIT . '</legend>';
215
+        echo "<fieldset><legend style='font-weight: bold; color: #900;'>"._EDIT.'</legend>';
216 216
         echo '<br>';
217 217
         if (empty($blog_id) && $blog_obj->getVar('blog_feed')) {
218 218
             $criteria  = new Criteria('blog_feed', $blog_obj->getVar('blog_feed'));
219
-            $blogs_obj =& $blog_handler->getList($criteria);
220
-            if (count($blogs_obj) > 0) {
221
-                echo "<div class=\"errorMsg\">" . planet_constant('AM_BLOGEXISTS');
219
+            $blogs_obj = & $blog_handler->getList($criteria);
220
+            if (count($blogs_obj)>0) {
221
+                echo "<div class=\"errorMsg\">".planet_constant('AM_BLOGEXISTS');
222 222
                 foreach (array_keys($blogs_obj) as $bid) {
223
-                    echo "<br><a href=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php'
224
-                         . URL_DELIMITER . 'b' . $bid . "\" target=\"_blank\">" . $blogs_obj[$bid] . '</a>';
223
+                    echo "<br><a href=\"".XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php'
224
+                         . URL_DELIMITER.'b'.$bid."\" target=\"_blank\">".$blogs_obj[$bid].'</a>';
225 225
                 }
226 226
                 echo '</div>';
227 227
             }
228 228
             unset($blogs_obj, $criteria);
229 229
         }
230
-        include XOOPS_ROOT_PATH . '/modules/' . $GLOBALS['moddirname'] . '/include/form.blog.php';
230
+        include XOOPS_ROOT_PATH.'/modules/'.$GLOBALS['moddirname'].'/include/form.blog.php';
231 231
         echo '</fieldset>';
232 232
         break;
233 233
 
@@ -255,14 +255,14 @@  discard block
 block discarded – undo
255 255
         $opform->addElement($op_select);
256 256
         $opform->display();
257 257
 
258
-        if ($category_id > 0) {
258
+        if ($category_id>0) {
259 259
             $criteria = new CriteriaCompo(new Criteria('b.blog_status', 0, '>'));
260 260
             $criteria->add(new Criteria('bc.cat_id', $category_id));
261 261
             $blog_count = $blog_handler->getCountByCategory($criteria);
262 262
             $criteria->setStart($start);
263 263
             $criteria->setLimit($xoopsModuleConfig['list_perpage']);
264
-            $blog_objs =& $blog_handler->getByCategory($criteria);
265
-        } else {
264
+            $blog_objs = & $blog_handler->getByCategory($criteria);
265
+        }else {
266 266
             /* All active blogs */
267 267
             if ($category_id == 0) {
268 268
                 $criteria = new Criteria('1', 1);
@@ -279,28 +279,28 @@  discard block
 block discarded – undo
279 279
                 $criteria->setStart($start);
280 280
                 $criteria->setLimit($xoopsModuleConfig['list_perpage']);
281 281
                 /* Pending blogs */
282
-            } else {
282
+            }else {
283 283
                 $criteria = new Criteria('blog_status', 0);
284 284
                 $criteria->setStart($start);
285 285
                 $criteria->setLimit($xoopsModuleConfig['list_perpage']);
286 286
             }
287 287
             $blog_count = $blog_handler->getCount($criteria);
288
-            $blog_objs  =& $blog_handler->getAll($criteria);
288
+            $blog_objs  = & $blog_handler->getAll($criteria);
289 289
         }
290 290
 
291
-        echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . planet_constant('AM_LIST') . '</legend>';
291
+        echo "<fieldset><legend style='font-weight: bold; color: #900;'>".planet_constant('AM_LIST').'</legend>';
292 292
         echo "<br style=\"clear:both\" />";
293 293
 
294
-        echo "<form name='list' id='list' method='post' action='" . xoops_getenv('PHP_SELF') . "'>";
294
+        echo "<form name='list' id='list' method='post' action='".xoops_getenv('PHP_SELF')."'>";
295 295
         echo "<table border='0' cellpadding='4' cellspacing='1' width='100%' class='outer'>";
296 296
         echo "<tr align='center'>";
297 297
         echo "<th class='bg3' width='5%'><input name='blog_check' id='blog_check' value='1' type='checkbox'  onclick=\"xoopsCheckAll('list', 'blog_check');\" /></td>";
298
-        echo "<th class='bg3'>" . planet_constant('AM_TITLE') . '</td>';
299
-        echo "<th class='bg3' width='5%'>" . planet_constant('AM_STATUS') . '</td>';
300
-        echo "<th class='bg3' width='40%'>" . planet_constant('AM_FEED') . '</td>';
298
+        echo "<th class='bg3'>".planet_constant('AM_TITLE').'</td>';
299
+        echo "<th class='bg3' width='5%'>".planet_constant('AM_STATUS').'</td>';
300
+        echo "<th class='bg3' width='40%'>".planet_constant('AM_FEED').'</td>';
301 301
         //        echo "<th class='bg3' width='5%'>" . _EDIT . "</td>";
302 302
         //        echo "<th class='bg3' width='5%'>" . _DELETE . "</td>";
303
-        echo "<th class='bg3' width='10%'>" . planet_constant('AM_ACTIONS') . '</td>';
303
+        echo "<th class='bg3' width='10%'>".planet_constant('AM_ACTIONS').'</td>';
304 304
         echo '</tr>';
305 305
 
306 306
         $status = array(
@@ -310,55 +310,55 @@  discard block
 block discarded – undo
310 310
         );
311 311
         foreach (array_keys($blog_objs) as $bid) {
312 312
             echo "<tr class='odd' align='left'>";
313
-            echo "<td align='center'><input name='blog[]' value='" . $bid . "' type='checkbox' /></td>";
314
-            echo "<td><a href='" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'b'
315
-                 . $bid . "'>" . $blog_objs[$bid]->getVar('blog_title') . '</a></td>';
316
-            echo "<td align='center'>" . $status[$blog_objs[$bid]->getVar('blog_status')] . '</td>';
317
-            echo '<td>' . $blog_objs[$bid]->getVar('blog_feed') . '</td>';
318
-            echo "<td align='center'><a href='admin.blog.php?op=edit&amp;blog=" . $bid . "' title='" . _EDIT
319
-                 . "'><img src='" . $pathIcon16 . "/edit.png '" . "alt='" . _EDIT . " title='" . _EDIT . " </a>
320
-                      <a href='admin.blog.php?op=del&amp;blog=" . $bid . "' title='" . _DELETE . "'><img src='"
321
-                 . $pathIcon16 . "/delete.png '" . " alt='" . _EDIT . " title='" . _DELETE . " </a>&nbsp;
322
-                      <a href='admin.blog.php?op=empty&amp;blog=" . $bid . "' title='"
323
-                 . planet_constant('MD_EMPTY_BLOG') . "'><img src='" . $pathIcon16 . "/empty.png '" . " alt='" . _EDIT
324
-                 . " title='" . planet_constant('MD_EMPTY_BLOG') . '</a></td>';
313
+            echo "<td align='center'><input name='blog[]' value='".$bid."' type='checkbox' /></td>";
314
+            echo "<td><a href='".XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php'.URL_DELIMITER.'b'
315
+                 . $bid."'>".$blog_objs[$bid]->getVar('blog_title').'</a></td>';
316
+            echo "<td align='center'>".$status[$blog_objs[$bid]->getVar('blog_status')].'</td>';
317
+            echo '<td>'.$blog_objs[$bid]->getVar('blog_feed').'</td>';
318
+            echo "<td align='center'><a href='admin.blog.php?op=edit&amp;blog=".$bid."' title='"._EDIT
319
+                 . "'><img src='".$pathIcon16."/edit.png '"."alt='"._EDIT." title='"._EDIT." </a>
320
+                      <a href='admin.blog.php?op=del&amp;blog=" . $bid."' title='"._DELETE."'><img src='"
321
+                 . $pathIcon16."/delete.png '"." alt='"._EDIT." title='"._DELETE." </a>&nbsp;
322
+                      <a href='admin.blog.php?op=empty&amp;blog=" . $bid."' title='"
323
+                 . planet_constant('MD_EMPTY_BLOG')."'><img src='".$pathIcon16."/empty.png '"." alt='"._EDIT
324
+                 . " title='".planet_constant('MD_EMPTY_BLOG').'</a></td>';
325 325
 
326 326
             echo '</tr>';
327 327
         }
328 328
         echo "<tr class='even' align='center'>";
329 329
         echo "<td colspan='7'>";
330 330
         echo "<select name='op' onChange='if (this.options[this.selectedIndex].value==\"register\") {setVisible(\"catdiv\");} else {setHidden(\"catdiv\");}'>";
331
-        echo "<option value=''>" . _SELECT . '</option>';
332
-        echo "<option value='del'>" . _DELETE . '</option>';
333
-        echo "<option value='empty'>" . planet_constant('MD_EMPTY_BLOG') . '</option>';
334
-        echo "<option value='register'>" . planet_constant('AM_REGISTER') . '</option>';
335
-        if ($category_id > 0) {
336
-            echo "<option value='remove'>" . planet_constant('AM_REMOVE') . '</option>';
331
+        echo "<option value=''>"._SELECT.'</option>';
332
+        echo "<option value='del'>"._DELETE.'</option>';
333
+        echo "<option value='empty'>".planet_constant('MD_EMPTY_BLOG').'</option>';
334
+        echo "<option value='register'>".planet_constant('AM_REGISTER').'</option>';
335
+        if ($category_id>0) {
336
+            echo "<option value='remove'>".planet_constant('AM_REMOVE').'</option>';
337 337
         }
338
-        echo "<option value='approve'>" . planet_constant('AM_APPROVE') . '</option>';
339
-        echo "<option value='feature'>" . planet_constant('AM_FEATURE') . '</option>';
340
-        echo "<option value='update'>" . planet_constant('AM_UPDATE') . '</option>';
338
+        echo "<option value='approve'>".planet_constant('AM_APPROVE').'</option>';
339
+        echo "<option value='feature'>".planet_constant('AM_FEATURE').'</option>';
340
+        echo "<option value='update'>".planet_constant('AM_UPDATE').'</option>';
341 341
         echo '</select>';
342 342
         echo "<div id='catdiv' style='visibility:hidden;display:inline;'>";
343 343
         echo "<select name='category_dest'>";
344
-        echo "<option value=''>" . _SELECT . '</option>';
344
+        echo "<option value=''>"._SELECT.'</option>';
345 345
         foreach ($categories as $cid => $name) {
346
-            echo "<option value='" . $cid . "'>" . $name . '</option>';
346
+            echo "<option value='".$cid."'>".$name.'</option>';
347 347
         }
348 348
         echo '</select>';
349 349
         echo '</div>';
350
-        echo "<input name='start' value='" . $start . "' type='hidden' />";
351
-        echo "<input name='category' value='" . $category_id . "' type='hidden' />";
352
-        echo "<input name='submit' value='" . _SUBMIT . "' type='submit' />";
353
-        echo "<input name='' value='" . _CANCEL . "' type='reset' />";
350
+        echo "<input name='start' value='".$start."' type='hidden' />";
351
+        echo "<input name='category' value='".$category_id."' type='hidden' />";
352
+        echo "<input name='submit' value='"._SUBMIT."' type='submit' />";
353
+        echo "<input name='' value='"._CANCEL."' type='reset' />";
354 354
         echo '</td>';
355 355
         echo '</tr>';
356
-        if ($blog_count > $xoopsModuleConfig['list_perpage']) {
357
-            include XOOPS_ROOT_PATH . '/class/pagenav.php';
356
+        if ($blog_count>$xoopsModuleConfig['list_perpage']) {
357
+            include XOOPS_ROOT_PATH.'/class/pagenav.php';
358 358
             $nav     = new XoopsPageNav($blog_count, $xoopsModuleConfig['list_perpage'], $start, 'start',
359
-                                        'category=' . $category_id);
359
+                                        'category='.$category_id);
360 360
             $pagenav = $nav->renderNav(4);
361
-            echo "<tr align='right'><td colspan='6'>" . $pagenav . '</td></tr>';
361
+            echo "<tr align='right'><td colspan='6'>".$pagenav.'</td></tr>';
362 362
         }
363 363
         echo '</table></form>';
364 364
         echo "</fieldset><br style='clear:both;'>";
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
             $button_tray->addElement($butt_cancel);
385 385
             $form_add->addElement($button_tray);
386 386
 
387
-            echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _ADD . '</legend>';
387
+            echo "<fieldset><legend style='font-weight: bold; color: #900;'>"._ADD.'</legend>';
388 388
             echo '<br>';
389 389
             $form->display();
390 390
             $form_add->display();
Please login to merge, or discard this patch.
admin/header.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -25,16 +25,16 @@
 block discarded – undo
25 25
 // Project: Article Project                                                 //
26 26
 // ------------------------------------------------------------------------ //
27 27
 
28
-include_once dirname(dirname(dirname(__DIR__))) . '/include/cp_header.php';
29
-require XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php';
30
-require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/functions.php';
31
-include_once XOOPS_ROOT_PATH . '/Frameworks/art/functions.admin.php';
28
+include_once dirname(dirname(dirname(__DIR__))).'/include/cp_header.php';
29
+require XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/vars.php';
30
+require_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/functions.php';
31
+include_once XOOPS_ROOT_PATH.'/Frameworks/art/functions.admin.php';
32 32
 
33 33
 // include the default language file for the admin interface
34
-if (!@include_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/'
35
-                   . $xoopsConfig['language'] . '/main.php'
34
+if (!@include_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/'
35
+                   . $xoopsConfig['language'].'/main.php'
36 36
 ) {
37
-    include_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/english/main.php';
37
+    include_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/english/main.php';
38 38
 }
39 39
 
40 40
 planet_define_url_delimiter();
Please login to merge, or discard this patch.
admin/admin.category.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -24,18 +24,18 @@  discard block
 block discarded – undo
24 24
 // URL: http://xoops.org                         //
25 25
 // Project: Article Project                                                 //
26 26
 // ------------------------------------------------------------------------ //
27
-include_once __DIR__ . '/admin_header.php';
28
-require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
27
+include_once __DIR__.'/admin_header.php';
28
+require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
29 29
 
30 30
 xoops_cp_header();
31 31
 $indexAdmin = new ModuleAdmin();
32 32
 echo $indexAdmin->addNavigation(basename(__FILE__));
33
-require XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php';
33
+require XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/vars.php';
34 34
 //planet_adminmenu(1);
35 35
 
36 36
 $op     = !empty($_POST['op']) ? $_POST['op'] : (!empty($_GET['op']) ? $_GET['op'] : '');
37 37
 $cat_id = !empty($_POST['category']) ? $_POST['category'] : (!empty($_GET['category']) ? $_GET['category'] : 0);
38
-$cat_id = is_array($cat_id) ? array_map('intval', $cat_id) : (int)$cat_id;
38
+$cat_id = is_array($cat_id) ? array_map('intval', $cat_id) : (int) $cat_id;
39 39
 
40 40
 $category_handler = xoops_getModuleHandler('category', $GLOBALS['moddirname']);
41 41
 $blog_handler     = xoops_getModuleHandler('blog', $GLOBALS['moddirname']);
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
 switch ($op) {
44 44
     case 'save':
45 45
         if ($cat_id) {
46
-            $category_obj =& $category_handler->get($cat_id);
47
-        } else {
48
-            $category_obj =& $category_handler->create();
46
+            $category_obj = & $category_handler->get($cat_id);
47
+        }else {
48
+            $category_obj = & $category_handler->create();
49 49
         }
50 50
 
51 51
         $category_obj->setVar('cat_title', $_POST['cat_title']);
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 
54 54
         if (!$category_handler->insert($category_obj)) {
55 55
             $message = planet_constant('AM_ERROR');
56
-        } else {
56
+        }else {
57 57
             $message = planet_constant('AM_DBUPDATED');
58 58
         }
59 59
         redirect_header('admin.category.php', 2, $message);
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
             $cat_id = array($cat_id);
64 64
         }
65 65
         foreach ($cat_id as $cid) {
66
-            $category_obj =& $category_handler->get($cid);
66
+            $category_obj = & $category_handler->get($cid);
67 67
             if (!$category_handler->delete($category_obj)) {
68 68
             }
69 69
         }
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
 
73 73
     case 'order':
74 74
         $count = count($_POST['cat_order']);
75
-        for ($i = 0; $i < $count; ++$i) {
76
-            $category_obj =& $category_handler->get($_POST['cat'][$i]);
75
+        for ($i = 0; $i<$count; ++$i) {
76
+            $category_obj = & $category_handler->get($_POST['cat'][$i]);
77 77
             $category_obj->setVar('cat_order', $_POST['cat_order'][$i]);
78 78
             $category_handler->insert($category_obj, true);
79 79
             unset($category_obj);
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         redirect_header('admin.category.php', 2, $message);
83 83
 
84 84
     case 'edit':
85
-        $category_obj =& $category_handler->get($cat_id);
85
+        $category_obj = & $category_handler->get($cat_id);
86 86
         $form         = new XoopsThemeForm(_EDIT, 'edit', xoops_getenv('PHP_SELF'));
87 87
         $form->addElement(new XoopsFormText(planet_constant('AM_TITLE'), 'cat_title', 50, 80,
88 88
                                             $category_obj->getVar('cat_title', 'E')), true);
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
         $button_tray->addElement($butt_cancel);
99 99
         $form->addElement($button_tray);
100 100
 
101
-        echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _EDIT . '</legend>';
101
+        echo "<fieldset><legend style='font-weight: bold; color: #900;'>"._EDIT.'</legend>';
102 102
         echo '<br>';
103 103
         $form->display();
104 104
         echo '</fieldset>';
@@ -112,20 +112,20 @@  discard block
 block discarded – undo
112 112
         $blog_counts = $blog_handler->getCountsByCategory();
113 113
         foreach (array_keys($categories) as $cid) {
114 114
             if (!empty($blog_counts[$cid])) {
115
-                $categories[$cid] .= ' (' . (int)$blog_counts[$cid] . ')';
115
+                $categories[$cid] .= ' ('.(int) $blog_counts[$cid].')';
116 116
             }
117 117
         }
118 118
 
119
-        echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . planet_constant('AM_LIST') . '</legend>';
119
+        echo "<fieldset><legend style='font-weight: bold; color: #900;'>".planet_constant('AM_LIST').'</legend>';
120 120
         echo "<br style=\"clear:both;\" />";
121 121
 
122 122
         echo "<form name='list' method='post'>";
123 123
         echo "<table border='0' cellpadding='4' cellspacing='1' width='100%' class='outer'>";
124 124
         echo "<tr align='center'>";
125
-        echo "<th class='bg3' width='5%'>" . planet_constant('AM_ORDER') . '</td>';
126
-        echo "<th align='left' class='bg3' width='80%'>" . planet_constant('AM_TITLE') . '</td>';
127
-        echo "<th class='bg3' width='5%'>" . planet_constant('AM_BLOGCOUNT') . '</td>';
128
-        echo "<th class='bg3' width='5%'>" . planet_constant('AM_ACTIONS') . '</td>';
125
+        echo "<th class='bg3' width='5%'>".planet_constant('AM_ORDER').'</td>';
126
+        echo "<th align='left' class='bg3' width='80%'>".planet_constant('AM_TITLE').'</td>';
127
+        echo "<th class='bg3' width='5%'>".planet_constant('AM_BLOGCOUNT').'</td>';
128
+        echo "<th class='bg3' width='5%'>".planet_constant('AM_ACTIONS').'</td>';
129 129
         //        echo "<td class='bg3' width='5%'>" . _DELETE . "</td>";
130 130
 
131 131
         echo '</tr>';
@@ -133,22 +133,22 @@  discard block
 block discarded – undo
133 133
         $ii = 0;
134 134
         foreach (array_keys($categories) as $cid) {
135 135
             echo "<tr class='odd' align='left'>";
136
-            echo "<td><input type='hidden' name='cat[]' value='" . $cid . "' />";
137
-            echo "<input type='text' name='cat_order[]' value='" . ($ii * 10) . "' /></td>";
138
-            echo '<td>' . $categories[$cid] . '</td>';
139
-            echo "<td align='center'>" . @$blog_counts[$cid] . '</td>';
140
-
141
-            echo "<td align='center'><a href='admin.category.php?op=edit &amp;category='" . $cid . "' title='" . _EDIT
142
-                 . "'><img src='" . $pathIcon16 . "/edit.png '" . "alt='" . _EDIT . "' title='" . _EDIT . "' </a>&nbsp;
143
-                  <a href='admin.category.php?op=del &amp;category='" . $cid . "' title='" . _DELETE . "'><img src='"
144
-                 . $pathIcon16 . "/delete.png '" . " alt='" . _EDIT . "' title='" . _DELETE . "' </a></td>";
136
+            echo "<td><input type='hidden' name='cat[]' value='".$cid."' />";
137
+            echo "<input type='text' name='cat_order[]' value='".($ii*10)."' /></td>";
138
+            echo '<td>'.$categories[$cid].'</td>';
139
+            echo "<td align='center'>".@$blog_counts[$cid].'</td>';
140
+
141
+            echo "<td align='center'><a href='admin.category.php?op=edit &amp;category='".$cid."' title='"._EDIT
142
+                 . "'><img src='".$pathIcon16."/edit.png '"."alt='"._EDIT."' title='"._EDIT."' </a>&nbsp;
143
+                  <a href='admin.category.php?op=del &amp;category='" . $cid."' title='"._DELETE."'><img src='"
144
+                 . $pathIcon16."/delete.png '"." alt='"._EDIT."' title='"._DELETE."' </a></td>";
145 145
             echo '</tr>';
146 146
             ++$ii;
147 147
         }
148 148
         echo "<tr class='even' align='center'>";
149 149
         echo "<td colspan='5'>";
150
-        echo "<input name='submit' value='" . _SUBMIT . "' type='submit' />";
151
-        echo "<input name='' value='" . _CANCEL . "' type='reset' />";
150
+        echo "<input name='submit' value='"._SUBMIT."' type='submit' />";
151
+        echo "<input name='' value='"._CANCEL."' type='reset' />";
152 152
         echo "<input name='op' value='order' type='hidden' />";
153 153
         echo '</td>';
154 154
         echo '</tr>';
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
         $button_tray->addElement($butt_cancel);
168 168
         $form->addElement($button_tray);
169 169
 
170
-        echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _ADD . '</legend>';
170
+        echo "<fieldset><legend style='font-weight: bold; color: #900;'>"._ADD.'</legend>';
171 171
         echo '<br>';
172 172
         $form->display();
173 173
         echo '</fieldset>';
Please login to merge, or discard this patch.
admin/admin_header.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
  */
19 19
 
20 20
 $path = dirname(dirname(dirname(__DIR__)));
21
-include_once $path . '/mainfile.php';
22
-include_once $path . '/include/cp_functions.php';
23
-require_once $path . '/include/cp_header.php';
21
+include_once $path.'/mainfile.php';
22
+include_once $path.'/include/cp_functions.php';
23
+require_once $path.'/include/cp_header.php';
24 24
 
25 25
 global $xoopsModule;
26 26
 
@@ -34,21 +34,21 @@  discard block
 block discarded – undo
34 34
 xoops_loadLanguage('modinfo', $moduleDirName);
35 35
 xoops_loadLanguage('main', $moduleDirName);
36 36
 
37
-$pathIcon16      = '../' . $xoopsModule->getInfo('icons16');
38
-$pathIcon32      = '../' . $xoopsModule->getInfo('icons32');
37
+$pathIcon16      = '../'.$xoopsModule->getInfo('icons16');
38
+$pathIcon32      = '../'.$xoopsModule->getInfo('icons32');
39 39
 $pathModuleAdmin = $xoopsModule->getInfo('dirmoduleadmin');
40 40
 
41
-include_once $GLOBALS['xoops']->path($pathModuleAdmin . '/moduleadmin.php');
41
+include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php');
42 42
 
43
-require XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php';
44
-require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/functions.php';
45
-include_once XOOPS_ROOT_PATH . '/Frameworks/art/functions.admin.php';
43
+require XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/vars.php';
44
+require_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/functions.php';
45
+include_once XOOPS_ROOT_PATH.'/Frameworks/art/functions.admin.php';
46 46
 
47 47
 // include the default language file for the admin interface
48
-if (!@include_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/'
49
-                   . $xoopsConfig['language'] . '/main.php'
48
+if (!@include_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/'
49
+                   . $xoopsConfig['language'].'/main.php'
50 50
 ) {
51
-    include_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/english/main.php';
51
+    include_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/english/main.php';
52 52
 }
53 53
 
54 54
 planet_define_url_delimiter();
Please login to merge, or discard this patch.
notification_update.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,5 +28,5 @@
 block discarded – undo
28 28
 // URL: http://www.myweb.ne.jp/, http://xoops.org/, http://jp.xoops.org/ //
29 29
 // Project: XOOPS Project                                                    //
30 30
 // ------------------------------------------------------------------------- //
31
-include dirname(dirname(__DIR__)) . '/mainfile.php';
32
-include XOOPS_ROOT_PATH . '/include/notification_update.php';
31
+include dirname(dirname(__DIR__)).'/mainfile.php';
32
+include XOOPS_ROOT_PATH.'/include/notification_update.php';
Please login to merge, or discard this patch.
action.rate.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -25,11 +25,11 @@  discard block
 block discarded – undo
25 25
 // Project: Article Project                                                 //
26 26
 // ------------------------------------------------------------------------ //
27 27
 
28
-include __DIR__ . '/header.php';
28
+include __DIR__.'/header.php';
29 29
 
30
-$rate       = (int)(!empty($_POST['rate']) ? $_POST['rate'] : (!empty($_GET['rate']) ? $_GET['rate'] : 0));
31
-$article_id = (int)(!empty($_POST['article']) ? $_POST['article'] : (!empty($_GET['article']) ? $_GET['article'] : 0));
32
-$blog_id    = (int)(!empty($_POST['blog']) ? $_POST['blog'] : (!empty($_GET['blog']) ? $_GET['blog'] : 0));
30
+$rate       = (int) (!empty($_POST['rate']) ? $_POST['rate'] : (!empty($_GET['rate']) ? $_GET['rate'] : 0));
31
+$article_id = (int) (!empty($_POST['article']) ? $_POST['article'] : (!empty($_GET['article']) ? $_GET['article'] : 0));
32
+$blog_id    = (int) (!empty($_POST['blog']) ? $_POST['blog'] : (!empty($_GET['blog']) ? $_GET['blog'] : 0));
33 33
 
34 34
 if (empty($article_id) && empty($blog_id)) {
35 35
     redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_INVALID'));
@@ -39,28 +39,28 @@  discard block
 block discarded – undo
39 39
 $blog_handler    = xoops_getModuleHandler('blog', $GLOBALS['moddirname']);
40 40
 if (empty($xoopsModuleConfig['anonymous_rate']) && !is_object($xoopsUser)) {
41 41
     $message = planet_constant('MD_NOACCESS');
42
-} else {
42
+}else {
43 43
     $uid = is_object($xoopsUser) ? $xoopsUser->getVar('uid') : 0;
44 44
     $ip  = planet_getIP();
45
-    if ($article_id > 0) {
45
+    if ($article_id>0) {
46 46
         $criteria = new CriteriaCompo(new Criteria('art_id', $article_id));
47
-    } else {
47
+    }else {
48 48
         $criteria = new CriteriaCompo(new Criteria('blog_id', $blog_id));
49 49
     }
50
-    if ($uid > 0) {
50
+    if ($uid>0) {
51 51
         $criteria->add(new Criteria('rate_uid', $uid));
52
-    } else {
52
+    }else {
53 53
         $criteria->add(new Criteria('rate_ip', $ip));
54
-        $criteria->add(new Criteria('rate_time', time() - 24 * 3600, '>'));
54
+        $criteria->add(new Criteria('rate_time', time()-24*3600, '>'));
55 55
     }
56 56
     $rate_handler = xoops_getModuleHandler('rate', $GLOBALS['moddirname']);
57 57
     if ($count = $rate_handler->getCount($criteria)) {
58 58
         $message = planet_constant('MD_ALREADYRATED');
59
-    } else {
60
-        $rate_obj =& $rate_handler->create();
61
-        if ($article_id > 0) {
59
+    }else {
60
+        $rate_obj = & $rate_handler->create();
61
+        if ($article_id>0) {
62 62
             $rate_obj->setVar('art_id', $article_id);
63
-        } else {
63
+        }else {
64 64
             $rate_obj->setVar('blog_id', $blog_id);
65 65
         }
66 66
         $rate_obj->setVar('rate_uid', $uid);
@@ -70,25 +70,25 @@  discard block
 block discarded – undo
70 70
         if (!$rate_id = $rate_handler->insert($rate_obj, true)) {
71 71
             redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_NOTSAVED'));
72 72
         }
73
-        if ($article_id > 0) {
74
-            $article_obj =& $article_handler->get($article_id);
75
-            $article_obj->setVar('art_rating', $article_obj->getVar('art_rating') + $rate);
76
-            $article_obj->setVar('art_rates', $article_obj->getVar('art_rates') + 1);
73
+        if ($article_id>0) {
74
+            $article_obj = & $article_handler->get($article_id);
75
+            $article_obj->setVar('art_rating', $article_obj->getVar('art_rating')+$rate);
76
+            $article_obj->setVar('art_rates', $article_obj->getVar('art_rates')+1);
77 77
             $article_handler->insert($article_obj, true);
78
-        } else {
79
-            $blog_obj =& $blog_handler->get($blog_id);
80
-            $blog_obj->setVar('blog_rating', $blog_obj->getVar('blog_rating') + $rate);
81
-            $blog_obj->setVar('blog_rates', $blog_obj->getVar('blog_rates') + 1);
78
+        }else {
79
+            $blog_obj = & $blog_handler->get($blog_id);
80
+            $blog_obj->setVar('blog_rating', $blog_obj->getVar('blog_rating')+$rate);
81
+            $blog_obj->setVar('blog_rates', $blog_obj->getVar('blog_rates')+1);
82 82
             $blog_handler->insert($blog_obj, true);
83 83
         }
84 84
         $message = planet_constant('MD_ACTIONDONE');
85 85
     }
86 86
 }
87
-if ($article_id > 0) {
88
-    redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . ''
87
+if ($article_id>0) {
88
+    redirect_header(XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.article.php'.URL_DELIMITER.''
89 89
                     . $article_id, 2, $message);
90
-} else {
91
-    redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'b' . $blog_id, 2,
90
+}else {
91
+    redirect_header(XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php'.URL_DELIMITER.'b'.$blog_id, 2,
92 92
                     $message);
93 93
 }
94
-include __DIR__ . '/footer.php';
94
+include __DIR__.'/footer.php';
Please login to merge, or discard this patch.
action.article.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -25,17 +25,17 @@  discard block
 block discarded – undo
25 25
 // Project: Article Project                                                 //
26 26
 // ------------------------------------------------------------------------ //
27 27
 
28
-include __DIR__ . '/header.php';
28
+include __DIR__.'/header.php';
29 29
 
30
-$art_id = (int)(isset($_GET['article']) ? $_GET['article'] : (isset($_POST['article']) ? $_POST['article'] : 0));
30
+$art_id = (int) (isset($_GET['article']) ? $_GET['article'] : (isset($_POST['article']) ? $_POST['article'] : 0));
31 31
 if (empty($art_id)) {
32 32
     redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_INVALID'));
33 33
 }
34 34
 if (!$xoopsUser->isAdmin()) {
35 35
     redirect_header('javascript:history.go(-1);', 2, _NOPERM);
36 36
 }
37
-include XOOPS_ROOT_PATH . '/header.php';
38
-include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php';
37
+include XOOPS_ROOT_PATH.'/header.php';
38
+include XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/vars.php';
39 39
 
40 40
 $article_handler = xoops_getModuleHandler('article', $GLOBALS['moddirname']);
41 41
 $article_obj     = $article_handler->get($art_id);
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 
45 45
 if ($op === 'del' || !empty($_POST['del'])) {
46 46
     $article_handler->delete($article_obj);
47
-    $redirect = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php';
47
+    $redirect = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php';
48 48
     $message  = planet_constant('MD_SAVED');
49 49
     redirect_header($redirect, 2, $message);
50 50
 } elseif ($op === 'save') {
@@ -65,16 +65,16 @@  discard block
 block discarded – undo
65 65
 
66 66
     $art_id_new = $article_handler->insert($article_obj);
67 67
     if (!$article_obj->getVar('art_id')) {
68
-        $redirect = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php';
68
+        $redirect = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php';
69 69
         $message  = planet_constant('MD_INSERTERROR');
70
-    } else {
71
-        $redirect = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . ''
70
+    }else {
71
+        $redirect = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.article.php'.URL_DELIMITER.''
72 72
                     . $article_obj->getVar('art_id');
73 73
         $message  = planet_constant('MD_SAVED');
74 74
     }
75 75
     redirect_header($redirect, 2, $message);
76
-} else {
77
-    require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
76
+}else {
77
+    require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
78 78
 
79 79
     $form = new XoopsThemeForm(_EDIT, 'formarticle', xoops_getenv('PHP_SELF'));
80 80
 
@@ -97,10 +97,10 @@  discard block
 block discarded – undo
97 97
     $butt_del->setExtra("onClick='document.forms.formarticle.op.value=del'");
98 98
     $button_tray->addElement($butt_del);
99 99
     $butt_cancel = new XoopsFormButton('', 'cancel', _CANCEL, 'button');
100
-    $butt_cancel->setExtra("onclick='window.document.location=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname']
101
-                           . '/view.article.php' . URL_DELIMITER . '' . (int)$art_id . "\"'");
100
+    $butt_cancel->setExtra("onclick='window.document.location=\"".XOOPS_URL.'/modules/'.$GLOBALS['moddirname']
101
+                           . '/view.article.php'.URL_DELIMITER.''.(int) $art_id."\"'");
102 102
     $button_tray->addElement($butt_cancel);
103 103
     $form->addElement($button_tray);
104 104
     $form->display();
105 105
 }
106
-include XOOPS_ROOT_PATH . '/footer.php';
106
+include XOOPS_ROOT_PATH.'/footer.php';
Please login to merge, or discard this patch.
view.archive.php 1 patch
Spacing   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 // URL: http://xoops.org                         //
25 25
 // Project: Article Project                                                 //
26 26
 // ------------------------------------------------------------------------ //
27
-include __DIR__ . '/header.php';
27
+include __DIR__.'/header.php';
28 28
 
29 29
 if (planet_parse_args($args_num, $args, $args_str)) {
30 30
     $args['year']  = @$args_num[0];
@@ -32,37 +32,37 @@  discard block
 block discarded – undo
32 32
     $args['day']   = @$args_num[2];
33 33
 }
34 34
 
35
-$day     = (int)(empty($_GET['day']) ? @$args['day'] : $_GET['day']);
36
-$year    = (int)(empty($_GET['year']) ? @$args['year'] : $_GET['year']);
37
-$month   = (int)(empty($_GET['month']) ? @$args['month'] : $_GET['month']);
38
-$blog_id = (int)(empty($_GET['blog']) ? @$args['blog'] : $_GET['blog']);
39
-$start   = (int)(empty($_GET['start']) ? @$args['start'] : $_GET['start']);
35
+$day     = (int) (empty($_GET['day']) ? @$args['day'] : $_GET['day']);
36
+$year    = (int) (empty($_GET['year']) ? @$args['year'] : $_GET['year']);
37
+$month   = (int) (empty($_GET['month']) ? @$args['month'] : $_GET['month']);
38
+$blog_id = (int) (empty($_GET['blog']) ? @$args['blog'] : $_GET['blog']);
39
+$start   = (int) (empty($_GET['start']) ? @$args['start'] : $_GET['start']);
40 40
 
41 41
 $page['title'] = planet_constant('MD_ACHIVE');
42 42
 
43 43
 $article_handler = xoops_getModuleHandler('article', $GLOBALS['moddirname']);
44 44
 $blog_handler    = xoops_getModuleHandler('blog', $GLOBALS['moddirname']);
45 45
 
46
-$xoopsOption['xoops_pagetitle'] = $xoopsModule->getVar('name') . ' - ' . planet_constant('MD_ACHIVE');
46
+$xoopsOption['xoops_pagetitle'] = $xoopsModule->getVar('name').' - '.planet_constant('MD_ACHIVE');
47 47
 $xoopsOption['template_main']   = planet_getTemplate('archive');
48
-include_once XOOPS_ROOT_PATH . '/header.php';
49
-include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php';
48
+include_once XOOPS_ROOT_PATH.'/header.php';
49
+include XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/vars.php';
50 50
 
51 51
 $year = empty($year) ? date('Y') : $year;
52
-if ($month < 1) {
52
+if ($month<1) {
53 53
     $month        = $day = 0;
54 54
     $page['time'] = sprintf(planet_constant('MD_TIME_Y'), $year);
55
-} elseif ($day < 1) {
55
+} elseif ($day<1) {
56 56
     $day          = 0;
57 57
     $page['time'] = sprintf(planet_constant('MD_TIME_YM'), $year, $month);
58
-} else {
58
+}else {
59 59
     $page['time'] = sprintf(planet_constant('MD_TIME_YMD'), $year, $month, $day);
60 60
 }
61 61
 $time = array('year' => $year, 'month' => $month, 'day' => $day);
62 62
 if ($xoopsUser) {
63
-    $timeoffset = ($xoopsUser->getVar('timezone_offset') - $xoopsConfig['server_TZ']) * 3600;
64
-} else {
65
-    $timeoffset = ($xoopsConfig['default_TZ'] - $xoopsConfig['server_TZ']) * 3600;
63
+    $timeoffset = ($xoopsUser->getVar('timezone_offset')-$xoopsConfig['server_TZ'])*3600;
64
+}else {
65
+    $timeoffset = ($xoopsConfig['default_TZ']-$xoopsConfig['server_TZ'])*3600;
66 66
 }
67 67
 
68 68
 $criteria = new CriteriaCompo();
@@ -79,13 +79,13 @@  discard block
 block discarded – undo
79 79
 $criteria->setStart($start);
80 80
 $criteria->setLimit($xoopsModuleConfig['articles_perpage']);
81 81
 
82
-$articles_obj   =& $article_handler->getAll($criteria, array('uid', 'art_title', 'art_time', 'blog_id', 'art_content'));
82
+$articles_obj   = & $article_handler->getAll($criteria, array('uid', 'art_title', 'art_time', 'blog_id', 'art_content'));
83 83
 $articles_count = $article_handler->getCount($criteria);
84 84
 
85 85
 $articles = array();
86 86
 $blogs_id = array();
87 87
 foreach ($articles_obj as $id => $article) {
88
-    $articles[]                            = array(
88
+    $articles[] = array(
89 89
         'id'      => $id,
90 90
         'blog'    => array('id' => $article->getVar('blog_id'), 'title' => ''),
91 91
         'title'   => $article->getVar('art_title'),
@@ -96,22 +96,22 @@  discard block
 block discarded – undo
96 96
     $blogs_id[$article->getVar('blog_id')] = 1;
97 97
     unset($_article);
98 98
 }
99
-$criteria_blog = new Criteria('blog_id', '(' . implode(',', array_keys($blog_array)) . ')', 'IN');
99
+$criteria_blog = new Criteria('blog_id', '('.implode(',', array_keys($blog_array)).')', 'IN');
100 100
 $blogs         = $blog_handler->getList($criteria_blog);
101 101
 foreach (array_keys($articles) as $key) {
102 102
     $articles[$key]['blog']['title'] = $blogs[$articles[$key]['blog']['id']];
103 103
 }
104
-if ($blog_id > 0) {
105
-    $page['blog'] = $blogs[$blog_id];;
104
+if ($blog_id>0) {
105
+    $page['blog'] = $blogs[$blog_id]; ;
106 106
 }
107 107
 
108
-if ($articles_count > $xoopsModuleConfig['articles_perpage']) {
109
-    include XOOPS_ROOT_PATH . '/class/pagenav.php';
108
+if ($articles_count>$xoopsModuleConfig['articles_perpage']) {
109
+    include XOOPS_ROOT_PATH.'/class/pagenav.php';
110 110
     $nav     = new XoopsPageNav($articles_count, $xoopsModuleConfig['articles_perpage'], $start, 'start',
111
-                                'month=' . $month . '&amp;day=' . $day . '&amp;year=' . $year . '&amp;blog='
112
-                                . (int)$blog_id);
111
+                                'month='.$month.'&amp;day='.$day.'&amp;year='.$year.'&amp;blog='
112
+                                . (int) $blog_id);
113 113
     $pagenav = $nav->renderNav(4);
114
-} else {
114
+}else {
115 115
     $pagenav = '';
116 116
 }
117 117
 
@@ -120,46 +120,46 @@  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 = array();
137 137
         while ($myrow = $xoopsDB->fetchArray($result)) {
138 138
             $months[] = array(
139
-                'title' => planet_constant('MD_MONTH_' . (int)$myrow['mon']) . ' (' . (int)$myrow['count'] . ')',
140
-                'url'   => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . ''
141
-                           . $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.''
141
+                           . $year.'/'.$myrow['mon'].'/b'.$blog_id
142 142
             );
143 143
         }
144 144
         $timenav['prev'] = array(
145
-            'url'   => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . ''
146
-                       . ($year - 1) . '/b' . $blog_id,
147
-            'title' => sprintf(planet_constant('MD_TIME_Y'), $year - 1)
145
+            'url'   => XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.archive.php'.URL_DELIMITER.''
146
+                       . ($year-1).'/b'.$blog_id,
147
+            'title' => sprintf(planet_constant('MD_TIME_Y'), $year-1)
148 148
         );
149
-        if ($year < date('Y')) {
149
+        if ($year<date('Y')) {
150 150
             $timenav['next'] = array(
151
-                'url'   => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . ''
152
-                           . ($year + 1) . '/b' . $blog_id,
153
-                'title' => sprintf(planet_constant('MD_TIME_Y'), $year + 1)
151
+                'url'   => XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.archive.php'.URL_DELIMITER.''
152
+                           . ($year+1).'/b'.$blog_id,
153
+                'title' => sprintf(planet_constant('MD_TIME_Y'), $year+1)
154 154
             );
155 155
         }
156 156
     } // Get daily list
157 157
     elseif (empty($day)) {
158
-        $sql    = "SELECT DAY(FROM_UNIXTIME(art_time - $timeoffset)) AS day, COUNT(DISTINCT a.art_id) AS count
159
-            FROM " . planet_DB_prefix('article') . "
158
+        $sql = "SELECT DAY(FROM_UNIXTIME(art_time - $timeoffset)) AS day, COUNT(DISTINCT a.art_id) AS count
159
+            FROM ".planet_DB_prefix('article')."
160 160
             WHERE YEAR(FROM_UNIXTIME(art_time - $timeoffset)) = $year
161 161
             AND MONTH(FROM_UNIXTIME(art_time - $timeoffset)) = $month
162
-            " . $blog_criteria . '
162
+            ".$blog_criteria.'
163 163
             GROUP BY day
164 164
             ';
165 165
         $result = $xoopsDB->query($sql);
@@ -167,38 +167,38 @@  discard block
 block discarded – undo
167 167
         while ($myrow = $xoopsDB->fetchArray($result)) {
168 168
             $days[$myrow['day']]['count'] = $myrow['count'];
169 169
         }
170
-        for ($i = 1; $i <= 31; ++$i) {
170
+        for ($i = 1; $i<=31; ++$i) {
171 171
             if (!isset($days[$i])) {
172 172
                 continue;
173 173
             }
174 174
             $days[$i] = array(
175 175
                 'title' => $days[$i]['count'],
176
-                'url'   => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . ''
177
-                           . $year . '/' . $month . '/' . $i . '/b' . $blog_id
176
+                'url'   => XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.archive.php'.URL_DELIMITER.''
177
+                           . $year.'/'.$month.'/'.$i.'/b'.$blog_id
178 178
             );
179 179
         }
180 180
         $calendar   = planet_getCalendar($year, $month, $days);
181
-        $month_next = $month + 1;
182
-        $month_prev = $month - 1;
181
+        $month_next = $month+1;
182
+        $month_prev = $month-1;
183 183
         $_year      = $year;
184 184
         if ($month == 12) {
185 185
             $month_next = 1;
186
-            $_year      = $year + 1;
186
+            $_year      = $year+1;
187 187
         }
188 188
         if ($month == 1) {
189 189
             $month_pre = 12;
190
-            $_year     = $year - 1;
190
+            $_year     = $year-1;
191 191
         }
192 192
         $timenav['prev'] = array(
193
-            'url'   => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . ''
194
-                       . $_year . '/' . $month_prev . '/b' . $blog_id,
195
-            'title' => planet_constant('MD_MONTH_' . $month_prev)
193
+            'url'   => XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.archive.php'.URL_DELIMITER.''
194
+                       . $_year.'/'.$month_prev.'/b'.$blog_id,
195
+            'title' => planet_constant('MD_MONTH_'.$month_prev)
196 196
         );
197
-        if ($year < date('Y') || $month < date('n')) {
197
+        if ($year<date('Y') || $month<date('n')) {
198 198
             $timenav['next'] = array(
199
-                'url'   => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . ''
200
-                           . $_year . '/' . $month_next . '/b' . $blog_id,
201
-                'title' => planet_constant('MD_MONTH_' . $month_next)
199
+                'url'   => XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.archive.php'.URL_DELIMITER.''
200
+                           . $_year.'/'.$month_next.'/b'.$blog_id,
201
+                'title' => planet_constant('MD_MONTH_'.$month_next)
202 202
             );
203 203
         }
204 204
     }
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 $xoopsTpl->assign('timenav', $timenav);
219 219
 $xoopsTpl->assign('pagenav', $pagenav);
220 220
 
221
-include_once __DIR__ . '/footer.php';
221
+include_once __DIR__.'/footer.php';
222 222
 
223 223
 /**
224 224
  * @param null $year
@@ -234,25 +234,25 @@  discard block
 block discarded – undo
234 234
     ob_start();
235 235
     echo '<table id="calendar">';
236 236
     echo '<caption>';
237
-    printf(planet_constant('MD_TIME_YM'), $year, planet_constant('MD_MONTH_' . $month));
237
+    printf(planet_constant('MD_TIME_YM'), $year, planet_constant('MD_MONTH_'.$month));
238 238
     echo '</caption>';
239 239
 
240
-    for ($i = 1; $i <= 7; ++$i) {
241
-        echo "\n\t\t<th abbr=\"" . planet_constant('MD_WEEK_' . $i) . "\" scope=\"col\" title=\""
242
-             . planet_constant('MD_WEEK_' . $i) . "\">" . planet_constant('MD_WEEK_' . $i) . '</th>';
240
+    for ($i = 1; $i<=7; ++$i) {
241
+        echo "\n\t\t<th abbr=\"".planet_constant('MD_WEEK_'.$i)."\" scope=\"col\" title=\""
242
+             . planet_constant('MD_WEEK_'.$i)."\">".planet_constant('MD_WEEK_'.$i).'</th>';
243 243
     }
244 244
 
245 245
     echo '<tr>';
246 246
 
247 247
     // See how much we should pad in the beginning
248 248
     $week_begins = 1;
249
-    $pad         = planet_calendar_week_mod(date('w', $unixmonth) - $week_begins);
249
+    $pad         = planet_calendar_week_mod(date('w', $unixmonth)-$week_begins);
250 250
     if (0 != $pad) {
251
-        echo "\n\t\t" . '<td colspan="' . $pad . '">&nbsp;</td>';
251
+        echo "\n\t\t".'<td colspan="'.$pad.'">&nbsp;</td>';
252 252
     }
253 253
 
254
-    $daysinmonth = (int)date('t', $unixmonth);
255
-    for ($day = 1; $day <= $daysinmonth; ++$day) {
254
+    $daysinmonth = (int) date('t', $unixmonth);
255
+    for ($day = 1; $day<=$daysinmonth; ++$day) {
256 256
         if (isset($newrow) && $newrow) {
257 257
             echo "\n\t</tr>\n\t<tr>\n\t\t";
258 258
         }
@@ -261,26 +261,26 @@  discard block
 block discarded – undo
261 261
         echo '<td>';
262 262
 
263 263
         if (!empty($days[$day]['url'])) {
264
-            echo '<a href="' . $days[$day]['url'] . "\"";
264
+            echo '<a href="'.$days[$day]['url']."\"";
265 265
             if (!empty($days[$day]['title'])) {
266
-                echo "title=\"" . $days[$day]['title'] . "\"";
266
+                echo "title=\"".$days[$day]['title']."\"";
267 267
             }
268 268
             echo ">$day</a>";
269 269
         } elseif (!empty($days[$day]['title'])) {
270
-            echo "<acronym title=\"" . $days[$day]['title'] . "\">$day</acronym>";
271
-        } else {
270
+            echo "<acronym title=\"".$days[$day]['title']."\">$day</acronym>";
271
+        }else {
272 272
             echo $day;
273 273
         }
274 274
         echo '</td>';
275 275
 
276
-        if (6 == planet_calendar_week_mod(date('w', mktime(0, 0, 0, $month, $day, $year)) - $week_begins)) {
276
+        if (6 == planet_calendar_week_mod(date('w', mktime(0, 0, 0, $month, $day, $year))-$week_begins)) {
277 277
             $newrow = true;
278 278
         }
279 279
     }
280 280
 
281
-    $pad = 7 - planet_calendar_week_mod(date('w', mktime(0, 0, 0, $month, $day, $year)) - $week_begins);
281
+    $pad = 7-planet_calendar_week_mod(date('w', mktime(0, 0, 0, $month, $day, $year))-$week_begins);
282 282
     if ($pad != 0 && $pad != 7) {
283
-        echo "\n\t\t" . '<td class="pad" colspan="' . $pad . '">&nbsp;</td>';
283
+        echo "\n\t\t".'<td class="pad" colspan="'.$pad.'">&nbsp;</td>';
284 284
     }
285 285
 
286 286
     echo "\n\t</tr>\n\t</tbody>\n\t</table>";
@@ -298,5 +298,5 @@  discard block
 block discarded – undo
298 298
 function planet_calendar_week_mod($num) {
299 299
     $base = 7;
300 300
 
301
-    return ($num - $base * floor($num / $base));
301
+    return ($num-$base*floor($num/$base));
302 302
 }
Please login to merge, or discard this patch.