search
  • Sign In
  • Sign Up
Password reset successful

Follow the proiects vou are interested in andi aet the latestnews about them taster

Home Backend Development PHP Empire CMS website management system-secondary development manual Classified information paging list program writing example

Classified information paging list program writing example

Category information paging list program writing example Program code writing Storage directory format:
Plug-in program storage directory: /e/extend/infolist/
Plug-in template storage directory uses: /e/extend/infolist/template/
Required program files:
/e/extend/infolist/index.php Main program file
/e/extend/infolist/template/index.temp.php Main program template file

Program Directory Template Directory
Main program file content(/e/extend/infolist/index.php):

<?php
require('../../class/connect.php'); //Introduce database configuration files and public function files
require('../../class/db_sql.php'); //Introduce database operation files
require('../../data/dbcache/class.php'); //Introduce column cache files
require '../'.LoadLang("pub/fun.php"); //Introduce paging language pack file
$link=db_connect(); //Connect to MYSQL
$empire=new mysqlquery(); //Declare database operation class
$editor=1; //Declare directory hierarchy

//--------Paging parameters --------
$page=(int)$_GET['page'];
$start=0;
$line=10; //Display number of records per page
$page_line=8; //Display the number of paging links per page
$offset=$page*$line; //Total offset

//-------- Query SQL --------
//Get the total number of information
$totalquery="select count(*) as total from {$dbtbpre}ecms_info where checked=1";
$num=$empire->gettotal($totalquery);
//select query SQL
$query="select * from {$dbtbpre}ecms_info where checked=1";
$query.=" order by newstime desc limit $offset,$line";
$sql=$empire->query($query);

$listpage=page1($num,$line,$page_line,$start,$page,$search);//Get paging navigation
require('template/index.temp.php'); //Import template file

db_close(); //Close the MYSQL link
$empire=null; //Cancel operation class variables
?>


Main program template file content(/e/extend/infolist/template/index.temp.php):
Note: The template can be visually produced with Dreamweaver. The blue part of the code does not allow direct access to the template file.
<?php
if(!defined('InEmpireCMS'))
{
exit();
}
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>分类信息分页列表</title>
<link href="template/images/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<br>
<br>
<br>
<table width="500" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
  <tr>
    <td height="25"><strong>分类信息分页列表:</strong></td>
  </tr>
  <tr>
    <td height="25" bgcolor="#FFFFFF">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <?php
                while($r=$empire->fetch($sql))        //循环获取查询记录
                {
                        $titleurl=sys_ReturnBqTitleLink($r);        //标题链接
                ?>
                <tr>
                <td width="74%" height="25">
                    <img src="template/images/arrow.gif" border="0" align="absmiddle"> [<a href="<?=$public_r[newsurl]?>e/action/ListInfo.php?classid=<?=$r[classid]?>&ph=1&myarea=<?=$r[myarea]?>"><?=$r[myarea]?></a>] <a href="<?=$titleurl?>" target="_blank">
                <?=esub(stripslashes($r[title]),32)?>
                </a></td>
                <td width="26%"><div align="center">
                                                                                                                                        <?=date('Y-m-d',$r[newstime])?>
                                                                                                                                                                                                                                      }
            ?>
                                                               
</td>
</tr>
<tr>
<td height="30" bgcolor="#FFFFFF">
<div class="epages" >
      
<?=$listpage?>

</div></td>
</tr></table></body>
</html>



Access the main program of the Hello World plug-in file: /e/extend/newnews/index.php
Hot AI Tools
Undress AI Tool
Undress AI Tool

Undress images for free

AI Clothes Remover
AI Clothes Remover

Online AI tool for removing clothes from photos.

Undresser.AI Undress
Undresser.AI Undress

AI-powered app for creating realistic nude photos

ArtGPT
ArtGPT

AI image generator for creative art from text prompts.

Stock Market GPT
Stock Market GPT

AI powered investment research for smarter decisions

Popular tool
Notepad++7.3.1
Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version
SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1
Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6
Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version
SublimeText3 Mac version

God-level code editing software (SublimeText3)