<?php
include_once "test-conn.php";


$qid=is_numeric($_GET['qid'])?$_GET['qid']:exit('No Qid!');
$result = mysql_query("SELECT * FROM {$tableqz}qqs where qid='{$qid}' and isly>0 and sidzt=0 limit 1");
if($row=mysql_fetch_array($result)){
	$uin=$row['qq'];
	$now=date("Y-m-d-H:i:s");
	$next=date("Y-m-d H:i:s",time()+60*60*8-10);
	@mysql_query("update {$tableqz}qqs set lastly='$now',nextly='$next' where qid='$qid'");
	include_once "qzone.class.php";
	$result = mysql_query("SELECT * FROM {$tableqz}qqs where sidzt=0 order by rand()");
	while($qq=mysql_fetch_array($result)){
		$qid=$qq['qid'];
		$con=get_con();
	$qzone=new qzone($qq['qq'],$qq['sid'],$qq['skey'],$qq['p_skey'],$qq['p_skey2']);
		$qzone->liuyan($uin,$con);
		$row=$qq;
		$hms=$qzone->msg;
		$arr = json_decode($hms, true);
		if($arr['code']==0){
			echo "刷留言成功！";
		}elseif($arr['code']==-3000){
			echo "请先登录";
		}else{
			echo "刷留言失败！";
			}
	echo '<br/>';
		include_once "mail.php";
	}
}else{
	exit('请开启留言互刷功能');
}

