<?php
$bt="QQ绑定信息";
include"../head.php";
include"../conn.php";
include_once"../function.php";
include"fun.php";
$sid = sqlstr($_COOKIE['dl']);

$qqinfo=mysql_fetch_array(mysql_query("select * from user where sid='$sid'"));

if(!$qqinfo){
header("Location:../login.php");
exit;//跳转到登录页面
}
$qq=$qqinfo["qq"];
$id=$qqinfo["id"];
$zz=sqlstr($_GET["z"]);
echo '<div class="hui"><div class="zuo">我的QQ信息</div><div class="you"><font color="red">»</font><a href="/m/diary/">返回</a></div></div>';
if($qq!=Null){
if($zz==1){
$msg="<font color='red'>QQ授权一线印象登录成功</font><br/>";
}
$tx=qqtx($qq);
echo '<div id="main">'.$msg.'<img src="'.$tx.'" /> <a href="index.php?z=qqtx">设为头像</a><br/><br/>QQ帐号：'.$qq.'<br/>QQ网名：<b>'.qqname($qq).'</b><br/>绑定一线帐号：'.$qqinfo["name"].'<br/>+<a href="qqlogin.php">更换QQ帐号</a><br/><br/>你已绑定QQ信息<br/>你可以通过QQ登录本站啦<br/>更多QQ同步功能，近期推出</div><br/>';

if($zz==qqtx){
unlink("../../{$qqinfo['tx']}");
mysql_query("UPDATE user SET tx='$tx' WHERE id='$id'");
echo "<div id='main'><font color='red'>设为头像成功～</font></div>";
}
}else{
echo"<div id='main'><font color='red'>你还没有绑定QQ号</font><br/> <br/> +<a href='qqlogin.php'>现在就去绑定QQ</a> </div> <br/>";
}

?>

<?php include("../footer.php"); ?>