<?php

class Go extends Module{

	//表单绝对URL地址
	public static function getlink($method,$id){
		global $_G;
		return VI_HOST."module/go/content/?id=".$id;	
	}

	//表单绝对URL地址
	public static function click( $link ){
		global $_G;
		
		//清空缓冲
		ob_clean();
		
		//分析链接
		preg_match("/^(.+?):\/\/(.*)/i", $link, $matche );
		
		switch( $matche[1] ){
		
			case 'qq':
				$link = 'tencent://message/?site=veryide&menu=yes&uin='. $matche[2];
			break;
		
			case 'mail':
				$link = 'mailto:'. $matche[2];
			break;
		
			case 'msn':
				$link = 'msnim:chat?contact='. $matche[2];
			break;
		
			case 'ww':
				$link = 'http://amos1.taobao.com/msg.aw?site=cntaobao&charset=utf-8&v=2&uid='. $matche[2];
			break;
			
		}
		
		//redirect
		if( $matche[1] == 'http' ){
			header("Location: ".$link);
		}else{
			exit( '<script type="text/javascript">location.href=\''.$link.'\';</script>' );
		}
		
	}

}

?>