DeDeCMSä¼ä¸šç½‘站建设ä¸å¢žåŠ æ 目缩略图的方法
使用DeDeCMS进行ä¼ä¸šç½‘站建设ä¸ï¼Œä¸€èˆ¬ä¼šåˆ›å»ºæ 目用于展示产å“åˆ†ç±»ï¼Œæœ‰æ—¶å€™å› ä¸ºç½‘ç«™åŠŸèƒ½éœ€æ±‚å’Œå±•ç¤ºæ•ˆæžœçš„å¤šæ ·æ€§ï¼Œéœ€è¦ä¸ºæ ç›®é¡µæ·»åŠ ç¼©ç•¥å›¾åŠŸèƒ½ï¼Œå…·ä½“åŠžæ³•å¦‚ä¸‹ã€‚
修改的文件如下:
- dede/catalog_add.php 
- dede/catalog_edit.php
- dede/templets/catalog_add.htm
- dede/templets/catalog_edit.htm
打开文件夹templets这个目录,在里é¢æ–°å»ºä¸€ä¸ªæ–‡ä»¶å¤¹typeimg,用于独立å˜æ”¾æ 目缩略图
æ–°åŠ å—段 typeimg
åŽå°æ‰§è¡ŒSQL(å‰ç¼€é»˜è®¤ä¸ºdede_ 具体å‰ç¼€æ ¹æ®è‡ªå·±ç½‘站修改):
- alter table `dede_arctype` add `typeimg` char(100) NOT NULL default '';
打开dede/catalog_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/catalog_edit.php,查找:
- $upquery = "Update `dede_arctype` set
在其下é¢æ–°åŠ 一行
- `typeimg`='$typeimg',
打开dede/templets/catalog_add.htm,查找:
- <tr> </p> <p> <td height="26">列表命å规则:</td>
- <td>
- <input name="namerule2" type="text" id="namerule2" value="{typedir}/list_{tid}_{page}.html" class="pubinputs" style="width:250px" />
- <img src="img/help.gif" alt="帮助" width="16" height="16" border="0" style="cursor:pointer" onClick="ShowHide('helpvar3')"/></td>
- </tr>
在下é¢å¢žåŠ 以下代ç :
- <tr>
- <td height="65">æ 目图片:</td>
- <td>
- <input name="typeimg" type="text" style="width:250px" id="typeimg" class="alltxt" value="" />
- <input type="button" name="set9" value="æµè§ˆ... "class="coolbg np" style="width:60px" onClick="SelectTemplets('form1.typeimg&activepath=%2Ftemplets%2Ftypeimg&img=yes');" />
- (æ 目模æ¿é‡Œç”¨{dede:field.typeimg /}调用)
- </td>
- </tr>
打开dede/templets/catalog_edit.htm,查找:
- <tr>
- <td height="26">列表命å规则:</td>
- <td> <input name="namerule2" type="text" id="namerule2" value="<?php echo $myrow['namerule2']?>" size="40" class="iptxt" />
- <img src="img/help.gif" alt="帮助" width="16" height="16" border="0" style="cursor:pointer" onClick="ShowHide('helpvar3')"/></td>
- </tr>
在下é¢æ–°å¢žä»¥ä¸‹ä»£ç :
- <tr>
- <td height="65">æ 目图片:</td>
- <td>
- <input name="typeimg" type="text" style="width:250px" id="typeimg" class="alltxt" value="<?php echo $myrow['typeimg']?>" />
- <input type="button" name="set9" value="æµè§ˆ... "class="coolbg np" style="width:60px" 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)
将如下代ç :
- $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);
DeDeCMS自定义表å•å®žçŽ°å—段默认为必填项
DeDeCMS自定义表å•æ交数æ®æ—¶åŠ 入验è¯ç 功能
DeDeCMS调用自定义表å•å†…容以åŠå®žçŽ°åˆ†é¡µåŠŸèƒ½ï¼ˆDatalistè¿ç”¨å®žä¾‹ï¼‰
DeDeCMSçš„channelæ ‡ç¾æ”¯æŒlimit(属性)功能
DeDeCMS获å–上级æ ç›®IDåŠé¡¶çº§æ ç›®ID
让DeDeCMSçš„channelæ ‡ç¾æ”¯æŒè°ƒç”¨æ ç›®æè¿°descriptionåŠå…³é”®è¯keywords
DeDeCMS调用æ 目排åºç¼–å·(自动递增数å—)
DeDeCMS安全设置:更改data目录命å
DedeCMS修改数æ®åº“表å‰ç¼€"_dede"的方法
DeDeCMS调用å‹æƒ…é“¾æŽ¥çš„æ ‡ç¾
最后编辑: 郝聪 编辑于2015/04/23 11:01