-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathpublic-viewecard.php
65 lines (51 loc) · 2.07 KB
/
public-viewecard.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
/**
* ExtGallery User area
*
* You may not change or alter any portion of this comment or credits
* of supporting developers from this source code or any supporting source code
* which is considered copyrighted (c) material of the original comment or credit authors.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* @copyright {@link https://xoops.org/ XOOPS Project}
* @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
* @author Zoullou (http://www.zoullou.net)
* @package ExtGallery
*/
use XoopsModules\Extgallery;
require_once __DIR__ . '/header.php';
$GLOBALS['xoopsOption']['template_main'] = 'extgallery_public-viewecard.tpl';
require_once XOOPS_ROOT_PATH . '/header.php';
$myts = \MyTextSanitizer::getInstance();
if (\Xmf\Request::hasVar('id', 'GET')) {
$ecardId = $myts->addSlashes($_GET['id']);
} else {
$ecardId = 0;
}
$ecardHandler = Extgallery\Helper::getInstance()->getHandler('PublicEcard');
$ecardObj = $ecardHandler->getEcard($ecardId);
// Check is the photo exist
if (!$ecardObj) {
redirect_header('index.php', 3, _NOPERM);
}
$ecard = $ecardHandler->objectToArray($ecardObj, ['photo_id']);
if ('' == $ecard['photo']['photo_serveur']) {
$ecard['photoUrl'] = XOOPS_URL . '/uploads/extgallery/public-photo/medium/' . $ecard['photo']['photo_name'];
} else {
$ecard['photoUrl'] = $ecard['photo']['photo_serveur'] . $ecard['photo']['photo_name'];
}
$xoopsTpl->assign('ecard', $ecard);
$rel = 'alternate';
$attributes['rel'] = $rel;
$attributes['type'] = 'application/rss+xml';
$attributes['title'] = _MD_EXTGALLERY_RSS;
$attributes['href'] = XOOPS_URL . '/modules/extgallery/public-rss.php';
$xoTheme->addMeta('link', $rel, $attributes);
$xoTheme->addStylesheet('modules/extgallery/assets/css/style.css');
$lang = [
'clickFormMore' => _MD_EXTGALLERY_CLICK_FOR_MORE,
];
$xoopsTpl->assign('lang', $lang);
require_once XOOPS_ROOT_PATH . '/footer.php';