-
Notifications
You must be signed in to change notification settings - Fork 0
/
'
executable file
·45 lines (40 loc) · 1.43 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
<?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="";
if(function_exists('apc_cache_info')){
$_apc_cache_info = apc_cache_info();
$view_apc_info =_apc_cache_info;
}
/////////////////////////Template
require("template/".$OJ_TEMPLATE."/myreg.php");
/////////////////////////Common foot
if(file_exists('./include/cache_end.php'))
require_once('./include/cache_end.php');
?>