1
|
|
|
<?php |
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
|
|
|
* SmallWorld |
14
|
|
|
* |
15
|
|
|
* @package \XoopsModules\Smallworld |
16
|
|
|
* @license GNU GPL (https://www.gnu.org/licenses/gpl-2.0.html/) |
17
|
|
|
* @copyright The XOOPS Project (https://xoops.org) |
18
|
|
|
* @copyright 2011 Culex |
19
|
|
|
* @author Michael Albertsen (http://culex.dk) <[email protected]> |
20
|
|
|
* @link https://github.com/XoopsModules25x/smallworld |
21
|
|
|
* @since 1.0 |
22
|
|
|
*/ |
23
|
|
|
|
24
|
|
|
use Xmf\Request; |
25
|
|
|
use XoopsModules\Smallworld; |
26
|
|
|
use XoopsModules\Smallworld\Constants; |
27
|
|
|
|
28
|
|
|
require_once __DIR__ . '/header.php'; |
29
|
|
|
|
30
|
|
|
$GLOBALS['xoopsOption']['template_main'] = 'smallworld_permalink.tpl'; |
31
|
|
|
require_once XOOPS_ROOT_PATH . '/header.php'; |
32
|
|
|
|
33
|
|
|
/** @var \XoopsModules\Smallworld\Helper $helper */ |
34
|
|
|
require_once $helper->path('include/functions.php'); |
35
|
|
|
|
36
|
|
|
$GLOBALS['xoopsLogger']->activated = false; |
37
|
|
|
/* error_reporting(E_ALL); */ |
38
|
|
|
|
39
|
|
|
//$set = smallworld_checkPrivateOrPublic(); |
40
|
|
|
//$check = new Smallworld\User(); |
41
|
|
|
//$pub = smallworld_checkUserPubPostPerm(); |
42
|
|
|
|
43
|
|
View Code Duplication |
if (Request::hasVar('updid', 'GET') && Request::hasVar('ownerid', 'GET')) { |
|
|
|
|
44
|
|
|
$updID = Request::getInt('updid', 0, 'GET'); |
45
|
|
|
$ownerID = Request::getInt('ownerid', 0, 'GET'); |
46
|
|
|
} else { |
47
|
|
|
$helper->redirect('index.php', Constants::REDIRECT_DELAY_MEDIUM, _SMALLWORLD_UPDATEID_NOT_EXIST); |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
$id = 0; |
51
|
|
|
$is_admin = $helper->isUserAdmin() ? 'YES' : 'NO'; |
52
|
|
|
$username = ''; |
53
|
|
|
if ($GLOBALS['xoopsUser'] && $GLOBALS['xoopsUser'] instanceof \XoopsUser) { |
|
|
|
|
54
|
|
|
$id = $GLOBALS['xoopsUser']->uid(); |
55
|
|
|
$username = $GLOBALS['xoopsUser']->uname(); |
56
|
|
|
/** {@internal not used}} |
57
|
|
|
if ($helper->userIsAdmin()) { |
58
|
|
|
$pub = $helper->getHandler('SwUser')->allUsers(); |
59
|
|
|
//$pub = $check->allUsers(); |
60
|
|
|
$GLOBALS['xoopsTpl']->assign('ownerofpage', $id); - not used |
61
|
|
|
} |
62
|
|
|
*/ |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
//$friend = $check->friendcheck($id, $ownerID); |
66
|
|
|
$profile = $helper->getHandler('SwUser')->checkIfProfile($id); |
67
|
|
|
$menu_startpage = "<a href='" . $helper->url('publicindex.php') . "'><img id='menuimg' src='" . $helper->url('assets/images/highrise.png') . "'>" . _SMALLWORLD_STARTPAGE . '</a>'; |
68
|
|
|
$menu_home = "<a href='" . $helper->url('index.php') . "'><img id='menuimg' src='" . $helper->url('assets/images/house.png') . "'>" . _SMALLWORLD_HOME . '</a>'; |
69
|
|
|
|
70
|
|
|
// Things to do with wall |
71
|
|
|
$wall = new Smallworld\WallUpdates(); |
72
|
|
|
|
73
|
|
|
// Follow array here - not used |
74
|
|
|
//$followers = smallworld_array_flatten($wall->getFollowers($id), 0); |
75
|
|
|
|
76
|
|
|
$updatesarray = $wall->updatesPermalink($updID, $id, $ownerID); |
77
|
|
|
$wall->parsePubArray($updatesarray, $id); |
78
|
|
|
|
79
|
|
|
$GLOBALS['xoopsTpl']->assign([ |
80
|
|
|
'menu_startpage' => $menu_startpage, |
81
|
|
|
'menu_home' => $menu_home, |
82
|
|
|
'myusername' => $username, |
83
|
|
|
'pagename' => 'index', |
84
|
|
|
'check' => $profile, |
85
|
|
|
'isadminuser' => $is_admin |
86
|
|
|
]); |
87
|
|
|
|
88
|
|
|
require_once XOOPS_ROOT_PATH . '/footer.php'; |
89
|
|
|
|
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.