|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace XoopsModules\Xooghost\Plugin; |
|
4
|
|
|
|
|
5
|
|
|
/** |
|
6
|
|
|
* Xooghost module |
|
7
|
|
|
* |
|
8
|
|
|
* You may not change or alter any portion of this comment or credits |
|
9
|
|
|
* of supporting developers from this source code or any supporting source code |
|
10
|
|
|
* which is considered copyrighted (c) material of the original comment or credit authors. |
|
11
|
|
|
* This program is distributed in the hope that it will be useful, |
|
12
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
14
|
|
|
* |
|
15
|
|
|
* @copyright XOOPS Project (https://xoops.org) |
|
16
|
|
|
* @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) |
|
17
|
|
|
* @package Xooghost |
|
18
|
|
|
* @since 2.6.0 |
|
19
|
|
|
* @author Laurent JEN (Aka DuGris) |
|
20
|
|
|
*/ |
|
21
|
|
|
|
|
22
|
|
|
/** |
|
23
|
|
|
* Class XooghostXoositemapPlugin |
|
24
|
|
|
*/ |
|
25
|
|
|
class XoositemapPlugin extends \Xoops\Module\Plugin\PluginAbstract implements \XoositemapPluginInterface |
|
|
|
|
|
|
26
|
|
|
{ |
|
27
|
|
|
/** |
|
28
|
|
|
* @param $subcategories |
|
29
|
|
|
* |
|
30
|
|
|
* @return array |
|
31
|
|
|
*/ |
|
32
|
|
|
public function Xoositemap($subcategories) |
|
33
|
|
|
{ |
|
34
|
|
|
$helper = \XoopsModules\Xooghost\Helper::getInstance(); |
|
35
|
|
|
$pageHandler = $helper->getHandler('Page'); |
|
36
|
|
|
|
|
37
|
|
|
$pages = $pageHandler->getPublished('published', 'desc'); |
|
|
|
|
|
|
38
|
|
|
|
|
39
|
|
|
$sitemap = []; |
|
40
|
|
|
foreach ($pages as $k => $page) { |
|
41
|
|
|
$sitemap[$k]['id'] = $k; |
|
42
|
|
|
$sitemap[$k]['title'] = $page['xooghost_title']; |
|
43
|
|
|
$sitemap[$k]['url'] = $page['xooghost_link']; |
|
44
|
|
|
$sitemap[$k]['uid'] = $page['xooghost_uid']; |
|
45
|
|
|
$sitemap[$k]['uname'] = $page['xooghost_uid_name']; |
|
46
|
|
|
$sitemap[$k]['image'] = $page['xooghost_image_link']; |
|
47
|
|
|
$sitemap[$k]['time'] = $page['xooghost_time']; |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
return $sitemap; |
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
|
|
/** |
|
54
|
|
|
* @param $subcategories |
|
55
|
|
|
* |
|
56
|
|
|
* @return array |
|
57
|
|
|
*/ |
|
58
|
|
|
public function Xoositemap_xml($subcategories) |
|
59
|
|
|
{ |
|
60
|
|
|
$helper = \XoopsModules\Xooghost\Helper::getInstance(); |
|
61
|
|
|
$pageHandler = $helper->getHandler('Page'); |
|
62
|
|
|
|
|
63
|
|
|
$sitemap = []; |
|
64
|
|
|
$time = 0; |
|
65
|
|
|
|
|
66
|
|
|
$pages = $pageHandler->getPublished('published', 'desc'); |
|
67
|
|
|
foreach ($pages as $k => $page) { |
|
68
|
|
|
$sitemap[$k]['url'] = $page['xooghost_link']; |
|
69
|
|
|
$sitemap[$k]['time'] = $page['xooghost_time']; |
|
70
|
|
|
if ($time < $page['xooghost_time']) { |
|
71
|
|
|
$time = $page['xooghost_time']; |
|
72
|
|
|
} |
|
73
|
|
|
} |
|
74
|
|
|
|
|
75
|
|
|
return ['dirname' => \XoopsModules\Xooghost\Helper::getInstance()->getModule()->getVar('dirname'), 'time' => $time, 'items' => $sitemap]; |
|
76
|
|
|
} |
|
77
|
|
|
} |
|
78
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths