📄 sign2.php
字号:
<?php
require_once '../../common.php';
$addr =$_SERVER["REQUEST_URI"];
$id = explode('?',$addr);
$uid = $id[1];
$query1= "select username,user_pic,user_info from ".$DBprefix."users where user_id='$uid'";
$result1=mysql_query($query1);
$data1=@mysql_Fetch_array($result1);
$name=$data1['username'];
$uuid="(UID:$uid)";
$pic=$data1['user_pic'];
$user_info=$data1['user_info'];
$tem=explode("attachments",$pic);
$tem[1]="../../attachments".$tem[1];
if (!file_exists($tem[1]) || $tem[1]=="../../attachments")
$pic="images/noavatar.jpg";
if ($name) {
Header("Content-type: image/png");
$query = "select content_body,share_time from ".$DBprefix."share where user_name='$name' order by share_id desc limit 0,1";
$result=mysql_query($query);
$data=@mysql_Fetch_array($result);
$content=$data['content_body'];
$tem=explode("|et|",$content);
if ($tem[1]) {
$content=$tem[0];
}
$ctime=$data['share_time'];
$ctime=gmdate('Y-m-d H:i:s',$ctime+8*3600);
$sign="images/sign2.png";
$imagemsg = getimagesize($pic);
$img = imagecreatefrompng($sign);
$pic = imagecreatefromjpeg($pic);
$width = $imagemsg[0];
$height = $imagemsg[1];
ImageCopyResampled($img, $pic,7,6,0,0,46,46,$width,$height);
$textColor = ImageColorAllocate($img, 100,100,100);
if (strlen($content)>32) {
$content1=get_substr($content,0,32);
$content2=get_substr($content, 32,30);
$content3=get_substr($content,31,30);
if ($content3!=$content2)
$content2=$content3;
$content=$content1."\n".$content2."...";
}
if (strlen($user_info)>24) {
$user_info1=get_substr($user_info,0,24);
$user_info2=get_substr($user_info,24,20);
$user_info3=get_substr($user_info,23,20);
if ($user_info3!=$user_info2)
$user_info2=$user_info3;
$user_info=$user_info1."\n".$user_info2."...";
}
if ($content=="") {
$content="尚未发表信息!";
$ctime=gmdate('Y-m-d H:i:s',time()+8*3600);
}
$string1 = iconv("GB2312", "UTF-8", "$name $uuid \n$user_info");
$string2 = iconv("GB2312", "UTF-8", "最后发表:\n$content");
$string3 = iconv("GB2312", "UTF-8", "$ctime");
ImageTTFText($img,10,0,65,18,$textColor,"c:\windows\fonts\simhei.ttf",$string1);
ImageTTFText($img,10,0,15,75,$textColor,"c:\windows\fonts\simhei.ttf",$string2);
ImageTTFText($img,10,0,95,130,$textColor,"c:\windows\fonts\simhei.ttf",$string3);
imagejpeg($img);
}
echo 无效的用户ID!;
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -