Completed
Push — master ( 2f8aec...b781ca )
by Richard
16s
created
htdocs/modules/publisher/admin/clone.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 use Xoops\Form\ThemeForm;
24 24
 use XoopsModules\Publisher;
25 25
 
26
-require_once __DIR__ . '/admin_header.php';
26
+require_once __DIR__.'/admin_header.php';
27 27
 
28 28
 $xoops = Xoops::getInstance();
29 29
 Publisher\Utils::cpHeader();
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     }
45 45
 
46 46
     // Check wether the cloned module exists or not
47
-    if ($clone && is_dir(XoopsBaseConfig::get('root-path') . '/modules/' . $clone)) {
47
+    if ($clone && is_dir(XoopsBaseConfig::get('root-path').'/modules/'.$clone)) {
48 48
         $xoops->redirect('clone.php', 3, sprintf(_AM_PUBLISHER_CLONE_EXISTS, $clone));
49 49
     }
50 50
 
@@ -60,8 +60,8 @@  discard block
 block discarded – undo
60 60
     $logocreated = publisher_createLogo(mb_strtolower($clone));
61 61
 
62 62
     $msg = '';
63
-    if (is_dir(XoopsBaseConfig::get('root-path') . '/modules/' . mb_strtolower($clone))) {
64
-        $msg .= sprintf(_AM_PUBLISHER_CLONE_CONGRAT, "<a href='" . XoopsBaseConfig::get('url') . "/modules/system/admin.php?fct=modulesadmin'>" . ucfirst(mb_strtolower($clone)) . '</a>') . "<br>\n";
63
+    if (is_dir(XoopsBaseConfig::get('root-path').'/modules/'.mb_strtolower($clone))) {
64
+        $msg .= sprintf(_AM_PUBLISHER_CLONE_CONGRAT, "<a href='".XoopsBaseConfig::get('url')."/modules/system/admin.php?fct=modulesadmin'>".ucfirst(mb_strtolower($clone)).'</a>')."<br>\n";
65 65
         if (!$logocreated) {
66 66
             $msg .= _AM_PUBLISHER_CLONE_IMAGEFAIL;
67 67
         }
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
         }
156 156
     }
157 157
 
158
-    if (!XoopsLoad::fileExists($imageBase = XoopsBaseConfig::get('root-path') . '/modules/' . $dirname . '/images/module_logo.png') || !XoopsLoad::fileExists($font = XoopsBaseConfig::get('root-path') . '/modules/' . $dirname . '/images/VeraBd.ttf')) {
158
+    if (!XoopsLoad::fileExists($imageBase = XoopsBaseConfig::get('root-path').'/modules/'.$dirname.'/images/module_logo.png') || !XoopsLoad::fileExists($font = XoopsBaseConfig::get('root-path').'/modules/'.$dirname.'/images/VeraBd.ttf')) {
159 159
         return false;
160 160
     }
161 161
 
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
     $white = imagecolorallocatealpha($imageModule, 255, 255, 255, 127);
175 175
     imagefill($imageModule, 0, 0, $white);
176 176
     imagecolortransparent($imageModule, $white);
177
-    imagepng($imageModule, XoopsBaseConfig::get('root-path') . '/modules/' . $dirname . '/images/module_logo.png');
177
+    imagepng($imageModule, XoopsBaseConfig::get('root-path').'/modules/'.$dirname.'/images/module_logo.png');
178 178
     imagedestroy($imageModule);
179 179
 
180 180
     return true;
Please login to merge, or discard this patch.
htdocs/modules/publisher/makepdf.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
  * @author          trabis <[email protected]>
26 26
  * @author          Sina Asghari (AKA stranger) <[email protected]>
27 27
  */
28
-require_once __DIR__ . '/header.php';
28
+require_once __DIR__.'/header.php';
29 29
 $xoops = Xoops::getInstance();
30 30
 $xoops->disableErrorReporting();
31 31
 
@@ -73,6 +73,6 @@  discard block
 block discarded – undo
73 73
 $xoops->service('htmltopdf')->setKeywords($itemObj->getVar('meta_keywords'));
74 74
 $xoops->service('htmltopdf')->setSubject($categoryObj->getVar('name'));
75 75
 $xoops->service('htmltopdf')->addHtml($content);
76
-$name = $itemObj->getVar('short_url') . '.pdf';
76
+$name = $itemObj->getVar('short_url').'.pdf';
77 77
 $xoops->service('htmltopdf')->outputPdfInline($name);
78 78
 exit();
Please login to merge, or discard this patch.
htdocs/modules/publisher/search.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
  * @author          Taiwen Jiang <[email protected]>
25 25
  * @version         $Id$
26 26
  */
27
-require_once __DIR__ . '/header.php';
27
+require_once __DIR__.'/header.php';
28 28
 $xoops = Xoops::getInstance();
29 29
 
30 30
 $helper = Helper::getInstance();
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 //Checking general permissions
35 35
 $xoopsConfigSearch = $xoops->getConfigs();
36 36
 if (empty($xoopsConfigSearch['enable_search'])) {
37
-    $xoops->redirect(PUBLISHER_URL . '/index.php', 2, XoopsLocale::E_NO_ACCESS_PERMISSION);
37
+    $xoops->redirect(PUBLISHER_URL.'/index.php', 2, XoopsLocale::E_NO_ACCESS_PERMISSION);
38 38
 }
39 39
 
40 40
 $groups = $xoops->getUserGroups();
@@ -93,12 +93,12 @@  discard block
 block discarded – undo
93 93
             }
94 94
         }
95 95
         if (0 == count($queries)) {
96
-            $xoops->redirect(PUBLISHER_URL . '/search.php', 2, sprintf(XoopsLocale::EF_KEYWORDS_MUST_BE_GREATER_THAN, $xoopsConfigSearch['keyword_min']));
96
+            $xoops->redirect(PUBLISHER_URL.'/search.php', 2, sprintf(XoopsLocale::EF_KEYWORDS_MUST_BE_GREATER_THAN, $xoopsConfigSearch['keyword_min']));
97 97
             exit();
98 98
         }
99 99
     } else {
100 100
         if (mb_strlen($query) < $xoopsConfigSearch['keyword_min']) {
101
-            $xoops->redirect(PUBLISHER_URL . '/search.php', 2, sprintf(XoopsLocale::EF_KEYWORDS_MUST_BE_GREATER_THAN, $xoopsConfigSearch['keyword_min']));
101
+            $xoops->redirect(PUBLISHER_URL.'/search.php', 2, sprintf(XoopsLocale::EF_KEYWORDS_MUST_BE_GREATER_THAN, $xoopsConfigSearch['keyword_min']));
102 102
             exit();
103 103
         }
104 104
         $queries = [$query];
@@ -110,8 +110,8 @@  discard block
 block discarded – undo
110 110
     if (!empty($search_username)) {
111 111
         $uname_required = true;
112 112
         $search_username = $search_username;
113
-        if (!$result = $xoopsDB->query('SELECT uid FROM ' . $xoopsDB->prefix('users') . ' WHERE uname LIKE ' . $xoopsDB->quoteString("%$search_username%"))) {
114
-            $xoops->redirect(PUBLISHER_URL . '/search.php', 1, _CO_PUBLISHER_ERROR);
113
+        if (!$result = $xoopsDB->query('SELECT uid FROM '.$xoopsDB->prefix('users').' WHERE uname LIKE '.$xoopsDB->quoteString("%$search_username%"))) {
114
+            $xoops->redirect(PUBLISHER_URL.'/search.php', 1, _CO_PUBLISHER_ERROR);
115 115
             exit();
116 116
         }
117 117
         $uid = [];
@@ -156,29 +156,29 @@  discard block
 block discarded – undo
156 156
         unset($next_search);
157 157
         unset($items);
158 158
     }
159
-    $search_url = $helper->url('search.php?' . $paras);
159
+    $search_url = $helper->url('search.php?'.$paras);
160 160
 
161 161
     if (count($results)) {
162 162
         $next = $start + $limit;
163 163
         $queries = implode(',', $queries);
164
-        $search_url_next = $search_url . "&start={$next}";
165
-        $search_next = '<a href="' . htmlspecialchars($search_url_next) . '">' . XoopsLocale::NEXT . '</a>';
164
+        $search_url_next = $search_url."&start={$next}";
165
+        $search_next = '<a href="'.htmlspecialchars($search_url_next).'">'.XoopsLocale::NEXT.'</a>';
166 166
         $xoopsTpl->assign('search_next', $search_next);
167 167
     }
168 168
     if ($start > 0) {
169 169
         $prev = $start - $limit;
170
-        $search_url_prev = $search_url . "&start={$prev}";
171
-        $search_prev = '<a href="' . htmlspecialchars($search_url_prev) . '">' . XoopsLocale::PREVIOUS . '</a>';
170
+        $search_url_prev = $search_url."&start={$prev}";
171
+        $search_prev = '<a href="'.htmlspecialchars($search_url_prev).'">'.XoopsLocale::PREVIOUS.'</a>';
172 172
         $xoopsTpl->assign('search_prev', $search_prev);
173 173
     }
174 174
 
175 175
     unset($results);
176
-    $search_info = XoopsLocale::KEYWORDS . ': ' . $myts->htmlSpecialChars($term);
176
+    $search_info = XoopsLocale::KEYWORDS.': '.$myts->htmlSpecialChars($term);
177 177
     if ($uname_required) {
178 178
         if ($search_info) {
179 179
             $search_info .= '<br>';
180 180
         }
181
-        $search_info .= _CO_PUBLISHER_UID . ': ' . $myts->htmlSpecialChars($search_username);
181
+        $search_info .= _CO_PUBLISHER_UID.': '.$myts->htmlSpecialChars($search_username);
182 182
     }
183 183
     $xoopsTpl->assign('search_info', $search_info);
184 184
 }
@@ -189,17 +189,17 @@  discard block
 block discarded – undo
189 189
 if ('OR' === $andor) {
190 190
     $type_select .= ' selected="selected"';
191 191
 }
192
-$type_select .= '>' . XoopsLocale::ANY_OR . '</option>';
192
+$type_select .= '>'.XoopsLocale::ANY_OR.'</option>';
193 193
 $type_select .= '<option value="AND"';
194 194
 if ('AND' === $andor) {
195 195
     $type_select .= ' selected="selected"';
196 196
 }
197
-$type_select .= '>' . XoopsLocale::ALL . '</option>';
197
+$type_select .= '>'.XoopsLocale::ALL.'</option>';
198 198
 $type_select .= '<option value="EXACT"';
199 199
 if ('EXACT' === $andor) {
200 200
     $type_select .= ' selected="selected"';
201 201
 }
202
-$type_select .= '>' . XoopsLocale::EXACT_MATCH . '</option>';
202
+$type_select .= '>'.XoopsLocale::EXACT_MATCH.'</option>';
203 203
 $type_select .= '</select>';
204 204
 
205 205
 /* category */
@@ -210,13 +210,13 @@  discard block
 block discarded – undo
210 210
 if (empty($category) || 0 == count($category)) {
211 211
     $select_category .= 'selected="selected"';
212 212
 }
213
-$select_category .= '>' . XoopsLocale::ALL . '</option>';
213
+$select_category .= '>'.XoopsLocale::ALL.'</option>';
214 214
 foreach ($categories as $id => $cat) {
215
-    $select_category .= '<option value="' . $id . '"';
215
+    $select_category .= '<option value="'.$id.'"';
216 216
     if (in_array($id, $category)) {
217 217
         $select_category .= 'selected="selected"';
218 218
     }
219
-    $select_category .= '>' . $cat . '</option>';
219
+    $select_category .= '>'.$cat.'</option>';
220 220
 }
221 221
 $select_category .= '</select>';
222 222
 
@@ -226,32 +226,32 @@  discard block
 block discarded – undo
226 226
 if (in_array('title', $searchin)) {
227 227
     $searchin_select .= ' checked';
228 228
 }
229
-$searchin_select .= '>' . _CO_PUBLISHER_TITLE . '&nbsp;&nbsp;';
229
+$searchin_select .= '>'._CO_PUBLISHER_TITLE.'&nbsp;&nbsp;';
230 230
 $searchin_select .= '<input type="checkbox" name="searchin[]" value="subtitle"';
231 231
 if (in_array('subtitle', $searchin)) {
232 232
     $searchin_select .= ' checked';
233 233
 }
234
-$searchin_select .= '>' . _CO_PUBLISHER_SUBTITLE . '&nbsp;&nbsp;';
234
+$searchin_select .= '>'._CO_PUBLISHER_SUBTITLE.'&nbsp;&nbsp;';
235 235
 $searchin_select .= '<input type="checkbox" name="searchin[]" value="summary"';
236 236
 if (in_array('summary', $searchin)) {
237 237
     $searchin_select .= ' checked';
238 238
 }
239
-$searchin_select .= '>' . _CO_PUBLISHER_SUMMARY . '&nbsp;&nbsp;';
239
+$searchin_select .= '>'._CO_PUBLISHER_SUMMARY.'&nbsp;&nbsp;';
240 240
 $searchin_select .= '<input type="checkbox" name="searchin[]" value="text"';
241 241
 if (in_array('body', $searchin)) {
242 242
     $searchin_select .= ' checked';
243 243
 }
244
-$searchin_select .= '>' . _CO_PUBLISHER_BODY . '&nbsp;&nbsp;';
244
+$searchin_select .= '>'._CO_PUBLISHER_BODY.'&nbsp;&nbsp;';
245 245
 $searchin_select .= '<input type="checkbox" name="searchin[]" value="keywords"';
246 246
 if (in_array('meta_keywords', $searchin)) {
247 247
     $searchin_select .= ' checked';
248 248
 }
249
-$searchin_select .= '>' . _CO_PUBLISHER_ITEM_META_KEYWORDS . '&nbsp;&nbsp;';
249
+$searchin_select .= '>'._CO_PUBLISHER_ITEM_META_KEYWORDS.'&nbsp;&nbsp;';
250 250
 $searchin_select .= '<input type="checkbox" name="searchin[]" value="all"';
251 251
 if (in_array('all', $searchin) || empty($searchin)) {
252 252
     $searchin_select .= ' checked';
253 253
 }
254
-$searchin_select .= '>' . XoopsLocale::ALL . '&nbsp;&nbsp;';
254
+$searchin_select .= '>'.XoopsLocale::ALL.'&nbsp;&nbsp;';
255 255
 
256 256
 /* sortby */
257 257
 $sortby_select = '<select name="sortby">';
@@ -259,22 +259,22 @@  discard block
 block discarded – undo
259 259
 if ('itemid' === $sortby || empty($sortby)) {
260 260
     $sortby_select .= ' selected="selected"';
261 261
 }
262
-$sortby_select .= '>' . XoopsLocale::NONE . '</option>';
262
+$sortby_select .= '>'.XoopsLocale::NONE.'</option>';
263 263
 $sortby_select .= '<option value="datesub"';
264 264
 if ('datesub' === $sortby) {
265 265
     $sortby_select .= ' selected="selected"';
266 266
 }
267
-$sortby_select .= '>' . _CO_PUBLISHER_DATESUB . '</option>';
267
+$sortby_select .= '>'._CO_PUBLISHER_DATESUB.'</option>';
268 268
 $sortby_select .= '<option value="title"';
269 269
 if ('title' === $sortby) {
270 270
     $sortby_select .= ' selected="selected"';
271 271
 }
272
-$sortby_select .= '>' . _CO_PUBLISHER_TITLE . '</option>';
272
+$sortby_select .= '>'._CO_PUBLISHER_TITLE.'</option>';
273 273
 $sortby_select .= '<option value="categoryid"';
274 274
 if ('categoryid' === $sortby) {
275 275
     $sortby_select .= ' selected="selected"';
276 276
 }
277
-$sortby_select .= '>' . _CO_PUBLISHER_CATEGORY . '</option>';
277
+$sortby_select .= '>'._CO_PUBLISHER_CATEGORY.'</option>';
278 278
 $sortby_select .= '</select>';
279 279
 
280 280
 $xoopsTpl->assign('type_select', $type_select);
Please login to merge, or discard this patch.
htdocs/modules/publisher/rate.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
  * @author          trabis <[email protected]>
21 21
  * @version         $Id$
22 22
  */
23
-require_once __DIR__ . '/header.php';
23
+require_once __DIR__.'/header.php';
24 24
 
25 25
 $xoops = Xoops::getInstance();
26 26
 
@@ -36,11 +36,11 @@  discard block
 block discarded – undo
36 36
 //Checking permissions
37 37
 if (!$helper->getConfig('perm_rating')
38 38
     || !$gpermHandler->checkRight('global', _PUBLISHER_RATE, $groups, $module_id)) {
39
-    $xoops->redirect(PUBLISHER_URL . '/item.php?itemid=' . $itemid, 2, XoopsLocale::E_NO_ACCESS_PERMISSION);
39
+    $xoops->redirect(PUBLISHER_URL.'/item.php?itemid='.$itemid, 2, XoopsLocale::E_NO_ACCESS_PERMISSION);
40 40
 }
41 41
 
42 42
 if ($rating > 5 || $rating < 1) {
43
-    $xoops->redirect(PUBLISHER_URL . '/item.php?itemid=' . $itemid, 2, _MD_PUBLISHER_VOTE_BAD);
43
+    $xoops->redirect(PUBLISHER_URL.'/item.php?itemid='.$itemid, 2, _MD_PUBLISHER_VOTE_BAD);
44 44
 }
45 45
 
46 46
 $criteria = new Criteria('itemid', $itemid);
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 }
62 62
 
63 63
 if ($voted) {
64
-    $xoops->redirect(PUBLISHER_URL . '/item.php?itemid=' . $itemid, 2, _MD_PUBLISHER_VOTE_ALREADY);
64
+    $xoops->redirect(PUBLISHER_URL.'/item.php?itemid='.$itemid, 2, _MD_PUBLISHER_VOTE_ALREADY);
65 65
 }
66 66
 
67 67
 $newRatingObj = $helper->getRatingHandler()->create();
@@ -78,4 +78,4 @@  discard block
 block discarded – undo
78 78
 $helper->getItemHandler()->updateAll('rating', number_format($current_rating / $count, 4), $criteria, true);
79 79
 $helper->getItemHandler()->updateAll('votes', $count, $criteria, true);
80 80
 
81
-$xoops->redirect(PUBLISHER_URL . '/item.php?itemid=' . $itemid, 2, _MD_PUBLISHER_VOTE_THANKS);
81
+$xoops->redirect(PUBLISHER_URL.'/item.php?itemid='.$itemid, 2, _MD_PUBLISHER_VOTE_THANKS);
Please login to merge, or discard this patch.
htdocs/modules/publisher/footer.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,17 +23,17 @@
 block discarded – undo
23 23
  * @author          The SmartFactory <www.smartfactory.ca>
24 24
  * @version         $Id$
25 25
  */
26
-require_once __DIR__ . '/include/common.php';
26
+require_once __DIR__.'/include/common.php';
27 27
 
28 28
 $helper = Helper::getInstance();
29 29
 
30 30
 $xoops = Xoops::getInstance();
31
-$xoops->theme()->addStylesheet(PUBLISHER_URL . '/css/publisher.css');
31
+$xoops->theme()->addStylesheet(PUBLISHER_URL.'/css/publisher.css');
32 32
 
33 33
 $xoopsTpl = $xoops->tpl();
34
-$xoopsTpl->assign('xoops_module_header', '<link rel="alternate" type="application/rss+xml" title="' . $helper->getModule()->getVar('name') . '" href="' . $helper->url('backend.php') . '">' . @$xoopsTpl->getTemplateVars('xoops_module_header'));
34
+$xoopsTpl->assign('xoops_module_header', '<link rel="alternate" type="application/rss+xml" title="'.$helper->getModule()->getVar('name').'" href="'.$helper->url('backend.php').'">'.@$xoopsTpl->getTemplateVars('xoops_module_header'));
35 35
 
36
-$xoopsTpl->assign('publisher_adminpage', "<a href='" . $helper->url('admin/index.php') . "'>" . _MD_PUBLISHER_ADMIN_PAGE . '</a>');
36
+$xoopsTpl->assign('publisher_adminpage', "<a href='".$helper->url('admin/index.php')."'>"._MD_PUBLISHER_ADMIN_PAGE.'</a>');
37 37
 $xoopsTpl->assign('isAdmin', Publisher\Utils::IsUserAdmin());
38 38
 $xoopsTpl->assign('publisher_url', $helper->url());
39 39
 $xoopsTpl->assign('publisher_images_url', $helper->url('images'));
Please login to merge, or discard this patch.
htdocs/modules/publisher/print.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
  * @author          trabis <[email protected]>
23 23
  * @author          The SmartFactory <www.smartfactory.ca>
24 24
  */
25
-require_once __DIR__ . '/header.php';
25
+require_once __DIR__.'/header.php';
26 26
 $xoops = Xoops::getInstance();
27 27
 $xoops->disableErrorReporting();
28 28
 
@@ -58,10 +58,10 @@  discard block
 block discarded – undo
58 58
 
59 59
 $mainImage = $itemObj->getMainImage();
60 60
 if ('' != $mainImage['image_path']) {
61
-    $item['image'] = '<img src="' . $mainImage['image_path'] . '" alt="' . $myts->undoHtmlSpecialChars($mainImage['image_name']) . '">';
61
+    $item['image'] = '<img src="'.$mainImage['image_path'].'" alt="'.$myts->undoHtmlSpecialChars($mainImage['image_name']).'">';
62 62
 }
63 63
 $xoopsTpl->assign('item', $item);
64
-$xoopsTpl->assign('printtitle', $xoops->getConfig('sitename') . ' - ' . Publisher\Utils::html2text($categoryObj->getCategoryPath()) . ' > ' . $myts->displayTarea($itemObj->title()));
64
+$xoopsTpl->assign('printtitle', $xoops->getConfig('sitename').' - '.Publisher\Utils::html2text($categoryObj->getCategoryPath()).' > '.$myts->displayTarea($itemObj->title()));
65 65
 $xoopsTpl->assign('printlogourl', $helper->getConfig('print_logourl'));
66 66
 $xoopsTpl->assign('printheader', $myts->displayTarea($helper->getConfig('print_header'), 1));
67 67
 $xoopsTpl->assign('lang_category', _CO_PUBLISHER_CATEGORY);
Please login to merge, or discard this patch.