<?php
header("content-type:text/html;charset=utf-8");
include "./hexin.php";
$msg=$_REQUEST["msg"];
if(preg_match("/^(畅聊) ?(.*?)\$/",$msg,$nr))
{
echo post("http://".$ym."/cl/cl.php","zh=".$zh."&mm=".$mm."&nr=".$nr[2]."");
}
else if(preg_match("/^(写入) ?(.*?)，(.*?),(.*?)\$/",$msg,$nr))
{
if($nr[4]=="true")
{
$_SESSION["".$nr[2].""]=$nr[3];
}
else if($_SESSION["".$nr[2].""]=="")
{
$_SESSION["".$nr[2].""]=$nr[3];
}
}
else if($msg=="滚底部")
{
$_SESSION["xxsl2"]=$_SESSION["xxsl1"];
}
else if($msg=="顶部刷新")
{
if($_SESSION["xxsl"]>"14")
{
$_SESSION["xx"]="";
$_SESSION["xlsx"]="true";
$_SESSION["xxsl"]=($_SESSION["xxsl"]-9);
echo json_encode(array("code"=>"0","msg"=>"刷新成功"),JSON_UNESCAPED_UNICODE);
}
else
{
echo json_encode(array("code"=>"1","msg"=>"刷新失败！"),JSON_UNESCAPED_UNICODE);
}
}
else if(preg_match("/^(消息操作) ?([0-9]+)\$/",$msg,$nr))
{
$xx=duqu("./shuoju/xiaoxi/".$nr[2].".txt");
$json=json_decode($xx,true);
$jxnr=json_decode($json["neirong"],true);
$qx=duqu("./shuoju/ziliao/".$zh."/quanxian.txt");
$qx1=duqu("./shuoju/ziliao/".$json["zhanghao"]."/quanxian.txt");
$_SESSION["xxid"]=$nr[2];
$_SESSION["qbxx"]=$xx;
if($zh=="2955036981"||$zh==$json["zhanghao"]||$qx>$qx1)
{
echo json_encode(array("chehui"=>"true","leixing"=>"".$jxnr["type"].""),JSON_UNESCAPED_UNICODE);
}
else
{
echo json_encode(array("chehui"=>"false","leixing"=>"".$jxnr["type"].""),JSON_UNESCAPED_UNICODE);
}
}
else if($msg=="撤回消息")
{
post("http://".$ym."/cl/cl.php","zh=".$zh."&mm=".$mm."&nr=撤回消息".$_SESSION["xxid"]."");
}
else if($msg=="转发消息")
{
$json=json_decode($_SESSION["qbxx"],true);
echo $json["neirong"];
}
else if($msg=="朗读消息")
{
$json=json_decode($_SESSION["qbxx"],true);
$jxnr=json_decode($json["neirong"],true);
$zy=zhuanyi($jxnr["neirong"]);
echo strip_tags($zy);
}
else if($msg=="编辑消息")
{
$json=json_decode($_SESSION["qbxx"],true);
echo $json["neirong"];
}
?>