C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\portal\modules\calendar\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
<?php
require("code.php");
if(
$code != $xcode) {
exit;
}
$day = strip_dir_illegals($_GET['day']);
$month = strip_dir_illegals($_GET['month']);
require(
$mod_root."/last_load.php");
if(
$last_load != date("Y")) {
$dir = $mod_root."/events";
$handle = opendir($dir);
while(
$file = readdir($handle)) {
if(!
is_dir($dir."/".$file)) {
if((
$file != ".") && ($file != "..") && ($file != "index.html")) {
unlink($dir."/".$file);
}
}
}
wf($mod_root."/last_load.php","w","<?php \$last_load = \"".date("Y")."\"; ?>");
}
if((!isset(
$do)) || ($do == "")) {
$month = $_GET['month'];
if(
$month == "") {
$month = date("m");
}
if(
strlen($month) < 2) {
$month = "0" . $month;
}
$previous = "<a href=\"$mod_url&month=".($month - 1)."\">&lt;&lt; Previous</a>";
$next = "<a href=\"$mod_url&month=".($month + 1)."\">Next &gt;&gt;</a>";
if(
$month == "01") { $month_name = "January"; $previous = ""; }
if(
$month == "02") { $month_name = "Febuary"; }
if(
$month == "03") { $month_name = "March"; }
if(
$month == "04") { $month_name = "April"; }
if(
$month == "05") { $month_name = "May"; }
if(
$month == "06") { $month_name = "June"; }
if(
$month == "07") { $month_name = "July"; }
if(
$month == "08") { $month_name = "August"; }
if(
$month == "09") { $month_name = "September"; }
if(
$month == "10") { $month_name = "October"; }
if(
$month == "11") { $month_name = "November"; }
if(
$month == "12") { $month_name = "December"; $next == ""; }
$tt = 0;
echo <<<HTML

<table width="100%" border="0">
<tr><td width="50%" align="left">
$previous</td><td width="50%" align="right">$next</td></tr>
</table><br />
<table width="100%" 
$sp_table>
<tr 
$sp_htr><td colspan="8" $sp_htd>$month_name</td></tr>
HTML;
for(
$count = 1; $count <= 31; $count++) {
$tt++;
if(
$tt == 1) { echo "<tr $sp_ctr>"; }
$event_subject = "";
$event_content = "";
if(
file_exists($mod_root."/events/".$month."-".$count.".php")) {
require(
$mod_root."/events/".$month."-".$count.".php");
}
$options = "";
if(
$u_rank >= $rank_required['mod_admin']) {
$options = "<br /><br /><a href=\"$admin_url&do=edit_event&month=$month&day=$count\">[Edit]</a> ";
if(
$event_subject != "") {
$options = $options . "<a href=\"$admin_url&do=delete_event&month=$month&day=$count\">[Delete]</a>";
}
}
$display = $count . ".";
$td_extra = "";
if((
$month == date("m")) && ($count == date("d"))) {
$display = "<b>".$count.".</b>";
$td_extra = "bgcolor=\"#AAAAAA\"";
}
echo <<<HTML

<td height="60" width="60" valign="top" 
$td_extra $sp_ctd>$display <a href="$mod_url&do=view_event&month=$month&day=$count">$event_subject</a>$options</td>
HTML;
if(
$tt == 7) { echo "</tr>"; $tt = 0; }
}
echo 
"</table><br /><br />";
}
if(
$do == "view_event") {
if(
file_exists($mod_root."/events/".$month."-".$day.".php")) {
require(
$mod_root."/events/".$month."-".$day.".php");
$display_signup = "<br /><br /><center>[<a href=\"$mod_url&do=signup&month=$month&day=$day\">Sign Up for Event</a>]</center>";
if(
instr("||",$event_signups)) {
$arr = explode("||",$event_signups);
$list = "";
foreach(
$arr as $single) {
if(
$usr == $single) { $display_signup = ""; }
$list = $list . "<a href=\"$url/load.php?viv=$single\">$single</a> ";
}
}
else {
if(
$event_signups != "") {
if(
$usr == $event_signups) { $display_signup = ""; }
$list = "<a href=\"$url/load.php?viv=Profile&user=$event_signups\">$event_signups</a> ";
}
else {
$list = "(none)";
}
}
$event_content = add_vxcode(add_emoticons($event_content),0);
echo <<<HTML

<center>[<a href="
$mod_url">Return to Events Main</a>]<br /><br /></center>
<table width="100%" 
$sp_table>
<tr 
$sp_htr><td $sp_htd>$event_subject</td></tr>
<tr 
$sp_ctr><td $sp_ctd>Posted by: <a href="$url/load.php?viv=Profile&user=$event_poster">$event_poster</a></td></tr>
<tr 
$sp_ctr><td $sp_ctd>Users signed up: $list
$display_signup
</td></tr>
<tr 
$sp_ctr><td $sp_ctd>$event_content</td></tr>
</table><br />
<center>[<a href="
$mod_url">Return to Events Main</a>]<br /><br /></center>
HTML;
}
}
if(
$do == "signup") {
if(
$online == 1) {
if(
file_exists($mod_root."/events/".$month."-".$day.".php")) {
require(
$mod_root."/events/".$month."-".$day.".php");
$err = 0;
if(
instr("||",$event_signups)) {
$arr = explode("||",$event_signups);
$list = "";
foreach(
$arr as $single) {
if(
$usr == $single) { $err = 1; }
}
}
else {
if(
$event_signups != "") {
if(
$usr == $event_signups) { $err = 1; }
}
}
if(
$err == 0) {
if(
$event_signups != "") {
$event_signups = $event_signups . "||" . $usr;
}
else {
$event_signups = $usr;
}
require(
$mod_root."/event_info.php");
wf($mod_root."/events/".$month."-".$day.".php","w",$event_info);
echo <<<HTML

You have signed up for this event.<br /><br />
<center>
[<a href="
$mod_url&do=view_event&month=$month&day=$day">Return to Event</a>]<br />
[<a href="
$mod_url">Return to Events Main</a>]<br /><br />
</center>
HTML;
}
}
}
else { 
$viv = "Not_Logged_In"; }
}
?>