1
|
|
|
<?php declare(strict_types=1); |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* **************************************************************************** |
5
|
|
|
* marquee - MODULE FOR XOOPS |
6
|
|
|
* Copyright (c) Hervé Thouzard (https://www.herve-thouzard.com) |
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 Hervé Thouzard (https://www.herve-thouzard.com) |
16
|
|
|
* @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) |
17
|
|
|
* @author Hervé Thouzard (https://www.herve-thouzard.com) |
18
|
|
|
* |
19
|
|
|
* Version : |
20
|
|
|
* **************************************************************************** |
21
|
|
|
* |
22
|
|
|
* @param $limit |
23
|
|
|
* @param $dateFormat |
24
|
|
|
* @param $itemsSize |
25
|
|
|
* |
26
|
|
|
* @return array |
27
|
|
|
*/ |
28
|
|
|
|
29
|
|
|
use XoopsModules\News; |
|
|
|
|
30
|
|
|
|
31
|
|
|
// Script to list recent articles from the News module (version >=1.21) |
32
|
|
|
/** |
33
|
|
|
* @param $limit |
34
|
|
|
* @param $dateFormat |
35
|
|
|
* @param $itemsSize |
36
|
|
|
* @return array |
37
|
|
|
*/ |
38
|
|
|
function b_marquee_news($limit, $dateFormat, $itemsSize) |
39
|
|
|
{ |
40
|
|
|
// require_once XOOPS_ROOT_PATH . '/modules/marquee/class/Utility.php'; |
41
|
|
|
require_once XOOPS_ROOT_PATH . '/modules/news/class/class.newsstory.php'; |
42
|
|
|
$block = $stories = []; |
|
|
|
|
43
|
|
|
$story = new News\NewsStory(); |
|
|
|
|
44
|
|
|
$restricted = News\Utility::getModuleOption('restrictindex', 'news'); |
|
|
|
|
45
|
|
|
$stories = News\NewsStory::getAllPublished($limit, 0, $restricted, 0, 1, true, 'published'); |
46
|
|
|
if (count($stories) > 0) { |
47
|
|
|
foreach ($stories as $onestory) { |
48
|
|
|
if ($itemsSize > 0) { |
49
|
|
|
$title = xoops_substr($onestory->title(), 0, $itemsSize + 3); |
50
|
|
|
} else { |
51
|
|
|
$title = $onestory->title(); |
52
|
|
|
} |
53
|
|
|
$block[] = [ |
54
|
|
|
'date' => formatTimestamp($onestory->published(), $dateFormat), |
55
|
|
|
'category' => $onestory->topic_title(), |
56
|
|
|
'author' => $onestory->uid(), |
57
|
|
|
'title' => $title, |
58
|
|
|
'link' => "<a href='" . XOOPS_URL . '/modules/news/article.php?storyid=' . $onestory->storyid() . "'>" . $title . '</a>', |
59
|
|
|
]; |
60
|
|
|
} |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
return $block; |
64
|
|
|
} |
65
|
|
|
|
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