-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdisoj-header.php
More file actions
84 lines (78 loc) · 2.58 KB
/
disoj-header.php
File metadata and controls
84 lines (78 loc) · 2.58 KB
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
<?
require("./include/db_info.inc.php");
if(isset($OJ_LANG)){
require_once("./lang/$OJ_LANG.php");
if(file_exists("./faqs.$OJ_LANG.php")){
$OJ_FAQ_LINK="faqs.$OJ_LANG.php";
}
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel=stylesheet href='./include/hoj.css' type='text/css'>
<?
function checkcontest($MSG){
require_once("./include/db_info.inc.php");
$sql="SELECT count(*) FROM `contest` WHERE `end_time`>NOW() AND `defunct`='N'";
$result=mysql_query($sql);
$row=mysql_fetch_row($result);
if (intval($row[0])==0) $retmsg=$MSG;
else $retmsg=$row[0]."<font color=red> $MSG</font>";
mysql_free_result($result);
return $retmsg;
}
if($OJ_ONLINE){
require_once('./include/online.php');
$on = new online();
}
?>
</head>
<body>
<center>
<h2><img id=logo src=./image/logo.png><font color="red">Welcome To <?=$OJ_NAME?> ACM-ICPC Online Judge</font></h2>
<table width=96%>
<tr align="center" class='hd' valign="top">
<th><a href="http://acm.sdibt.edu.cn:8080/vjudge/"><font color=red>VIRTUAL JUDGE</font></a></th>
<th><span style="color:1a5cc8" id="dict_status"></span></th>
<th><a href="./<?=isset($OJ_FAQ_LINK)?$OJ_FAQ_LINK:"faqs.php"?>"><?=$MSG_FAQ?></a></th>
<th><a href="./discuss.php"><?=$MSG_BBS?></a></th>
<th><a href="<?=$OJ_HOME?>"><?=$MSG_HOME?></a></th>
<th><a href="./problemset.php"><?=$MSG_PROBLEMS?></a></th>
<th><a href="./status.php"><?=$MSG_STATUS?></a></th>
<th><a href="./ranklist.php"><?=$MSG_RANKLIST?></a></th>
<th><a href="./contest.php"><?=checkcontest($MSG_CONTEST)?></a></th>
<?
if (isset($_SESSION['user_id'])){
$sid=$_SESSION['user_id'];
print "<th><a href=./modifypage.php><b>$MSG_USERINFO</b></a> <a href='userinfo.php?user=$sid'><font color=red>$sid</font></a></th>";
print "<th><a href=./logout.php>$MSG_LOGOUT</a></th>";
}else{
print "<th><a href=./loginpage.php>$MSG_LOGIN</a></th>";
print "<th><a href=./registerpage.php>$MSG_REGISTER</a></th>";
}
if (isset($_SESSION['administrator'])||isset($_SESSION['contest_creator'])){
print "<th><a href=./admin>$MSG_ADMIN</a></th>";
}
?>
</tr>
</table>
</center>
<?
$fp=fopen("./admin/msg.txt","r");
$msg="";
while (!feof($fp)){
$strtmp=fgets($fp);
$msg=$msg.$strtmp;
}
if (strlen($msg)>5){
echo "<marquee scrollamount=3 behavior=ALTERNATE scrolldelay=150>";
echo "<font color=red>";
echo $msg;
echo "</font>";
echo "</marquee>";
}
?>
<hr>
<script src="./include/underlineTranslation.js" type="text/javascript"></script>
<script type="text/javascript">dictInit();</script>