web建站教程
  1. 首页
  2. vuejs
  3. js
  4. 好玩
  5. AIGC工具
  6. 前端知识
  7. 百度echarts
  8. 更多
    php入门
    nodejs
    mockjs
    reactjs
    mysql
    wordpress
    织梦cms
    帝国cms
    git教程
    IT知识
    模板大全
    休息站
    手机应用

帝国cms如何修改分类信息发布的内容生产图片格

757 ℃

帝国cms如何修改分类信息发布的内容生产图片格式,放到e目录下

修改第16行
$r=$empire->fetch1("select dianhua,chuanzhen,dianziyouxiang from phome_ecms_zhaopin where id='$id'");
$r=$empire->fetch1("select 你要图片化的字段名 from 你要调用的数据表名 where id='$id'");

然后模板添加
<img src="[!–news.url–]e/key/zhaopin.php?key=dianziyouxiang&id=[!–id–]" /></img>
<img src="[!–news.url–]e/key/zhaopin.php?key=你要图片化的字段名&id=[!–id–]" /></img>

可以复制PHP文件改名来达到多个数据库的调用

<?php
@require("../class/connect.php");
if (!defined('InEmpireCMS')) {
    exit();
}
include("../class/db_sql.php");
include("../class/config.php");
$link = db_connect();
$empire = new mysqlquery();
//取得号码
function number($keys) {
    global $empire,
    $dbtbpre;
    $id = $_GET[id];
    $r = $empire – >fetch1("select dianhua,chuanzhen,dianziyouxiang from phome_ecms_zhaopin where id='$id'");
    $r[$keys] ? $number = trim($r[$keys]) : $number = 'No write..';
    return $number;
}
//显示号码为图片
function ShowKey() {
    $keys = $_GET[key];
    $number = number($keys);
    $strlen = strlen($number);
    $key = strtolower($number);
    $imgW = $strlen * 10;
    $key = strtolower(number($keys));
    $set = setcookie("checkplkey", $key, 0, "/", "");
    //支持gd库
    if (function_exists("imagejpeg")) {
        header("Content-type: image/jpeg");
        $img = imagecreate($imgW, 24);
        $black = imagecolorallocate($img, 51, 51, 51);
        $gray = imagecolorallocate($img, 255, 255, 255);
        imagefill($img, 0, 0, $gray);
        imagestring($img, 5, 5, 3, $key, $black);
        imagejpeg($img);
        imagedestroy($img);
    }
    elseif(function_exists("imagegif")) {
        header("Content-type: image/gif");
        $img = imagecreate(140, 24);
        $black = imagecolorallocate($img, 51, 51, 51);
        $gray = imagecolorallocate($img, 255, 255, 255);
        imagefill($img, 0, 0, $gray);
        imagestring($img, 5, 5, 3, $key, $black);
        imagegif($img);
        imagedestroy($img);
    }
    elseif(function_exists("imagepng")) {
        header("Content-type: image/png");
        $img = imagecreate($imgW, 24);
        $black = imagecolorallocate($img, 51, 51, 51);
        $gray = imagecolorallocate($img, 255, 255, 255);
        imagefill($img, 0, 0, $gray);
        imagestring($img, 5, 5, 3, $key, $black);
        imagepng($img);
        imagedestroy($img);
    }
    elseif(function_exists("imagewbmp")) {
        header("Content-type: image/vnd.wap.wbmp");
        $img = imagecreate($imgW, 24);
        $black = imagecolorallocate($img, 51, 51, 51);
        $gray = imagecolorallocate($img, 255, 255, 255);
        imagefill($img, 0, 0, $gray);
        imagestring($img, 5, 5, 3, $key, $black);
        imagewbmp($img);
        imagedestroy($img);
    } else {
        include("../class/functions.php");
        $set = setcookie("checkplkey", "ecms", 0, "/", "");
        echo ReadFiletext("../data/images/ecms.jpg");
    }
}
ShowKey();
?>

CMS网站被挂黑链应该如何解决?(如何防止黑链)

fetch基本方法的调用

jquery利用select实现多级联动(省市县)

git中fetch和push的用法介绍

html怎样动态设置select默认选项

标签: CMS网站 empire fetch id select

上面是“帝国cms如何修改分类信息发布的内容生产图片格”的全面内容,想了解更多关于 帝国cms 内容,请继续关注web建站教程。

当前网址:https://ipkd.cn/webs_1355.html

声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

当前位置: 网站首页 > 帝国cms
本文共计2492个字,预计阅读时长17分钟

基金从业资格考试题库

一站式备考基金从业资格考试,收录2021-2025年模拟题库!呱呱工具箱

AI工作站

收录全球3800+ 款各行各业AI应用,轻轻松松做事!

生活小工具

收录了万年历、老黄历、八字智能排盘等100+款小工具!生活小工具
上一篇: 推荐一个可以查询老黄历的网站,可以根据五行取名!
下一篇: 详细介绍HTTP状态码不同之处的原因(什么原因导致的)
x 打工人ai神器