<?php

header('content-type: image/jpg');

//引入核心文件
require_once '../common.php';

//接收留言id参数并进行过滤判断
if(isset($_GET['msgid'])){
	$msgid = ToUtf8($_GET['msgid']);
	if(check_zzs($msgid) == false){
		exit('Access Denied');
	}
}

//连接到MYSQL并打开系统数据库
$DataBase->open_db();

//查找留言
$DataBase->sel("message", "WHERE `id` = '$msgid'");

if(count($DataBase->Result) == 1){
	if($DataBase->Result[0]['avatar'] == 7 && $DataBase->Result[0]['privacy'] == 2){
		$imgurl = "http://q1.qlogo.cn/g?b=qq&nk=".$DataBase->Result[0]['qq']."&s=100";
		echo file_get_contents($imgurl);
	}
}

//关闭数据库连接
$DataBase->close_dblink();

?>