www.91084.com

GVKun编程网logo

dedecms网站栏目增加缩略图的办法(网站怎么增加栏目)

8

这篇文章主要围绕dedecms网站栏目增加缩略图的办法和网站怎么增加栏目展开,旨在为您提供一份详细的参考资料。我们将全面介绍dedecms网站栏目增加缩略图的办法的优缺点,解答网站怎么增加栏目的相关问

这篇文章主要围绕dedecms网站栏目增加缩略图的办法网站怎么增加栏目展开,旨在为您提供一份详细的参考资料。我们将全面介绍dedecms网站栏目增加缩略图的办法的优缺点,解答网站怎么增加栏目的相关问题,同时也会为您带来DedeCMS 上传缩略图启用水印的办法、DedeCms 栏目增加缩略图功能的办法、DedeCms 栏目增加缩略图功能的方法、DedeCms 给栏目增加缩略图(5.5/5.6通用)的实用方法。

本文目录一览:

dedecms网站栏目增加缩略图的办法(网站怎么增加栏目)

dedecms网站栏目增加缩略图的办法(网站怎么增加栏目)

 

涉及到文件如下(注意备份):

复制代码

代码如下:


dede/cata日志_add.php 
dede/cata日志_edit.php
dede/templets/cata日志_add.htm
dede/templets/cata日志_edit.htm

打开文件夹templets这个目录,在里面新建一个文件夹typeimg,用于独立存放栏目缩略图

新加字段 typeimg

后台执行SQL(前缀默认为dede_ 具体前缀根据自己网站修改):

复制代码

代码如下:


alter table `dede_arctype` add `typeimg` char(100) NOT NULL default '';
打开dede/cata日志_add.php


查找:

复制代码

代码如下:


$queryTemplate = "insert into `dede_arctype`

将:

复制代码

代码如下:


(reid,topid,sortrank,typename,typedir,


替换为:

复制代码

代码如下:


(reid,topid,sortrank,typename,typedir,typeimg,

将:

复制代码

代码如下:


('~reid~','~topid~','~rank~','~typename~','~typedir~',


替换为:

复制代码

代码如下:


('~reid~','~topid~','~rank~','~typename~','~typedir~','~typeimg~',

打开dede/cata日志_edit.php

查找:

复制代码

代码如下:


$upquery = "Update `dede_arctype` set


在其下面新加一行

复制代码

代码如下:


`typeimg`='$typeimg',

打开dede/templets/cata日志_add.htm 查找

复制代码

代码如下:


<tr> </p> <p> <td height="26">列表命名规则:</td> 
<td> 
<input name="namerule2" type="text" id="namerule2" value="{typedir}/list_{tid}_{page}.html"/> 
<img src=http://www.dede58.com/a/dedejq/"img/help.gif" alt="帮助" width="16" height="16" border="0"onClick="ShowHide('helpvar3')"/></td> 
</tr>

在其下面增加以下内容

复制代码

代码如下:


<tr> 
<td height="65">栏目图片:</td> 
<td> 
<input name="typeimg" type="text"id="typeimg"value="" /> 
<input type="button" name="set9" value="浏览... "onClick="SelectTemplets('form1.typeimg&activepath=%2Ftemplets%2Ftypeimg&img=yes');" /> 
(栏目源码里用{dede:field.typeimg /}调用) 
</td> 
</tr>


打开dede/templets/cata日志_edit.htm 查找

复制代码

代码如下:


<tr> 
<td height="26">列表命名规则:</td> 
<td> <input name="namerule2" type="text" id="namerule2" value="<?php echo $myrow['namerule2']?>" size="40"/> 
<img src=http://www.dede58.com/a/dedejq/"img/help.gif" alt="帮助" width="16" height="16" border="0"onClick="ShowHide('helpvar3')"/></td> 
</tr>

在其下面新增以下内容:

复制代码

代码如下:


<tr> 
<td height="65">栏目图片:</td> 
<td> 
<input name="typeimg" type="text"id="typeimg"value="<?php echo $myrow['typeimg']?>" /> 
<input type="button" name="set9" value="浏览... "onClick="SelectImages('form1.typeimg&activepath=%2Ftemplets%2Ftypeimg&img=yes');" /> 
(栏目源码里用{dede:field.typeimg /}调用) 
</td> 
</tr>


完成!

添加或修改图片时在 栏目管理》高级选项上传即可。

如果想同时在新闻内容详细页调用打开\include\arc.archives.class.php 查找

复制代码

代码如下:


if($this->ChannelUnit->ChannelInfos['issystem']!=-1)




复制代码

代码如下:

#p#分页标题#e#


$query = "Select arc.*,tp.reid,tp.typedir,ch.addtable from `dede_archives` arc left join dede_arctype tp on tp.id=arc.typeid left join dede_channeltype as ch on arc.channel = ch.id where arc.id='$aid' "; 
$this->Fields = $this->dsql->GetOne($query);

替换为

复制代码

代码如下:


$query = "Select arc.*,tp.reid,tp.typedir,tp.typeimg,ch.addtable 
from `dede_archives` arc 
left join dede_arctype tp on tp.id=arc.typeid 
left join dede_channeltype as ch on arc.channel = ch.id 
where arc.id='$aid' "; 
$this->Fields = $this->dsql->GetOne($query);


OK,给织梦给栏目增加缩略图的办法就介绍到这了,有需要的朋友可以自行参考修改调整。 本文章网址:http://www.ppssdd.com/code/14537.html。转载请保留出处,谢谢合作!

DedeCMS 上传缩略图启用水印的办法

DedeCMS 上传缩略图启用水印的办法

 

打开include\FCKeditor\editor\dia日志\dede_image.php ,第117行,原文:

以下为引用的内容: if (in_array($imgfile_type,$cfg_photo_typenames)) { WaterImg($fullfilename,'up'); }  

  修改为:

以下为引用的内容: if ($needwatermark=="1" && in_array($imgfile_type,$cfg_photo_typenames)) //修改 by nic { WaterImg($fullfilename,'up'); WaterImg($full_litfilename,'up'); // add by nic }  

本文章网址:http://www.ppssdd.com/code/6101.html。转载请保留出处,谢谢合作!

DedeCms 栏目增加缩略图功能的办法

DedeCms 栏目增加缩略图功能的办法

 

此功能添加涉及到以下文件:

  dede/cata日志_add.php

  dede/cata日志_edit.php

  dede/templets/cata日志_add.htm

  dede/templets/cata日志_edit.htm

  include/taglib/channel.lib.php

  此升级修改办法,在V5.7,V5.7sp1 测试通过,其他版本未测试,原理基本相同,请大家自行测试是否可行。

  首先给 栏目表(`dede_arctype`)增加一个字段typeimg

alter table `dede_arctype` add `typeimg` varchar(200) NOT NULL default ;

  修改cata日志_add.php文件

  打开dede/cata日志_add.php

  查找$queryTemplate = “insert into `dede_arctype`

  将

(reid,topid,sortrank,typename,typedir,

  替换为:

(reid,topid,sortrank,typename,typedir,typeimg,

  将

(‘~reid~’,'~topid~’,'~rank~’,'~typename~’,'~typedir~’,

  替换为:

(‘~reid~’,'~topid~’,'~rank~’,'~typename~’,'~typedir~’,'~typeimg~’,

  查找$in_query = “INSERT INTO `dede_arctype`

  将

(reid,topid,sortrank,typename,typedir,

  替换为:

(reid,topid,sortrank,typename,typedir,typeimg,

  将

(‘$reid’,'$topid’,'$sortrank’,'$typename’,'$typedir’,

  替换为:

(‘$reid’,'$topid’,'$sortrank’,'$typename’,'$typedir’,'$typeimg’,

  保存cata日志_add.php

  下面修改cata日志_edit.php文件

  打开dede/cata日志_edit.php

  查找$upquery = “Update `dede_arctype` set

  在 typedir=’$typedir’, 其下面增加一行:

`typeimg`=’$typeimg’,

  保存cata日志_edit.php

  开始修改栏目添加源码文件

  打开dede/templets/cata日志_add.htm

  在*上面找到这个段

<title>栏目管理</title> <link href=http://www.dede58.com/a/dedejq/”css/base.css” rel=”stylesheet” type=”text/css”>

  替换为:

<title>栏目管理</title> <link href=http://www.dede58.com/a/dedejq/”css/base.css” rel=”stylesheet” type=”text/css”> <script language=”javascript” src=http://www.dede58.com/a/dedejq/”../include/js/dedeajax2.js”></script> <script language=’javascript’ src=http://www.dede58.com/a/dedejq/”js/main.js”></script> <script type=”text/javascript” src=http://www.dede58.com/a/dedejq/”js/calendar/calendar.js”></script>

  列表命名规则:

<tr> <td height="26">列表命名规则:</td> <td> <input name="namerule2" type="text" id="namerule2" value="{typedir}/list_{tid}_{page}.html"/> <img src=http://www.dede58.com/a/dedejq/"images/help.gif" alt="帮助" width="16" height="16" border="0"onClick="ShowHide('helpvar3')"/></td> </tr>

  在标签下面增加一行:

<!--增加栏目缩略图--> <tr> <td width="90">栏目图片:</td> <td width="560"> <table width="100%" border="0" cellspacing="1" cellpadding="1"> <tr> <td height="30"> <input name="typeimg" type="text" id="typeimg"/> <input type="button" value="本地上传"/> <iframe name='uplitpicfra' id='uplitpicfra' src=''></iframe> <span><input name="litpic" type="file" id="litpic" onChange="SeePicNew(this, 'divpicview', 'uplitpicfra', 165, 'archives_add.php');" size="1"/></span> <input type="button" name="Submit2" value="选择图片"onClick="SelectImage('form1.typeimg','small');"/> <input type="button" name="Submit2" value="裁剪"onClick="imageCut('typeimg');"/> <input type='checkbox'name='ddisremote' value='1' id='ddisremote'/>远程<br />(栏目源码里用{dede:field.typeimg /}调用 </td> </tr> </table> </td> <td width="150" align="center"> <div id='divpicview'></div> </td> </tr> <!--增加栏目缩略图-->

  保存cata日志_add.htm

  开始修改栏目编辑源码文件

  打开dede/templets/cata日志_edit.htm

#p#分页标题#e#

  在*上面找到这个段

<title>栏目管理</title> <link href=http://www.dede58.com/a/dedejq/”css/base.css” rel=”stylesheet” type=”text/css”>

  替换为:

<title>栏目管理</title> <link href=http://www.dede58.com/a/dedejq/”css/base.css” rel=”stylesheet” type=”text/css”> <script language=”javascript” src=http://www.dede58.com/a/dedejq/”../include/js/dedeajax2.js”></script> <script language=”javascript” src=http://www.dede58.com/a/dedejq/”js/main.js”></script> <script type=”text/javascript” src=http://www.dede58.com/a/dedejq/”js/calendar/calendar.js”></script>

  查找

<tr> <td height="26">列表命名规则:</td> <td> <input name="namerule2" type="text" id="namerule2" value=http://www.dede58.com/a/dedejq/"<?php echo $myrow['namerule2']?>" size="40"/> <img src=http://www.dede58.com/a/dedejq/"images/help.gif" alt="帮助" width="16" height="16" border="0"onClick="ShowHide('helpvar3')"/></td> </tr>

  在其下面增加一行:

<!--增加栏目缩略图--> <tr> <td width="90" height="81">栏目图片:</td></td> <td width="500"> <input name="typeimg" type="text" id="typeimg"value=http://www.dede58.com/a/dedejq/"<?php echo $myrow['typeimg']?>"><input type="button" name="Submit" value="浏览..."onClick="SelectImage('form1.typeimg','');"> <input type="button" name="Submit2" value="裁剪"onClick="imageCut('typeimg');"/> <input type='checkbox'name='ddisremote' value='1'> 远程<br />(栏目源码里用{dede:field.typeimg /}调用) </td> <td align="center"> <img src=http://www.dede58.com/a/dedejq/"<?php if($myrow['typeimg']!="") echo $myrow['typeimg']; else echo "images/pview.gif";?>" width="150" height="100" id="picview" name="picview"> </td> </tr> <!--增加栏目缩略图-->

  保存cata日志_edit.htm

  至此已经修改完成!

  栏目图片的添加或修改图片时在 (栏目管理>高级选项)里面就会自动出现栏目图片添加的选择,点击选择图片,弹出窗口内选择浏览上传就OK

  注意:前台栏目标签调用的时候,还需要改一个文件,才能实现栏目图片显示,否则只能通过sql语句才能显示图片。

  打开:include/taglib/channel.lib.php

  找到

if($type=='top') { $sql = "Select id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath,description From `dede_arctype` where reid=0 And ishidden<>1 order by sortrank asc limit 0,$row"; } else if($type=="son") { //if($_sys_globals['typeid']>0) $typeid = $_sys_globals['typeid']; if($typeid==0) { return ''; } $sql = "Select id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath,description From `dede_arctype` where reid='$typeid' And ishidden<>1 order by sortrank asc limit 0,$row"; } else if($type=="self") { if($reid==0) { return ''; } $sql = "Select id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath,description From `dede_arctype` where reid='$reid' And ishidden<>1 order by sortrank asc limit 0,$row"; }

  替换成下面的:

if($type=='top') { $sql = "Select id,typename,typeimg,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath,description From `dede_arctype` where reid=0 And ishidden<>1 order by sortrank asc limit 0,$row"; } else if($type=="son") { //if($_sys_globals['typeid']>0) $typeid = $_sys_globals['typeid']; if($typeid==0) { return ''; } $sql = "Select id,typename,typeimg,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath,description From `dede_arctype` where reid='$typeid' And ishidden<>1 order by sortrank asc limit 0,$row"; } else if($type=="self") { if($reid==0) { return ''; } $sql = "Select id,typename,typeimg,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath,description From `dede_arctype` where reid='$reid' And ishidden<>1 order by sortrank asc limit 0,$row"; }

  调用办法:

<img src=http://www.dede58.com/a/dedejq/”[field:typeimg /]” />

 如果想同时在新闻内容详细页调用栏目图片打开,修改\include\arc.archives.class.php

  查找

if($this->ChannelUnit->ChannelInfos['issystem']!=-1) #p#分页标题#e#

  将

$query = “Select arc.*,tp.reid,tp.typedir,ch.addtable from `dede_archives` arc left join dede_arctype tp on tp.id=arc.typeid left join dede_channeltype as ch on arc.channel = ch.id where arc.id=’$aid’ “; $this->Fields = $this->dsql->GetOne($query);

  替换为: 

$query = “Select arc.*,tp.reid,tp.typedir,tp.typeimg,ch.addtable from `dede_archives` arc left join dede_arctype tp on tp.id=arc.typeid left join dede_channeltype as ch on arc.channel = ch.id where arc.id=’$aid’ “; $this->Fields = $this->dsql->GetOne($query);

  保存文件即可。

本文章网址:http://www.ppssdd.com/code/14543.html。转载请保留出处,谢谢合作!

DedeCms 栏目增加缩略图功能的方法

DedeCms 栏目增加缩略图功能的方法

此功能添加涉及到以下文件:

  dede/catalog_add.PHP

  dede/catalog_edit.PHP

  dede/templets/catalog_add.htm

  dede/templets/catalog_edit.htm

  include/taglib/channel.lib.PHP

  此升级修改方法,在v5.7,v5.7sp1 测试通过,其他版本未测试,原理基本相同,请大家自行测试是否可行。

  首先给 栏目表(`dede_arctype`)增加一个字段typeimg

alter table `dede_arctype` add `typeimg` varchar(200) NOT NULL default ;


  修改catalog_add.PHP文件

  打开dede/catalog_add.PHP

  查找$queryTemplate = “insert into `dede_arctype`

  将

(reid,topid,sortrank,typename,typedir,


  替换为:

(reid,typeimg,

  将

(‘~reid~’,'~topid~’,'~rank~’,'~typename~’,'~typedir~’,

  替换为:

(‘~reid~’,'~typeimg~’,

  查找$in_query = “INSERT INTO `dede_arctype`

  将

(reid,

  替换为:

(reid,

  将

(‘$reid’,'$topid’,'$sortrank’,'$typename’,'$typedir’,

  替换为:

(‘$reid’,'$typeimg’,

  保存catalog_add.PHP

  下面修改catalog_edit.PHP文件

  打开dede/catalog_edit.PHP

  查找$upquery = “Update `dede_arctype` set

  在 typedir=’$typedir’,其下面增加一行:

`typeimg`=’$typeimg’,

  保存catalog_edit.PHP

  开始修改栏目添加模板文件

  打开dede/templets/catalog_add.htm

  在最上面找到这个段

栏目管理


  替换为:

栏目管理


  列表命名规则:


  在标签下面增加一行:

图片: 远程
(栏目模板里用{dede:field.typeimg /}调用

DedeCms 给栏目增加缩略图(5.5/5.6通用)

DedeCms 给栏目增加缩略图(5.5/5.6通用)

 

各位网站管理员朋友,大家好,今天我们来学习一下怎么给DedeCms 给栏目增加缩略图,本文转自官方论坛,希望访问烈火学院的朋友给一个出处,本办法适用于DedeCms5.5/5.6。

首先。新加字段 typeimg 
后台执行SQL:

alter table `dede_arctype` add `typeimg` char(100) NOT NULL default '';

涉及到文件: 
dede/cata日志_add.php 
dede/cata日志_edit.php 
dede/templets/cata日志_add.htm 
dede/templets/cata日志_edit.htm 

打开文件夹templets这个目录,在里面新建一个文件夹typeimg,用于独立存放栏目缩略图

打开dede/cata日志_add.php 
查找$queryTemplate = "insert into `dede_arctype` 
将:

(reid,topid,sortrank,typename,typedir,

替换为:

(reid,topid,sortrank,typename,typedir,typeimg,

再将:

('~reid~','~topid~','~rank~','~typename~','~typedir~',

替换为:

('~reid~','~topid~','~rank~','~typename~','~typedir~','~typeimg~',

打开dede/cata日志_edit.php
查找

$upquery = "Update `dede_arctype` set

在其下边增加一行:

`typeimg`='$typeimg',

打开dede/templets/cata日志_add.htm(烈火小编友情提示:这里的dede为后台目录,一般我们都进行了修改) 
查找

<tr> <td height="26">列表命名规则:</td> <td> <input name="namerule2" type="text" id="namerule2" value="{typedir}/list_{tid}_{page}.html"/> <img src=http://www.dede58.com/a/dedejq/"img/help.gif" alt="帮助" width="16" height="16" border="0"onClick="ShowHide('helpvar3')"/></td> </tr>  

在其下面增加以下内容

<tr> <td height="65">栏目图片:</td> <td> <input name="typeimg" type="text"id="typeimg"value="" /> <input type="button" name="set9" value="浏览... "onClick="SelectTemplets('form1.typeimg&activepath=%2Ftemplets%2Ftypeimg&img=yes');" /> (栏目源码里用{dede:field.typeimg /}调用) </td> </tr>  

打开dede/templets/cata日志_edit.htm
查找

<tr> <td height="26">列表命名规则:</td> <td> <input name="namerule2" type="text" id="namerule2" value="<?php echo $myrow['namerule2']?>" size="40"/> <img src=http://www.dede58.com/a/dedejq/"img/help.gif" alt="帮助" width="16" height="16" border="0"onClick="ShowHide('helpvar3')"/></td> </tr>  

在其下边增加内容:

<tr> <td height="65">栏目图片:</td> <td> <input name="typeimg" type="text"id="typeimg"value="<?php echo $myrow['typeimg']?>" /> <input type="button" name="set9" value="浏览... "onClick="SelectImages('form1.typeimg&activepath=%2Ftemplets%2Ftypeimg&img=yes');" />  



(栏目源码里用{dede:field.typeimg /}调用) 
</td> 
</tr> 
完成!

本文章网址:http://www.ppssdd.com/code/7095.html。转载请保留出处,谢谢合作!

今天关于dedecms网站栏目增加缩略图的办法网站怎么增加栏目的讲解已经结束,谢谢您的阅读,如果想了解更多关于DedeCMS 上传缩略图启用水印的办法、DedeCms 栏目增加缩略图功能的办法、DedeCms 栏目增加缩略图功能的方法、DedeCms 给栏目增加缩略图(5.5/5.6通用)的相关知识,请在本站搜索。

本文标签: