dedecms 自定义表单分页+模版显示
百度知道有网友提问的问题,想在前台把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`" ; //可以接着加条件 例如order by id desc 排序 $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.pagesize value='5'/} <!--这里设置每页显示的条数--> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.zuola.net/TR/xhtml1/DTD/xhtml1-transitional.dtd"> < html xmlns = "http://www.zuola.net/1999/xhtml" > < head > |