<?php
//decode by http://www.yunlu99.com/
require "config.php";
$num = rand(1, 10);
if ($wallpaper == 1) {
$url2 = "http://wp.birdpaper.com.cn/intf/search?content={$title}&pageno={$num}&count=1";
$content = file_get_contents($url2);
$array = json_decode($content, true);
$imgurl = $array["data"]["list"][0]["url"];
}
if ($imgurl) {
header("Content-Type: image/png");
session_start();
header("Cache-Control: private, max-age=10800, pre-check=10800");
header("Pragma: private");
header("Expires: " . date(DATE_RFC822, strtotime(" 2 day")));
@ob_end_clean();
@readfile($imgurl);
@flush();
@ob_flush();
exit;
} else {
$bgimg = "./image/" . $numrand . ".jpg";
$bg_info = getimagesize($bgimg);
$bg_type = image_type_to_extension($bg_info[2], false);
$func = "imagecreatefrom" . $bg_type;
$bg_image = $func($bgimg);
$numrand2 = rand(1, 10);
$tu1 = "./image/" . $numrand2 . ".jpg";
$tu1_info = getimagesize($tu1);
$tu1_type = image_type_to_extension($tu1_info[2], false);
$tu1_func = "imagecreatefrom" . $tu1_type;
$tu1_image = $tu1_func($tu1);
imagecopy($bg_image, $tu1_image, 0, 0, 0, 0, 0, 400);
$tu2 = "./image/" . $numrand2 . ".jpg";
$tu2_mark = getimagesize($tu2);
$tu2_type = image_type_to_extension($tu2_mark[2], false);
$tu2_func = "imagecreatefrom" . $tu2_type;
$tu2_image = $tu2_func($tu2);
imagecopy($bg_image, $tu2_image, 583, 1193, 0, 0, 258, 261);
$gettxtone = mb_substr($get, 0, 20, "utf-8");
$gettxttwo = mb_substr($get, 20, 20, "utf-8");
$gettxtthree = mb_substr($get, 25, 13, "utf-8");
$text1 = preg_split("/(?<!^)(?!\$)/u", $gettxtone);
$text2 = preg_split("/(?<!^)(?!\$)/u", $gettxttwo);
$text3 = preg_split("/(?<!^)(?!\$)/u", $gettxtthree);
if ($waterturn == 1) {
$waterfont = $watertitle;
$waterfont = preg_split("/(?<!^)(?!\$)/u", $waterfont);
}
$color = imagecolorallocate($bg_image, 255, 255, 255);
$font = "./font/" . $fontrand . ".ttf";
$font_lposition = [100, 60];
$font_tposition = [220, 120];
$height = $height + $h * $size;
$titlelenth = strlen($title);
if ($titlelenth > 10) {
$x = 130;
$y = 175;
} else {
$x = 200;
$y = ($height - imagefontheight($size)) / 2;
}
$size = 30;
$y2 = $y + 60;
$x2 = 110;
$y3 = $y2 + 60;
$x3 = $x2;
foreach ($text1 as $k => $v) {
imagettftext($bg_image, $size, 0, $x, $y, $color, $font, $v);
$x = $x + 45;
}
foreach ($text2 as $k => $v) {
imagettftext($bg_image, $size, 0, $x2, $y2, $color, $font, $v);
$x2 = $x2 + 45;
}
foreach ($text3 as $k => $v) {
imagettftext($bg_image, $size, 0, $x3, $y3, $color, $font, $v);
$x3 = $x3 + 45;
}
if ($waterfont) {
foreach ($waterfont as $k => $v) {
imagettftext($bg_image, $size, 0, $waterx, $watery, $color, $font, $v);
$waterx = $waterx + 45;
}
}
header("Content-type:image/png");
imagepng($bg_image);
imagedestroy($bg_image);
imagedestroy($bg_image);
imagedestroy($tu1_image);
imagedestroy($tu2_image);
session_start();
header("Cache-Control: private, max-age=10800, pre-check=10800");
header("Pragma: private");
header("Expires: " . date(DATE_RFC822, strtotime(" 2 day")));
}
没有合适的资源?快使用搜索试试~ 我知道了~
伪静态根据标题生成图片.tar
需积分: 5 0 下载量 39 浏览量
2024-03-15
10:18:07
上传
评论
收藏 11.17MB GZ 举报
温馨提示
共15个文件
jpg:10个
ttf:2个
php:2个
根据标题生成图片.tar
资源推荐
资源详情
资源评论
收起资源包目录
根据标题生成图片.tar.gz (15个子文件)
url.php 3KB
font
8.ttf 9.58MB
1.ttf 9.27MB
config.php 632B
image
2.jpg 30KB
10.jpg 24KB
6.jpg 15KB
1.jpg 7KB
5.jpg 9KB
8.jpg 19KB
3.jpg 17KB
7.jpg 13KB
9.jpg 8KB
4.jpg 15KB
伪静态规则 43B
共 15 条
- 1
资源评论
亲测源码模板
- 粉丝: 109
- 资源: 10
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功