帝国cms7.5给自定义列表增加页面内容,像专题一样

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

帝国cms7.5给自定义列表增加页面内容,像专题一样

修改步骤:

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

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

<?php
  include('../ecmseditor/eshoweditor.php');
  $loadeditorjs=ECMS_ShowEditorJS('../ecmseditor/infoeditor/');
?>
<?=$loadeditorjs?>
<tr bgcolor="#FFFFFF"> 
  <td height="25" valign="top"><strong>页面内容</strong>(*)</td>
  <td height="25"></td>
</tr>
<tr bgcolor="#FFFFFF"> 
  <td height="25" 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字段的值读取出来。