Hongmu Notes
Home Program Notes EmpireCMS 8.0 – Beginner Website Clone Tutorial
Program Notes Empire cms

EmpireCMS 8.0 – Beginner Website Clone Tutorial

EmpireCMS 8.0 – Beginner Website Clone Tutorial

QQ Discussion Group: 958972323

Required tools:

Local server environment:https://www.xp.cn/

Website domain: 127.0.0.1

EmpireCMS 8.0 Download Link:http://www.phome.net/down/

Editor: Notepad++

Page Download Tool:Website Clone Tool

Online HTML formatting:Online HTML Code Formatting – HTML Code Beautification Tool

Page Type:

Home page: https://simplee.001666.cn/

List Page: https://simplee.001666.cn/info/

Content page: https://simplee.001666.cn/blog/265.html

Navigation Code Call:

<?php
// 查询一级菜单
$sql = $empire->query("select classid, sonclass, classname, islast, islist from {$dbtbpre}enewsclass where bclassid=0 and showclass=0 order by myorder asc");
while ($primaryMenu = $empire->fetch($sql)) {
    $classUrl = sys_ReturnBqClassname($primaryMenu, 9); 
    $topClass = '';
    $featherClass = explode('|', $class_r[$GLOBALS['navclassid']]['featherclass']);
    $topbclassid = $featherClass[1] ? $featherClass[1] : $GLOBALS['navclassid'];
    
    // 判断是否为当前菜单
    if ($topbclassid == $primaryMenu['classid']) {
        $topClass = 'active';
    }
    //$value=ReturnClassAddField($primaryMenu['classid'],'icon');
?>
						<li id="navbar-category-1" class="<?=$topClass?>">
                            <a href="<?=$classUrl?>">
                                <i class="fa <?=$value?>"></i><?=$primaryMenu['classname']?>
                            </a>
                        </li>
						
<?}?>

Site Icon Library:Icon Library – Font Awesome Chinese Website

Universal Tag – Call Article:

[!--empirenews.listtemp--]<!--list.var1-->[!--empirenews.listtemp--]

Dynamic Tag – Call Article:

EmpireCMS Dynamic Tags Field Call Reference – Hongmu Notes

TAG Call:

<?php
$num=$empire->num("select tagid from {$dbtbpre}enewstags");
$randnum=100; 
$randids=''; 
$randdh=''; 
for($i=1;$i<=$randnum;$i++) 
{ 
$randids.=$randdh.rand(1,$num); 
$randdh=',';
} 
?>
[e:loop={"select tagname,tagid,num from phome_enewstags where tagid in ($randids)  limit $randnum",32,24,0}]
<a target="_blank" href="/tag/<?=$bqr['tagid']?>/" title="<?=$bqr['tagname']?>"><?=$bqr['tagname']?></a> | 
[/e:loop]

Friendly link inclusion:

How to use Lingdong Tags to call up friendly links at the bottom of an Empire CMS homepage? -Hongmu Notes

Home page title invocation:

帝国CMS列表页与内容页标题代码 – Hongmu Notes

Paginated Call

Method 1: Modify CSS to achieve a site imitation effect (Recommended rating: 2 stars)

High difficulty: requires flexible invocation and knowledge of CSS; the ability to modify CSS code based on the target website is necessary.

.pagination .navigation a,.pagination span {background-color:#fff;line-height:28px;height:28px;width:60px;text-align:center;margin:0 10px 0 0;display:block;float:left;color:#000;box-shadow:0 0 5px rgba(0,0,0,0.2);position:relative}

.pagination .navigation>b {
    background-color: #fff;
    line-height: 28px;
    height: 28px;
    width: 60px;
    text-align: center;
    margin: 0 10px 0 0;
    display: block;
    float: left;
    color: #000;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    position: relative;
    font-weight: 400;
}

Method 2: Custom Page Pagination Function (Recommended rating: 1 star)

Moderate difficulty: Modify the HTML structure within a PHP file to apply CSS code based on that structure.

<?php
//---------------------------用户自定义标签函数文件
//列表模板之列表式分页
function usr_ShowListMorePage($num,$page,$dolink,$type,$totalpage,$line,$ok,$search="",$add=null){
	global $fun_r,$public_r;
	if($num<=$line)
	{
		$pager['showpage']='';
		return $pager;
	}
	//文件名
	if(empty($add['dofile']))
	{
		$add['dofile']='index';
	}
	//静态页数
	$repagenum=$add['repagenum'];
	$page_line=$public_r['listpagelistnum'];
	$snum=2;
	//$totalpage=ceil($num/$line);//取得总页数
	$firststr='';
	//上一页
	if($page<>1)
	{
		$toppage='<a  class="page-numbers" title="第&lt;&lt;页" href="'.$dolink.$add['dofile'].$type.'"><span class="page">&lt;&lt;</span></a>';
		$pagepr=$page-1;
		if($pagepr==1)
		{
			$prido=$add['dofile'].$type;
		}
		else
		{
			$prido=$add['dofile'].'_'.$pagepr.$type;
		}
		$prepage='<a class="page-numbers"  href="'.$dolink.$prido.'"><span class="page">&lt;</span></a>';
	}
	//下一页
	if($page!=$totalpage)
	{
		$pagenex=$page+1;
		$nextpagelink=$repagenum&&$repagenum<$pagenex?eReturnRewritePageLink2($add,$pagenex):$dolink.$add['dofile'].'_'.$pagenex.$type;
		$lastpagelink=$repagenum&&$repagenum<$totalpage?eReturnRewritePageLink2($add,$totalpage):$dolink.$add['dofile'].'_'.$totalpage.$type;
		$nextpage='<a href="'.$nextpagelink.'"><span class="page">&gt;</span></a>';
		$lastpage='<a href="'.$lastpagelink.'"><span class="page">&gt;&gt;</span></a>';
	}
	$starti=$page-$snum<1?1:$page-$snum;
	$no=0;
	for($i=$starti;$i<=$totalpage&&$no<$page_line;$i++)
	{
		$no++;
		if($page==$i)
		{
			$is_1="<span class=\"page now-page\">";
			$is_2="</span>";
		}
		elseif($i==1)
		{
			$is_1='<a href="'.$dolink.$add['dofile'].$type.'">';
			$is_2="</a>";
		}
		else
		{
			$thispagelink=$repagenum&&$repagenum<$i?eReturnRewritePageLink2($add,$i):$dolink.$add['dofile'].'_'.$i.$type;
			$is_1='<a href="'.$thispagelink.'">';
			$is_2="</a>";
		}
		$returnstr.='&nbsp;'.$is_1.$i.$is_2;
	}
	$returnstr=$firststr.$toppage.$prepage.$returnstr.$nextpage.$lastpage;
	$pager['showpage']=$returnstr;
	return $pager;
}
?>

Method 3: Modify the Empire Core Configuration File (Not recommended)

Moderate difficulty: Modify the HTML structure within a PHP file to apply CSS code based on that structure.

Reason for not recommending modification: The core documents should remain unchanged unless absolutely necessary.

Comment Form

<script>
		  function CheckPl(obj)
		  {
		  if(obj.saytext.value=="")
		  {
		  alert("您没什么话要说吗?");
		  obj.saytext.focus();
		  return false;
		  }
		  return true;
		  }
		  </script><form action="[!--news.url--]e/pl/doaction.php" method="post" name="saypl" id="saypl" onsubmit="return CheckPl(document.saypl)">
<table width="100%" border="0" cellpadding="0" cellspacing="0" id="plpost">

<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0" class="title">
<tr>
<td><strong>发表评论</strong></td>
<td align="right"><a href="[!--news.url--]e/pl/?classid=[!--classid--]&amp;id=[!--id--]">共有<span><script type="text/javascript" src="[!--news.url--]e/public/ViewClick/?classid=[!--classid--]&id=[!--id--]&down=2"></script></span>条评论</a></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="10" cellpadding="0">
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="2">
<tr>
<td width="56%" align="left">用户名:
<input name="username" type="text" class="inputText" id="username" value="" size="16" /></td>
<td width="44%" align="left">密码:
<input name="password" type="password" class="inputText" id="password" value="" size="16" /></td>
</tr>
<tr>
<td align="left">验证码:
<input name="key" type="text" class="inputText" size="10" />
<img src="[!--news.url--]e/ShowKey/?v=pl" align="absmiddle" name="plKeyImg" id="plKeyImg" onclick="plKeyImg.src='[!--news.url--]e/ShowKey/?v=pl&t='+Math.random()" title="看不清楚,点击刷新" /> </td>
<td align="left"><input name="nomember" type="checkbox" id="nomember" value="1" checked="checked" />
匿名发表</td>
</tr>
</table>
<textarea name="saytext" rows="6" id="saytext"></textarea><input name="imageField" type="image" src="[!--news.url--]e/data/images/postpl.gif"/>
<input name="id" type="hidden" id="id" value="[!--id--]" />
<input name="classid" type="hidden" id="classid" value="[!--classid--]" />
<input name="enews" type="hidden" id="enews" value="AddPl" />
<input name="repid" type="hidden" id="repid" value="0" />
<input type="hidden" name="ecmsfrom" value="[!--titleurl--]"></td>
</tr>
</table>
</td>
</tr>
</table></form>

 

微信赞赏

WeChat

支付宝赞赏

Alipay

✍️ Author: Hong Mu

webmaster · Thanks for reading, stay tuned for more exciting content

Author homepage View home page →

Related articles

Empire CMS database statement & SQL statement format

Empire CMS database statement & SQL statement format Program Notes Empire cms

Introduction to Imperial CMS extended SQL program writing, basic examples of Imperial CMS database statements & SQL statement formats: Note: The following examples are based on placing PHP files in the system root directory. Example 1: Connect to MYSQL program. (a.php)<?php require('e/class/connect.php'); //Introduce database configuration files and public function files requ…
👁 351
Empire CMS obtains the system COOKIE variable function getcvar()

Empire CMS obtains the system COOKIE variable function getcvar() Program Notes Empire cms

Get the system COOKIE variable function syntax: getcvar($var,$ecms) Description: $var: is the variable name $ecms: 0 is to set the foreground COOKIE variable, 1 is to set the background COOKIE variable. This parameter can be omitted and defaults to 0. Usage example: getcvar('mlusername'), get the user name of the front-end login member getcvar('loginu...
👁 295
Empire CMS smart label call field collection

Empire CMS smart label call field collection Program Notes Empire cms

Collect and classify all fields that support smart tag calls into Empire CMS smart tags: [e:loop={column ID/topic ID, number of items displayed, operation type, only display pictures with titles, additional SQL conditions, display sorting}] Template code content [/e:loop] Calling time: <?=date('m-d',$bqr[newstime])?> <?=dat…
👁 3749

Recommended reading

(Adaptive mobile terminal) hardware machinery website pbootcms template blue marketing hardware accessories website source code download 0487

(Adaptive mobile terminal) hardware machinery website pbootcms template blue marketing hardware accessories website source code download 0487 Practical Collection pbootcms Template

A PbootCMS blue marketing website template for the hardware machinery and accessories industry, supporting mobile access. The design style focuses on the product display and the inquiry conversion, and can effectively display the hardware product parameters and models. Help hardware machinery enterprises to obtain accurate customers online. Template display, installation instructions Website background: / admin.php account: admin password: admin decompression password: www.4s5.c...
👁 54
Responsive branded watch retail and recycling website template – 0465

Responsive branded watch retail and recycling website template – 0465 Practical Collection Yiyou template

An eYouCMS responsive website template designed for the branded watch retail and recycling industry. Its sophisticated and elegant design is ideal for showcasing watch products, brand stories, recycling services, and appraisal services. This template helps watch brands showcase their products online and attract watch enthusiasts and collectors. Template Overview | Installation Instructions | Website Backend: /login.php | Username: admin | Password: admin | Related Articles: Common Questions About Installing eYouCMS...
👁 43
(Adaptive Mobile Version) Stone Industry Website Template – Download Stone Carving Art Website Source Code – 1055

(Adaptive Mobile Version) Stone Industry Website Template – Download Stone Carving Art Website Source Code – 1055 Practical Collection pbootcms Template

A PbootCMS website template designed for the stone industry and stone carving art, compatible with both PC and WAP devices. Featuring a classical artistic design style, this template is ideal for stone manufacturing companies and stone carving studios to showcase their products and brand stories. It helps stone enterprises effectively communicate their artistic value online and attract high-end clients. Template Display | Installation Instructions | Website Backend: /admin.php | Username: admin | Password: admin | Extraction Password: www.4s5.cn – Related...
👁 52
Responsive Mask Protective Equipment Website Template (Bilingual) – 1068

Responsive Mask Protective Equipment Website Template (Bilingual) – 1068 Practical Collection Yiyou template

This EyouCMS responsive bilingual website template is ideal for the mask and protective equipment industry. Its professional, international design style effectively showcases mask products, protective gear, and the company's export advantages. The multilingual support enables businesses to promote their brands and display their products across global markets. Template Demo | Installation Instructions | Website Backend: /login.php | Username: admin | Password: admin | Related Articles: Summary of Common Installation Questions for EyouCMS | EyouCMS...
👁 37
(Adaptive mobile terminal) automatic solvent extraction instrument equipment website pbootcms template blue instrument equipment website source download 0488

(Adaptive mobile terminal) automatic solvent extraction instrument equipment website pbootcms template blue instrument equipment website source download 0488 Practical Collection pbootcms Template

A PbootCMS blue website template for fully automatic extraction instruments and scientific equipment, supporting PC and WAP terminal. The design style is sophisticated, suitable for displaying instrument products, technical parameters and scientific research applications. It helps the instrument manufacturers to attract customers from scientific research and testing institutions online. Template display, installation instructions website background: / admin.php account: admin password: admin decompression password: www.4s5....
👁 39
Responsive potted plant and floral website template – 0466

Responsive potted plant and floral website template – 0466 Practical Collection Yiyou template

This EyouCMS responsive template is ideal for the greenery, flowers, and potted plants industry. Its fresh and natural design style is perfect for showcasing plant and floral products, potted plant designs, brand stories, and gardening services. It helps floral and greenery brands showcase their products online and attract both individual and corporate customers. Template Display | Installation Instructions | Website Backend: /login.php | Username: admin | Password: admin | Related Articles: Common Installation Questions for EyouCMS...
👁 40