|
你好,这个在设置里的皮肤更改的,希望能帮到您,给个好评吧亲,谢谢啦建议你可以直接设置显示的哦在了解DedeCms的模板代码之前,了解一下织梦模板引擎的知识是非常有意义的。织梦模板引擎是一种使用XML名字空间形式的模板解析器,使用织梦解析器解析模板的最大好处是可以轻松的制定标记的属性,感觉上就像在用HTML一样,使模板代码十分直观灵活,新版的织梦模板引擎不单能实现模板的解析还能分析模板里错误的标记。1、织梦模板引擎的代码样式有如下几种形式:{dede:标记名称属性='值'/}{dede:标记名称属性='值'}{/dede:标记名称}{dede:标记名称属性='值'}自定义样式模板(InnerText){/dede:标记名称}提示:如果使用带底层模板的标记,必须严格用{dede:标记名称属性='值'}{/dede:标记名称}这种格式,否则会报错。2、织梦模板引擎内置有多个系统标记,这些系统标记在任何场合都是能直接使用的。(1)global标记,表示获取一个外部变量,除了数据库密码之外,能调用系统的任何配置参数,形式为:{dede:globalname='变量名称'}{/dede:global}或{dede:globalname='变量名称'/}其中变量名称不能加$符号,如变量$cfg_cmspath,应该写成{dede:globalname='cfg_cmspath'/}。(2)foreach用来输出一个数组,形式为:{dede:foreacharray='数组名称'}[field:key/][field:value/]{/dede:foreach}(3)include引入一个文件,形式为:{dede:includefile='文件名称'ismake='是否为dede板块模板(yes/no)'/}对文件的搜索路径为顺序为:绝对路径、include文件夹,CMS安装目录,CMS主模板目录3、织梦标记允许在任何标记中使用函数对得到的值进行处理,形式为:{dede:标记名称属性='值'function='youfunction(参数一参数二@me)'/}其中@me用于表示当前标记的值,其它参数由你的函数决定是否存在,例如:{dede:fieldname='pubdate'function='strftime(%Y-%m-%d%H:%M:%S@me)'/}4、织梦标记允许有限的编程扩展。格式为:{dede:tagnamerunphp='yes'}$aaa=@me;@me=123456{/dede:tagname}@me表示这个标记本身的值,因此标记内编程是不能使用echo之类的语句的,只能把所有返回值传递给@me。此外由于程序代码占用了底层模板InnerText的内容,因此需编程的标记只能使用默认的InnerText。摘自织梦CMS中的图片处理类,摘自织梦cms图片本文实例讲述了摘自织梦CMS中的图片处理类。分享给大家供大家参考。具体如下:__construct($targetfile,$cfg_thumb,$cfg_watermarktext,$photo_waterpos,$photo_diaphaneity,$photo_wheight,$photo_wwidth,$cfg_watermarktype,$photo_marktrans,$trueMarkimg,$attach);}//析构函数function__construct($targetfile,$cfg_thumb,$cfg_watermarktext,$photo_waterpos,$photo_diaphaneity,$photo_wheight,$photo_wwidth,$cfg_watermarktype,$photo_marktrans,$trueMarkimg,$attach=array()){$this->thumbstatus=$cfg_thumb;$this->watermarktext=$cfg_watermarktext;$this->watermarkstatus=$photo_waterpos;$this->watermarkquality=$photo_marktrans;$this->watermarkminwidth=$photo_wwidth;$this->watermarkminheight=$photo_wheight;$this->watermarktype=$cfg_watermarktype;$this->watermarktrans=$photo_diaphaneity;$this->animatedgif=0;$this->targetfile=$targetfile;$this->attachinfo=@getimagesize($targetfile);$this->attach=$attach;switch($this->attachinfo[mime]){caseimage/jpeg:$this->imagecreatefromfunc=function_exists(imagecreatefromjpeg)?imagecreatefromjpeg:;$this->imagefunc=function_exists(imagejpeg)?imagejpeg:;break;caseimage/gif:$this->imagecreatefromfunc=function_exists(imagecreatefromgif)?imagecreatefromgif:;$this->imagefunc=function_exists(imagegif)?imagegif:;break;caseimage/png:$this->imagecreatefromfunc=function_exists(imagecreatefrompng)?imagecreatefrompng:;$this->imagefunc=function_exists(imagepng)?imagepng:;break;}//为空则匹配类型的函数不存在$this->attach[size]=empty($this->attach[size])?@filesize($targetfile):$this->attach[size];if($this->attachinfo[mime]==image/gif){$fp=fopen($targetfile,rb);$targetfilecontent=fread($fp,$this->attach[size]);fclose($fp);$this->animatedgif=strpos($targetfilecontent,NETSCAPE2.0)===false?0:1;}}/***生成缩略图**@accesspublic*@paramint$thumbwidth图片宽度*@paramint$thumbheight图片高度*@paramint$preview是否预览*@returnvoid*/functionthumb($thumbwidth,$thumbheight,$preview=0){$this->thumb_gd($thumbwidth,$thumbheight,$preview);if($this->thumbstatus==2&&$this->watermarkstatus){$this->image($this->targetfile,$this->attach);$this->attach[size]=filesize($this->targetfile);}}/***图片水印**@accesspublic*@paramint$preview是否预览*@returnvoid*/functionwatermark($preview=0){if($this->watermarkminwidth&&$this->attachinfo[0]watermarkminwidth&&$this->watermarkminheight&&$this->attachinfo[1]watermarkminheight){return;}$this->watermark_gd($preview);}/***使用gd生成缩略图**@accesspublic*@paramint$thumbwidth图片宽度*@paramint$thumbheight图片高度*@paramint$preview是否预览*@returnvoid*/functionthumb_gd($thumbwidth,$thumbheight,$preview=0){if($this->thumbstatus&&function_exists(imagecreatetruecolor)&&function_exists(imagecopyresampled)&&function_exists(imagejpeg)){$imagecreatefromfunc=$this->imagecreatefromfunc;$imagefunc=$this->thumbstatus==1?imagejpeg:$this->imagefunc;list($imagewidth,$imageheight)=$this->attachinfo;if(!$this->animatedgif&&($imagewidth>=$thumbwidth||$imageheight>=$thumbheight)){$attach_photo=$imagecreatefromfunc($this->targetfile);$x_ratio=$thumbwidth/$imagewidth;$y_ratio=$thumbheight/$imageheight;if(($x_ratio*$imageheight)thumbstatus==1?$this->targetfile..thumb.jpg:$this->targetfile):./watermark_tmp.jpg;$thumb_photo=imagecreatetruecolor($thumb[width],$thumb[height]);imagecopyresampled($thumb_photo,$attach_photo,0,0,0,0,$thumb[width],$thumb[height],$imagewidth,$imageheight);if($this->attachinfo[mime]==image/jpeg){$imagefunc($thumb_photo,$targetfile,100);}else{$imagefunc($thumb_photo,$targetfile);}$this->attach[thumb]=$this->thumbstatus==1?1:0;}}}/***使用gd进行水印**@accesspublic*@paramint$preview是否预览*@returnvoid*/functionwatermark_gd($preview=0){if($this->watermarkstatus&&function_exists(imagecopy)&&function_exists(imagealphablending)&&function_exists(imagecopymerge)){$imagecreatefunc=$this->imagecreatefromfunc;$imagefunc=$this->imagefunc;list($imagewidth,$imageheight)=$this->attachinfo;if($this->watermarktypewatermarktype==1?DEDEDATA./mark/mark.png:DEDEDATA./mark/mark.gif;$watermarkinfo=@getimagesize($watermark_file);$watermark_logo=$this->watermarktype==1?@imagecreatefrompng($watermark_file):@imagecreatefromgif($watermark_file);if(!$watermark_logo){return;}list($logowidth,$logoheight)=$watermarkinfo;}else{$box=@imagettfbbox($this->watermarktext[size],$this->watermarktext[angle],$this->watermarktext[fontpath],$this->watermarktext[text]);$logowidth=max($box[2],$box[4])-min($box[0],$box[6]);$logoheight=max($box[1],$box[3])-min($box[5],$box[7]);$ax=min($box[0],$box[6])*-1;$ay=min($box[5],$box[7])*-1;}$wmwidth=$imagewidth-$logowidth;$wmheight=$imageheight-$logoheight;if(($this->watermarktypewatermarktype==2)&&$wmwidth>10&&$wmheight>10&&!$this->animatedgif){switch($this->watermarkstatus){case1:$x=+5;$y=+5;break;case2:$x=($imagewidth-$logowidth)/2;$y=+5;break;case3:$x=$imagewidth-$logowidth-5;$y=+5;break;case4:$x=+5;$y=($imageheight-$logoheight)/2;break;case5:$x=($imagewidth-$logowidth)/2;$y=($imageheight-$logoheight)/2;break;case6:$x=$imagewidth-$logowidth-5;$y=($imageheight-$logoheight)/2;break;case7:$x=+5;$y=$imageheight-$logoheight-5;break;case8:$x=($imagewidth-$logowidth)/2;$y=$imageheight-$logoheight-5;break;case9:$x=$imagewidth-$logowidth-5;$y=$imageheight-$logoheight-5;break;}$dst_photo=@imagecreatetruecolor($imagewidth,$imageheight);$target_photo=$imagecreatefunc($this->targetfile);imagecopy($dst_photo,$target_photo,0,0,0,0,$imagewidth,$imageheight);if($this->watermarktype==1){imagecopy($dst_photo,$watermark_logo,$x,$y,0,0,$logowidth,$logoheight);}elseif($this->watermarktype==2){if(($this->watermarktext[shadowx]||$this->watermarktext[shadowy])&&$this->watermarktext[shadowcolor]){$shadowcolorrgb=explode(,,$this->watermarktext[shadowcolor]);$shadowcolor=imagecolorallocate($dst_photo,$shadowcolorrgb[0],$shadowcolorrgb[1],$shadowcolorrgb[2]);imagettftext($dst_photo,$this->watermarktext[size],$this->watermarktext[angle],$x+$ax+$this->watermarktext[shadowx],$y+$ay+$this->watermarktext[shadowy],$shadowcolor,$this->watermarktext[fontpath],$this->watermarktext[text]);}$colorrgb=explode(,,$this->watermarktext[color]);$color=imagecolorallocate($dst_photo,$colorrgb[0],$colorrgb[1],$colorrgb[2]);imagettftext($dst_photo,$this->watermarktext[size],$this->watermarktext[angle],$x+$ax,$y+$ay,$color,$this->watermarktext[fontpath],$this->watermarktext[text]);}else{imagealphablending($watermark_logo,true);imagecopymerge($dst_photo,$watermark_logo,$x,$y,0,0,$logowidth,$logoheight,$this->watermarktrans);}$targetfile=!$preview?$this->targetfile:./watermark_tmp.jpg;if($this->attachinfo[mime]==image/jpeg){$imagefunc($dst_photo,$targetfile,$this->watermarkquality);}else{$imagefunc($dst_photo,$targetfile);}$this->attach[size]=filesize($this->targetfile);}}}}//EndClass织梦系统美化模板源码,大部分资源网站都在用的织梦系统模板,本次为大家带来的是美化版本,界面更加清爽,背景,广告栏都可以自己来定制,同时还能添加喜欢的音乐,可以打造出专属的个性化资源网站页面。本次放出织梦系统美化模板源码资源下载,想要建站的朋友们可以试试哦!织梦系统美化模板源码使用访问./install安装之后登录数据库删除数据库导入aishouji.sql文件即可访问织梦系统美化模板源码功能一套标准的资源网站模板支持个性化定制支持背景,音乐,图片设置自动采集系统可添加相关的下载页面相关视频
|