-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
188 lines (169 loc) · 4.37 KB
/
index.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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<?php
error_reporting(0);
/* include core files */
include_once('config.php');
include_once('includes/breadcrumb.php');
include_once('includes/center.php');
include_once('includes/check.php');
include_once('includes/clean.php');
include_once('includes/contents.php');
include_once('includes/detection.php');
include_once('includes/filesystem.php');
include_once('includes/generate.php');
include_once('includes/get.php');
include_once('includes/head.php');
include_once('includes/loader.php');
include_once('includes/misc.php');
include_once('includes/modules.php');
include_once('includes/navigation.php');
include_once('includes/parser.php');
include_once('includes/query.php');
include_once('includes/replace.php');
include_once('includes/search.php');
include_once('includes/service.php');
include_once('includes/startup.php');
/* startup redaxscript */
startup();
/* include files as needed */
if (FIRST_PARAMETER == 'password_reset' || LOGGED_IN != TOKEN && s('captcha') > 0)
{
include_once('includes/captcha.php');
}
if (LAST_TABLE == 'articles')
{
include_once('includes/comments.php');
}
if (FIRST_PARAMETER == 'admin' || FIRST_PARAMETER == 'login' || FIRST_PARAMETER == 'logout')
{
include_once('includes/login.php');
}
if (FIRST_PARAMETER == 'registration' && s('registration') == 1)
{
include_once('includes/password.php');
include_once('includes/registration.php');
}
if ((FIRST_PARAMETER == 'reminder' || FIRST_PARAMETER == 'password_reset') && s('reminder') == 1)
{
include_once('includes/password.php');
include_once('includes/reminder.php');
}
/* include admin files as needed */
if (LOGGED_IN == TOKEN)
{
include_once('includes/admin/admin.php');
include_once('includes/admin/center.php');
}
if (FIRST_PARAMETER == 'admin' && LOGGED_IN == TOKEN)
{
include_once('includes/admin/query.php');
switch (true)
{
case CATEGORIES_NEW == 1:
case CATEGORIES_EDIT == 1:
case CATEGORIES_DELETE == 1:
case ARTICLES_NEW == 1:
case ARTICLES_EDIT == 1:
case ARTICLES_DELETE == 1:
case EXTRAS_NEW == 1:
case EXTRAS_EDIT == 1:
case EXTRAS_DELETE == 1:
case COMMENTS_NEW == 1:
case COMMENTS_EDIT == 1:
case COMMENTS_DELETE == 1:
if (TABLE_PARAMETER == 'categories' || TABLE_PARAMETER == 'articles' || TABLE_PARAMETER == 'extras' || TABLE_PARAMETER == 'comments')
{
include_once('includes/admin/contents.php');
}
case GROUPS_NEW == 1:
case GROUPS_EDIT == 1:
case GROUPS_DELETE == 1:
if (TABLE_PARAMETER == 'groups')
{
include_once('includes/admin/groups.php');
}
case MODULES_INSTALL == 1:
case MODULES_EDIT == 1:
case MODULES_UNINSTALL == 1:
if (TABLE_PARAMETER == 'modules')
{
include_once('includes/admin/modules.php');
}
case SETTINGS_EDIT == 1:
if (TABLE_PARAMETER == 'settings')
{
include_once('includes/admin/settings.php');
}
case USERS_NEW == 1:
case USERS_EDIT == 1:
case USERS_DELETE == 1:
case USERS_EXCEPTION == 1:
if (TABLE_PARAMETER == 'users')
{
include_once('includes/admin/users.php');
}
break;
}
}
/* include language files */
include_once('languages/' . LANGUAGE . '.php');
include_once('languages/misc.php');
/* include module files */
$modules_include = modules_include();
if ($modules_include)
{
foreach ($modules_include as $value)
{
if (file_exists('modules/' . $value . '/languages/' . LANGUAGE . '.php'))
{
include_once('modules/' . $value . '/languages/' . LANGUAGE . '.php');
}
else if (file_exists('modules/' . $value . '/languages/en.php'))
{
include_once('modules/' . $value . '/languages/en.php');
}
if (file_exists('modules/' . $value . '/config.php'))
{
include_once('modules/' . $value . '/config.php');
}
if (file_exists('modules/' . $value . '/index.php'))
{
include_once('modules/' . $value . '/index.php');
}
}
}
/* call loader else render template */
if (FIRST_PARAMETER == 'loader' && (SECOND_PARAMETER == 'styles' || SECOND_PARAMETER == 'scripts'))
{
echo loader(SECOND_PARAMETER, 'outline');
}
else
{
hook('render_start');
/* undefine */
undefine(array(
'RENDER_BREAK',
'CENTER_BREAK',
'REFRESH_ROUTE',
'DESCRIPTION',
'KEYWORDS',
'ROBOTS',
'TITLE'
));
/* render break */
if (RENDER_BREAK == 1)
{
return;
break;
}
else
{
/* handle error */
if (CONTENT_ERROR && CENTER_BREAK == '')
{
header('http/1.0 404 not found');
}
include_once('templates/' . TEMPLATE . '/index.phtml');
}
hook('render_end');
}
?>