| 放到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,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,"/","");
 //支持gd库
 if (function_exists("imagejpeg")) {
 header ("Content-type: image/jpeg");
 $img=imagecreate($imgW,24);
    $black=imagecolorallocate($img,51,51);$gray=imagecolorallocate($img,255,255);
 imagefill($img,$gray);
 imagestring($img,5,3,$black);
 imagejpeg($img);
 imagedestroy($img);
 }
 elseif (function_exists("imagegif")) {
 header ("Content-type: image/gif");
 $img=imagecreate(140,$black);
 imagegif($img);
 imagedestroy($img);
 }
 elseif (function_exists("imagepng")) {
 header ("Content-type: image/png");
 $img=imagecreate($imgW,$black);
 imagepng($img);
 imagedestroy($img);
 }
 elseif (function_exists("imagewbmp")) {
 header ("Content-type: image/vnd.wap.wbmp");
 $img=imagecreate($imgW,$black);
 imagewbmp($img);
 imagedestroy($img);
 }
 else {
 include("../class/functions.php");
 $set=setcookie("checkplkey","ecms","");
 echo ReadFiletext("../data/images/ecms.jpg");
 }
 }
 ShowKey();
 ?>
 (编辑:南平站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |