<?php


/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: portal.php 16832 2010-09-15 07:38:31Z wangjinbo $
 */
 
$pid=trim(mod_config::get_one_config('yl_tbpid'))?mod_config::get_one_config('yl_tbpid'):'mm_10005319_0_0';
$link='http://www.114la.com/public/widget/taobao/index2.html';
$content=file_get_contents($link);
$content=preg_replace("/\&unid=(.+?)\&/i",'&',$content);
$content=preg_replace("/eventid=(\d+)/i",'eventid=101329',$content);
$content=preg_replace("/\&pid=(.+?)\&/i",'&pid='.$pid.'&',$content);
$content=preg_replace("/\?pid=(.+?)\&/i",'?pid='.$pid.'&',$content);
$content=preg_replace("/<img\s+src=\"(.+?)\"/i",'<img src="http://www.114la.com/public/widget/taobao/\\1"',$content);
$file=PATH_ROOT.'/public/widget/taobao/index2.html';
$fp = fopen($file, "w"); //创建一个文件，并打开，准备写入
fwrite($fp, $content); //把php页面的内容全部写入output00001.html，然后……
fclose($fp);
echo "计划任务完成";
 
?>
