<?php
include(dirname(dirname(__FILE__))."/./configs/config.php");
include(dirname(dirname(__FILE__))."/./configs/db_config.php");
include(dirname(dirname(__FILE__))."/./configs/ranking.php");
include(dirname(dirname(__FILE__))."/./includes/base.php");
header('Content-Type:text/html;charset=GB2312');
date_default_timezone_set('PRC');
session_start();
if($_COOKIE['core_user_rank']!="2" && ($core_baropen==0 || (strtotime($core_opentime1) > (strtotime(date('H:i'))+$core_time*3600) || strtotime($core_opentime2) < (strtotime(date('H:i'))+$core_time*3600) && $core_opentime1!=$core_opentime2)))
  jump("../close.php");
if (!file_exists('../install/install.lock'))
  jump("../install/");
$phpcolor = new mysql();
$phpcolor->open();
$phpcolor->newranking($int_jczr,$core_time);
/* 过滤所有GET过来变量 */
foreach ($_GET as $get_key=>$get_var)      
{
  $get_var=trim($get_var);
  $get_var=str_replace("　","",$get_var);
  $get_var=str_replace(",","，",$get_var);
  $get_var=str_replace("(","（",$get_var);
  $get_var=str_replace(")","）",$get_var);
  $get_var=str_replace("%20","％20",$get_var);
  $get_var=str_replace("%27","％27",$get_var);
  $get_var=str_replace("&","&amp;",$get_var);
  $get_var=str_replace("<","&lt;",$get_var);
  $get_var=str_replace(">","&gt;",$get_var);
  $get_var=str_replace("'","&#39;",$get_var);
  $_GET[strtolower($get_key)]=$get_var;
}
/* 过滤所有POST过来的变量 */
foreach ($_POST as $post_key=>$post_var)
{
  if(is_array($post_var))
  {
    foreach($post_var as $post_vars)
	{
      $post_vars=trim($post_vars);
      $post_vars=str_replace("　","",$post_vars);
      $post_vars=str_replace(",","，",$post_vars);
      $post_vars=str_replace("(","（",$post_vars);
      $post_vars=str_replace(")","）",$post_vars);
      $post_vars=str_replace("%20","％20",$post_vars);
      $post_vars=str_replace("%27","％27",$post_vars);  
      $post_vars=str_replace("&","&amp;",$post_vars);
      $post_vars=str_replace("<","&lt;",$post_vars);
      $post_vars=str_replace(">","&gt;",$post_vars);
      $post_vars=str_replace("'","&#39;",$post_vars);
	  $_POST[strtolower($post_key)][]=$post_vars;
    }
  }
  else
  {
    $post_var=trim($post_var);
    $post_var=str_replace("　","",$post_var);
    $post_var=str_replace(",","，",$post_var);
    $post_var=str_replace("(","（",$post_var);
    $post_var=str_replace(")","）",$post_var);
    $post_var=str_replace("%20","％20",$post_var);
    $post_var=str_replace("%27","％27",$post_var);  
    $post_var=str_replace("&","&amp;",$post_var);
    $post_var=str_replace("<","&lt;",$post_var);
    $post_var=str_replace(">","&gt;",$post_var);
    $post_var=str_replace("'","&#39;",$post_var);
    $_POST[strtolower($post_key)]=$post_var;
  }
}
if(isset($_COOKIE['corew_user_name']))
{
  $_COOKIE['corew_user_name']=html_replace($_COOKIE['corew_user_name']);
  $phpcolor->table="user";
  $phpcolor->field="id,passwd,state";
  $phpcolor->where="username='".$_COOKIE['corew_user_name']."'";
  $userv=$phpcolor->exist(1);
  if($_COOKIE["corew_user_passwd"]!=md5($userv['passwd'].$core_scode) || $userv['state']==0)
  {
    echo "对不起，您的ID验证失败，原因可能但不仅限于：1、在核对您密码时发生错误。2、您的ID已被封锁，请您清除cookies后重新访问本站";
	exit();
  }
  else
  {
    setcookie("corew_user_name", $_COOKIE["corew_user_name"], time()+$core_time*3600+3600);
    setcookie("corew_user_passwd", $_COOKIE["corew_user_passwd"], time()+$core_time*3600+3600);
  }
}
if ($core_wapbaropen==0)
{
  echo "对不起，手机版关闭维护中。<a href='../index.php'>访问电脑版</a>";
  exit();
}
?>