@@ -28,27 +28,27 @@ discard block |
||
28 | 28 | * Temporarily try and fix, but set up a (delayed) warning |
29 | 29 | */ |
30 | 30 | if (!class_exists('XoopsLoad', false)) { |
31 | - require_once dirname(__DIR__). '/class/XoopsBaseConfig.php'; |
|
31 | + require_once dirname(__DIR__).'/class/XoopsBaseConfig.php'; |
|
32 | 32 | XoopsBaseConfig::bootstrapTransition(); |
33 | 33 | $delayedWarning = 'Patch mainfile.php for XoopsBaseConfig'; |
34 | 34 | } |
35 | 35 | |
36 | 36 | global $xoops; |
37 | -$GLOBALS['xoops'] =& $xoops; |
|
37 | +$GLOBALS['xoops'] = & $xoops; |
|
38 | 38 | |
39 | 39 | //Legacy support |
40 | 40 | global $xoopsDB; |
41 | -$GLOBALS['xoopsDB'] =& $xoopsDB; |
|
41 | +$GLOBALS['xoopsDB'] = & $xoopsDB; |
|
42 | 42 | /** |
43 | 43 | * YOU SHOULD NEVER USE THE FOLLOWING TO CONSTANTS, THEY WILL BE REMOVED |
44 | 44 | */ |
45 | 45 | defined('DS') or define('DS', DIRECTORY_SEPARATOR); |
46 | -defined('NWLINE')or define('NWLINE', "\n"); |
|
46 | +defined('NWLINE') or define('NWLINE', "\n"); |
|
47 | 47 | |
48 | 48 | /** |
49 | 49 | * Include files with definitions |
50 | 50 | */ |
51 | -include_once __DIR__ . '/defines.php'; |
|
51 | +include_once __DIR__.'/defines.php'; |
|
52 | 52 | // include_once __DIR__ . '/version.php'; |
53 | 53 | |
54 | 54 | /** |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | */ |
65 | 65 | $xoops = Xoops::getInstance(); |
66 | 66 | |
67 | -$xoops->option =& $GLOBALS['xoopsOption']; |
|
67 | +$xoops->option = & $GLOBALS['xoopsOption']; |
|
68 | 68 | |
69 | 69 | /** |
70 | 70 | * Create Instance Xoops\Core\Logger Object, the logger manager |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | //$xoops->cache()->delete($key); |
87 | 87 | $autoloadPrefixDirList = $xoops->cache()->cacheRead( |
88 | 88 | $key, |
89 | - function () use ($xoops) { |
|
89 | + function() use ($xoops) { |
|
90 | 90 | try { |
91 | 91 | $criteria = new CriteriaCompo(new Criteria('isactive', 1)); |
92 | 92 | $criteria->add(new Criteria('namespace', '', '!=')); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | /** @var XoopsObject $almod */ |
100 | 100 | foreach ($autoloadModules as $almod) { |
101 | 101 | $prefix = $almod->getVar('namespace'); |
102 | - $base_dir = $xoops->path('modules/' . $almod->getVar('dirname') . '/src'); |
|
102 | + $base_dir = $xoops->path('modules/'.$almod->getVar('dirname').'/src'); |
|
103 | 103 | $autoloadPrefixDirList[] = [$prefix, $base_dir]; |
104 | 104 | } |
105 | 105 | return $autoloadPrefixDirList; |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | * Requires functions and database loaded |
159 | 159 | */ |
160 | 160 | $xoops->getConfigs(); |
161 | -$xoopsConfig =& $xoops->config; |
|
161 | +$xoopsConfig = & $xoops->config; |
|
162 | 162 | |
163 | 163 | /** |
164 | 164 | * Merge file and db configs. |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $xoops->addConfigs(include $file); |
168 | 168 | unset($file); |
169 | 169 | } else { |
170 | - trigger_error('File Path Error: ' . 'var/configs/system_configs.php' . ' does not exist.'); |
|
170 | + trigger_error('File Path Error: '.'var/configs/system_configs.php'.' does not exist.'); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | $xoops->events()->triggerEvent('core.include.common.configs.success'); |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | $xFrameOptions = $xoopsConfig['xFrameOptions'] ?? 'sameorigin'; |
185 | 185 | $xoops->events()->triggerEvent('core.include.common.xframeoption'); |
186 | 186 | if (!headers_sent() && !empty($xFrameOptions)) { |
187 | - header('X-Frame-Options: ' .$xFrameOptions); |
|
187 | + header('X-Frame-Options: '.$xFrameOptions); |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | /** |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | } else { |
266 | 266 | if (!$moduleperm_handler->checkRight('module_read', $xoops->module->getVar('mid'), FixedGroups::ANONYMOUS)) { |
267 | 267 | $xoops->redirect( |
268 | - $xoops_url . '/user.php?from=' . $xoops->module->getVar('dirname', 'n'), |
|
268 | + $xoops_url.'/user.php?from='.$xoops->module->getVar('dirname', 'n'), |
|
269 | 269 | 1, |
270 | 270 | XoopsLocale::E_NO_ACCESS_PERMISSION |
271 | 271 | ); |
@@ -291,10 +291,10 @@ discard block |
||
291 | 291 | |
292 | 292 | $xoopsTpl = $xoops->tpl(); |
293 | 293 | $xoTheme = null; |
294 | -$xoopsUser =& $xoops->user; |
|
295 | -$xoopsModule =& $xoops->module; |
|
296 | -$xoopsUserIsAdmin =& $xoops->userIsAdmin; |
|
297 | -$xoopsModuleConfig =& $xoops->moduleConfig; |
|
294 | +$xoopsUser = & $xoops->user; |
|
295 | +$xoopsModule = & $xoops->module; |
|
296 | +$xoopsUserIsAdmin = & $xoops->userIsAdmin; |
|
297 | +$xoopsModuleConfig = & $xoops->moduleConfig; |
|
298 | 298 | |
299 | 299 | //Creates 'system_modules_active' cache file if it has been deleted. |
300 | 300 | $xoops->getActiveModules(); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | use XoopsModules\Publisher; |
35 | 35 | use XoopsModules\Publisher\Helper; |
36 | 36 | |
37 | -require_once dirname(__DIR__) . '/header.php'; |
|
37 | +require_once dirname(__DIR__).'/header.php'; |
|
38 | 38 | |
39 | 39 | $xoops = Xoops::getInstance(); |
40 | 40 | $xoops->disableErrorReporting(); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | //Checking permissions |
58 | 58 | if (!$helper->getConfig('perm_rating') || !$gpermHandler->checkRight('global', _PUBLISHER_RATE, $groups, $module_id)) { |
59 | - $output = "unit_long$itemid|" . XoopsLocale::E_NO_ACCESS_PERMISSION . "\n"; |
|
59 | + $output = "unit_long$itemid|".XoopsLocale::E_NO_ACCESS_PERMISSION."\n"; |
|
60 | 60 | echo $output; |
61 | 61 | exit(); |
62 | 62 | } |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $units = 5; |
66 | 66 | |
67 | 67 | if ($rating > 5 || $rating < 1) { |
68 | - $output = "unit_long$itemid|" . _MD_PUBLISHER_VOTE_BAD . "\n"; |
|
68 | + $output = "unit_long$itemid|"._MD_PUBLISHER_VOTE_BAD."\n"; |
|
69 | 69 | echo $output; |
70 | 70 | exit(); |
71 | 71 | } |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | } |
88 | 88 | |
89 | 89 | if ($voted) { |
90 | - $output = "unit_long$itemid|" . _MD_PUBLISHER_VOTE_ALREADY . "\n"; |
|
90 | + $output = "unit_long$itemid|"._MD_PUBLISHER_VOTE_ALREADY."\n"; |
|
91 | 91 | echo $output; |
92 | 92 | exit(); |
93 | 93 | } |
@@ -111,8 +111,8 @@ discard block |
||
111 | 111 | // $new_back is what gets 'drawn' on your page after a successful 'AJAX/Javascript' vote |
112 | 112 | $new_back = []; |
113 | 113 | |
114 | -$new_back[] .= '<div class="publisher_unit-rating" style="width:' . $units * $rating_unitwidth . 'px;">'; |
|
115 | -$new_back[] .= '<div class="publisher_current-rating" style="width:' . @number_format($current_rating / $count, 2) * $rating_unitwidth . 'px;">' . _MD_PUBLISHER_VOTE_RATING . '</div>'; |
|
114 | +$new_back[] .= '<div class="publisher_unit-rating" style="width:'.$units * $rating_unitwidth.'px;">'; |
|
115 | +$new_back[] .= '<div class="publisher_current-rating" style="width:'.@number_format($current_rating / $count, 2) * $rating_unitwidth.'px;">'._MD_PUBLISHER_VOTE_RATING.'</div>'; |
|
116 | 116 | $new_back[] .= '<div class="publisher_r1-unit">1</div>'; |
117 | 117 | $new_back[] .= '<div class="publisher_r2-unit">2</div>'; |
118 | 118 | $new_back[] .= '<div class="publisher_r3-unit">3</div>'; |
@@ -124,8 +124,8 @@ discard block |
||
124 | 124 | $new_back[] .= '<div class="publisher_r9-unit">9</div>'; |
125 | 125 | $new_back[] .= '<div class="publisher_r10-unit">10</div>'; |
126 | 126 | $new_back[] .= '</div>'; |
127 | -$new_back[] .= '<div class="publisher_voted">' . _MD_PUBLISHER_VOTE_RATING . ' <strong>' . @number_format($current_rating / $count, 2) . '</strong>/' . $units . ' (' . $count . ' ' . $tense . ')</div>'; |
|
128 | -$new_back[] .= '<div class="publisher_thanks">' . _MD_PUBLISHER_VOTE_THANKS . '</div>'; |
|
127 | +$new_back[] .= '<div class="publisher_voted">'._MD_PUBLISHER_VOTE_RATING.' <strong>'.@number_format($current_rating / $count, 2).'</strong>/'.$units.' ('.$count.' '.$tense.')</div>'; |
|
128 | +$new_back[] .= '<div class="publisher_thanks">'._MD_PUBLISHER_VOTE_THANKS.'</div>'; |
|
129 | 129 | |
130 | 130 | $allnewback = implode("\n", $new_back); |
131 | 131 |
@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | use XoopsModules\Publisher; |
30 | 30 | use XoopsModules\Publisher\Helper; |
31 | 31 | |
32 | -include dirname(dirname(dirname(__DIR__))) . '/mainfile.php'; |
|
33 | -require_once __DIR__ . '/common.php'; |
|
32 | +include dirname(dirname(dirname(__DIR__))).'/mainfile.php'; |
|
33 | +require_once __DIR__.'/common.php'; |
|
34 | 34 | |
35 | 35 | $xoops = Xoops::getInstance(); |
36 | 36 | $xoops->disableErrorReporting(); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | $image = null; |
76 | 76 | if (false === $error) { |
77 | - $uploader = new XoopsMediaUploader(XoopsBaseConfig::get('uploads-path') . '/images', [ |
|
77 | + $uploader = new XoopsMediaUploader(XoopsBaseConfig::get('uploads-path').'/images', [ |
|
78 | 78 | 'image/gif', |
79 | 79 | 'image/jpeg', |
80 | 80 | 'image/pjpeg', |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | } |
108 | 108 | } |
109 | 109 | } else { |
110 | - $error = sprintf(_CO_PUBLISHER_FAILSAVEIMG, $filename) . '<br>' . implode('<br>', $uploader->getErrors(false)); |
|
110 | + $error = sprintf(_CO_PUBLISHER_FAILSAVEIMG, $filename).'<br>'.implode('<br>', $uploader->getErrors(false)); |
|
111 | 111 | } |
112 | 112 | } |
113 | 113 |
@@ -24,11 +24,11 @@ |
||
24 | 24 | |
25 | 25 | $xoops = Xoops::getInstance(); |
26 | 26 | define('PUBLISHER_DIRNAME', basename(dirname(__DIR__))); |
27 | -define('PUBLISHER_URL', $xoops->url('modules/' . PUBLISHER_DIRNAME)); |
|
28 | -define('PUBLISHER_ADMIN_URL', PUBLISHER_URL . '/admin'); |
|
29 | -define('PUBLISHER_UPLOADS_URL', $xoops->url('uploads/' . PUBLISHER_DIRNAME)); |
|
30 | -define('PUBLISHER_ROOT_PATH', $xoops->path('modules/' . PUBLISHER_DIRNAME)); |
|
31 | -define('PUBLISHER_UPLOADS_PATH', $xoops->path('uploads/' . PUBLISHER_DIRNAME)); |
|
27 | +define('PUBLISHER_URL', $xoops->url('modules/'.PUBLISHER_DIRNAME)); |
|
28 | +define('PUBLISHER_ADMIN_URL', PUBLISHER_URL.'/admin'); |
|
29 | +define('PUBLISHER_UPLOADS_URL', $xoops->url('uploads/'.PUBLISHER_DIRNAME)); |
|
30 | +define('PUBLISHER_ROOT_PATH', $xoops->path('modules/'.PUBLISHER_DIRNAME)); |
|
31 | +define('PUBLISHER_UPLOADS_PATH', $xoops->path('uploads/'.PUBLISHER_DIRNAME)); |
|
32 | 32 | |
33 | 33 | $path = dirname(__DIR__); |
34 | 34 | //XoopsLoad::addMap(array( |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | */ |
21 | 21 | use XoopsModules\Publisher\Helper; |
22 | 22 | |
23 | -require_once dirname(__DIR__) . '/include/common.php'; |
|
23 | +require_once dirname(__DIR__).'/include/common.php'; |
|
24 | 24 | |
25 | 25 | $helper = Helper::getInstance(); |
26 | 26 | |
@@ -53,21 +53,21 @@ discard block |
||
53 | 53 | // per their requirements. |
54 | 54 | |
55 | 55 | $url_arr = explode('/modules/', $_SERVER['PHP_SELF']); |
56 | - $newUrl = $url_arr[0] . '/modules/' . PUBLISHER_DIRNAME . '/' . $seoMap[$seoOp]; |
|
56 | + $newUrl = $url_arr[0].'/modules/'.PUBLISHER_DIRNAME.'/'.$seoMap[$seoOp]; |
|
57 | 57 | |
58 | 58 | $_ENV['PHP_SELF'] = $newUrl; |
59 | 59 | $_SERVER['SCRIPT_NAME'] = $newUrl; |
60 | 60 | $_SERVER['PHP_SELF'] = $newUrl; |
61 | 61 | switch ($seoOp) { |
62 | 62 | case 'category': |
63 | - $_SERVER['REQUEST_URI'] = $newUrl . '?categoryid=' . $seoArg; |
|
63 | + $_SERVER['REQUEST_URI'] = $newUrl.'?categoryid='.$seoArg; |
|
64 | 64 | $_GET['categoryid'] = $seoArg; |
65 | 65 | $_REQUEST['categoryid'] = $seoArg; |
66 | 66 | break; |
67 | 67 | case 'item': |
68 | 68 | case 'print': |
69 | 69 | default: |
70 | - $_SERVER['REQUEST_URI'] = $newUrl . '?itemid=' . $seoArg; |
|
70 | + $_SERVER['REQUEST_URI'] = $newUrl.'?itemid='.$seoArg; |
|
71 | 71 | $_GET['itemid'] = $seoArg; |
72 | 72 | $_REQUEST['itemid'] = $seoArg; |
73 | 73 | } |
@@ -39,7 +39,7 @@ |
||
39 | 39 | } |
40 | 40 | } |
41 | 41 | $itemHandler = $helper->getItemHandler(); |
42 | - $criteria = new Criteria('itemid', '(' . implode(', ', $items_id) . ')', 'IN'); |
|
42 | + $criteria = new Criteria('itemid', '('.implode(', ', $items_id).')', 'IN'); |
|
43 | 43 | $items_obj = $itemHandler->getItemObjects($criteria, 'itemid'); |
44 | 44 | |
45 | 45 | /* @var Publisher\Item $item_obj */ |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | $hightlight_key = ''; |
41 | 41 | } else { |
42 | 42 | $keywords = implode('+', $queryarray); |
43 | - $hightlight_key = '&keywords=' . $keywords; |
|
43 | + $hightlight_key = '&keywords='.$keywords; |
|
44 | 44 | } |
45 | 45 | $itemsObjs = $helper->getItemHandler()->getItemsFromSearch($queryarray, $andor, $limit, $offset, $userid, $categories, $sortby, $searchin, $extra); |
46 | 46 | $withCategoryPath = $helper->getConfig('search_cat_path'); |
@@ -50,9 +50,9 @@ discard block |
||
50 | 50 | foreach ($itemsObjs as $obj) { |
51 | 51 | $item['image'] = 'images/item_icon.gif'; |
52 | 52 | $item['link'] = $obj->getItemUrl(); |
53 | - $item['link'] .= (!empty($hightlight_key) && (false === mb_strpos($item['link'], '.php?'))) ? '?' . ltrim($hightlight_key, '&') : $hightlight_key; |
|
53 | + $item['link'] .= (!empty($hightlight_key) && (false === mb_strpos($item['link'], '.php?'))) ? '?'.ltrim($hightlight_key, '&') : $hightlight_key; |
|
54 | 54 | if ($withCategoryPath) { |
55 | - $item['title'] = $obj->getCategoryPath(false) . ' > ' . $obj->title(); |
|
55 | + $item['title'] = $obj->getCategoryPath(false).' > '.$obj->title(); |
|
56 | 56 | } else { |
57 | 57 | $item['title'] = $obj->title(); |
58 | 58 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $start = max($pos - 100, 0); |
71 | 71 | $length = mb_strlen($query) + 200; //xoops_local("strlen", $query) + 200; |
72 | 72 | $context = $obj->highlight(XoopsLocale::substr($text, $start, $length, ' [...]'), $query); |
73 | - $sanitized_text .= '<p>[...] ' . $context . '</p>'; |
|
73 | + $sanitized_text .= '<p>[...] '.$context.'</p>'; |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | //End of highlight |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | use Xoops\Core\XoopsTpl; |
23 | 23 | use XoopsModules\Publisher; |
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 | |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $categoryObj = $helper->getCategoryHandler()->get($categoryid); |
38 | 38 | } |
39 | 39 | |
40 | -header('Content-Type:text/xml; charset=' . XoopsLocale::getCharset()); |
|
40 | +header('Content-Type:text/xml; charset='.XoopsLocale::getCharset()); |
|
41 | 41 | $tpl = new XoopsTpl(); |
42 | 42 | $tpl->caching = 2; |
43 | 43 | $tpl->cache_lifetime = 0; |
@@ -54,14 +54,14 @@ discard block |
||
54 | 54 | $tpl->assign('channel_editor', $xoops->getConfig('adminmail')); |
55 | 55 | |
56 | 56 | if (-1 != $categoryid) { |
57 | - $channel_category .= ' > ' . $categoryObj->getVar('name'); |
|
57 | + $channel_category .= ' > '.$categoryObj->getVar('name'); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | $tpl->assign('channel_category', htmlspecialchars($channel_category)); |
61 | 61 | $tpl->assign('channel_generator', $helper->getModule()->getVar('name')); |
62 | 62 | $tpl->assign('channel_language', XoopsLocale::getLangCode()); |
63 | - $tpl->assign('image_url', XoopsBaseConfig::get('url') . '/images/logo.gif'); |
|
64 | - $dimention = getimagesize(XoopsBaseConfig::get('root-path') . '/images/logo.gif'); |
|
63 | + $tpl->assign('image_url', XoopsBaseConfig::get('url').'/images/logo.gif'); |
|
64 | + $dimention = getimagesize(XoopsBaseConfig::get('root-path').'/images/logo.gif'); |
|
65 | 65 | if (empty($dimention[0])) { |
66 | 66 | $width = 140; |
67 | 67 | $height = 140; |
@@ -23,4 +23,4 @@ |
||
23 | 23 | $doNotStartPrint = true; |
24 | 24 | $noTitle = true; |
25 | 25 | $smartPopup = true; |
26 | -require_once __DIR__ . '/print.php'; |
|
26 | +require_once __DIR__.'/print.php'; |