1.新建文件list.php,放在网站根目录
1 2 3 4 5 6 7 8 9 10 11 | <?php require_once (dirname( __FILE__ ). "/include/common.inc.php" ); //载入基础文件 require_once (DEDEINC. "/datalistcp.class.php" ); //载入动态分页类 $dlist = new DataListCP(); //初始化动态列表类 $sql = "select * from zmsys_archives as a right join zmsys_addonarticle as b on a.id=b.aid" ; //查询数据 $dlist ->pageSize=5; //设定每页显示记录数(默认25条) $dl ->SetParameter( $key , $value ); //设定get字符串的变量 $dlist ->SetTemplate(DEDETEMPLATE. '/' . $cfg_df_style . '/list.htm' ); //载入模版 $dlist ->SetSource( $sql ); //设定查询SQL $dlist ->Display(); //显示 ?> |
2.新建list.htm模板文件