放到e目錄下
修改第16行
$r=$empire->fetch1("select dianhua,chuanzhen,dianziyouxiang from phome_ecms_zhaopin where id='$id'");
$r=$empire->fetch1("select 你要圖片化的字段名 from 你要調(diào)用的數(shù)據(jù)表名 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>
可以復(fù)制PHP文件改名來達(dá)到多個(gè)數(shù)據(jù)庫的調(diào)用
<?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();
?>
版權(quán)聲明: 本站資源均來自互聯(lián)網(wǎng)或會員發(fā)布,如果侵犯了您的權(quán)益請與我們聯(lián)系,我們將在24小時(shí)內(nèi)刪除!謝謝!
轉(zhuǎn)載請注明: 帝國cms分類信息發(fā)布的內(nèi)容生產(chǎn)圖片格式