<?php
include_once "conn.php";

$qid=is_numeric($_GET['qid'])?$_GET['qid']:exit('No Qid!');
$result = mysql_query("SELECT * FROM {$tableqz}qqs where qid='{$qid}' and isreply>0 and sidzt=0 limit 1");
if($row=mysql_fetch_array($result)){
	$uin=$row['qq'];
	$sid=$row['sid'];
	$skey=$row['skey'];
	$do=$row['isreply'];
	$pic=$row['replypic'];
	$now=date("Y-m-d-H:i:s");
	$next=date("Y-m-d H:i:s",time()+60*$row['replyrate']-10);
	@mysql_query("update {$tableqz}qqs set lastreply='$now',nextreply='$next' where qid='$qid'");
	$con=urlencode(get_con($row['replycon']));
	include_once "qzone.class.php";
	$qzone=new qzone($uin,$sid,$skey);
	if($do==2){
		$qzone->reply($con,'pc',$pic);
	}else{
		$qzone->reply($con,0,$pic);
	}
	include_once "mail.php";
	exit('Ok!');
}else{
	exit('Qid Error!');
}
