<?php 
$sql="SELECT id,userid,w,weibo,rizhi,wbpic,zhuanzai,time,zan,zhuan,fen,ower FROM weibo WHERE id='{$_GET['id']}' AND siteid='{$wapid}'";
	/*执行数据查询语句*/  
    $result=mysql_query($sql);      
    if($result && mysql_num_rows($result)>0){ 
	list($uid,$userid,$w,$weibo,$rizhi,$wbpic,$zhuanzai,$time,$zan,$z,$fen,$ower)=mysql_fetch_row($result);
    if($_GET['action'] == 'zan'){
    $vs=$zan+1;
	$sql="UPDATE weibo SET zan='$vs' WHERE id='{$_GET["id"]}' AND siteid='{$wapid}'";
	mysql_query($sql);
	    header("location:index.php?page=".$_GET['page']."&sid=".$sid_info);
	}elseif($_GET['action'] == 'fen'){
      $vs=$fen+1;
    $sql="UPDATE weibo SET fen='$vs' WHERE id='{$_GET["id"]}' AND siteid='{$wapid}'";
	mysql_query($sql);
		header("location:index.php?page=".$_GET['page']."&sid=".$sid_info);
    }elseif($_GET['action'] == 'zhuan'){
	$vs=$z+1;
	$wb="UPDATE weibo SET zhuan='$vs' WHERE id='{$_GET["id"]}' AND siteid='{$wapid}'";
	mysql_query($wb);
	/*初始化*/
    $sql="SELECT id,userid,weibo FROM weibo WHERE id=
	'{$_GET["id"]}'";
	     $info=mysql_query($sql);
         if($info && mysql_num_rows($info)>0){
		 list($wid,$tid,$content) = mysql_fetch_row($info);
		 }
    /*添加转载微博*/
	$time=time();//date("Y-m-d-H-i");
	$weibos="INSERT INTO weibo(userid,w,weibo,rizhi,wbpic,zhuanzai,time,ower,siteid)VALUES
	('{$id}','{$w}','{$content}','{$rizhi}','NULL','yes','{$time}','{$tid}','{$wapid}')";
	mysql_query($weibos);
    header("location:index.php?page=".$_GET['page']."&sid=".$sid_info);
	         
	}
	}
	?>