'$now' and title like '%$OJ_NOIP_KEYWORD%'"; $row=pdo_query($sql); if(!empty($row)) $NOIP_flag=$row[0]; else $NOIP_flag=false; } $view_news = ""; $sql = "select * " . "FROM `news` " . "WHERE `defunct`!='Y' AND `title`!='faqs.$OJ_LANG'" . "ORDER BY `importance` ASC,`time` DESC " . "LIMIT 50"; $view_news .= "
"; $view_news .= "

" . $MSG_NEWS . "

"; $view_news .= "
"; $result = mysql_query_cache( $sql ); //mysql_escape_string($sql)); if ( !$result ) { $view_news.= ""; } else { foreach ( $result as $row ) { $view_news .= "
"; $view_news .= "
" . $row[ 'title' ] . "-" . $row[ 'user_id' ] . "
"; $view_news .= "
" . bbcode_to_html($row[ 'content' ]) . "
"; $view_news .= "
"; } } $view_news .= "
"; $view_news .= ""; $view_news .= "
"; $view_apc_info = ""; $last_1000_id=0; $last_1000_id=pdo_query("select max(solution_id)-1000 from solution"); if(!empty($last_1000_id)) $last_1000_id=$last_1000_id[0][0]; if ($last_1000_id==NULL) $last_1000_id=0; $sql = "SELECT UNIX_TIMESTAMP(date(in_date))*1000 md,count(1) c FROM (select * from solution where solution_id > $last_1000_id) solution where result<13 and solution_id > $last_1000_id group by md order by md desc limit 200"; $result = mysql_query_cache( $sql ); //mysql_escape_string($sql)); $chart_data_all = array(); //echo $sql; if(!empty($result)) foreach ( $result as $row ) { array_push( $chart_data_all, array( $row[ 'md' ], $row[ 'c' ] ) ); } $sql = "SELECT UNIX_TIMESTAMP(date(in_date))*1000 md,count(1) c FROM (select * from solution where solution_id > $last_1000_id) solution where result=4 and solution_id > $last_1000_id group by md order by md desc limit 200"; $result = mysql_query_cache( $sql ); //mysql_escape_string($sql)); $chart_data_ac = array(); //echo $sql; if(!empty($result)) foreach ( $result as $row ) { array_push( $chart_data_ac, array( $row[ 'md' ], $row[ 'c' ] ) ); } $speed=0; if ( isset( $_SESSION[ $OJ_NAME . '_' . 'administrator' ] ) ) { $sql = "select avg(sp) sp from (select avg(1) sp,judgetime DIV 3600 from solution where result>3 and solution_id >$last_1000_id group by (judgetime DIV 3600) order by sp) tt;"; $result = mysql_query_cache( $sql ); $speed = ( $result[ 0 ][ 0 ] ? $result[ 0 ][ 0 ] : 0 ) . '/min'; } else { if(isset($chart_data_all[ 0 ])) $speed = ( isset($chart_data_all[ 0 ][ 1 ]) ? $chart_data_all[ 0 ][ 1 ] : 0 ) . '/day'; } /////////////////////////Template require( "template/" . $OJ_TEMPLATE . "/index.php" ); if( isset($OJ_LONG_LOGIN) && $OJ_LONG_LOGIN &&(!isset($_SESSION[$OJ_NAME.'_user_id'])) &&isset($_COOKIE[$OJ_NAME."_user"]) &&isset($_COOKIE[$OJ_NAME."_check"])){ echo""; } /////////////////////////Common foot if ( file_exists( './include/cache_end.php' ) ) require_once( './include/cache_end.php' ); ?>