|
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 page will display a list of the authors of the site |
|
22
|
|
|
* |
|
23
|
|
|
* @package News |
|
24
|
|
|
* @author Hervé Thouzard |
|
25
|
|
|
* @copyright (c) Hervé Thouzard (https://www.herve-thouzard.com) |
|
26
|
|
|
*/ |
|
27
|
|
|
|
|
28
|
|
|
use XoopsModules\News; |
|
29
|
|
|
use XoopsModules\News\NewsStory; |
|
30
|
|
|
|
|
31
|
|
|
require_once \dirname(__DIR__, 2) . '/mainfile.php'; |
|
32
|
|
|
//require_once XOOPS_ROOT_PATH . '/modules/news/class/class.newsstory.php'; |
|
33
|
|
|
//require_once XOOPS_ROOT_PATH . '/modules/news/class/class.newstopic.php'; |
|
34
|
|
|
//require_once XOOPS_ROOT_PATH . '/modules/news/class/class.sfiles.php'; |
|
35
|
|
|
|
|
36
|
|
|
if (!News\Utility::getModuleOption('newsbythisauthor')) { |
|
37
|
|
|
redirect_header('index.php', 2, _ERRORS); |
|
38
|
|
|
} |
|
39
|
|
|
|
|
40
|
|
|
$GLOBALS['xoopsOption']['template_main'] = 'news_whos_who.tpl'; |
|
41
|
|
|
require_once XOOPS_ROOT_PATH . '/header.php'; |
|
42
|
|
|
|
|
43
|
|
|
$option = News\Utility::getModuleOption('displayname'); |
|
44
|
|
|
$article = new NewsStory(); |
|
45
|
|
|
$uid_ids = []; |
|
46
|
|
|
$uid_ids = $article->getWhosWho(News\Utility::getModuleOption('restrictindex')); |
|
47
|
|
|
if (count($uid_ids) > 0) { |
|
|
|
|
|
|
48
|
|
|
$lst_uid = implode(',', $uid_ids); |
|
|
|
|
|
|
49
|
|
|
/** @var \XoopsMemberHandler $memberHandler */ |
|
50
|
|
|
$memberHandler = xoops_getHandler('member'); |
|
51
|
|
|
$critere = new \Criteria('uid', '(' . $lst_uid . ')', 'IN'); |
|
52
|
|
|
$tbl_users = $memberHandler->getUsers($critere); |
|
53
|
|
|
foreach ($tbl_users as $one_user) { |
|
54
|
|
|
$uname = ''; |
|
55
|
|
|
switch ($option) { |
|
56
|
|
|
case 1: // Username |
|
57
|
|
|
$uname = $one_user->getVar('uname'); |
|
58
|
|
|
break; |
|
59
|
|
|
case 2: // Display full name (if it is not empty) |
|
60
|
|
|
if ('' !== xoops_trim($one_user->getVar('name'))) { |
|
61
|
|
|
$uname = $one_user->getVar('name'); |
|
62
|
|
|
} else { |
|
63
|
|
|
$uname = $one_user->getVar('uname'); |
|
64
|
|
|
} |
|
65
|
|
|
break; |
|
66
|
|
|
} |
|
67
|
|
|
$xoopsTpl->append( |
|
68
|
|
|
'whoswho', |
|
69
|
|
|
[ |
|
70
|
|
|
'uid' => $one_user->getVar('uid'), |
|
71
|
|
|
'name' => $uname, |
|
72
|
|
|
'user_avatarurl' => XOOPS_URL . '/uploads/' . $one_user->getVar('user_avatar'), |
|
73
|
|
|
] |
|
74
|
|
|
); |
|
75
|
|
|
} |
|
76
|
|
|
} |
|
77
|
|
|
|
|
78
|
|
|
$xoopsTpl->assign('advertisement', News\Utility::getModuleOption('advertisement')); |
|
79
|
|
|
|
|
80
|
|
|
/** |
|
81
|
|
|
* Manage all the meta datas |
|
82
|
|
|
*/ |
|
83
|
|
|
News\Utility::createMetaDatas($article); |
|
84
|
|
|
|
|
85
|
|
|
$xoopsTpl->assign('xoops_pagetitle', _AM_NEWS_WHOS_WHO); |
|
86
|
|
|
$myts = \MyTextSanitizer::getInstance(); |
|
87
|
|
|
$meta_description = _AM_NEWS_WHOS_WHO . ' - ' . $xoopsModule->name('s'); |
|
88
|
|
|
if (isset($xoTheme) && is_object($xoTheme)) { |
|
89
|
|
|
$xoTheme->addMeta('meta', 'description', $meta_description); |
|
90
|
|
|
} else { // Compatibility for old Xoops versions |
|
91
|
|
|
$xoopsTpl->assign('xoops_meta_description', $meta_description); |
|
92
|
|
|
} |
|
93
|
|
|
|
|
94
|
|
|
require_once XOOPS_ROOT_PATH . '/footer.php'; |
|
95
|
|
|
|