<?php
if(!defined('APP_PATH')||!defined('I_PATH')){exit('Access Denied');}

class ld_weibo extends controllerBase
{
	function __construct(){
		parent::__construct();
		$this->a=$this->sysParams('a',1);
	}
	function index()
	{
		
		if($this->sysParams('run')==1)
		{
			require(APP_PATH."/config.php");
			
			$map=$iConfig['companyweibolink'];
		    $configfile='config.php';
		    $fp_tp=@fopen($configfile,"r");
		    $fp_txt=@fread($fp_tp,filesize($configfile));
		    @fclose($fp_tp);
		    foreach($map as $k=>$v)
		    { 
		    	$fp_txt=preg_replace("/'".$k."'\s*=>\s*'.*?',/","'".$k."' => '".$this->sysParams($k,1)."',",$fp_txt);
		    	
		    }
		    $fpt_tpl=@fopen($configfile,"w");
		    @fwrite($fpt_tpl,$fp_txt);
		    @fclose($fpt_tpl);
		    message_a("在线微博修改成功",'?c=ld_weibo');
			
		}
		
		$this->weibolink = func_get_iglobal(array('companyweibolink')); 
		$this->display('weibo.html');
	}
	
}