@@ -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'; |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | // # [11-may-2001] Kenneth Lee - http://www.nexgear.com/ |
34 | 34 | // ###################################################################### |
35 | 35 | |
36 | -require_once __DIR__ . '/header.php'; |
|
36 | +require_once __DIR__.'/header.php'; |
|
37 | 37 | |
38 | 38 | $xoops = Xoops::getInstance(); |
39 | 39 | $helper = Helper::getInstance(); |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | $myts = Sanitizer::getInstance(); |
64 | -$xoopsTpl->assign('xoops_pagetitle', $myts->htmlSpecialChars(_MD_PUBLISHER_ARCHIVES) . $pgtitle . ' - ' . $myts->htmlSpecialChars($xoopsModule->getVar('name'))); |
|
64 | +$xoopsTpl->assign('xoops_pagetitle', $myts->htmlSpecialChars(_MD_PUBLISHER_ARCHIVES).$pgtitle.' - '.$myts->htmlSpecialChars($xoopsModule->getVar('name'))); |
|
65 | 65 | |
66 | 66 | $useroffset = ''; |
67 | 67 | if ($xoops->isUser()) { |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | $itemhandler->field_object = 'categoryid'; |
147 | 147 | // Categories for which user has access |
148 | 148 | $categoriesGranted = $helper->getPermissionHandler()->getGrantedItems('category_read'); |
149 | - $grantedCategories = new Criteria('l.categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN'); |
|
149 | + $grantedCategories = new Criteria('l.categoryid', '('.implode(',', $categoriesGranted).')', 'IN'); |
|
150 | 150 | $criteria = new CriteriaCompo(); |
151 | 151 | $criteria->add($grantedCategories, 'AND'); |
152 | 152 | $criteria->add(new Criteria('o.status', 2), 'AND'); |
@@ -165,18 +165,18 @@ discard block |
||
165 | 165 | foreach ($storyarray as $item) { |
166 | 166 | $story = []; |
167 | 167 | $htmltitle = ''; |
168 | - $story['title'] = "<a href='" . XoopsBaseConfig::get('url') . '/modules/publisher/category.php?categoryid=' . $item->getVar('categoryid') . "'>" . $item->getCategoryName() . "</a>: <a href='" . $item->getItemUrl() . "'" . $htmltitle . '>' . $item->title() . '</a>'; |
|
168 | + $story['title'] = "<a href='".XoopsBaseConfig::get('url').'/modules/publisher/category.php?categoryid='.$item->getVar('categoryid')."'>".$item->getCategoryName()."</a>: <a href='".$item->getItemUrl()."'".$htmltitle.'>'.$item->title().'</a>'; |
|
169 | 169 | $story['counter'] = $item->getVar('counter'); |
170 | 170 | $story['date'] = $item->datesub(); |
171 | - $story['print_link'] = XoopsBaseConfig::get('url') . '/modules/publisher/print.php?itemid=' . $item->getVar('itemid'); |
|
172 | - $story['mail_link'] = 'mailto:?subject=' . sprintf(_CO_PUBLISHER_INTITEM, $xoops->getConfig('sitename')) . '&body=' . sprintf(_CO_PUBLISHER_INTITEMFOUND, $xoops->getConfig('sitename')) . ': ' . $item->getItemUrl(); |
|
171 | + $story['print_link'] = XoopsBaseConfig::get('url').'/modules/publisher/print.php?itemid='.$item->getVar('itemid'); |
|
172 | + $story['mail_link'] = 'mailto:?subject='.sprintf(_CO_PUBLISHER_INTITEM, $xoops->getConfig('sitename')).'&body='.sprintf(_CO_PUBLISHER_INTITEMFOUND, $xoops->getConfig('sitename')).': '.$item->getItemUrl(); |
|
173 | 173 | |
174 | 174 | $xoopsTpl->append('stories', $story); |
175 | 175 | } |
176 | 176 | } |
177 | 177 | $xoopsTpl->assign('lang_printer', _MD_PUBLISHER_PRINTERFRIENDLY); |
178 | 178 | $xoopsTpl->assign('lang_sendstory', _MD_PUBLISHER_SENDSTORY); |
179 | - $xoopsTpl->assign('lang_storytotal', _MD_PUBLISHER_TOTAL_ITEMS . ' ' . $count); |
|
179 | + $xoopsTpl->assign('lang_storytotal', _MD_PUBLISHER_TOTAL_ITEMS.' '.$count); |
|
180 | 180 | } else { |
181 | 181 | $xoopsTpl->assign('show_articles', false); |
182 | 182 | } |