C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\portal\modules\en_board\mod.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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
<?php
require("code.php");
if(
$code != $xcode) {
exit;
}
$id strip_dir_illegals($id);
global 
$all_keyterms;
require(
$mod_root."/styles.php");
$total_posts 0;
$enable_dispm 0;
require(
$mod_root."/messages.php");
if(
$act == "viewmsg") {
$enable_dispm 1;
}
echo <<<HTML

<table width="100%" cellpadding="6" 
$table_style>
<tr 
$table_tr_content_style><td $table_td_content_style>
<center>
<a href="
$mod_url&m=search">Search</a> | <a href="$mod_url&m=show_help">Help</a>
</center>
</td></tr>
</table><br /><br />
HTML;
if(
$m == "search") {
echo <<<HTML

<center>
<form action="
$mod_url&m=search_go" method="POST">
<table 
$table_style>
<tr 
$table_tr_top_style><td $table_td_top_style>Search All</td></tr>
<tr 
$table_tr_content_style><td $table_td_content_style>Keywords: <input type="text" name="all_keyterms"></td></tr>
<tr 
$table_tr_content_style><td $table_td_content_style><center><input type="submit" value="Search"></center></td></tr>
</table><br />
</form>
<!--
<form action="
$mod_url&m=advance_search_go" method="POST">
<table 
$table_style>
<tr 
$table_tr_top_style><td $table_td_top_style>Advance Search</td></tr>
<tr 
$table_tr_content_style><td $table_td_content_style>
<table width="100%" 
$table_style>
<tr 
$table_tr_content_style><td $table_td_content_style>Search Subjects:</td><td $table_td_content_style><input type="text" name="subject_keyterms"></td></tr>
<tr 
$table_tr_content_style><td $table_td_content_style>Search Content:</td><td $table_td_content_style><input type="text" name="content_keyterms"></td></tr>
<tr 
$table_tr_content_style><td $table_td_content_style>In Forum:</td><td $table_td_content_style><input type="text" name="in_forum"></td></tr>
</table>
</td></tr>
<tr 
$table_tr_content_style><td width="100%" $table_td_content_style><center><input type="submit" value="Search"></center></td></tr>
</table>
</form>
-->
HTML;
}
if(
$m == "search_go") {
echo <<<HTML

<center><b>Search Results</b></center><hr noshade>
<center>
<table width="100%" 
$table_style>
<tr 
$table_tr_top_style><td width="60%" $table_td_top_style>Subject</td><td width="20%" $table_td_top_style>Author</td><td width="20%" $table_td_top_style>Date Posted</td></tr>
HTML;
$search_arr explode("||",$forum_search);
$i 0;
foreach(
$search_arr as $single_item) {
if(
file_exists($mod_root."/messages/".$single_item.".php")) {
require(
$mod_root."/messages/".$single_item.".php");
echo <<<HTML

<tr 
$table_tr_content_style><td $table_td_content_style><a href="$mod_url&board=$l_board&act=viewmsg&id=$single_item">$topic</a></td><td $table_td_content_style><a href="load.php?viv=Profile&user=$poster">$poster</a></td><td $table_td_content_style>$date_posted</td></tr>
HTML;
$i++;
}
}
echo <<<HTML

</table><br />
<small>There are 
$i results.</small><br />
</center><br />
HTML;
}
if(
$m == "show_help") {
echo <<<HTML

<center><b>Help</b></center><hr noshade>
Help not available.<br /><br />
HTML;
}
if(
$m == "") {
if(
$act != "") {
echo 
"<center>[<a href=\"$mod_url&board=$board\" target=\"_top\">Back to Message Listing</a>]<br /><br /></center><br /><br />";
}
if(
$act == "viewmsg") {
$admin_options "";
if((
$online == 1) && ($u_rank >= $rank_required['mod_delete_thread'])) {
$admin_options "[<a href=\"$admin_url&board=$board&id=$id&do=delete_thread\">Delete Thread</a>]";
}
?>
<center><a href="<?php echo $mod_url?>">Forums</a> : <a href="<?php echo $mod_url?>&board=<?php echo $board?>"><?php echo str_replace("_"," ",$board); ?></a> : Message</center><hr noshade>
<center>
<?php echo $admin_options?><br /><br />
[<a href="<?php echo $mod_url?>&board=<?php echo $board?>&id=<?php echo $id?>&tp=r&act=fill">Reply to this Message</a>]<br /><br />
<?php
echo <<<HTML
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr><td 
$border_tl></td><td $border_t></td><td $border_tr></td></tr>
<tr><td 
$border_l></td><td $center_style>
HTML;
?>
<table width="100%" <?php echo $table_style?>>
<?php
if(file_exists($mod_root."/messages/$id.php")) {
$post_messages "";
require(
$mod_root."/messages/$id.php");
echo 
$post_messages;
}
else {
echo 
"<tr><td>Error: Message not found.\n</td></tr>";
}
echo <<<HTML

</table>
</td><td 
$border_r></td></tr>
<tr><td 
$border_bl></td><td $border_b></td><td $border_br></td></tr>
</table><br />
HTML;
?>
[<a href="<?php echo $mod_url?>&board=<?php echo $board?>&id=<?php echo $id?>&tp=r&act=fill">Reply to this Message</a>]<br /><br />
<?php echo $admin_options?><br /><br />
</center>
<?php
}
if(
$board == "") {
echo 
"<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">";
require(
$mod_root."/forums.php");
echo 
"</table><br />";
echo <<<HTML

<center>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td width="50%"><img src="
$url/modules/$mod/images/$icon_style/forum_new.gif"> : Forum (New Posts)</td><td width="50%"><img src="$url/modules/$mod/images/$icon_style/forum.gif"> : Forum (No New Posts)</td></tr>
</table><br />
</center>
HTML;
}
if((
$board != "") && ($act == "")) {
$msg_l "[<a href=\"$mod_url&board=".$board."&en_start=".($en_start $en_show)."&en_show=".$en_show."\">&lt;&lt; Previous ".$en_show."</a>]";
$msg_mid " ";
$msg_m "[<a href=\"$mod_url&board=".$board."&en_start=".($en_start $en_show)."&en_show=".$en_show."\">Next ".$en_show." &gt;&gt;</a>]";
?>
<center><a href="<?php echo $mod_url?>">Forums</a> : <?php echo str_replace("_"," ",$board); ?></center><hr noshade>
<center>
[<a href="<?php echo $mod_url?>&board=<?php echo $board?>&tp=p&act=fill">Post a New Message</a>]<br /><br />
<?php
if($show_l == 1) { echo $msg_l; }
if((
$show_l == 1) && ($show_m == 1)) { echo $msg_mid; }
if(
$show_m == 1) { echo $msg_m; }
echo <<<HTML

<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr><td 
$border_tl></td><td $border_t></td><td $border_tr></td></tr>
<tr><td 
$border_l></td><td $center_style>
HTML;
?>
<br /><br />
<table width="100%" <?php echo $table_style?>>
<tr <?php echo $table_tr_top_style?>><td width="5%" <?php echo $table_td_top_style?>></td><td width="50%" <?php echo $table_td_top_style?>>Topic</td><td width="10%" <?php echo $table_td_top_style?>>Replies</td><td width="15%" <?php echo $table_td_top_style?>>Author</td><td width="20%" <?php echo $table_td_top_style?>>Last Reply</td></tr>
<?php
echo $message_list;
echo <<<HTML

</table>
</td><td 
$border_r></td></tr>
<tr><td 
$border_bl></td><td $border_b></td><td $border_br></td></tr>
</table><br />
HTML;
if(
$show_l == 1) { echo $msg_l; }
if((
$show_l == 1) && ($show_m == 1)) { echo $msg_mid; }
if(
$show_m == 1) { echo $msg_m; }
echo <<<HTML

<br /><br />
[<a href="
$mod_url&board=$board&tp=p&act=fill">Post a New Message</a>]<br /><br />
<table border="0" cellspacing="0" cellpadding="2">
<tr><td width="50%"><img src="
$url/modules/$mod/images/$icon_style/new_thread.gif"> : Thread (New Posts)</td><td width="50%"><img src="$url/modules/$mod/images/$icon_style/thread.gif"> : Thread (No New Posts)</td></tr>
<tr><td width="50%"><img src="
$url/modules/$mod/images/$icon_style/new_hot_thread.gif"> : Hot Thread (New Posts)</td><td width="50%"><img src="$url/modules/$mod/images/$icon_style/hot_thread.gif"> : Hot Thread (No New Posts)</td></tr>
<tr><td width="50%"><img src="
$url/modules/$mod/images/$icon_style/new_sticky_thread.gif"> : Sticky Thread (New Posts)</td><td width="50%"><img src="$url/modules/$mod/images/$icon_style/sticky_thread.gif"> : Sticky Thread (No New Posts)</td></tr>
</table><br />
</center>
HTML;
}
if(
$act == "edit_post") {
if(
$online == 1) {
$pass 0;
if(
strtolower($usr) == strtolower($eposter)) {
$pass 1;
}
if(
$u_rank >= $rank_required['mod_edit_post']) {
$pass 1;
}
if(
$id <> 0) {
$pass 1;
}
if(
$pass == 1) {
if(
file_exists($mod_root."/messages/".$id.".php")) {
$rtopic restore_uc($etopic);
$rposter restore_uc($eposter);
$rmessage add_vxcode(add_emoticons(restore_uc(str_replace("[NSPC]","<br />",stripslashes($emessage)))),0);
$rdate_posted restore_uc($edate_posted);
$emessage stripslashes($emessage);
$fcontent rf($mod_root."/messages/".$id.".php");
$pass 0;
$type "";
if(
instr("\$poster = \"$rposter\";\n\$message = \"".$rmessage."\";\n\$topic = \"$rtopic\";\n\$date_posted = \"$rdate_posted\";",$fcontent)) {
$pass 1;
$type "post";
}
if(
instr("\$poster = \"$rposter\";\n\$message = \"".$rmessage."\";\n\$topic = \"$rtopic\";\n\$rdate_posted = \"$rdate_posted\";",$fcontent)) {
$pass 1;
$type "reply";
}
if(
$pass == 1) {
if(
$tp == "go") {
$n_message add_vxcode(add_emoticons(alter(quot_alter($HTTP_POST_VARS['n_message']))),0)."<br /><br /><i>Edited by <a href='load.php?viv=Profile&user=$usr'>$usr</a> at $date.</i>";
if(
$type == "post") {
$ncontent str_replace("\$poster = \"$rposter\";\n\$message = \"".add_vxcode(add_emoticons($rmessage),0)."\";\n\$topic = \"$rtopic\";\n\$date_posted = \"$rdate_posted\";","\$poster = \"$rposter\";\n\$message = \"".$n_message."\";\n\$topic = \"$rtopic\";\n\$date_posted = \"$rdate_posted\";",$fcontent);
}
if(
$type == "reply") {
$ncontent str_replace("\$poster = \"$rposter\";\n\$message = \"".add_vxcode(add_emoticons($rmessage),0)."\";\n\$topic = \"$rtopic\";\n\$date_posted = \"$rdate_posted\";","\$poster = \"$rposter\";\n\$message = \"".$n_message."\";\n\$topic = \"$rtopic\";\n\$rdate_posted = \"$rdate_posted\";",$fcontent);
}
wf($mod_root."/messages/".$id.".php","w",$ncontent);
echo <<<HTML

<center><b>Edit Post</b></center><hr noshade>
Post successfully edited.<br /><br />
<center>[<a href="
$mod_url&board=$board&id=$id&act=viewmsg">Go Back to the Message</a>]<br /><br /></center>
HTML;
}
else {
$dmessage rem_vxcode(rem_emoticons($rmessage),0);
echo <<<HTML

<center><b>Edit Post</b></center><hr noshade>
<center>
<form action="
$mod_url&act=edit_post&tp=go&board=$board&id=$id&etopic=$etopic&eposter=$eposter&edate_posted=$edate_posted&emessage=$emessage" method="POST">
<table 
$sp_table>
<tr 
$sp_ctr><td $sp_ctd>Message:</td></tr>
<tr 
$sp_ctr><td $sp_ctd><textarea name="n_message" cols="75" rows="20">$dmessage</textarea></td></tr>
<tr 
$sp_ctr><td align="center" $sp_ctd><input type="submit" value="Edit Post"> <input type="reset" value="Reset Form"></td></tr>
</table><br />
</form>
</center>
HTML;
}
}
else { 
derr("Message does not exist."); }
}
else { 
derr("Message does not exist."); }
}
else { 
derr("You may not edit that post."); }
}
else { 
$viv "Not_Logged_In"; }
}
if(
$act == "fill") {
if(
$online == 1) {
echo <<<HTML

<script language="JavaScript">
function disableForm(theform) {
if (document.all || document.getElementById) {
for (i = 0; i < theform.length; i++) {
var tempobj = theform.elements[i];
if (tempobj.type.toLowerCase() == "submit" || tempobj.type.toLowerCase() == "reset")
tempobj.disabled = true;
}
return true;
}
}
</script>
HTML;
if(
$tp == "p") {
?>
<center><b>Post a Message</b></center><hr noshade>
<?php echo $vxcode_info?>
<hr noshade>
<center>
<form action="<?php echo $mod_post?>&board=<?php echo $board?>&id=<?php echo $id?>&tp=p&act=write" method="POST" onSubmit="return disableForm(this);">
<table width="100%" <?php echo $table_style?>>
<tr <?php echo $table_tr_content_style?>><td <?php echo $table_td_content_style?>>Topic:</td><td <?php echo $table_td_content_style?>><input type="text" name="topic" size="25" maxlength="25"></td></tr>
<tr <?php echo $table_tr_content_style?>><td colspan="2" <?php echo $table_td_content_style?>>Message:</td></tr>
<tr <?php echo $table_tr_content_style?>><td colspan="2" <?php echo $table_td_content_style?>><textarea name="message" cols="75" rows="20"></textarea></td></tr>
</table>
<input type="submit" value="Post Message"> <input type="reset" value="Clear Form">
</form>
</center>
<?php
}
if(
$tp == "r"){
if(
file_exists($mod_root."/messages/$id.php")) {
require(
$mod_root."/messages/$id.php");
?>
<center><b>Post a Reply</b></center><hr noshade>
<?php echo $vxcode_info?>
<hr noshade>
<center>
<form action="<?php echo $mod_post?>&board=<?php echo $board?>&tp=r&act=write" method="POST" onSubmit="return disableForm(this);">
<input type="hidden" name="id" value="<?php echo $id?>">
<table <?php echo $table_style?>>
<tr <?php echo $table_tr_content_style?>><td <?php echo $table_td_content_style?>>Topic:</td><td <?php echo $table_td_content_style?>><input type="text" name="topic" value="<?php if(substr($topic,0,3) != "Re:") { echo "Re: "; } echo $topic?>" size="25" maxlength="25"></td></tr>
<tr <?php echo $table_tr_content_style?>><td colspan="2" <?php echo $table_td_content_style?>>Message:</td></tr>
<tr <?php echo $table_tr_content_style?>><td colspan="2" <?php echo $table_td_content_style?>><textarea name="message" cols="75" rows="20"></textarea></td></tr>
</table>
<input type="submit" value="Post Reply"> <input type="reset" value="Clear Form">
</form>
</center>
<?php
}
else { echo 
"Error: Message does not exist.<br /><br />\n"; }
}
}
else {
echo 
"Error: You need to be logged in to post a message.<br /><br />\n";
}
}
if(
$act == "write") {
if(
$online == 1) {
$err 0;
$topic alter($HTTP_POST_VARS['topic']);
$message add_vxcode(add_emoticons(alter(quot_alter($HTTP_POST_VARS['message']))),0);
if(
$topic == "") {
derr("Topic is blank.");
$err 1;
}
if(
$email == "") {
derr("Email is blank.");
$err 1;
}
if(
$message == "") {
derr("No Message prompted.");
$err 1;
}
if(
$err == 0) {
$shortdate date("d/m/y");
if(
$tp == "p") {
$randx rand(0,999999) . rand(0,999999);
$randy rand(0,999999) . rand(0,999999);
$id $randx $randy;
$action "Post";
}
if(
$tp == "r") {
$action "Reply";
}
if(
file_exists($mod_root."/messagelist/$id.php")) {
if(
$action == "Post") {
$err 1;
}
if(
$action == "Reply") {
$err 0;
}
}
if(
$err == 0) {
if(
$action != "") {
$last "<small><a href='\$mod_url&board=$board&act=viewmsg&id=$id'>$topic</a> at $shortdate by <a href='load.php?viv=Profile&user=$usr'>$usr</a>.</small>";

$other_vars "";
if(
$action == "Post") {
$other_vars "\$m_topic = \"$topic\";\n\$m_poster = \"$usr\";\n\$Last['$board'] = \"$last\";\n\$Posts['$board'] = \$Posts['$board'] + 1;\n\$Topics['$board'] = \$Topics['$board'] + 1;\n\$Replies['$board$randx$randy'] = 0;\n\$Last['$board$randx$randy'] = 'N/A';";
}
if(
$action == "Reply") {
$other_vars "\$Last['$board'] = \"$last\";\n\$Posts['$board'] = \$Posts['$board'] + 1;\n\$Replies['$board$id'] = \$Replies['$board$id'] + 1;\n\$Last['$board$id'] = '$shortdate<br /><b>$usr</b>';";
}
wf($mod_root."/messages/".$id.".php""a","<?php \$poster = \"$usr\";\n\$message = \"$message\";\n\$topic = \"$topic\";\n\$date_posted = \"$date\";\n\$ident_date = \"$shortdate\";\n\$user_logged = $online;\n\$l_board = \"$board\";\n\$l_id = $id;\n\$total_posts = \$total_posts + 1;\n\$user_remote_ip = \"$REMOTE_ADDR\";\n$other_vars\nrequire(\$mod_root.\"/display_message.php\");\n?>\n");
wf($mod_root."/messages/".$board.".php""w","<?php\n\$Last['$board'] = \"$last\";\n\$Last_Date_Ident['$board'] = \"$shortdate\";\n?>");
wf($mod_root."/latest_post.php""w","<?php \$latest_post = \"$date<br />Topic: <a href=\\\"\$mod_url&board=$board&act=viewmsg&id=$id\\\">$topic</a><br />Posted by: <a href=\\\"\$url/load.php?viv=Profile&user=$usr\\\">$usr</a>\"; ?>");
echo 
"Message <a href=\"$mod_url&board=$board&act=viewmsg&id=$id\">$topic</a> has been posted.";
}
}
}
}
else {
echo 
"Error: You need to be logged in to post a message.<br /><br />\n";
}
}
}
if(
$act != "") {
echo 
"<center>[<a href=\"$mod_url&board=$board\">Back to Message Listing</a>]<br /><br /></center><br /><br />";
}
require(
$mod_root."/latest_post.php");
echo <<<HTML

<br /><br />
<table width="100%" 
$table_style>
<tr 
$table_tr_top_style><td $table_td_top_style>Latest Post</td></tr>
<tr 
$table_tr_content_style><td $table_td_content_style>
$latest_post<br />
</td></tr>
<tr 
$table_tr_top_style><td $table_td_top_style>Stats</td></tr>
<tr 
$table_tr_content_style><td $table_td_content_style>
Total Posts: 
$total_posts<br />
</td></tr>
</table><br /><br />
HTML;
                                                                                echo 
"<center><small>Powered by <a href=\"http://www.shad0wed.com/\" target=\"_blank\">Shadowed Forums</a>.</small></center><br /><br />\n";
?>