百度知道有网友提问的问题,想在前台把DEDECMS的自定义表单提交的内容显示出来并分页.帮他写了一下.
根目录建立form.php
1
2
3
4
5
6
7
8
9
10
|
<?php
require_once ( '/include/common.inc.php' );
require_once (DEDEINC. '/datalistcp.class.php' );
$sql = "Select*From`dede_diyform1`" ;
$dlist = new DataListCP();
$dlist ->SetTemplet( "templets/plus/form.htm" );
$dlist ->SetSource( $sql );
$dlist ->display();
?>
|
form.htm 放到templets/plus目录下
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
{dede:config.pagesizevalue='5'/}
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< html xmlns = "http://www.w3.org/1999/xhtml" >
< head >
< meta http-equiv = "Content-Type" content = "text/html;charset=UTF-8" >
< title >翻页</ title >
</ head >
< body >
< ul >
{dede:datalist}
< li >{dede:field.name/}-----{dede:field.sex/}< li >
{/dede:datalist}
</ ul >
{dede:pagelistlistsize=5/}
</ body >
</ html >
|
{dede:field.name /}和{dede:field.sex /} 根据你自己的自定义表单字段来填写.
例如 我的自定义表单1里就加了2个字段

后台的数据

是不是非常简单,翻页的样式自己写个CSS 就搞定了.

请先
!