1
|
|
|
<?php declare(strict_types=1); |
2
|
|
|
/* |
3
|
|
|
* You may not change or alter any portion of this comment or credits |
4
|
|
|
* of supporting developers from this source code or any supporting source code |
5
|
|
|
* which is considered copyrighted (c) material of the original comment or credit authors. |
6
|
|
|
* |
7
|
|
|
* This program is distributed in the hope that it will be useful, |
8
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
9
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
/** |
13
|
|
|
* @copyright {@link https://xoops.org/ XOOPS Project} |
14
|
|
|
* @license {@link https://www.gnu.org/licenses/gpl-2.0.html GNU GPL 2 or later} |
15
|
|
|
* @author XOOPS Development Team |
16
|
|
|
*/ |
17
|
|
|
|
18
|
|
|
/* |
19
|
|
|
* Created on 28 oct. 2006 |
20
|
|
|
* |
21
|
|
|
* This file is responsible for creating micro summaries for Firefox 2 web navigator |
22
|
|
|
* For more information, see this page : https://wiki.mozilla.org/Microsummaries |
23
|
|
|
* |
24
|
|
|
* @package News |
25
|
|
|
* @author Hervé Thouzard (https://www.herve-thouzard.com) |
26
|
|
|
* @copyright (c) Hervé Thouzard |
27
|
|
|
* |
28
|
|
|
* NOTE : If you use this code, please make credit. |
29
|
|
|
* |
30
|
|
|
*/ |
31
|
|
|
|
32
|
|
|
use XoopsModules\News; |
33
|
|
|
use XoopsModules\News\NewsStory; |
34
|
|
|
|
35
|
|
|
require_once \dirname(__DIR__, 2) . '/mainfile.php'; |
36
|
|
|
// require_once XOOPS_ROOT_PATH . '/modules/news/class/class.newsstory.php'; |
37
|
|
|
if (!News\Utility::getModuleOption('firefox_microsummaries')) { |
38
|
|
|
exit(); |
39
|
|
|
} |
40
|
|
|
$story = new NewsStory(); |
41
|
|
|
$restricted = News\Utility::getModuleOption('restrictindex'); |
42
|
|
|
$sarray = []; |
43
|
|
|
// Get the last news from all topics according to the module's restrictions |
44
|
|
|
$sarray = NewsStory::getAllPublished(1, 0, $restricted, 0); |
45
|
|
|
if (count($sarray) > 0) { |
|
|
|
|
46
|
|
|
$laststory = null; |
47
|
|
|
$laststory = $sarray[0]; |
48
|
|
|
if (is_object($laststory)) { |
49
|
|
|
header('Content-Type:text;'); |
50
|
|
|
echo $laststory->title() . ' - ' . $xoopsConfig['sitename']; |
51
|
|
|
} |
52
|
|
|
} |
53
|
|
|
|