-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
executable file
·66 lines (54 loc) · 2.01 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
<?php
////////////////////////////Common head
$cache_time=10;
$OJ_CACHE_SHARE=false;
require_once('./include/cache_start.php');
require_once('./include/db_info.inc.php');
require_once('./include/setlang.php');
$view_title= "Welcome To Online Judge";
///////////////////////////MAIN
$view_news="";
$sql= "SELECT * "
."FROM `news` "
."WHERE `defunct`!='Y'"
."ORDER BY `importance` ASC,`time` DESC "
."LIMIT 5";
$result=mysql_query($sql);//mysql_escape_string($sql));
if (!$result){
$view_news= "<h3>No News Now!</h3>";
$view_news.= mysql_error();
}else{
$view_news.= "<table width=96%>";
while ($row=mysql_fetch_object($result)){
$view_news.= "<tr><td><td><big><b>".$row->title."</b></big>-<small>[".$row->user_id."]</small></tr>";
$view_news.= "<tr><td><td>".$row->content."</tr>";
}
mysql_free_result($result);
$view_news.= "<tr><td width=20%><td>This <a href=http://cm.baylor.edu/welcome.icpc>ACM/ICPC</a> OnlineJudge is a GPL product from <a href=http://code.google.com/p/hustoj>hustoj</a></tr>";
$view_news.= "</table>";
}
$view_apc_info="";
$sql= "SELECT UNIX_TIMESTAMP(date(in_date))*1000 md,count(1) c FROM `solution` group by md order by md desc ";
$result=mysql_query($sql);//mysql_escape_string($sql));
$chart_data_all= array();
//echo $sql;
while ($row=mysql_fetch_array($result)){
$chart_data_all[$row['md']]=$row['c'];
}
$sql= "SELECT UNIX_TIMESTAMP(date(in_date))*1000 md,count(1) c FROM `solution` where result=4 group by md order by md desc ";
$result=mysql_query($sql);//mysql_escape_string($sql));
$chart_data_ac= array();
//echo $sql;
while ($row=mysql_fetch_array($result)){
$chart_data_ac[$row['md']]=$row['c'];
}
if(function_exists('apc_cache_info')){
$_apc_cache_info = apc_cache_info();
$view_apc_info =_apc_cache_info;
}
/////////////////////////Template
require("template/".$OJ_TEMPLATE."/index.php");
/////////////////////////Common foot
if(file_exists('./include/cache_end.php'))
require_once('./include/cache_end.php');
?>