-
Notifications
You must be signed in to change notification settings - Fork 4
/
header.php
154 lines (139 loc) · 6.7 KB
/
header.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<?php
// ------------------------------------------------------------------------ //
// XOOPS - PHP Content Management System //
// Copyright (c) 2000 XOOPS.org //
// <http://www.xoops.org/> //
// ------------------------------------------------------------------------ //
// Based on: //
// myPHPNUKE Web Portal System - http://myphpnuke.com/ //
// PHP-NUKE Web Portal System - http://phpnuke.org/ //
// Thatware - http://thatware.org/ //
// ------------------------------------------------------------------------- //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// //
// 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. See the //
// GNU General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program; if not, write to the Free Software //
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
// ------------------------------------------------------------------------ //
include dirname(dirname(__DIR__)) . '/mainfile.php';
//wanikoo
$mylinks_theme = 'mylinksdefault';
$mylinks_allowed_theme = array(
'mylinksdefault',
'mylinksdefault-RW',
'mylinksdefault-LW',
'mylinksdefault-BW',
'weblinkslike',
'weblinkslike-RW',
'weblinkslike-LW',
'weblinkslike-BW'
);
if (!empty($_POST['mylinks_theme_select']) && in_array($_POST['mylinks_theme_select'], $mylinks_allowed_theme)) {
$mylinks_theme = $_POST['mylinks_theme_select'];
$_SESSION['mylinksUserTheme'] = $_POST['mylinks_theme_select'];
} elseif (!empty($_SESSION['mylinksUserTheme']) && in_array($_SESSION['mylinksUserTheme'], $mylinks_allowed_theme)) {
$mylinks_theme = $_SESSION['mylinksUserTheme'];
}
//wanikoo
if (in_array($mylinks_theme, $mylinks_allowed_theme)) {
$valid_theme = true;
} else {
$valid_theme = false;
}
$mylinks_wide_theme = false;
$mylinks_right_wide_theme = false;
$mylinks_left_wide_theme = false;
$mylinks_both_wide_theme = false;
if (true == $valid_theme) {
if (strpos($mylinks_theme, '-RW') || strpos($mylinks_theme, '-w')) {
$mylinks_wide_theme = true;
$mylinks_right_wide_theme = true;
} elseif (strpos($mylinks_theme, '-LW')) {
$mylinks_wide_theme = true;
$mylinks_left_wide_theme = true;
} elseif (strpos($mylinks_theme, '-BW')) {
$mylinks_wide_theme = true;
$mylinks_both_wide_theme = true;
}
}
//wanikoo
$modulename = basename(__DIR__);
define('XOOPSMYLINKURL', XOOPS_URL . "/modules/{$modulename}");
define('XOOPSMYLINKPATH', XOOPS_ROOT_PATH . "/modules/{$modulename}");
define('XOOPSMYLINKINCURL', XOOPSMYLINKURL . '/include');
define('XOOPSMYLINKINCPATH', XOOPSMYLINKPATH . '/include');
define('XOOPSMYLINKIMGURL', XOOPSMYLINKURL . '/images');
define('XOOPSMYLINKIMGPATH', XOOPSMYLINKPATH . '/images');
include_once XOOPSMYLINKPATH . '/include/functions.php';
//wanikoo
$mylinks_show_siteinfo = $xoopsModuleConfig['showsiteinfo'] ? true : false;
$mylinks_show_extrafunc = $xoopsModuleConfig['showextrafunc'] ? true : false;
if (strpos($GLOBALS['xoopsRequestUri'], 'singlelink.php')) {
$mylinks_show_extrafunc_big = true;
} else {
$mylinks_show_extrafunc_big = false;
}
//ver3.11
$mylinks_shot_provider = $xoopsModuleConfig['shotprovider'];
//ver3.0
//$mylinks_show_externalsearch = false;
$mylinks_show_feed = $xoopsModuleConfig['showfeed'] ? true : false;
//ver2.0
$mylinks_show_logo = $xoopsModuleConfig['showlogo'] ? true : false;
$mylinks_show_letters = $xoopsModuleConfig['showletters'] ? true : false;
$mylinks_show_toolbar = $xoopsModuleConfig['showtoolbar'] ? true : false;
$mylinks_show_search = $xoopsModuleConfig['showxoopssearch'] ? true : false;
/* v3.11 changed theme changer to not display by default
* since there are no themes included with module and adds
* complexity for new users/admins
*/
$mylinks_show_themechanger = false;
$mylinks_adcodes = array();
$mylinks_adcodes['all'] = '';
$mylinks_adcodes['index'] = '';
$mylinks_adcodes['singlelink'] = '';
$mylinks_adcodes['viewcat'] = '';
$mylinks_adcodes['topten'] = '';
$mylinks_adcodes['recent'] = '';
$mylinks_adcodes['ratelink'] = '';
$mylinks_adcodes['modlink'] = '';
$mylinks_adcodes['brokenlink'] = '';
$mylinks_adcodes['submit'] = '';
//wanikoo
// disallow=0, allow =1, memberonly =2
$mylinks_can_print = $xoopsModuleConfig['canprint'];
$mylinks_can_pdf = $xoopsModuleConfig['canpdf'];
$mylinks_can_bookmark = $xoopsModuleConfig['canbookmark'];
//if qrcode module exists
if (file_exists(XOOPS_ROOT_PATH . '/modules/qrcode/qrcode_image.php')) {
// disallow=0, allow =1, memberonly =2
$mylinks_can_qrcode = $xoopsModuleConfig['canqrcode'];
} else {
//no qrcode module
$mylinks_can_qrcode = 0;
}
//logo
if ($mylinks_show_logo && !is_dir(XOOPSMYLINKIMGPATH . "/{$mylinks_theme}/icons/logo.gif")
&& file_exists(XOOPSMYLINKIMGPATH . "/{$mylinks_theme}/icons/logo.gif")
) {
$logoimage = "<a href='" . XOOPSMYLINKURL . "/index.php'><img src='" . XOOPSMYLINKIMGURL . "/{$mylinks_theme}/icons/logo.gif' style='border-width: 0px;' alt=''></a>";
} elseif ($mylinks_show_logo && !is_dir(XOOPSMYLINKIMGPATH . '/icons/logo.gif')
&& file_exists(XOOPSMYLINKIMGPATH . '/icons/logo.gif')
) {
$logoimage = "<a href='" . XOOPSMYLINKURL . "/index.php'><img src='" . XOOPSMYLINKIMGURL . "/icons/logo.gif' style='border-width: 0px' alt=''></a>";
} else {
$logoimage = '';
}