@@ -22,12 +22,12 @@ |
||
22 | 22 | */ |
23 | 23 | class PlanetCorePreload extends XoopsPreloadItem |
24 | 24 | { |
25 | - // to add PSR-4 autoloader |
|
26 | - /** |
|
27 | - * @param $args |
|
28 | - */ |
|
29 | - public static function eventCoreIncludeCommonEnd($args) |
|
30 | - { |
|
31 | - include __DIR__ . '/autoloader.php'; |
|
32 | - } |
|
25 | + // to add PSR-4 autoloader |
|
26 | + /** |
|
27 | + * @param $args |
|
28 | + */ |
|
29 | + public static function eventCoreIncludeCommonEnd($args) |
|
30 | + { |
|
31 | + include __DIR__ . '/autoloader.php'; |
|
32 | + } |
|
33 | 33 | } |
@@ -28,6 +28,6 @@ |
||
28 | 28 | */ |
29 | 29 | public static function eventCoreIncludeCommonEnd($args) |
30 | 30 | { |
31 | - include __DIR__ . '/autoloader.php'; |
|
31 | + include __DIR__.'/autoloader.php'; |
|
32 | 32 | } |
33 | 33 | } |
@@ -4,29 +4,29 @@ |
||
4 | 4 | * @see http://www.php-fig.org/psr/psr-4/examples/ |
5 | 5 | */ |
6 | 6 | spl_autoload_register(function ($class) { |
7 | - // project-specific namespace prefix |
|
8 | - $prefix = 'XoopsModules\\' . ucfirst(basename(dirname(__DIR__))); |
|
7 | + // project-specific namespace prefix |
|
8 | + $prefix = 'XoopsModules\\' . ucfirst(basename(dirname(__DIR__))); |
|
9 | 9 | |
10 | - // base directory for the namespace prefix |
|
11 | - $base_dir = __DIR__ . '/../class/'; |
|
10 | + // base directory for the namespace prefix |
|
11 | + $base_dir = __DIR__ . '/../class/'; |
|
12 | 12 | |
13 | - // does the class use the namespace prefix? |
|
14 | - $len = strlen($prefix); |
|
13 | + // does the class use the namespace prefix? |
|
14 | + $len = strlen($prefix); |
|
15 | 15 | |
16 | - if (0 !== strncmp($prefix, $class, $len)) { |
|
17 | - return; |
|
18 | - } |
|
16 | + if (0 !== strncmp($prefix, $class, $len)) { |
|
17 | + return; |
|
18 | + } |
|
19 | 19 | |
20 | - // get the relative class name |
|
21 | - $relative_class = substr($class, $len); |
|
20 | + // get the relative class name |
|
21 | + $relative_class = substr($class, $len); |
|
22 | 22 | |
23 | - // replace the namespace prefix with the base directory, replace namespace |
|
24 | - // separators with directory separators in the relative class name, append |
|
25 | - // with .php |
|
26 | - $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php'; |
|
23 | + // replace the namespace prefix with the base directory, replace namespace |
|
24 | + // separators with directory separators in the relative class name, append |
|
25 | + // with .php |
|
26 | + $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php'; |
|
27 | 27 | |
28 | - // if the file exists, require it |
|
29 | - if (file_exists($file)) { |
|
30 | - require $file; |
|
31 | - } |
|
28 | + // if the file exists, require it |
|
29 | + if (file_exists($file)) { |
|
30 | + require $file; |
|
31 | + } |
|
32 | 32 | }); |
@@ -3,12 +3,12 @@ discard block |
||
3 | 3 | /** |
4 | 4 | * @see http://www.php-fig.org/psr/psr-4/examples/ |
5 | 5 | */ |
6 | -spl_autoload_register(function ($class) { |
|
6 | +spl_autoload_register(function($class) { |
|
7 | 7 | // project-specific namespace prefix |
8 | - $prefix = 'XoopsModules\\' . ucfirst(basename(dirname(__DIR__))); |
|
8 | + $prefix = 'XoopsModules\\'.ucfirst(basename(dirname(__DIR__))); |
|
9 | 9 | |
10 | 10 | // base directory for the namespace prefix |
11 | - $base_dir = __DIR__ . '/../class/'; |
|
11 | + $base_dir = __DIR__.'/../class/'; |
|
12 | 12 | |
13 | 13 | // does the class use the namespace prefix? |
14 | 14 | $len = strlen($prefix); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | // replace the namespace prefix with the base directory, replace namespace |
24 | 24 | // separators with directory separators in the relative class name, append |
25 | 25 | // with .php |
26 | - $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php'; |
|
26 | + $file = $base_dir.str_replace('\\', '/', $relative_class).'.php'; |
|
27 | 27 | |
28 | 28 | // if the file exists, require it |
29 | 29 | if (file_exists($file)) { |
@@ -25,10 +25,10 @@ |
||
25 | 25 | // Project: Article Project // |
26 | 26 | // ------------------------------------------------------------------------ // |
27 | 27 | |
28 | -include __DIR__ . '/../../mainfile.php'; |
|
29 | -include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php'; |
|
28 | +include __DIR__.'/../../mainfile.php'; |
|
29 | +include XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/vars.php'; |
|
30 | 30 | //require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/functions.php'; |
31 | -require_once __DIR__ . '/class/Utility.php'; |
|
31 | +require_once __DIR__.'/class/Utility.php'; |
|
32 | 32 | |
33 | 33 | planet_define_url_delimiter(); |
34 | 34 | $myts = \MyTextSanitizer::getInstance(); |
@@ -37,17 +37,17 @@ discard block |
||
37 | 37 | * |
38 | 38 | */ |
39 | 39 | if (preg_match("/(\/comment_[^\.]*\.php\?.*=.*)/i", Request::getUrl('REQUEST_URI', '', 'SERVER'), $matches)) {//$_SERVER['REQUEST_URI'] |
40 | - header('location: ' . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . $matches[1]); |
|
41 | - exit(); |
|
40 | + header('location: ' . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . $matches[1]); |
|
41 | + exit(); |
|
42 | 42 | } |
43 | 43 | if (preg_match("/\/notification_update\.php/i", Request::getUrl('REQUEST_URI', '', 'SERVER'), $matches)) { |
44 | - include XOOPS_ROOT_PATH . '/include/notification_update.php'; |
|
45 | - exit(); |
|
44 | + include XOOPS_ROOT_PATH . '/include/notification_update.php'; |
|
45 | + exit(); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | if ($REQUEST_URI_parsed = PlanetUtility::planetParseArguments($args_num, $args, $args_str)) { |
49 | - $args['article'] = @$args_num[0]; |
|
50 | - $args['blog'] = @$args['blog']; |
|
49 | + $args['article'] = @$args_num[0]; |
|
50 | + $args['blog'] = @$args['blog']; |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | $article_id = Request::getInt('article', @$args['article'], 'POST');//(int)(empty($_GET['article']) ? @$args['article'] : $_GET['article']); |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | // restore $_SERVER['REQUEST_URI'] |
62 | 62 | if (!empty($REQUEST_URI_parsed)) { |
63 | - $_SERVER['REQUEST_URI'] = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . (empty($article_id) ? '' : '?article=' . $article_id); |
|
63 | + $_SERVER['REQUEST_URI'] = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . (empty($article_id) ? '' : '?article=' . $article_id); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | $xoopsOption['xoops_pagetitle'] = $xoopsModule->getVar('name') . ' - ' . $article_obj->getVar('art_title'); |
@@ -69,29 +69,29 @@ discard block |
||
69 | 69 | include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php'; |
70 | 70 | |
71 | 71 | $article_data = [ |
72 | - 'id' => $article_id, |
|
73 | - 'title' => $article_obj->getVar('art_title'), |
|
74 | - 'content' => $article_obj->getVar('art_content'), |
|
75 | - 'author' => $article_obj->getVar('art_author'), |
|
76 | - 'time' => $article_obj->getTime(), |
|
77 | - 'link' => $article_obj->getVar('art_link'), |
|
78 | - 'views' => $article_obj->getVar('art_views'), |
|
79 | - 'comments' => $article_obj->getVar('art_comments'), |
|
80 | - 'star' => $article_obj->getStar(), |
|
81 | - 'rates' => $article_obj->getVar('art_rates'), |
|
82 | - 'blog' => ['id' => $article_obj->getVar('blog_id'), 'title' => $blog_obj->getVar('blog_title')] |
|
72 | + 'id' => $article_id, |
|
73 | + 'title' => $article_obj->getVar('art_title'), |
|
74 | + 'content' => $article_obj->getVar('art_content'), |
|
75 | + 'author' => $article_obj->getVar('art_author'), |
|
76 | + 'time' => $article_obj->getTime(), |
|
77 | + 'link' => $article_obj->getVar('art_link'), |
|
78 | + 'views' => $article_obj->getVar('art_views'), |
|
79 | + 'comments' => $article_obj->getVar('art_comments'), |
|
80 | + 'star' => $article_obj->getStar(), |
|
81 | + 'rates' => $article_obj->getVar('art_rates'), |
|
82 | + 'blog' => ['id' => $article_obj->getVar('blog_id'), 'title' => $blog_obj->getVar('blog_title')] |
|
83 | 83 | ]; |
84 | 84 | |
85 | 85 | if (!empty($helper->getConfig('do_sibling'))) { |
86 | - $articles_sibling = $articleHandler->getSibling($article_obj, $blog_id); |
|
87 | - if (!empty($articles_sibling['previous'])) { |
|
88 | - $articles_sibling['previous']['url'] = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' . $articles_sibling['previous']['id'] . '/b' . $blog_id; |
|
89 | - $articles_sibling['previous']['title'] = $articles_sibling['previous']['title']; |
|
90 | - } |
|
91 | - if (!empty($articles_sibling['next'])) { |
|
92 | - $articles_sibling['next']['url'] = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' . $articles_sibling['next']['id'] . '/b' . $blog_id; |
|
93 | - $articles_sibling['next']['title'] = $articles_sibling['next']['title']; |
|
94 | - } |
|
86 | + $articles_sibling = $articleHandler->getSibling($article_obj, $blog_id); |
|
87 | + if (!empty($articles_sibling['previous'])) { |
|
88 | + $articles_sibling['previous']['url'] = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' . $articles_sibling['previous']['id'] . '/b' . $blog_id; |
|
89 | + $articles_sibling['previous']['title'] = $articles_sibling['previous']['title']; |
|
90 | + } |
|
91 | + if (!empty($articles_sibling['next'])) { |
|
92 | + $articles_sibling['next']['url'] = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' . $articles_sibling['next']['id'] . '/b' . $blog_id; |
|
93 | + $articles_sibling['next']['title'] = $articles_sibling['next']['title']; |
|
94 | + } |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | $xoopsTpl->assign('modulename', $xoopsModule->getVar('name')); |
@@ -102,11 +102,11 @@ discard block |
||
102 | 102 | $xoopsTpl->assign('user_level', !is_object($xoopsUser) ? 0 : ($xoopsUser->isAdmin() ? 2 : 1)); |
103 | 103 | if (empty($helper->getConfig('anonymous_rate')) && !is_object($xoopsUser)) { |
104 | 104 | } else { |
105 | - $xoopsTpl->assign('canrate', 1); |
|
105 | + $xoopsTpl->assign('canrate', 1); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | if ($transferbar = @include XOOPS_ROOT_PATH . '/Frameworks/transfer/bar.transfer.php') { |
109 | - $xoopsTpl->assign('transfer', $transferbar); |
|
109 | + $xoopsTpl->assign('transfer', $transferbar); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | // Loading module meta data, NOT THE RIGHT WAY DOING IT |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | /** @var Planet\Helper $helper */ |
30 | 30 | $helper = Planet\Helper::getInstance(); |
31 | 31 | |
32 | -include __DIR__ . '/header.php'; |
|
32 | +include __DIR__.'/header.php'; |
|
33 | 33 | |
34 | 34 | /** |
35 | 35 | * The comment detection scripts should be removed once absolute url is used in comment_view.php |
@@ -37,11 +37,11 @@ discard block |
||
37 | 37 | * |
38 | 38 | */ |
39 | 39 | if (preg_match("/(\/comment_[^\.]*\.php\?.*=.*)/i", Request::getUrl('REQUEST_URI', '', 'SERVER'), $matches)) {//$_SERVER['REQUEST_URI'] |
40 | - header('location: ' . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . $matches[1]); |
|
40 | + header('location: '.XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].$matches[1]); |
|
41 | 41 | exit(); |
42 | 42 | } |
43 | 43 | if (preg_match("/\/notification_update\.php/i", Request::getUrl('REQUEST_URI', '', 'SERVER'), $matches)) { |
44 | - include XOOPS_ROOT_PATH . '/include/notification_update.php'; |
|
44 | + include XOOPS_ROOT_PATH.'/include/notification_update.php'; |
|
45 | 45 | exit(); |
46 | 46 | } |
47 | 47 | |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | $args['blog'] = @$args['blog']; |
51 | 51 | } |
52 | 52 | |
53 | -$article_id = Request::getInt('article', @$args['article'], 'POST');//(int)(empty($_GET['article']) ? @$args['article'] : $_GET['article']); |
|
54 | -$blog_id = Request::getInt('blog', @$args['blog'], 'POST');//(int)(empty($_GET['blog']) ? @$args['blog'] : $_GET['blog']); |
|
53 | +$article_id = Request::getInt('article', @$args['article'], 'POST'); //(int)(empty($_GET['article']) ? @$args['article'] : $_GET['article']); |
|
54 | +$blog_id = Request::getInt('blog', @$args['blog'], 'POST'); //(int)(empty($_GET['blog']) ? @$args['blog'] : $_GET['blog']); |
|
55 | 55 | |
56 | 56 | $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
57 | 57 | $blogHandler = xoops_getModuleHandler('blog', $GLOBALS['moddirname']); |
@@ -60,13 +60,13 @@ discard block |
||
60 | 60 | |
61 | 61 | // restore $_SERVER['REQUEST_URI'] |
62 | 62 | if (!empty($REQUEST_URI_parsed)) { |
63 | - $_SERVER['REQUEST_URI'] = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . (empty($article_id) ? '' : '?article=' . $article_id); |
|
63 | + $_SERVER['REQUEST_URI'] = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.article.php'.(empty($article_id) ? '' : '?article='.$article_id); |
|
64 | 64 | } |
65 | 65 | |
66 | -$xoopsOption['xoops_pagetitle'] = $xoopsModule->getVar('name') . ' - ' . $article_obj->getVar('art_title'); |
|
66 | +$xoopsOption['xoops_pagetitle'] = $xoopsModule->getVar('name').' - '.$article_obj->getVar('art_title'); |
|
67 | 67 | $xoopsOption['template_main'] = PlanetUtility::planetGetTemplate('article'); |
68 | -require_once XOOPS_ROOT_PATH . '/header.php'; |
|
69 | -include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php'; |
|
68 | +require_once XOOPS_ROOT_PATH.'/header.php'; |
|
69 | +include XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/vars.php'; |
|
70 | 70 | |
71 | 71 | $article_data = [ |
72 | 72 | 'id' => $article_id, |
@@ -85,11 +85,11 @@ discard block |
||
85 | 85 | if (!empty($helper->getConfig('do_sibling'))) { |
86 | 86 | $articles_sibling = $articleHandler->getSibling($article_obj, $blog_id); |
87 | 87 | if (!empty($articles_sibling['previous'])) { |
88 | - $articles_sibling['previous']['url'] = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' . $articles_sibling['previous']['id'] . '/b' . $blog_id; |
|
88 | + $articles_sibling['previous']['url'] = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.article.php'.URL_DELIMITER.''.$articles_sibling['previous']['id'].'/b'.$blog_id; |
|
89 | 89 | $articles_sibling['previous']['title'] = $articles_sibling['previous']['title']; |
90 | 90 | } |
91 | 91 | if (!empty($articles_sibling['next'])) { |
92 | - $articles_sibling['next']['url'] = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' . $articles_sibling['next']['id'] . '/b' . $blog_id; |
|
92 | + $articles_sibling['next']['url'] = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.article.php'.URL_DELIMITER.''.$articles_sibling['next']['id'].'/b'.$blog_id; |
|
93 | 93 | $articles_sibling['next']['title'] = $articles_sibling['next']['title']; |
94 | 94 | } |
95 | 95 | } |
@@ -101,11 +101,11 @@ discard block |
||
101 | 101 | |
102 | 102 | $xoopsTpl->assign('user_level', !is_object($xoopsUser) ? 0 : ($xoopsUser->isAdmin() ? 2 : 1)); |
103 | 103 | if (empty($helper->getConfig('anonymous_rate')) && !is_object($xoopsUser)) { |
104 | -} else { |
|
104 | +}else { |
|
105 | 105 | $xoopsTpl->assign('canrate', 1); |
106 | 106 | } |
107 | 107 | |
108 | -if ($transferbar = @include XOOPS_ROOT_PATH . '/Frameworks/transfer/bar.transfer.php') { |
|
108 | +if ($transferbar = @include XOOPS_ROOT_PATH.'/Frameworks/transfer/bar.transfer.php') { |
|
109 | 109 | $xoopsTpl->assign('transfer', $transferbar); |
110 | 110 | } |
111 | 111 | |
@@ -115,6 +115,6 @@ discard block |
||
115 | 115 | // for comment and notification |
116 | 116 | //$_SERVER['REQUEST_URI'] = XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/view.article.php"; |
117 | 117 | $_GET['article'] = $article_id; |
118 | -include XOOPS_ROOT_PATH . '/include/comment_view.php'; |
|
118 | +include XOOPS_ROOT_PATH.'/include/comment_view.php'; |
|
119 | 119 | |
120 | -require_once __DIR__ . '/footer.php'; |
|
120 | +require_once __DIR__.'/footer.php'; |
@@ -32,13 +32,13 @@ discard block |
||
32 | 32 | include __DIR__ . '/header.php'; |
33 | 33 | |
34 | 34 | if (preg_match("/\/notification_update\.php/i", Request::getUrl('REQUEST_URI', '', 'SERVER'), $matches)) { |
35 | - include XOOPS_ROOT_PATH . '/include/notification_update.php'; |
|
36 | - exit(); |
|
35 | + include XOOPS_ROOT_PATH . '/include/notification_update.php'; |
|
36 | + exit(); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | if ($REQUEST_URI_parsed = PlanetUtility::planetParseArguments($args_num, $args, $args_str)) { |
40 | - $args['start'] = @$args_num[0]; |
|
41 | - $args['sort'] = @$args_str[0]; |
|
40 | + $args['start'] = @$args_num[0]; |
|
41 | + $args['sort'] = @$args_str[0]; |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /* Start */ |
@@ -85,28 +85,28 @@ discard block |
||
85 | 85 | $blog_prefix = ''; |
86 | 86 | /* Specific category */ |
87 | 87 | if ($category_id > 0) { |
88 | - $category_obj = $categoryHandler->get($category_id); |
|
89 | - $criteria->add(new \Criteria('bc.cat_id', $category_id)); |
|
90 | - $uid = 0; |
|
91 | - $blog_id = 0; |
|
92 | - $category_data = ['id' => $category_id, 'title' => $category_obj->getVar('cat_title')]; |
|
93 | - $query_type = 'category'; |
|
94 | - $blog_prefix = 'b.'; |
|
88 | + $category_obj = $categoryHandler->get($category_id); |
|
89 | + $criteria->add(new \Criteria('bc.cat_id', $category_id)); |
|
90 | + $uid = 0; |
|
91 | + $blog_id = 0; |
|
92 | + $category_data = ['id' => $category_id, 'title' => $category_obj->getVar('cat_title')]; |
|
93 | + $query_type = 'category'; |
|
94 | + $blog_prefix = 'b.'; |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /* User bookmarks(favorites) */ |
98 | 98 | if ($uid > 0) { |
99 | - $criteria->add(new \Criteria('bm.bm_uid', $uid)); |
|
100 | - $category_id = 0; |
|
101 | - $blog_id = 0; |
|
102 | - $bookmarkHandler = xoops_getModuleHandler('bookmark', $GLOBALS['moddirname']); |
|
103 | - $user_data = [ |
|
104 | - 'uid' => $uid, |
|
105 | - 'name' => XoopsUser::getUnameFromId($uid), |
|
106 | - 'marks' => $bookmarkHandler->getCount(new \Criteria('bm_uid', $uid)) |
|
107 | - ]; |
|
108 | - $query_type = 'bookmark'; |
|
109 | - $blog_prefix = 'b.'; |
|
99 | + $criteria->add(new \Criteria('bm.bm_uid', $uid)); |
|
100 | + $category_id = 0; |
|
101 | + $blog_id = 0; |
|
102 | + $bookmarkHandler = xoops_getModuleHandler('bookmark', $GLOBALS['moddirname']); |
|
103 | + $user_data = [ |
|
104 | + 'uid' => $uid, |
|
105 | + 'name' => XoopsUser::getUnameFromId($uid), |
|
106 | + 'marks' => $bookmarkHandler->getCount(new \Criteria('bm_uid', $uid)) |
|
107 | + ]; |
|
108 | + $query_type = 'bookmark'; |
|
109 | + $blog_prefix = 'b.'; |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | $criteria->add(new \Criteria($blog_prefix . 'blog_status', 0, '>')); |
@@ -115,20 +115,20 @@ discard block |
||
115 | 115 | $order = 'DESC'; |
116 | 116 | $sort = empty($sort) ? 'default' : $sort; |
117 | 117 | switch ($sort) { |
118 | - case 'marks': |
|
119 | - $sortby = $blog_prefix . 'blog_marks'; |
|
120 | - break; |
|
121 | - case 'rating': |
|
122 | - $sortby = $blog_prefix . 'blog_rating'; |
|
123 | - break; |
|
124 | - case 'time': |
|
125 | - $sortby = $blog_prefix . 'blog_time'; |
|
126 | - break; |
|
127 | - case 'default': |
|
128 | - default: |
|
129 | - $sort = 'default'; |
|
130 | - $sortby = $blog_prefix . 'blog_id'; |
|
131 | - break; |
|
118 | + case 'marks': |
|
119 | + $sortby = $blog_prefix . 'blog_marks'; |
|
120 | + break; |
|
121 | + case 'rating': |
|
122 | + $sortby = $blog_prefix . 'blog_rating'; |
|
123 | + break; |
|
124 | + case 'time': |
|
125 | + $sortby = $blog_prefix . 'blog_time'; |
|
126 | + break; |
|
127 | + case 'default': |
|
128 | + default: |
|
129 | + $sort = 'default'; |
|
130 | + $sortby = $blog_prefix . 'blog_id'; |
|
131 | + break; |
|
132 | 132 | } |
133 | 133 | $criteria->setSort($sortby); |
134 | 134 | $criteria->setOrder($order); |
@@ -137,93 +137,93 @@ discard block |
||
137 | 137 | |
138 | 138 | $tags = empty($list) ? '' : [$blog_prefix . 'blog_title', $blog_prefix . 'blog_time']; |
139 | 139 | switch ($query_type) { |
140 | - case 'category': |
|
141 | - $blogs_obj = $blogHandler->getByCategory($criteria, $tags); |
|
142 | - $count_blog = $blogHandler->getCountByCategory($criteria); |
|
143 | - break; |
|
144 | - case 'bookmark': |
|
145 | - $blogs_obj = $blogHandler->getByBookmark($criteria, $tags); |
|
146 | - $count_blog = $blogHandler->getCountByBookmark($criteria); |
|
147 | - break; |
|
148 | - default: |
|
149 | - $blogs_obj = $blogHandler->getAll($criteria, $tags); |
|
150 | - $count_blog = $blogHandler->getCount($criteria); |
|
151 | - break; |
|
140 | + case 'category': |
|
141 | + $blogs_obj = $blogHandler->getByCategory($criteria, $tags); |
|
142 | + $count_blog = $blogHandler->getCountByCategory($criteria); |
|
143 | + break; |
|
144 | + case 'bookmark': |
|
145 | + $blogs_obj = $blogHandler->getByBookmark($criteria, $tags); |
|
146 | + $count_blog = $blogHandler->getCountByBookmark($criteria); |
|
147 | + break; |
|
148 | + default: |
|
149 | + $blogs_obj = $blogHandler->getAll($criteria, $tags); |
|
150 | + $count_blog = $blogHandler->getCount($criteria); |
|
151 | + break; |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | /* Objects to array */ |
155 | 155 | $blogs = []; |
156 | 156 | foreach (array_keys($blogs_obj) as $id) { |
157 | - $_blog = [ |
|
158 | - 'id' => $id, |
|
159 | - 'title' => $blogs_obj[$id]->getVar('blog_title'), |
|
160 | - 'time' => $blogs_obj[$id]->getTime() |
|
161 | - ]; |
|
162 | - if (empty($list)) { |
|
163 | - $_blog = array_merge($_blog, [ |
|
164 | - 'image' => $blogs_obj[$id]->getImage(), |
|
165 | - 'feed' => $blogs_obj[$id]->getVar('blog_feed'), |
|
166 | - 'link' => $blogs_obj[$id]->getVar('blog_link'), |
|
167 | - 'desc' => $blogs_obj[$id]->getVar('blog_desc'), |
|
168 | - 'star' => $blogs_obj[$id]->getStar(), |
|
169 | - 'rates' => $blogs_obj[$id]->getVar('blog_rates'), |
|
170 | - 'marks' => $blogs_obj[$id]->getVar('blog_marks') |
|
171 | - ]); |
|
172 | - } |
|
173 | - $blogs[] = $_blog; |
|
174 | - unset($_blog); |
|
157 | + $_blog = [ |
|
158 | + 'id' => $id, |
|
159 | + 'title' => $blogs_obj[$id]->getVar('blog_title'), |
|
160 | + 'time' => $blogs_obj[$id]->getTime() |
|
161 | + ]; |
|
162 | + if (empty($list)) { |
|
163 | + $_blog = array_merge($_blog, [ |
|
164 | + 'image' => $blogs_obj[$id]->getImage(), |
|
165 | + 'feed' => $blogs_obj[$id]->getVar('blog_feed'), |
|
166 | + 'link' => $blogs_obj[$id]->getVar('blog_link'), |
|
167 | + 'desc' => $blogs_obj[$id]->getVar('blog_desc'), |
|
168 | + 'star' => $blogs_obj[$id]->getStar(), |
|
169 | + 'rates' => $blogs_obj[$id]->getVar('blog_rates'), |
|
170 | + 'marks' => $blogs_obj[$id]->getVar('blog_marks') |
|
171 | + ]); |
|
172 | + } |
|
173 | + $blogs[] = $_blog; |
|
174 | + unset($_blog); |
|
175 | 175 | } |
176 | 176 | unset($blogs_obj); |
177 | 177 | |
178 | 178 | if ($count_blog > $limit) { |
179 | - include XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
180 | - $start_link = []; |
|
181 | - if ($sort) { |
|
182 | - $start_link[] = 'sort=' . $sort; |
|
183 | - } |
|
184 | - if ($category_id) { |
|
185 | - $start_link[] = 'category=' . $category_id; |
|
186 | - } |
|
187 | - if ($list) { |
|
188 | - $start_link[] = 'list=' . $list; |
|
189 | - } |
|
190 | - $nav = new \XoopsPageNav($count_blog, $limit, $start, 'start', implode('&', $start_link)); |
|
191 | - $pagenav = $nav->renderNav(4); |
|
179 | + include XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
180 | + $start_link = []; |
|
181 | + if ($sort) { |
|
182 | + $start_link[] = 'sort=' . $sort; |
|
183 | + } |
|
184 | + if ($category_id) { |
|
185 | + $start_link[] = 'category=' . $category_id; |
|
186 | + } |
|
187 | + if ($list) { |
|
188 | + $start_link[] = 'list=' . $list; |
|
189 | + } |
|
190 | + $nav = new \XoopsPageNav($count_blog, $limit, $start, 'start', implode('&', $start_link)); |
|
191 | + $pagenav = $nav->renderNav(4); |
|
192 | 192 | } else { |
193 | - $pagenav = ''; |
|
193 | + $pagenav = ''; |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | $xoopsTpl->assign('xoops_pagetitle', $xoopsOption['xoops_pagetitle']); |
197 | 197 | $xoopsTpl->assign('link_home', '<a href="' . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php" title="' . planet_constant('MD_HOME') . '" target="_self">' . planet_constant('MD_HOME') . '</a>'); |
198 | 198 | |
199 | 199 | if ($category_id || $uid) { |
200 | - $xoopsTpl->assign('link_index', '<a href="' . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.blogs.php" title="' . planet_constant('MD_INDEX') . '" target="_self">' . planet_constant('MD_INDEX') . '</a>'); |
|
200 | + $xoopsTpl->assign('link_index', '<a href="' . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.blogs.php" title="' . planet_constant('MD_INDEX') . '" target="_self">' . planet_constant('MD_INDEX') . '</a>'); |
|
201 | 201 | |
202 | - $link_articles = '<a href="' . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . (empty($category_id) ? '' : '/c' . $category_id) . (empty($uid) ? '' : '/u' . $uid) . '" title="' . planet_constant('MD_ARTICLES') . '">' . planet_constant('MD_ARTICLES') . '</a>'; |
|
203 | - $xoopsTpl->assign('link_articles', $link_articles); |
|
202 | + $link_articles = '<a href="' . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . (empty($category_id) ? '' : '/c' . $category_id) . (empty($uid) ? '' : '/u' . $uid) . '" title="' . planet_constant('MD_ARTICLES') . '">' . planet_constant('MD_ARTICLES') . '</a>'; |
|
203 | + $xoopsTpl->assign('link_articles', $link_articles); |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | $link_switch = '<a href="' |
207 | - . XOOPS_URL |
|
208 | - . '/modules/' |
|
209 | - . $GLOBALS['moddirname'] |
|
210 | - . '/view.blogs.php' |
|
211 | - . (empty($category_id) ? '' : '/c' . $category_id) |
|
212 | - . (empty($uid) ? '' : '/u' . $uid) |
|
213 | - . (empty($list) ? '/l1' : '') |
|
214 | - . '" title="' |
|
215 | - . (empty($list) ? planet_constant('MD_LISTVIEW') : planet_constant('MD_FULLVIEW')) |
|
216 | - . '">' |
|
217 | - . (empty($list) ? planet_constant('MD_LISTVIEW') : planet_constant('MD_FULLVIEW')) |
|
218 | - . '</a>'; |
|
207 | + . XOOPS_URL |
|
208 | + . '/modules/' |
|
209 | + . $GLOBALS['moddirname'] |
|
210 | + . '/view.blogs.php' |
|
211 | + . (empty($category_id) ? '' : '/c' . $category_id) |
|
212 | + . (empty($uid) ? '' : '/u' . $uid) |
|
213 | + . (empty($list) ? '/l1' : '') |
|
214 | + . '" title="' |
|
215 | + . (empty($list) ? planet_constant('MD_LISTVIEW') : planet_constant('MD_FULLVIEW')) |
|
216 | + . '">' |
|
217 | + . (empty($list) ? planet_constant('MD_LISTVIEW') : planet_constant('MD_FULLVIEW')) |
|
218 | + . '</a>'; |
|
219 | 219 | $xoopsTpl->assign('link_switch', $link_switch); |
220 | 220 | |
221 | 221 | if (empty($uid) && is_object($xoopsUser)) { |
222 | - $xoopsTpl->assign('link_bookmark', '<a href="' . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.blogs.php' . URL_DELIMITER . 'u' . $xoopsUser->getVar('uid') . '" title="' . planet_constant('MD_BOOKMARKS') . '" target="_self">' . planet_constant('MD_BOOKMARKS') . '</a>'); |
|
222 | + $xoopsTpl->assign('link_bookmark', '<a href="' . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.blogs.php' . URL_DELIMITER . 'u' . $xoopsUser->getVar('uid') . '" title="' . planet_constant('MD_BOOKMARKS') . '" target="_self">' . planet_constant('MD_BOOKMARKS') . '</a>'); |
|
223 | 223 | } |
224 | 224 | |
225 | 225 | if (1 == $helper->getConfig('newblog_submit') || is_object($xoopsUser)) { |
226 | - $xoopsTpl->assign('link_submit', '<a href="' . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/action.blog.php" title="' . _SUBMIT . '" target="_blank">' . _SUBMIT . '</a>'); |
|
226 | + $xoopsTpl->assign('link_submit', '<a href="' . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/action.blog.php" title="' . _SUBMIT . '" target="_blank">' . _SUBMIT . '</a>'); |
|
227 | 227 | } |
228 | 228 | |
229 | 229 | $xoopsTpl->assign('pagetitle', $xoopsModule->getVar('name') . '::' . planet_constant('MD_BLOGS')); |
@@ -237,35 +237,35 @@ discard block |
||
237 | 237 | $xoopsTpl->assign('user_level', !is_object($xoopsUser) ? 0 : ($xoopsUser->isAdmin() ? 2 : 1)); |
238 | 238 | if (empty($helper->getConfig('anonymous_rate')) && !is_object($xoopsUser)) { |
239 | 239 | } elseif (!$list) { |
240 | - $xoopsTpl->assign('canrate', 1); |
|
240 | + $xoopsTpl->assign('canrate', 1); |
|
241 | 241 | } |
242 | 242 | |
243 | 243 | $sort_link = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.blogs.php' . URL_DELIMITER; |
244 | 244 | $vars = []; |
245 | 245 | if (!empty($category_id)) { |
246 | - $vars[] = 'c' . $category_id; |
|
246 | + $vars[] = 'c' . $category_id; |
|
247 | 247 | } |
248 | 248 | if (!empty($uid)) { |
249 | - $vars[] = 'u' . $uid; |
|
249 | + $vars[] = 'u' . $uid; |
|
250 | 250 | } |
251 | 251 | if (!empty($list)) { |
252 | - $vars[] = 'li'; |
|
252 | + $vars[] = 'li'; |
|
253 | 253 | } |
254 | 254 | if (!empty($vars)) { |
255 | - $sort_link .= implode('/', $vars) . '/'; |
|
255 | + $sort_link .= implode('/', $vars) . '/'; |
|
256 | 256 | } |
257 | 257 | $sortlinks = []; |
258 | 258 | $valid_sorts = [ |
259 | - 'marks' => planet_constant('MD_BOOKMARKS'), |
|
260 | - 'rating' => planet_constant('MD_RATING'), |
|
261 | - 'time' => planet_constant('MD_TIME'), |
|
262 | - 'default' => planet_constant('MD_DEFAULT') |
|
259 | + 'marks' => planet_constant('MD_BOOKMARKS'), |
|
260 | + 'rating' => planet_constant('MD_RATING'), |
|
261 | + 'time' => planet_constant('MD_TIME'), |
|
262 | + 'default' => planet_constant('MD_DEFAULT') |
|
263 | 263 | ]; |
264 | 264 | foreach ($valid_sorts as $val => $name) { |
265 | - if ($val == $sort) { |
|
266 | - continue; |
|
267 | - } |
|
268 | - $sortlinks[] = '<a href="' . $sort_link . $val . '">' . $name . '</a>'; |
|
265 | + if ($val == $sort) { |
|
266 | + continue; |
|
267 | + } |
|
268 | + $sortlinks[] = '<a href="' . $sort_link . $val . '">' . $name . '</a>'; |
|
269 | 269 | } |
270 | 270 | $xoopsTpl->assign('link_sort', implode(' | ', $sortlinks)); |
271 | 271 |
@@ -29,10 +29,10 @@ discard block |
||
29 | 29 | /** @var Planet\Helper $helper */ |
30 | 30 | $helper = Planet\Helper::getInstance(); |
31 | 31 | |
32 | -include __DIR__ . '/header.php'; |
|
32 | +include __DIR__.'/header.php'; |
|
33 | 33 | |
34 | 34 | if (preg_match("/\/notification_update\.php/i", Request::getUrl('REQUEST_URI', '', 'SERVER'), $matches)) { |
35 | - include XOOPS_ROOT_PATH . '/include/notification_update.php'; |
|
35 | + include XOOPS_ROOT_PATH.'/include/notification_update.php'; |
|
36 | 36 | exit(); |
37 | 37 | } |
38 | 38 | |
@@ -69,10 +69,10 @@ discard block |
||
69 | 69 | } |
70 | 70 | */ |
71 | 71 | |
72 | -$xoopsOption['xoops_pagetitle'] = $xoopsModule->getVar('name') . ' - ' . planet_constant('MD_BLOGS'); |
|
72 | +$xoopsOption['xoops_pagetitle'] = $xoopsModule->getVar('name').' - '.planet_constant('MD_BLOGS'); |
|
73 | 73 | $xoopsOption['template_main'] = PlanetUtility::planetGetTemplate('blogs'); |
74 | -require_once XOOPS_ROOT_PATH . '/header.php'; |
|
75 | -include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php'; |
|
74 | +require_once XOOPS_ROOT_PATH.'/header.php'; |
|
75 | +include XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/vars.php'; |
|
76 | 76 | |
77 | 77 | // Following part will not be executed after cache |
78 | 78 | $categoryHandler = xoops_getModuleHandler('category', $GLOBALS['moddirname']); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $criteria = new \CriteriaCompo(); |
85 | 85 | $blog_prefix = ''; |
86 | 86 | /* Specific category */ |
87 | -if ($category_id > 0) { |
|
87 | +if ($category_id>0) { |
|
88 | 88 | $category_obj = $categoryHandler->get($category_id); |
89 | 89 | $criteria->add(new \Criteria('bc.cat_id', $category_id)); |
90 | 90 | $uid = 0; |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | } |
96 | 96 | |
97 | 97 | /* User bookmarks(favorites) */ |
98 | -if ($uid > 0) { |
|
98 | +if ($uid>0) { |
|
99 | 99 | $criteria->add(new \Criteria('bm.bm_uid', $uid)); |
100 | 100 | $category_id = 0; |
101 | 101 | $blog_id = 0; |
@@ -109,25 +109,25 @@ discard block |
||
109 | 109 | $blog_prefix = 'b.'; |
110 | 110 | } |
111 | 111 | |
112 | -$criteria->add(new \Criteria($blog_prefix . 'blog_status', 0, '>')); |
|
112 | +$criteria->add(new \Criteria($blog_prefix.'blog_status', 0, '>')); |
|
113 | 113 | |
114 | 114 | /* Sort */ |
115 | 115 | $order = 'DESC'; |
116 | 116 | $sort = empty($sort) ? 'default' : $sort; |
117 | 117 | switch ($sort) { |
118 | 118 | case 'marks': |
119 | - $sortby = $blog_prefix . 'blog_marks'; |
|
119 | + $sortby = $blog_prefix.'blog_marks'; |
|
120 | 120 | break; |
121 | 121 | case 'rating': |
122 | - $sortby = $blog_prefix . 'blog_rating'; |
|
122 | + $sortby = $blog_prefix.'blog_rating'; |
|
123 | 123 | break; |
124 | 124 | case 'time': |
125 | - $sortby = $blog_prefix . 'blog_time'; |
|
125 | + $sortby = $blog_prefix.'blog_time'; |
|
126 | 126 | break; |
127 | 127 | case 'default': |
128 | 128 | default: |
129 | 129 | $sort = 'default'; |
130 | - $sortby = $blog_prefix . 'blog_id'; |
|
130 | + $sortby = $blog_prefix.'blog_id'; |
|
131 | 131 | break; |
132 | 132 | } |
133 | 133 | $criteria->setSort($sortby); |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $criteria->setStart($start); |
136 | 136 | $criteria->setLimit($limit); |
137 | 137 | |
138 | -$tags = empty($list) ? '' : [$blog_prefix . 'blog_title', $blog_prefix . 'blog_time']; |
|
138 | +$tags = empty($list) ? '' : [$blog_prefix.'blog_title', $blog_prefix.'blog_time']; |
|
139 | 139 | switch ($query_type) { |
140 | 140 | case 'category': |
141 | 141 | $blogs_obj = $blogHandler->getByCategory($criteria, $tags); |
@@ -175,31 +175,31 @@ discard block |
||
175 | 175 | } |
176 | 176 | unset($blogs_obj); |
177 | 177 | |
178 | -if ($count_blog > $limit) { |
|
179 | - include XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
178 | +if ($count_blog>$limit) { |
|
179 | + include XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
180 | 180 | $start_link = []; |
181 | 181 | if ($sort) { |
182 | - $start_link[] = 'sort=' . $sort; |
|
182 | + $start_link[] = 'sort='.$sort; |
|
183 | 183 | } |
184 | 184 | if ($category_id) { |
185 | - $start_link[] = 'category=' . $category_id; |
|
185 | + $start_link[] = 'category='.$category_id; |
|
186 | 186 | } |
187 | 187 | if ($list) { |
188 | - $start_link[] = 'list=' . $list; |
|
188 | + $start_link[] = 'list='.$list; |
|
189 | 189 | } |
190 | 190 | $nav = new \XoopsPageNav($count_blog, $limit, $start, 'start', implode('&', $start_link)); |
191 | 191 | $pagenav = $nav->renderNav(4); |
192 | -} else { |
|
192 | +}else { |
|
193 | 193 | $pagenav = ''; |
194 | 194 | } |
195 | 195 | |
196 | 196 | $xoopsTpl->assign('xoops_pagetitle', $xoopsOption['xoops_pagetitle']); |
197 | -$xoopsTpl->assign('link_home', '<a href="' . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php" title="' . planet_constant('MD_HOME') . '" target="_self">' . planet_constant('MD_HOME') . '</a>'); |
|
197 | +$xoopsTpl->assign('link_home', '<a href="'.XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php" title="'.planet_constant('MD_HOME').'" target="_self">'.planet_constant('MD_HOME').'</a>'); |
|
198 | 198 | |
199 | 199 | if ($category_id || $uid) { |
200 | - $xoopsTpl->assign('link_index', '<a href="' . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.blogs.php" title="' . planet_constant('MD_INDEX') . '" target="_self">' . planet_constant('MD_INDEX') . '</a>'); |
|
200 | + $xoopsTpl->assign('link_index', '<a href="'.XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.blogs.php" title="'.planet_constant('MD_INDEX').'" target="_self">'.planet_constant('MD_INDEX').'</a>'); |
|
201 | 201 | |
202 | - $link_articles = '<a href="' . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . (empty($category_id) ? '' : '/c' . $category_id) . (empty($uid) ? '' : '/u' . $uid) . '" title="' . planet_constant('MD_ARTICLES') . '">' . planet_constant('MD_ARTICLES') . '</a>'; |
|
202 | + $link_articles = '<a href="'.XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php'.(empty($category_id) ? '' : '/c'.$category_id).(empty($uid) ? '' : '/u'.$uid).'" title="'.planet_constant('MD_ARTICLES').'">'.planet_constant('MD_ARTICLES').'</a>'; |
|
203 | 203 | $xoopsTpl->assign('link_articles', $link_articles); |
204 | 204 | } |
205 | 205 | |
@@ -208,8 +208,8 @@ discard block |
||
208 | 208 | . '/modules/' |
209 | 209 | . $GLOBALS['moddirname'] |
210 | 210 | . '/view.blogs.php' |
211 | - . (empty($category_id) ? '' : '/c' . $category_id) |
|
212 | - . (empty($uid) ? '' : '/u' . $uid) |
|
211 | + . (empty($category_id) ? '' : '/c'.$category_id) |
|
212 | + . (empty($uid) ? '' : '/u'.$uid) |
|
213 | 213 | . (empty($list) ? '/l1' : '') |
214 | 214 | . '" title="' |
215 | 215 | . (empty($list) ? planet_constant('MD_LISTVIEW') : planet_constant('MD_FULLVIEW')) |
@@ -219,14 +219,14 @@ discard block |
||
219 | 219 | $xoopsTpl->assign('link_switch', $link_switch); |
220 | 220 | |
221 | 221 | if (empty($uid) && is_object($xoopsUser)) { |
222 | - $xoopsTpl->assign('link_bookmark', '<a href="' . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.blogs.php' . URL_DELIMITER . 'u' . $xoopsUser->getVar('uid') . '" title="' . planet_constant('MD_BOOKMARKS') . '" target="_self">' . planet_constant('MD_BOOKMARKS') . '</a>'); |
|
222 | + $xoopsTpl->assign('link_bookmark', '<a href="'.XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.blogs.php'.URL_DELIMITER.'u'.$xoopsUser->getVar('uid').'" title="'.planet_constant('MD_BOOKMARKS').'" target="_self">'.planet_constant('MD_BOOKMARKS').'</a>'); |
|
223 | 223 | } |
224 | 224 | |
225 | 225 | if (1 == $helper->getConfig('newblog_submit') || is_object($xoopsUser)) { |
226 | - $xoopsTpl->assign('link_submit', '<a href="' . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/action.blog.php" title="' . _SUBMIT . '" target="_blank">' . _SUBMIT . '</a>'); |
|
226 | + $xoopsTpl->assign('link_submit', '<a href="'.XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/action.blog.php" title="'._SUBMIT.'" target="_blank">'._SUBMIT.'</a>'); |
|
227 | 227 | } |
228 | 228 | |
229 | -$xoopsTpl->assign('pagetitle', $xoopsModule->getVar('name') . '::' . planet_constant('MD_BLOGS')); |
|
229 | +$xoopsTpl->assign('pagetitle', $xoopsModule->getVar('name').'::'.planet_constant('MD_BLOGS')); |
|
230 | 230 | $xoopsTpl->assign('category', @$category_data); |
231 | 231 | $xoopsTpl->assign('user', @$user_data); |
232 | 232 | $xoopsTpl->assign('blogs', $blogs); |
@@ -240,19 +240,19 @@ discard block |
||
240 | 240 | $xoopsTpl->assign('canrate', 1); |
241 | 241 | } |
242 | 242 | |
243 | -$sort_link = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.blogs.php' . URL_DELIMITER; |
|
243 | +$sort_link = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.blogs.php'.URL_DELIMITER; |
|
244 | 244 | $vars = []; |
245 | 245 | if (!empty($category_id)) { |
246 | - $vars[] = 'c' . $category_id; |
|
246 | + $vars[] = 'c'.$category_id; |
|
247 | 247 | } |
248 | 248 | if (!empty($uid)) { |
249 | - $vars[] = 'u' . $uid; |
|
249 | + $vars[] = 'u'.$uid; |
|
250 | 250 | } |
251 | 251 | if (!empty($list)) { |
252 | 252 | $vars[] = 'li'; |
253 | 253 | } |
254 | 254 | if (!empty($vars)) { |
255 | - $sort_link .= implode('/', $vars) . '/'; |
|
255 | + $sort_link .= implode('/', $vars).'/'; |
|
256 | 256 | } |
257 | 257 | $sortlinks = []; |
258 | 258 | $valid_sorts = [ |
@@ -265,8 +265,8 @@ discard block |
||
265 | 265 | if ($val == $sort) { |
266 | 266 | continue; |
267 | 267 | } |
268 | - $sortlinks[] = '<a href="' . $sort_link . $val . '">' . $name . '</a>'; |
|
268 | + $sortlinks[] = '<a href="'.$sort_link.$val.'">'.$name.'</a>'; |
|
269 | 269 | } |
270 | 270 | $xoopsTpl->assign('link_sort', implode(' | ', $sortlinks)); |
271 | 271 | |
272 | -require_once __DIR__ . '/footer.php'; |
|
272 | +require_once __DIR__.'/footer.php'; |
@@ -21,21 +21,21 @@ |
||
21 | 21 | $op = \Xmf\Request::getCmd('op', ''); |
22 | 22 | |
23 | 23 | switch ($op) { |
24 | - case 'load': |
|
25 | - loadSampleData(); |
|
26 | - break; |
|
24 | + case 'load': |
|
25 | + loadSampleData(); |
|
26 | + break; |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | // XMF TableLoad for SAMPLE data |
30 | 30 | |
31 | 31 | function loadSampleData() |
32 | 32 | { |
33 | - // $moduleDirName = basename(dirname(__DIR__)); |
|
34 | - xoops_loadLanguage('comment'); |
|
35 | - $items = \Xmf\Yaml::readWrapped('quotes_data.yml'); |
|
33 | + // $moduleDirName = basename(dirname(__DIR__)); |
|
34 | + xoops_loadLanguage('comment'); |
|
35 | + $items = \Xmf\Yaml::readWrapped('quotes_data.yml'); |
|
36 | 36 | |
37 | - \Xmf\Database\TableLoad::truncateTable('randomquote_quotes'); |
|
38 | - \Xmf\Database\TableLoad::loadTableFromArray('randomquote_quotes', $items); |
|
37 | + \Xmf\Database\TableLoad::truncateTable('randomquote_quotes'); |
|
38 | + \Xmf\Database\TableLoad::loadTableFromArray('randomquote_quotes', $items); |
|
39 | 39 | |
40 | - redirect_header('../admin/index.php', 1, _CM_ACTIVE); |
|
40 | + redirect_header('../admin/index.php', 1, _CM_ACTIVE); |
|
41 | 41 | } |
@@ -15,7 +15,7 @@ |
||
15 | 15 | * @author Michael Beck (aka Mamba) |
16 | 16 | */ |
17 | 17 | |
18 | -require_once __DIR__ . '/../../../mainfile.php'; |
|
18 | +require_once __DIR__.'/../../../mainfile.php'; |
|
19 | 19 | |
20 | 20 | |
21 | 21 | $op = \Xmf\Request::getCmd('op', ''); |
@@ -34,12 +34,12 @@ discard block |
||
34 | 34 | $blog_id = Request::getInt('blog', Request::getInt('blog', 0, 'POST'), 'GET'); //(int)(!empty($_POST['blog']) ? $_POST['blog'] : (!empty($_GET['blog']) ? $_GET['blog'] : 0)); |
35 | 35 | $blogHandler = xoops_getModuleHandler('blog', $GLOBALS['moddirname']); |
36 | 36 | if ($blog_id > 0) { |
37 | - $blog = $blogHandler->get($blog_id); |
|
38 | - $count = $blogHandler->do_update($blog); |
|
39 | - redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php?blog=' . $blog_id, 2, sprintf(planet_constant('MD_UPDATED'), (int)$count)); |
|
37 | + $blog = $blogHandler->get($blog_id); |
|
38 | + $count = $blogHandler->do_update($blog); |
|
39 | + redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php?blog=' . $blog_id, 2, sprintf(planet_constant('MD_UPDATED'), (int)$count)); |
|
40 | 40 | } |
41 | 41 | if (planetGetCookie('upd') + 30 * 60 > time()) { |
42 | - return; |
|
42 | + return; |
|
43 | 43 | } |
44 | 44 | PlanetUtility::planetSetCookie('upd', time()); |
45 | 45 | $start = 0; |
@@ -50,15 +50,15 @@ discard block |
||
50 | 50 | $criteria->setLimit($helper->getConfig('blogs_perupdate')); |
51 | 51 | $blogs = $blogHandler->getAll($criteria); |
52 | 52 | foreach (array_keys($blogs) as $id) { |
53 | - $blogHandler->do_update($blogs[$id]); |
|
53 | + $blogHandler->do_update($blogs[$id]); |
|
54 | 54 | } |
55 | 55 | $start += count($blogs); |
56 | 56 | if (count($blogs) < $helper->getConfig('blogs_perupdate')) { |
57 | - $start = 0; |
|
57 | + $start = 0; |
|
58 | 58 | } |
59 | 59 | $fp = fopen(XOOPS_CACHE_PATH . '/' . $xoopsModule->getVar('dirname') . '_update.php', 'w'); |
60 | 60 | if (!$fp) { |
61 | - return; |
|
61 | + return; |
|
62 | 62 | } |
63 | 63 | fwrite($fp, "<?php\n \$start=" . (int)$start . ";\n?>"); |
64 | 64 | fclose($fp); |
@@ -29,21 +29,21 @@ discard block |
||
29 | 29 | /** @var Planet\Helper $helper */ |
30 | 30 | $helper = Planet\Helper::getInstance(); |
31 | 31 | |
32 | -include __DIR__ . '/header.php'; |
|
32 | +include __DIR__.'/header.php'; |
|
33 | 33 | |
34 | 34 | $blog_id = Request::getInt('blog', Request::getInt('blog', 0, 'POST'), 'GET'); //(int)(!empty($_POST['blog']) ? $_POST['blog'] : (!empty($_GET['blog']) ? $_GET['blog'] : 0)); |
35 | 35 | $blogHandler = xoops_getModuleHandler('blog', $GLOBALS['moddirname']); |
36 | -if ($blog_id > 0) { |
|
36 | +if ($blog_id>0) { |
|
37 | 37 | $blog = $blogHandler->get($blog_id); |
38 | 38 | $count = $blogHandler->do_update($blog); |
39 | - redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php?blog=' . $blog_id, 2, sprintf(planet_constant('MD_UPDATED'), (int)$count)); |
|
39 | + redirect_header(XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php?blog='.$blog_id, 2, sprintf(planet_constant('MD_UPDATED'), (int) $count)); |
|
40 | 40 | } |
41 | -if (planetGetCookie('upd') + 30 * 60 > time()) { |
|
41 | +if (planetGetCookie('upd')+30*60>time()) { |
|
42 | 42 | return; |
43 | 43 | } |
44 | 44 | PlanetUtility::planetSetCookie('upd', time()); |
45 | 45 | $start = 0; |
46 | -@include XOOPS_CACHE_PATH . '/' . $xoopsModule->getVar('dirname') . '_update.php'; |
|
46 | +@include XOOPS_CACHE_PATH.'/'.$xoopsModule->getVar('dirname').'_update.php'; |
|
47 | 47 | $criteria = new \Criteria('blog_status', 0, '>'); |
48 | 48 | $criteria->setSort('blog_id'); |
49 | 49 | $criteria->setStart($start); |
@@ -53,12 +53,12 @@ discard block |
||
53 | 53 | $blogHandler->do_update($blogs[$id]); |
54 | 54 | } |
55 | 55 | $start += count($blogs); |
56 | -if (count($blogs) < $helper->getConfig('blogs_perupdate')) { |
|
56 | +if (count($blogs)<$helper->getConfig('blogs_perupdate')) { |
|
57 | 57 | $start = 0; |
58 | 58 | } |
59 | -$fp = fopen(XOOPS_CACHE_PATH . '/' . $xoopsModule->getVar('dirname') . '_update.php', 'w'); |
|
59 | +$fp = fopen(XOOPS_CACHE_PATH.'/'.$xoopsModule->getVar('dirname').'_update.php', 'w'); |
|
60 | 60 | if (!$fp) { |
61 | 61 | return; |
62 | 62 | } |
63 | -fwrite($fp, "<?php\n \$start=" . (int)$start . ";\n?>"); |
|
63 | +fwrite($fp, "<?php\n \$start=".(int) $start.";\n?>"); |
|
64 | 64 | fclose($fp); |