zoukankan      html  css  js  c++  java
  • 织梦文章内容页独立内容页模板

    织梦内容页独立内容模板,可以让文章不同样式展示

    1、后台-系统-SQL命令行工具-执行

    ALTER TABLE `#@_archives` ADD `tempname` VARCHAR( 40 ) NOT NULL DEFAULT '';

    2、后台文档发布模板里添加表单

    文章模型的是

    • dede/templets/article_add.htm
    • dede/templets/article_edit.htm

    图集模型的是

    • dede/templets/album_add.htm
    • dede/templets/album_edit.htm

    软件模型的是

    • dede/templets/soft_add.htm
    • dede/templets/soft_edit.htm

    商品和自定义模型的是

    • dede/templets/archives_add.htm
    • dede/templets/archives_edit.htm

    根据你自己的模型来添加表单,搜索自定义文件名

    发布和编辑都是插入如下的代码

    <script type="text/javascript">
    function SelectTemplets(fname)
    {
    	var posLeft = 200;
    	var posTop = 300;
    	window.open("../include/dialog/select_templets.php?f="+fname, "poptempWin", "scrollbars=yes,resizable=yes,statebar=no,width=600,height=400,left="+posLeft+", top="+posTop);
    }
    </script>
    <tr>
    	<td colspan="2">
    		<table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-bottom:3px;">
    			<tr> 
    				<td width="90" class="bline" height='24'>&nbsp;自定义模板:</td>
    				<td class="bline"><input type='text' name="tempname" id="tempname" style='300px' class='text' value="<?php echo $arcRow['tempname']; ?>" /> <input name='diytemp_bt' type='button' class='inputbut' value='浏览...' onClick="SelectTemplets('form1.tempname')" />
    				</td>
    			</tr>
    		</table>
    	</td>
    </tr>

    插入代码后的效果如下

    3、后台文档发布和编辑处理php文件修改

    文章模型的是

    • dede/article_add.php
    • dede/article_edit.php

    图集模型的是

    • dede/album_add.php
    • dede/album_edit.php

    软件模型的是

    • dede/soft_add.php
    • dede/soft_edit.php

    商品和自定义模型的是

    • dede/archives_add.php
    • dede/archives_edit.php

    打开对应的文档发布处理,php文件是 xxx_add.php

    找到

    ,weight

    改成

    ,weight,tempname

    继续找到

    ,'$weight'

    改成

    ,'$weight','$tempname'

    文档编辑处理php文件是 xxx_edit.php

    找到

    weight='$weight'

    改成

    weight='$weight',tempname='$tempname'

    4、/include/arc.archives.class.php 找到

    $this->Fields['filename'] = empty($this->Fields['filename'])? '' : $this->Fields['filename'];

    在它下面加入

    $this->Fields['tempname'] = empty($this->Fields['tempname'])? '' : $this->Fields['tempname'];

    继续找到

    $cid = $this->ChannelUnit->ChannelInfos['nid'];

    在它下面加入

    $this->Fields['tempname'] = empty($this->Fields['tempname'])? '' : $this->Fields['tempname'];

    继续找到

    $filetag = str_replace('{tid}', $tid,$filetag);

    在它下面加入

    if(!empty($this->Fields['tempname'])) $filetag = $this->Fields['tempname'];

    完成

  • 相关阅读:
    转: CvMat,Mat和IplImage之间的转化和拷贝
    Scrapy 轻松定制网络爬虫
    榆林暑期见习
    文学
    浅析Redis实现lock互斥访问资源
    使用Maven构建Java项目
    正则表达式
    CSS 命名规范及标题供参考与学习
    从零开始在linux下搭建wordpress博客
    python2和python3的区别
  • 原文地址:https://www.cnblogs.com/dedehtml/p/9904693.html
Copyright © 2011-2022 走看看