@@ -29,7 +29,7 @@ |
||
29 | 29 | $xoops = Xoops::getInstance(); |
30 | 30 | |
31 | 31 | $count = TableLoad::countRows('publisher_mimetypes'); |
32 | - if ($count==0) { |
|
32 | + if ($count == 0) { |
|
33 | 33 | $filename = $xoops->path('modules/publisher/sql/publisher_mimetypes.yml'); |
34 | 34 | TableLoad::loadTableFromYamlFile('publisher_mimetypes', $filename); |
35 | 35 | } |
@@ -22,18 +22,18 @@ |
||
22 | 22 | |
23 | 23 | $xoops = \Xoops::getInstance(); |
24 | 24 | define("PUBLISHER_DIRNAME", basename(dirname(__DIR__))); |
25 | -define("PUBLISHER_URL", $xoops->url('modules/' . PUBLISHER_DIRNAME)); |
|
26 | -define("PUBLISHER_ADMIN_URL", PUBLISHER_URL . '/admin'); |
|
27 | -define("PUBLISHER_UPLOADS_URL", $xoops->url('uploads/' . PUBLISHER_DIRNAME)); |
|
28 | -define("PUBLISHER_ROOT_PATH", $xoops->path('modules/' . PUBLISHER_DIRNAME)); |
|
29 | -define("PUBLISHER_UPLOADS_PATH", $xoops->path('uploads/' . PUBLISHER_DIRNAME)); |
|
25 | +define("PUBLISHER_URL", $xoops->url('modules/'.PUBLISHER_DIRNAME)); |
|
26 | +define("PUBLISHER_ADMIN_URL", PUBLISHER_URL.'/admin'); |
|
27 | +define("PUBLISHER_UPLOADS_URL", $xoops->url('uploads/'.PUBLISHER_DIRNAME)); |
|
28 | +define("PUBLISHER_ROOT_PATH", $xoops->path('modules/'.PUBLISHER_DIRNAME)); |
|
29 | +define("PUBLISHER_UPLOADS_PATH", $xoops->path('uploads/'.PUBLISHER_DIRNAME)); |
|
30 | 30 | |
31 | 31 | $path = dirname(__DIR__); |
32 | 32 | XoopsLoad::addMap(array( |
33 | - 'publishermetagen' => $path . '/class/metagen.php', |
|
34 | - 'publisher' => $path . '/class/helper.php', |
|
35 | - 'publisherutils' => $path . '/class/utils.php', |
|
36 | - 'publisherblockform' => $path . '/class/blockform.php', |
|
33 | + 'publishermetagen' => $path.'/class/metagen.php', |
|
34 | + 'publisher' => $path.'/class/helper.php', |
|
35 | + 'publisherutils' => $path.'/class/utils.php', |
|
36 | + 'publisherblockform' => $path.'/class/blockform.php', |
|
37 | 37 | )); |
38 | 38 | |
39 | 39 | $publisher = Publisher::getInstance(); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | $hightlight_key = ''; |
26 | 26 | } else { |
27 | 27 | $keywords = implode('+', $queryarray); |
28 | - $hightlight_key = "&keywords=" . $keywords; |
|
28 | + $hightlight_key = "&keywords=".$keywords; |
|
29 | 29 | } |
30 | 30 | $itemsObjs = $publisher->getItemHandler() |
31 | 31 | ->getItemsFromSearch($queryarray, $andor, $limit, $offset, $userid, $categories, $sortby, $searchin, $extra); |
@@ -36,9 +36,9 @@ discard block |
||
36 | 36 | foreach ($itemsObjs as $obj) { |
37 | 37 | $item['image'] = "images/item_icon.gif"; |
38 | 38 | $item['link'] = $obj->getItemUrl(); |
39 | - $item['link'] .= (!empty($hightlight_key) && (strpos($item['link'], '.php?') === false)) ? "?" . ltrim($hightlight_key, '&') : $hightlight_key; |
|
39 | + $item['link'] .= (!empty($hightlight_key) && (strpos($item['link'], '.php?') === false)) ? "?".ltrim($hightlight_key, '&') : $hightlight_key; |
|
40 | 40 | if ($withCategoryPath) { |
41 | - $item['title'] = $obj->getCategoryPath(false) . " > " . $obj->title(); |
|
41 | + $item['title'] = $obj->getCategoryPath(false)." > ".$obj->title(); |
|
42 | 42 | } else { |
43 | 43 | $item['title'] = $obj->title(); |
44 | 44 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $start = max(($pos - 100), 0); |
57 | 57 | $length = strlen($query) + 200; //xoops_local("strlen", $query) + 200; |
58 | 58 | $context = $obj->highlight(XoopsLocale::substr($text, $start, $length, " [...]"), $query); |
59 | - $sanitized_text .= "<p>[...] " . $context . "</p>"; |
|
59 | + $sanitized_text .= "<p>[...] ".$context."</p>"; |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | //End of highlight |
@@ -77,11 +77,11 @@ |
||
77 | 77 | /* @var $item PublisherItem */ |
78 | 78 | foreach ($sarray as $item) { |
79 | 79 | $tpl->append('items', |
80 | - array('title' => htmlspecialchars($item->title(), ENT_QUOTES), |
|
81 | - 'link' => $item->getItemUrl(), |
|
82 | - 'guid' => $item->getItemUrl(), |
|
83 | - 'pubdate' => XoopsLocale::formatTimestamp($item->getVar('datesub'), 'rss'), |
|
84 | - 'description' => htmlspecialchars($item->getBlockSummary(300, true), ENT_QUOTES))); |
|
80 | + array('title' => htmlspecialchars($item->title(), ENT_QUOTES), |
|
81 | + 'link' => $item->getItemUrl(), |
|
82 | + 'guid' => $item->getItemUrl(), |
|
83 | + 'pubdate' => XoopsLocale::formatTimestamp($item->getVar('datesub'), 'rss'), |
|
84 | + 'description' => htmlspecialchars($item->getBlockSummary(300, true), ENT_QUOTES))); |
|
85 | 85 | } |
86 | 86 | } |
87 | 87 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * @author The SmartFactory <www.smartfactory.ca> |
22 | 22 | */ |
23 | 23 | |
24 | -include_once __DIR__ . '/header.php'; |
|
24 | +include_once __DIR__.'/header.php'; |
|
25 | 25 | $xoops = Xoops::getInstance(); |
26 | 26 | $xoops->disableErrorReporting(); |
27 | 27 | |
@@ -36,10 +36,10 @@ discard block |
||
36 | 36 | $categoryObj = $publisher->getCategoryHandler()->get($categoryid); |
37 | 37 | } |
38 | 38 | |
39 | -header('Content-Type:text/xml; charset=' . XoopsLocale::getCharset()); |
|
39 | +header('Content-Type:text/xml; charset='.XoopsLocale::getCharset()); |
|
40 | 40 | $tpl = new XoopsTpl(); |
41 | 41 | $tpl->caching = 2; |
42 | -$tpl->cache_lifetime= 0; |
|
42 | +$tpl->cache_lifetime = 0; |
|
43 | 43 | |
44 | 44 | $myts = \Xoops\Core\Text\Sanitizer::getInstance(); |
45 | 45 | if (!$tpl->isCached('module:publisher/publisher_rss.tpl')) { |
@@ -53,14 +53,14 @@ discard block |
||
53 | 53 | $tpl->assign('channel_editor', $xoops->getConfig('adminmail')); |
54 | 54 | |
55 | 55 | if ($categoryid != -1) { |
56 | - $channel_category .= " > " . $categoryObj->getVar('name'); |
|
56 | + $channel_category .= " > ".$categoryObj->getVar('name'); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | $tpl->assign('channel_category', htmlspecialchars($channel_category)); |
60 | 60 | $tpl->assign('channel_generator', $publisher->getModule()->getVar('name')); |
61 | 61 | $tpl->assign('channel_language', XoopsLocale::getLangCode()); |
62 | - $tpl->assign('image_url', \XoopsBaseConfig::get('url') . '/images/logo.gif'); |
|
63 | - $dimention = getimagesize(\XoopsBaseConfig::get('root-path') . '/images/logo.gif'); |
|
62 | + $tpl->assign('image_url', \XoopsBaseConfig::get('url').'/images/logo.gif'); |
|
63 | + $dimention = getimagesize(\XoopsBaseConfig::get('root-path').'/images/logo.gif'); |
|
64 | 64 | if (empty($dimention[0])) { |
65 | 65 | $width = 140; |
66 | 66 | $height = 140; |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | * @version $Id$ |
23 | 23 | */ |
24 | 24 | |
25 | -include_once __DIR__ . '/header.php'; |
|
25 | +include_once __DIR__.'/header.php'; |
|
26 | 26 | |
27 | 27 | $xoops = Xoops::getInstance(); |
28 | 28 | $publisher = Publisher::getInstance(); |
@@ -49,10 +49,10 @@ discard block |
||
49 | 49 | $fileObj->updateCounter(); |
50 | 50 | |
51 | 51 | if (!preg_match("/^ed2k*:\/\//i", $fileObj->getFileUrl())) { |
52 | - header("Location: " . $fileObj->getFileUrl()); |
|
52 | + header("Location: ".$fileObj->getFileUrl()); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | $myts = \Xoops\Core\Text\Sanitizer::getInstance(); |
56 | 56 | echo "<html><head><meta http-equiv=\"Refresh\" content=\"0; URL=" |
57 | - . $myts->htmlSpecialChars($fileObj->getFileUrl()) . "\"></head><body></body></html>"; |
|
57 | + . $myts->htmlSpecialChars($fileObj->getFileUrl())."\"></head><body></body></html>"; |
|
58 | 58 | exit(); |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | * @author Sina Asghari (AKA stranger) <[email protected]> |
23 | 23 | */ |
24 | 24 | |
25 | -include_once __DIR__ . '/header.php'; |
|
25 | +include_once __DIR__.'/header.php'; |
|
26 | 26 | $xoops = Xoops::getInstance(); |
27 | 27 | $xoops->disableErrorReporting(); |
28 | 28 | |
@@ -70,6 +70,6 @@ discard block |
||
70 | 70 | $xoops->service('htmltopdf')->setKeywords($itemObj->getVar('meta_keywords')); |
71 | 71 | $xoops->service('htmltopdf')->setSubject($categoryObj->getVar('name')); |
72 | 72 | $xoops->service('htmltopdf')->addHtml($content); |
73 | -$name = $itemObj->getVar('short_url') . '.pdf'; |
|
73 | +$name = $itemObj->getVar('short_url').'.pdf'; |
|
74 | 74 | $xoops->service('htmltopdf')->outputPdfInline($name); |
75 | 75 | exit(); |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | * @version $Id$ |
21 | 21 | */ |
22 | 22 | |
23 | -include_once dirname(__DIR__) . '/include/common.php'; |
|
23 | +include_once dirname(__DIR__).'/include/common.php'; |
|
24 | 24 | |
25 | 25 | /** |
26 | 26 | * Function To Show Publisher Items From Categories In Their Own Columns |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $block['columns'] = $columns; |
134 | 134 | $block['columnwidth'] = (int)(100 / $opt_num_columns); |
135 | 135 | |
136 | - $xoTheme->addStylesheet(\XoopsBaseConfig::get('url') . '/modules/' . PUBLISHER_DIRNAME . '/css/publisher.css'); |
|
136 | + $xoTheme->addStylesheet(\XoopsBaseConfig::get('url').'/modules/'.PUBLISHER_DIRNAME.'/css/publisher.css'); |
|
137 | 137 | |
138 | 138 | return $block; |
139 | 139 | } |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | * @version $Id$ |
21 | 21 | */ |
22 | 22 | |
23 | -include_once dirname(__DIR__) . '/include/common.php'; |
|
23 | +include_once dirname(__DIR__).'/include/common.php'; |
|
24 | 24 | |
25 | 25 | function publisher_date_to_date_show($options) |
26 | 26 | { |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $block['lang_poster'] = _MB_PUBLISHER_POSTEDBY; |
60 | 60 | $block['lang_date'] = _MB_PUBLISHER_DATE; |
61 | 61 | $modulename = $myts->displayTarea($publisher->getModule()->getVar('name')); |
62 | - $block['lang_visitItem'] = _MB_PUBLISHER_VISITITEM . " " . $modulename; |
|
62 | + $block['lang_visitItem'] = _MB_PUBLISHER_VISITITEM." ".$modulename; |
|
63 | 63 | $block['lang_articles_from_to'] = sprintf(_MB_PUBLISHER_ARTICLES_FROM_TO, $options[0], $options[1]); |
64 | 64 | } |
65 | 65 |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | |
23 | 23 | defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined"); |
24 | 24 | |
25 | -include_once dirname(__DIR__) . '/include/common.php'; |
|
25 | +include_once dirname(__DIR__).'/include/common.php'; |
|
26 | 26 | |
27 | 27 | function publisher_items_new_show($options) |
28 | 28 | { |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $criteria = null; |
49 | 49 | } else { |
50 | 50 | $criteria = new CriteriaCompo(); |
51 | - $criteria->add(new Criteria('categoryid', '(' . $options[0] . ')', 'IN')); |
|
51 | + $criteria->add(new Criteria('categoryid', '('.$options[0].')', 'IN')); |
|
52 | 52 | } |
53 | 53 | $xoops = \Xoops::getInstance(); |
54 | 54 | $thumbService = $xoops->service('thumbnail'); |
@@ -64,12 +64,12 @@ discard block |
||
64 | 64 | $item['poster'] = $itemsObj[$i]->posterName(); // for make poster name linked, use linkedPosterName() instead of posterName() |
65 | 65 | |
66 | 66 | if ($image === 'article') { |
67 | - $item['image'] = \XoopsBaseConfig::get('url') . '/uploads/blank.gif'; |
|
67 | + $item['image'] = \XoopsBaseConfig::get('url').'/uploads/blank.gif'; |
|
68 | 68 | $item['image_name'] = ''; |
69 | 69 | $images = $itemsObj[$i]->getImages(); |
70 | 70 | if (is_object($images['main'])) { |
71 | 71 | $item['image'] = $thumbService |
72 | - ->getImgUrl('uploads/' . $images['main']->getVar('image_name'), 50, 0) |
|
72 | + ->getImgUrl('uploads/'.$images['main']->getVar('image_name'), 50, 0) |
|
73 | 73 | ->getValue(); |
74 | 74 | |
75 | 75 | $item['image_name'] = $images['main']->getVar('image_nicename'); |
@@ -80,11 +80,11 @@ discard block |
||
80 | 80 | } elseif ($image === 'avatar') { |
81 | 81 | $auid = $itemsObj[$i]->getVar('uid'); |
82 | 82 | if ($auid == '0') { |
83 | - $item['image'] = \XoopsBaseConfig::get('url') . '/uploads/blank.gif'; |
|
83 | + $item['image'] = \XoopsBaseConfig::get('url').'/uploads/blank.gif'; |
|
84 | 84 | $images = $itemsObj[$i]->getImages(); |
85 | 85 | if (is_object($images['main'])) { |
86 | 86 | $item['image'] = $thumbService |
87 | - ->getImgUrl('uploads/' . $images['main']->getVar('image_name'), 50, 0) |
|
87 | + ->getImgUrl('uploads/'.$images['main']->getVar('image_name'), 50, 0) |
|
88 | 88 | ->getValue(); |
89 | 89 | } |
90 | 90 | } else { |