{"id":149,"date":"2012-02-18T17:30:49","date_gmt":"2012-02-18T09:30:49","guid":{"rendered":"http:\/\/www.aoisnow.net\/blog\/?p=149"},"modified":"2012-02-18T17:30:49","modified_gmt":"2012-02-18T09:30:49","slug":"day-2208-%e9%a5%ad%e5%90%a6%e8%ae%ba%e5%9d%9b%e7%ad%be%e5%90%8d%e5%9b%be%e6%8f%92%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/www.aoisnow.net\/blog\/archives\/149","title":{"rendered":"Day 2208 \u996d\u5426\u8bba\u575b\u7b7e\u540d\u56fe\u63d2\u4ef6"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" title=\"\u7b7e\u540d\u56fe\u6f14\u793a\" src=\"http:\/\/www.aoisnow.net\/ffsig\/ffsig.php?id=tokiko\" alt=\"\" width=\"400\" height=\"150\" \/><\/p>\n<p>\u4ee5\u4e0a\u4e3a\u6f14\u793a\u3002<br \/>\n\u5199\u5b8c\u6a59\u8bed\u541b\u3001\u6731\u9e6d\u5b50\u548c\u963f\u6c42\u4e09\u4e2a\u5355\u8bcd\u673a\u5668\u4eba\u540e\uff0c\u5c31\u60f3\u505a\u4e00\u4e2a\u9875\u9762\u628a\u8fd9\u4e9bBot\u4eec\u90fd\u5217\u51fa\u6765\uff08\u8fd9\u4e2a\u9875\u9762\u73b0\u5728\u5728<a href=\"http:\/\/www.aoisnow.net\/ffbot\/\" target=\"_blank\" rel=\"noopener\">\u8fd9\u91cc<\/a>\uff09\uff0c\u4ee5\u4fbf\u597d\u5947\u7684\u4eba\u70b9\u4e86Source Name\u540e\u80fd\u540c\u65f6\u770b\u5230\u53e6\u5916\u4e24\u4e2a\u673a\u5668\u4eba\uff0c\u591a\u70b9\u5173\u6ce8\u5ea6\uff0c\u53ef\u662f\u996d\u5426\u672c\u8eab\u7684\u7b7e\u540d\u56fe\u63d2\u4ef6\u56e0\u4e3a\u5e74\u4ee3\u4e45\u8fdc\uff0c\u6548\u679c\u5b9e\u5728\u4e0d\u6562\u606d\u7ef4\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" title=\"\u996d\u5426\u81ea\u6709\u63d2\u4ef6\u6f14\u793a\" src=\"http:\/\/b.fanfou.com\/u\/tokiko\/s.png\" alt=\"\" width=\"360\" height=\"120\" \/><\/p>\n<p>\u800c\u540e\u60f3\u8d77\u4ee5\u524d\u7528\u8fc7\u7684\u3001WandSea\u7f16\u5199\u7684TwSig\uff08\u63a8\u7279\u7b7e\u540d\u56fe\uff09\uff0c\u51b3\u5b9a\u8d81\u8fd9\u8fd9\u4e2a\u673a\u4f1a\u5b66\u4e60\u4e00\u4e0b\u76f8\u5173\u51fd\u6570\u7684\u4f7f\u7528\u65b9\u6cd5\uff0c\u6210\u679c\u5c31\u662f\u5f00\u5934\u7684\u90a3\u4e2a\u6837\u5b50\u3002<\/p>\n<p>\u7ee7\u7eed\u9605\u8bfb\u53ef\u4ee5\u770b\u5230\u5b8c\u6574\u4ee3\u7801\u4ee5\u53ca\u4e0b\u8f7d\uff0c\u521d\u5b66PHP\u4e4b\u6545\uff0c\u4ee3\u7801\u53ea\u662f\u80fd\u7528\u5c31OK\u4e86\uff0c\u800c\u4e14\u8fd8\u501f\u7528\u4e86\u5f88\u591a\u522b\u4eba\u7684\u65b9\u6cd5\uff0c\u80af\u5b9a\u6709\u5f88\u591a\u5410\u69fd\u7684\u5730\u65b9\uff0c\u8fd8\u8bf7\u591a\u5305\u6db5\u3002<\/p>\n<p><!--more--><\/p>\n<p>\u4ee3\u7801\u4e0b\u8f7d\uff08\u4e0d\u542b\u8c03\u7528\u7684\u5b57\u4f53\uff09\uff1a<a href=\"http:\/\/www.aoisnow.net\/blog\/wp-content\/uploads\/2012\/02\/ffsig.zip\">Fanfou Forum Signature Plugin<\/a><\/p>\n<p>\u4e3b\u8981\u77e5\u8bc6\u70b9\uff1afile_get_contents\u3001json_decode\u3001imagecreatetruecolor\u3001imagecopyresampled\u3001imagecolorallocate\u3001imagettftext\u3001imagecopy\u3001imagepng<\/p>\n<pre><?php\n\tmb_internal_encoding(\"UTF-8\");\n\t$allowid = array('chengyujun','tokiko','akyuu','mukyu','ryuquen');\n\t$ff_id = $_GET['id'];\n\t$ff_id = mb_convert_encoding($ff_id, \"UTF-8\", \"gb2312\");\n\tif(in_array($ff_id,$allowid)){\n\t\theader(\"Content-type: image\/png\");\n\t\tif($ff_id){\n\t\t\t$r_url = 'http:\/\/api.fanfou.com\/users\/show.json?id='.$ff_id;\n\t\t\t$r_json = @file_get_contents($r_url);\n\t\t\tif($r_json <> false){\n\t\t\t\t$r_json = json_decode($r_json, true);\n\t\t\t\tif(!$r_json['error']){\n\t\t\t\t\t$font = 'wqy.ttc';\n\t\t\t\t\t$img = imagecreatetruecolor(400,150);\n\t\t\t\t\t$img_back = imagecreatefrompng('sigback.png');\n\t\t\t\t\timagecopyresampled($img,$img_back,0,0,0,0,400,150,400,150);\n\t\t\t\t\t$color_white = imagecolorallocate($img,255,255,255);\n\t\t\t\t\t$color_skyblue = imagecolorallocate($img,0,120,255);\n\t\t\t\t\t$txt_id = $r_json['name'];\n\t\t\t\t\t$txt_fo = $r_json['friends_count'];\n\t\t\t\t\t$txt_foer = $r_json['followers_count'];\n\t\t\t\t\t$txt_msgc = $r_json['statuses_count'];\n\t\t\t\t\t$txt_recentmsg = $r_json['status']['text'];\n\t\t\t\t\tif(!$txt_recentmsg || $txt_recentmsg == '') $txt_recentmsg = '\u6211\u53ea\u5411\u5173\u6ce8\u6211\u7684\u4eba\u516c\u5f00\u6211\u7684\u6d88\u606f\u3002';\n\t\t\t\t\tif(strlen($txt_recentmsg) > 315) $txt_recentmsg = cut_str($txt_recentmsg,105);\n\t\t\t\t\t$txt_avatar = $r_json['profile_image_url_large'];\n\t\t\t\t\tif(!$txt_avatar || $txt_avatar == '') $txt_avatar = 'avatar00.jpg';\n\t\t\t\t\t$pic_avatar = imagecreatefromjpeg($txt_avatar);\n\t\t\t\t\timagetextouter($img,10,132,33,'#EEFFFF',$font,$txt_id,'#66CCFF');\n\t\t\t\t\timagettftext($img,9,0,133,53,$color_white,$font,'\u5173\u6ce8\/'.$txt_fo.' '.'\u5173\u6ce8\u8005\/'.$txt_foer.' '.'\u6d88\u606f\u6570\/'.$txt_msgc);\n\t\t\t\t\timagettftext($img,9,0,131,51,$color_skyblue,$font,'\u5173\u6ce8\/'.$txt_fo.' '.'\u5173\u6ce8\u8005\/'.$txt_foer.' '.'\u6d88\u606f\u6570\/'.$txt_msgc);\n\t\t\t\t\timagettftext($img,9,0,132,71,$color_white,$font,autowrap(9,0,$font,$txt_recentmsg,260));\n\t\t\t\t\timagettftext($img,9,0,131,70,$color_skyblue,$font,autowrap(9,0,$font,$txt_recentmsg,260));\n\t\t\t\t\timagecopy($img,$pic_avatar,20,27,0,0,96,96);\n\t\t\t\t}else{\n\t\t\t\t\t$img = imagecreatefrompng('sig500.png');\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$img = imagecreatefrompng('sig500.png');\n\t\t\t}\n\t\t}else{\n\t\t\t$img = imagecreatefrompng('sig404.png');\n\t\t}\n\t\timagepng($img);\n\t\timagedestroy($img);\n\t\timagedestroy($img_back);\n\t}else{\n\t\t$img = imagecreatefrompng('sig502.png');\n\t\timagepng($img);\n\t\timagedestroy($img);\n\t}\n\n\tfunction autowrap($fontsize, $angle, $fontface, $string, $width) {\n\t\/\/ Autowrap function by NetPuter\n\t\/\/ From: http:\/\/orzdream.com\/2010\/08\/auto-wrap-in-php-gd\/\n\t\/\/ \u8fd9\u51e0\u4e2a\u53d8\u91cf\u5206\u522b\u662f \u5b57\u4f53\u5927\u5c0f, \u89d2\u5ea6, \u5b57\u4f53\u540d\u79f0, \u5b57\u7b26\u4e32, \u9884\u8bbe\u5bbd\u5ea6 \n\t$content = \"\";\n \n\t\/\/ \u5c06\u5b57\u7b26\u4e32\u62c6\u5206\u6210\u4e00\u4e2a\u4e2a\u5355\u5b57 \u4fdd\u5b58\u5230\u6570\u7ec4 letter \u4e2d\n\tfor ($i=0;$i<mb_strlen($string);$i++) {\n\t\t$letter[] = mb_substr($string, $i, 1);\n\t}\n \n\tforeach ($letter as $l) {\n\t\t$teststr = $content.\" \".$l;\n\t\t$testbox = imagettfbbox($fontsize, $angle, $fontface, $teststr);\n\t\t\/\/ \u5224\u65ad\u62fc\u63a5\u540e\u7684\u5b57\u7b26\u4e32\u662f\u5426\u8d85\u8fc7\u9884\u8bbe\u7684\u5bbd\u5ea6\n\t\tif (($testbox[2] > $width) && ($content !== \"\")) {\n\t\t\t$content .= \"\\n\";\n\t\t}\n\t\t$content .= $l;\n\t}\n\treturn $content;\n\t}\n\n\tfunction imagetextouter(&$im, $size, $x, $y, $color, $fontfile, $text, $outer)\n\t\/\/ Image Outerliner\n\t\/\/ From http:\/\/www.ugia.cn\/?p=88\n\t{\n\t\tif (!function_exists('ImageColorAllocateHEX'))\n\t\t{\n\t\t\tfunction ImageColorAllocateHEX($im, $s)\n\t\t\t{\n\t\t\t   if($s{0} == \"#\") $s = substr($s,1);\n\t\t\t   $bg_dec = hexdec($s);\n\t\t\t   return imagecolorallocate($im,\n\t\t\t\t\t\t   ($bg_dec & 0xFF0000) >> 16,\n\t\t\t\t\t\t   ($bg_dec & 0x00FF00) >>  8,\n\t\t\t\t\t\t   ($bg_dec & 0x0000FF)\n\t\t\t\t\t\t   );\n\t\t\t}\n\t\t}\n\t\t$ttf = false;\n\t\tif (is_file($fontfile))\n\t\t{\n\t\t\t$ttf = true;\n\t\t\t$area = imagettfbbox($size, $angle, $fontfile, $text);\n\t\t\t$width  = $area[2] - $area[0] + 2;\n\t\t\t$height = $area[1] - $area[5] + 2;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$width  = strlen($text) * 10;\n\t\t\t$height = 16;\n\t\t}\n\t\t$im_tmp = imagecreate($width, $height);\n\t\t$white = imagecolorallocate($im_tmp, 255, 255, 255);\n\t\t$black = imagecolorallocate($im_tmp, 0, 0, 0);\n\t\t$color = ImageColorAllocateHEX($im, $color);\n\t\t$outer = ImageColorAllocateHEX($im, $outer);\n\t\tif ($ttf)\n\t\t{\n\t\t\timagettftext($im_tmp, $size, 0, 0, $height - 2, $black, $fontfile, $text);\n\t\t\timagettftext($im, $size, 0, $x, $y, $color, $fontfile, $text);\n\t\t\t$y = $y - $height + 2;\n\t\t}\n\t\telse\n\t\t{\n\t\t\timagestring($im_tmp, $size, 0, 0, $text, $black);\n\t\t\timagestring($im, $size, $x, $y, $text, $color);\n\t\t}\n\t\tfor ($i = 0; $i < $width; $i ++)\n\t\t{\n\t\t\tfor ($j = 0; $j < $height; $j ++)\n\t\t\t{\n\t\t\t\t$c = ImageColorAt($im_tmp, $i, $j);\n\t\t\t\tif ($c !== $white)\n\t\t\t\t{\n\t\t\t\t\tImageColorAt ($im_tmp, $i, $j - 1) != $white || imagesetpixel($im, $x + $i, $y + $j - 1, $outer);\n\t\t\t\t\tImageColorAt ($im_tmp, $i, $j + 1) != $white || imagesetpixel($im, $x + $i, $y + $j + 1, $outer);\n\t\t\t\t\tImageColorAt ($im_tmp, $i - 1, $j) != $white || imagesetpixel($im, $x + $i - 1, $y + $j, $outer);\n\t\t\t\t\tImageColorAt ($im_tmp, $i + 1, $j) != $white || imagesetpixel($im, $x + $i + 1, $y + $j, $outer);\n\t\t\t\t\tImageColorAt ($im_tmp, $i - 1, $j - 1) != $white || imagesetpixel($im, $x + $i - 1, $y + $j - 1, $outer);\n\t\t\t\t\tImageColorAt ($im_tmp, $i + 1, $j - 1) != $white || imagesetpixel($im, $x + $i + 1, $y + $j - 1, $outer);\n\t\t\t\t\tImageColorAt ($im_tmp, $i - 1, $j + 1) != $white || imagesetpixel($im, $x + $i - 1, $y + $j + 1, $outer);\n\t\t\t\t\tImageColorAt ($im_tmp, $i + 1, $j + 1) != $white || imagesetpixel($im, $x + $i + 1, $y + $j + 1, $outer);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\timagedestroy($im_tmp);\n\t}\n\n\tfunction cut_str($sourcestr,$cutlength){\n\t\t\/\/Double-byted chars substr function\n\t\t\/\/From: http:\/\/hi.baidu.com\/ayu1106\/blog\/item\/b62d73ede57521d7b31cb1c0.html\n\t\t$returnstr='';\n\t\t$i=0;\n\t\t$n=0;\n\t\t$str_length=strlen($sourcestr);\/\/\u5b57\u7b26\u4e32\u7684\u5b57\u8282\u6570\n\t\twhile (($n<$cutlength) and ($i<=$str_length)){\n\t\t   $temp_str=substr($sourcestr,$i,1);\n\t\t   $ascnum=Ord($temp_str);\/\/\u5f97\u5230\u5b57\u7b26\u4e32\u4e2d\u7b2c$i\u4f4d\u5b57\u7b26\u7684ascii\u7801\n\t\t   if ($ascnum>=224){ \/\/\u5982\u679cASCII\u4f4d\u9ad8\u4e0e224\uff0c\n\t\t\t$returnstr=$returnstr.substr($sourcestr,$i,3); \/\/\u6839\u636eUTF-8\u7f16\u7801\u89c4\u8303\uff0c\u5c063\u4e2a\u8fde\u7eed\u7684\u5b57\u7b26\u8ba1\u4e3a\u5355\u4e2a\u5b57\u7b26\n\t\t\t$i=$i+3; \/\/\u5b9e\u9645Byte\u8ba1\u4e3a3\n\t\t\t$n++; \/\/\u5b57\u4e32\u957f\u5ea6\u8ba11\n\t\t   }elseif ($ascnum>=192){ \/\/\u5982\u679cASCII\u4f4d\u9ad8\u4e0e192\uff0c\n\t\t\t$returnstr=$returnstr.substr($sourcestr,$i,2); \/\/\u6839\u636eUTF-8\u7f16\u7801\u89c4\u8303\uff0c\u5c062\u4e2a\u8fde\u7eed\u7684\u5b57\u7b26\u8ba1\u4e3a\u5355\u4e2a\u5b57\u7b26\n\t\t\t$i=$i+2; \/\/\u5b9e\u9645Byte\u8ba1\u4e3a2\n\t\t\t$n++; \/\/\u5b57\u4e32\u957f\u5ea6\u8ba11\n\t\t   }elseif ($ascnum>=65 && $ascnum<=90){ \/\/\u5982\u679c\u662f\u5927\u5199\u5b57\u6bcd\uff0c\n\t\t\t$returnstr=$returnstr.substr($sourcestr,$i,1);\n\t\t\t$i=$i+1; \/\/\u5b9e\u9645\u7684Byte\u6570\u4ecd\u8ba11\u4e2a\n\t\t\t$n++; \/\/\u4f46\u8003\u8651\u6574\u4f53\u7f8e\u89c2\uff0c\u5927\u5199\u5b57\u6bcd\u8ba1\u6210\u4e00\u4e2a\u9ad8\u4f4d\u5b57\u7b26\n\t\t   }else{ \/\/\u5176\u4ed6\u60c5\u51b5\u4e0b\uff0c\u5305\u62ec\u5c0f\u5199\u5b57\u6bcd\u548c\u534a\u89d2\u6807\u70b9\u7b26\u53f7\uff0c\n\t\t\t$returnstr=$returnstr.substr($sourcestr,$i,1);\n\t\t\t$i=$i+1; \/\/\u5b9e\u9645\u7684Byte\u6570\u8ba11\u4e2a\n\t\t\t$n=$n+0.5; \/\/\u5c0f\u5199\u5b57\u6bcd\u548c\u534a\u89d2\u6807\u70b9\u7b49\u4e0e\u534a\u4e2a\u9ad8\u4f4d\u5b57\u7b26\u5bbd...\n\t\t   }\n\t\t}\n\t\tif ($str_length>$cutlength){\n\t\t   $returnstr = $returnstr . \"...\";\/\/\u8d85\u8fc7\u957f\u5ea6\u65f6\u5728\u5c3e\u5904\u52a0\u4e0a\u7701\u7565\u53f7\n\t\t}\n\t\treturn $returnstr; \n\t}\n?><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4ee5\u4e0a\u4e3a\u6f14\u793a\u3002 \u5199\u5b8c\u6a59\u8bed\u541b\u3001\u6731\u9e6d\u5b50\u548c\u963f\u6c42\u4e09\u4e2a\u5355\u8bcd\u673a\u5668\u4eba\u540e\uff0c\u5c31\u60f3\u505a\u4e00\u4e2a\u9875\u9762\u628a\u8fd9\u4e9bBot\u4eec\u90fd\u5217\u51fa\u6765\uff08\u8fd9\u4e2a\u9875\u9762\u73b0\u5728\u5728\u8fd9 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-149","post","type-post","status-publish","format-standard","hentry","category-works"],"_links":{"self":[{"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/posts\/149","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/comments?post=149"}],"version-history":[{"count":0,"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/posts\/149\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/media?parent=149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/categories?post=149"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.aoisnow.net\/blog\/wp-json\/wp\/v2\/tags?post=149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}