<?php

if (file_exists('writable/set/set.php')) {
  $GLOBALS['WEATHER_DATA'] = '';
} else {
  $GLOBALS['WEATHER_DATA'] = '../../';
}
if (!isset($web)) {
  require ($GLOBALS['WEATHER_DATA'].'writable/set/set.php');
}
if (!function_exists('read_file')) {
  function read_file($url) {
  $r = '';
  if (preg_match('/^https?\:\/\//i', $url)) {
    $timeout = 5;                                           //设置一个超时时间，单位为秒
    $ch = @curl_init();
    @curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);           //设置超时   
    @curl_setopt($ch, CURLOPT_URL, $url);                   //设置访问的url地址   
    //@curl_setopt($ch, CURLOPT_USERAGENT, _USERAGENT_);    //用户访问代理 User-Agent   
    @curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
    @curl_setopt($ch, CURLOPT_REFERER, $url);               //设置 referer 
    @curl_setopt($ch, CURLOPT_HEADER, FALSE);               //是否显示头部信息   
    @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);        //跟踪301 
    @curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);        //返回结果
    $r = @curl_exec($ch);
    @curl_close($ch);
    if(!$r){
      $ctx = @stream_context_create(array('http' => array('timeout' => $timeout)));
      $r=@file_get_contents($url, 0, $ctx);
    }
  } else {
    //if (file_exists($url)) {
      $r=@file_get_contents($url);
    //}
  }
  return $r;
  }
}

if (empty($web['newinfo_url'][0]) || empty($web['newinfo_url'][1])) {
  $web['newinfo_url'][0] = 'http://info.162100.com/get_newinfo_for162100.php';
  $web['newinfo_url'][1] = 'http://info.162100.com/write.php';
}
if (empty($web['newinfo_url'][0])) {
  $web['newinfo_url'][2] = '信 息 窗';
}
if (!preg_match('/^https?:\/\//i', $web['newinfo_url'][0])) {
  if (!file_exists($web['newinfo_url'][0])) {
    echo ''.$web['newinfo_url'][2].'调用路径出错！<br />
请检查后台“边栏、号外管理/边栏信息窗开关”中此项设置';
    die();
  }
}


echo read_file($web['newinfo_url'][0]);






?>