最新公告
  • 欢迎您光临 我爱模板网,本站秉承服务宗旨 履行“站长”责任,销售只是起点 服务永无止境! 立即加入钻石VIP
  • 帝国cms7.5给自定义列表增加页面内容,像专题一样

    正文概述 管理员   2025-09-04   5

    自定义列表会根据自定义的SQL,生成信息列表,有时候可能想在自定义列表上面显示一段富文本,这样能补充自定义列表的主题内容。像专题或像栏目的页面内容一样。

    修改步骤:

    一,找到自定义列表的编辑页面,路劲 /e/admin/other/AddUserlist.php

    二,找到页面底部,在“提交”按钮的<tr>上面新增下面代码:

    <?php
      include('../ecmseditor/eshoweditor.php');
      $loadeditorjs=ECMS_ShowEditorJS('../ecmseditor/infoeditor/');
    ?>
    <?=$loadeditorjs?>
    <tr bgcolor="#FFFFFF"> 
      <td  valign="top"><strong>页面内容</strong>(*)</td>
      <td ></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td  colspan="2" valign="top"> 
        <?=ECMS_ShowEditorVar('pagetext',stripSlashes($r[pagetext]),'Default','../ecmseditor/infoeditor/','600','100%')?>
      </td>
    </tr>

    三,找到自定义列表处理函数文件,路劲/e/admin/other/ListUserlist.php

    四,找到增加自定义列表的函数,搜索:function AddUserlist,在大概53行后,新增一行:

    $pagetext=RepPhpAspJspcode($add['pagetext']);

    然后将下面更改数据库的语句,更改为:

    $sql=$empire->query("insert into {$dbtbpre}enewsuserlist(listname,pagetitle,filepath,filetype,totalsql,listsql,maxnum,lencord,listtempid,pagekeywords,pagedescription,classid,pagetext) values('$add[listname]','".$add[pagetitle]."','$add[filepath]','$add[filetype]','".addslashes($add[totalsql])."','".addslashes($add[listsql])."',$maxnum,$lencord,$listtempid,'".$add[pagekeywords]."','".$add[pagedescription]."','$add[classid]','$pagetext');");

    五,找到修改自定义列表的函数,搜索:function EditUserlist,大概在110行后,新增一行:

    $pagetext=RepPhpAspJspcode($add['pagetext']);
    $sql=$empire->query("update {$dbtbpre}enewsuserlist set listname='$add[listname]',pagetitle='$add[pagetitle]',filepath='$add[filepath]',filetype='$add[filetype]',totalsql='".addslashes($add['totalsql'])."',listsql='".addslashes($add['listsql'])."',maxnum=$maxnum,lencord=$lencord,listtempid=$listtempid,pagekeywords='$add[pagekeywords]',pagedescription='$add[pagedescription]',classid='$add[classid]',pagetext='$pagetext' where listid='$listid'");

    六,打开数据库,找到表phome_enewsuserlist,新增字段pagetext,类型为mediumtext

    到此,给自定义列表增加页面内容字段就搞定了。剩下的就是在自定义列表启用的模板里把这个pagetext字段的值读取出来。


    我爱模板网 » 帝国cms7.5给自定义列表增加页面内容,像专题一样

    发表评论

    如需帝国cms功能定制以及二次开发请联系我们

    联系作者
    script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?587cc1e5c052b5b0ce99533beff13c96"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })();

    请选择支付方式

    ×
    支付宝支付
    余额支付
    ×
    微信扫码支付 0 元