/
index.php
247 lines (234 loc) · 11.5 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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.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. */
/************************************************************************/
/* Additional security & Abstraction layer conversion */
/* 2003 chatserv */
/* http://www.nukefixes.com -- http://www.nukeresources.com */
/************************************************************************/
if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
die ("You can't access this file directly...");
}
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
$pagetitle = "- $module_name";
function showpage($pid, $page=0) {
global $prefix, $db, $sitename, $admin, $module_name;
include("header.php");
OpenTable();
$pid = intval($pid);
$mypage = $db->sql_fetchrow($db->sql_query("SELECT * FROM ".$prefix."_pages WHERE pid='$pid'"));
$myactive = intval($mypage['active']);
$mytitle = stripslashes(check_html($mypage['title'], "nohtml"));
$mysubtitle = stripslashes(check_html($mypage['subtitle'], "nohtml"));
$mypage_header = stripslashes($mypage['page_header']);
$mytext = stripslashes($mypage['text']);
$mypage_footer = stripslashes($mypage['page_footer']);
$mysignature = stripslashes($mypage['signature']);
$mydate = $mypage['date'];
$mycounter = intval($mypage['counter']);
if (($myactive == 0) AND (!is_admin($admin))) {
echo "Sorry... This page doesn't exist.";
} else {
$db->sql_query("UPDATE ".$prefix."_pages SET counter=counter+1 WHERE pid='$pid'");
$date = explode(" ", $mydate);
echo "<font class=\"title\">$mytitle</font><br>"
."<font class=\"content\">$mysubtitle<br><br><br><br>";
$contentpages = explode( "<!--pagebreak-->", $mytext );
$pageno = count($contentpages);
if ( $page=="" || $page < 1 )
$page = 1;
if ( $page > $pageno )
$page = $pageno;
$arrayelement = (int)$page;
$arrayelement --;
if ($pageno > 1) {
echo ""._PAGE.": $page/$pageno<br>";
}
if ($page == 1) {
echo "<p align=\"justify\">".nl2br($mypage_header)."</p><br>";
}
echo "<p align=\"justify\">$contentpages[$arrayelement]</p>";
if($page >= $pageno) {
$next_page = "";
} else {
$next_pagenumber = $page + 1;
if ($page != 1) {
$next_page .= "- ";
}
$next_page .= "<a href=\"modules.php?name=$module_name&pa=showpage&pid=$pid&page=$next_pagenumber\">"._NEXT." ($next_pagenumber/$pageno)</a> <a href=\"modules.php?name=$module_name&pa=showpage&pid=$pid&page=$next_pagenumber\"><img src=\"images/right.gif\" border=\"0\" alt=\""._NEXT."\" title=\""._NEXT."\"></a>";
}
if ($page == $pageno) {
echo "<br><p align=\"justify\">".nl2br($mypage_footer)."</p><br><br>";
}
if($page <= 1) {
$previous_page = "";
} else {
$previous_pagenumber = $page - 1;
$previous_page = "<a href=\"modules.php?name=$module_name&pa=showpage&pid=$pid&page=$previous_pagenumber\"><img src=\"images/left.gif\" border=\"0\" alt=\""._PREVIOUS."\" title=\""._PREVIOUS."\"></a> <a href=\"modules.php?name=$module_name&pa=showpage&pid=$pid&page=$previous_pagenumber\">"._PREVIOUS." ($previous_pagenumber/$pageno)</a>";
}
echo "<br><br><br><center>$previous_page $next_page</center><br><br>";
if ($page == $pageno) {
echo "<p align=\"right\">".nl2br($mysignature)."</p>"
."<p align=\"right\">"._COPYRIGHT." $sitename "._COPYRIGHT2."</p>"
."<p align=\"right\"><font class=\"tiny\">"._PUBLISHEDON.": $date[0] ($mycounter "._READS.")</font></p>"
."<center>"._GOBACK."</center>";
}
}
CloseTable();
include("footer.php");
}
function list_pages() {
global $prefix, $db, $sitename, $admin, $multilingual, $module_name;
include("header.php");
title("$sitename: "._PAGESLIST."");
OpenTable();
echo "<center><font class=\"content\">"._LISTOFCONTENT." $sitename:</center><br><br>";
$result = $db->sql_query("SELECT * FROM ".$prefix."_pages_categories");
$numrows = $db->sql_numrows($result);
$numrows2 = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_pages WHERE cid!='0' AND active='1'"));
if ($numrows > 0 AND $numrows2 > 0) {
echo "<center>"._CONTENTCATEGORIES."</center><br><br>"
."<table border=\"1\" align=\"center\" width=\"95%\">";
while ($row = $db->sql_fetchrow($result)) {
$cid = intval($row['cid']);
$title = stripslashes(check_html($row['title'], "nohtml"));
$description = stripslashes($row['description']);
$numrows3 = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_pages WHERE cid='$cid'"));
if ($numrows3 > 0) {
echo "<tr><td valign=\"top\"> <a href=\"modules.php?name=$module_name&pa=list_pages_categories&cid=$cid\">$title</a> </td><td align=\"left\">$description</td></tr>";
}
}
echo "</td></tr></table><br><br>"
."<center>"._NONCLASSCONT."</center><br><br>";
}
$result4 = $db->sql_query("SELECT pid, title, subtitle, clanguage FROM ".$prefix."_pages WHERE active='1' AND cid='0' ORDER BY date");
echo "<blockquote>";
while ($row4 = $db->sql_fetchrow($result4)) {
$pid = intval($row4['pid']);
$title = stripslashes(check_html($row4['title'], "nohtml"));
$subtitle = stripslashes(check_html($row4['subtitle'], "nohtml"));
$clanguage = $row4['clanguage'];
if ($multilingual == 1) {
$the_lang = "<img src=\"images/language/flag-".$clanguage.".png\" hspace=\"3\" border=\"0\" height=\"10\" width=\"20\">";
} else {
$the_lang = "";
}
if ($subtitle != "") {
$subtitle = " ($subtitle)";
} else {
$subtitle = "";
}
if (is_admin($admin)) {
echo "<strong><big>·</big></strong> $the_lang <a href=\"modules.php?name=$module_name&pa=showpage&pid=$pid\">$title</a> $subtitle [ <a href=\"admin.php?op=content_edit&pid=$pid\">"._EDIT."</a> | <a href=\"admin.php?op=content_change_status&pid=$pid&active=1\">"._DEACTIVATE."</a> | <a href=\"admin.php?op=content_delete&pid=$pid\">"._DELETE."</a> ]<br>";
} else {
echo "<strong><big>·</big></strong> $the_lang <a href=\"modules.php?name=$module_name&pa=showpage&pid=$pid\">$title</a> $subtitle<br>";
}
}
echo "</blockquote>";
if (is_admin($admin)) {
$result5 = $db->sql_query("SELECT pid, cid, title, subtitle, clanguage FROM ".$prefix."_pages WHERE active='0' ORDER BY date");
echo "<br><br><center><b>"._YOURADMINLIST."</b></center><br><br>";
echo "<blockquote>";
while ($row5 = $db->sql_fetchrow($result5)) {
$pid = intval($row5['pid']);
$cid = intval($row5['cid']);
$title = stripslashes(check_html($row5['title'], "nohtml"));
$subtitle = stripslashes(check_html($row5['subtitle'], "nohtml"));
$clanguage = $row5['clanguage'];
if ($multilingual == 1) {
$the_lang = "<img src=\"images/language/flag-".$clanguage.".png\" hspace=\"3\" border=\"0\" height=\"10\" width=\"20\">";
} else {
$the_lang = "";
}
if ($subtitle != "") {
$subtitle = " ($subtitle) ";
} else {
$subtitle = " ";
}
echo "<strong><big>·</big></strong> $the_lang <a href=\"modules.php?name=$module_name&pa=showpage&pid=$pid\">$title</a> $subtitle [ <a href=\"admin.php?op=content_edit&pid=$pid\">"._EDIT."</a> | <a href=\"admin.php?op=content_change_status&pid=$pid&active=0\">"._ACTIVATE."</a> | <a href=\"admin.php?op=content_delete&pid=$pid\">"._DELETE."</a> ]<br>";
}
echo "</blockquote>";
}
CloseTable();
include("footer.php");
}
function list_pages_categories($cid) {
global $prefix, $db, $sitename, $admin, $multilingual, $module_name;
include("header.php");
title("$sitename: "._PAGESLIST."");
OpenTable();
echo "<center><font class=\"content\">"._LISTOFCONTENT." $sitename:</center><br><br>";
$cid = intval($cid);
$result = $db->sql_query("SELECT pid, title, subtitle, clanguage FROM ".$prefix."_pages WHERE active='1' AND cid='$cid' ORDER BY date");
echo "<blockquote>";
while ($row = $db->sql_fetchrow($result)) {
$pid = intval($row['pid']);
$title = stripslashes(check_html($row['title'], "nohtml"));
$subtitle = stripslashes(check_html($row['subtitle'], "nohtml"));
$clanguage = $row['clanguage'];
if ($multilingual == 1) {
$the_lang = "<img src=\"images/language/flag-".$clanguage.".png\" hspace=\"3\" border=\"0\" height=\"10\" width=\"20\">";
} else {
$the_lang = "";
}
if ($subtitle != "") {
$subtitle = " ($subtitle)";
} else {
$subtitle = "";
}
if (is_admin($admin)) {
echo "<strong><big>·</big></strong> $the_lang <a href=\"modules.php?name=$module_name&pa=showpage&pid=$pid\">$title</a> $subtitle [ <a href=\"admin.php?op=content_edit&pid=$pid\">"._EDIT."</a> | <a href=\"admin.php?op=content_change_status&pid=$pid&active=1\">"._DEACTIVATE."</a> | <a href=\"admin.php?op=content_delete&pid=$pid\">"._DELETE."</a> ]<br>";
} else {
echo "<strong><big>·</big></strong> $the_lang <a href=\"modules.php?name=$module_name&pa=showpage&pid=$pid\">$title</a> $subtitle<br>";
}
}
echo "</blockquote>";
if (is_admin($admin)) {
$result2 = $db->sql_query("SELECT pid, title, subtitle, clanguage FROM ".$prefix."_pages WHERE active='0' AND cid='$cid' ORDER BY date");
echo "<br><br><center><b>"._YOURADMINLIST."</b></center><br><br>";
echo "<blockquote>";
while ($row2 = $db->sql_fetchrow($result2)) {
$pid = intval($row2['pid']);
$title = stripslashes(check_html($row2['title'], "nohtml"));
$subtitle = stripslashes(check_html($row2['subtitle'], "nohtml"));
$clanguage = $row2['clanguage'];
if ($multilingual == 1) {
$the_lang = "<img src=\"images/language/flag-".$clanguage.".png\" hspace=\"3\" border=\"0\" height=\"10\" width=\"20\">";
} else {
$the_lang = "";
}
if ($subtitle != "") {
$subtitle = " ($subtitle) ";
} else {
$subtitle = " ";
}
echo "<strong><big>·</big></strong> $the_lang <a href=\"modules.php?name=$module_name&pa=showpage&pid=$pid\">$title</a> $subtitle [ <a href=\"admin.php?op=content_edit&pid=$pid\">"._EDIT."</a> | <a href=\"admin.php?op=content_change_status&pid=$pid&active=0\">"._ACTIVATE."</a> | <a href=\"admin.php?op=content_delete&pid=$pid\">"._DELETE."</a> ]<br>";
}
echo "</blockquote>";
}
echo "<center>"._GOBACK."</center>";
CloseTable();
include("footer.php");
}
switch($pa) {
case "showpage":
showpage($pid, $page);
break;
case "list_pages_categories":
list_pages_categories($cid);
break;
default:
list_pages();
break;
}
?>