1、给留言表添加字段gtitle,gSex,homepage 分别代表留言标题,留言者的头像,网址,添加字段方法:后台登陆--》系统--》备份与恢复数据--》执行SQL语句,输入以下代码执行即可:
ALTER TABLE phome_enewsgbook ADD gtitle VARCHAR(100); ALTER TABLE phome_enewsgbook ADD gSex VARCHAR(10) DEFAULT 'boy' ; ALTER TABLE phome_enewsgbook ADD homepage VARCHAR(80);
2、修改文件:
(1)把gbookfun.php上传到e/enews/覆盖下
(2)把gbooktemp.txt上传到e/data/template/覆盖下
(3)修改e/class/functions.php,找到//生成留言板文件函数,替换以下代码
//生成留言板文件 function ReGbooktemp(){ global $empire,$public_r,$fun_r,$dbtbpre; $tfile="../data/template/gbooktemp.txt"; $file="../tool/gbook/index.php"; $gbtemp=ReadFiletext($tfile); //取得留言页面模板 $pr=$empire->fetch1("select gbooktemp from ".GetTemptb("enewspubtemp")." limit 1"); $url="<?=$url?>"; $pagetitle="<?=$bname?>"; $pr['gbooktemp']=ReplaceSvars($pr['gbooktemp'],$url,0,$pagetitle,$pagetitle,$pagetitle,$add,1); $pr['gbooktemp']=RepSearchRtemp($pr['gbooktemp'],$url); $pr['gbooktemp']=str_replace("[!--bname--]","<?=$bname?>",$pr['gbooktemp']); $pr['gbooktemp']=str_replace("[!--bid--]","<?=$bid?>",$pr['gbooktemp']); $listtemp_r=explode("[!--empirenews.listtemp--]",$pr['gbooktemp']); $gbtemp=str_replace("<!--empire.listtemp.top-->",$listtemp_r[0],$gbtemp); $gbtemp=str_replace("<!--empire.listtemp.footer-->",$listtemp_r[2],$gbtemp); //---列表中间 //处理回复 $restart=" <? if($r[retext]) { ?> "; $endstart=" <? } ?>"; $listtemp_center=str_replace("[!--start.regbook--]",$restart,$listtemp_r[1]); $listtemp_center=str_replace("[!--end.regbook--]",$endstart,$listtemp_center); $listtemp_center=str_replace("[!--lyid--]","<?=$r[lyid]?>",$listtemp_center); $listtemp_center=str_replace("[!--name--]","<?=$r[name]?>",$listtemp_center); $listtemp_center=str_replace("[!--gtitle--]","<?=$r[gtitle]?>",$listtemp_center); $listtemp_center=str_replace("[!--gSex--]","<?=$r[gSex]?>",$listtemp_center); $listtemp_center=str_replace("[!--homepage--]","<?=$r[homepage]?>",$listtemp_center); $listtemp_center=str_replace("[!--email--]","<?=$r[email]?>",$listtemp_center); $listtemp_center=str_replace("[!--mycall--]","<?=$r[mycall]?>",$listtemp_center); $listtemp_center=str_replace("[!--lytime--]","<?=$r[lytime]?>",$listtemp_center); $listtemp_center=str_replace("[!--lytext--]","<?=$r[lytext]?>",$listtemp_center); $listtemp_center=str_replace("[!--retext--]","<?=$r[retext]?>",$listtemp_center); $gbtemp=str_replace("<!--empire.listtemp.center-->",$listtemp_center,$gbtemp); WriteFiletext($file,$gbtemp); }
(4)把gbook.php上传到/e/admin/tool/覆盖。
3、将附件中的images文件夹上传至主机根目录下
4、登陆后台--》模板管理--》公共模板--》修改留言板模板--》替换以下代码,是基于帝国cms默认留言模板修改的,如果是改了模板样式,请根据下面代码自行修改。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//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> <meta name="keywords" content="[!--bname--]" /> <meta name="description" content="[!--bname--]" /> <link href="[!--news.url--]skin/default/css/style.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="[!--news.url--]skin/default/js/tabs.js"></script> <style type="text/css"> <!-- .timetd {border-right:1px solid #dedede; border-top:1px solid #dedede; border-bottom:1px dashed #dedede; padding-left:5px; } .bottomtd {border-right:1px solid #dedede; border-top:1px dashed #dedede; padding-left:5px; } .rebox { width:98%; padding:3px; border:1px solid #dedede; } .lefttd {border-left:1px solid #dedede; border-right:1px solid #dedede; } .ltd {border-left:1px solid #dedede; border-right:1px solid #dedede; border-top:1px solid #dedede; border-bottom:1px dashed #dedede; } .msgtd {line-height:180%; border-right:1px solid #dedede; padding:5px; height:80px; } .STYLE2 { border-right: 1px solid #dedede; border-top: 1px solid #dedede; border-bottom: 1px dashed #dedede; padding-left: 5px; font-weight: bold; font-size: 16px; } --> </style> </head> <body class="listpage"> [!--temp.dtheader--] <table width="100%" border="0" cellspacing="10" cellpadding="0"> <tr valign="top"> <td class="list_content"><table width="100%" border="0" cellspacing="0" cellpadding="0" class="position"> <tr> <td>现在的位置:<a href=../../../>首页</a> > [!--bname--] </td> </tr> </table><table width="100%" border="0" cellspacing="0" cellpadding="0" class="box"> <tr> <td><table width="100%" border="0" cellpadding="3" cellspacing="2"> <tr> <td align="center" bgcolor="#E1EFFB"><strong>[!--bname--]</strong></td> </tr> <tr> <td align="left" valign="top"><table width="100%" border="0" cellpadding="4" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td height="100%" valign="top" bgcolor="#FFFFFF"> [!--empirenews.listtemp--] <table width="92%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#F4F9FD" class="tableborder"> <tr bgcolor="#FFFFFF"> <td width="12%"><div align="center"> <table border="2" bordercolor="#000000"> <tr> <td><img src='[!--news.url--]images/[!--gSex--].gif ' width="110" height="140" /></td> </tr> </table> </div></td> <td valign="top" bgcolor="#FFFFFF"><table width="100%"> <tr> <th width="35%" align="left" valign="top" bordercolor="#DEEFFF" scope="col"><span class="STYLE2">主题:[!--gtitle--]</span></th> <th width="65%" align="left" valign="top" bordercolor="#00FFFF" scope="col"><span class="timetd"><a href='mailto:[!--email--]'><img src='[!--news.url--]images/time.gif' border="0" width='16' height='16' /></a> 时间: [!--lytime--]</span></th> </tr> <tr> <th height="2" colspan="2" valign="top" bgcolor="#DDEFFB" scope="col"></th> </tr> <tr> <td colspan="2" valign="top"><table border="0" width="100%" cellspacing="1" cellpadding="8" bgcolor='#cccccc'> <tr> <td width='100%' bgcolor='#FFFFFF' style='word-break:break-all'> [!--lytext--] </td> </tr> </table> <p>[!--start.regbook--]</p> <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1"> <tr> <td><strong><font color="#FF0000">回复:</font></strong> [!--retext--] </td> </tr> </table> [!--end.regbook--]</td> </tr> </table></td> </tr> <tr bgcolor="#FFFFFF"> <td height="23"><div align="center"><b>[!--name--]</b></div></td> <td><span class="bottomtd"><a href='mailto:[!--email--]'><img src='[!--news.url--]images/mail.gif' border="0" width='16' height='16' />:[邮件]</a> <a href='mailto:[!--email--]'><img src='[!--news.url--]images/qq.gif' border="0" width='16' height='16' /></a>:[!--mycall--] <a href='/' target='_blank'><img src='[!--news.url--]images/home.gif' border="0" width='16' height='16' /></a>:[!--homepage--] </span></td> </tr> </table> <br /> [!--empirenews.listtemp--] <table width="92%" border="0" align="center" cellpadding="4" cellspacing="1"> <tr> <td>分页: [!--listpage--]</td> </tr> </table> <form action="../../enews/index.php" method="post" name="form1" id="form1"> <table width="92%" border="0" align="center" cellpadding="4" cellspacing="1"class="tableborder"> <tr class="header"> <td colspan="5" bgcolor="#F4F9FD"><strong>请您留言:</strong></td> </tr> <tr bgcolor="#FFFFFF"> <td width="252">标题:</td> <td width="198" height="23"><input name="gtitle" type="text" id="gtitle" /> *</td> <td width="67">电子邮箱:</td> <td width="175"><input id="email" name="email" type="text" /> * </td> <td width="300"><div align="center">选择头像</div></td> </tr> <tr bgcolor="#FFFFFF"> <td>姓名:</td> <td height="23"><input name="name" type="text" id="name" />*</td> <td rowspan="2">个人主页:</td> <td rowspan="2"><input name="homepage" type="text" class="ipt-txt" value="http://" size="20" maxlength="80" /></td> <td width="300" rowspan="3"><table width="45" height="38" border="0" cellspacing="0"> <tr bgcolor="#ffffff" class="writetable"> <td nowrap="nowrap" height="2"><p>男:<br /> <br /> </p></td> <td nowrap="nowrap"><p> <input name="Sex" type="radio" value="01" checked="checked" onclick="document.all.gSex.value=this.value;" /> <img src="[!--news.url--]images/01.gif"width="25" height="25" /> <input type="radio" name="Sex" value="02" onclick="document.all.gSex.value=this.value;" /> <img src="[!--news.url--]images/02.gif"width="25" height="25" /> <input type="radio" name="Sex" value="03" onclick="document.all.gSex.value=this.value;" /> <img src="[!--news.url--]images/03.gif"width="25" height="25" /> <input type="radio" name="Sex" value="04" onclick="document.all.gSex.value=this.value;" /> <img src="[!--news.url--]images/04.gif"width="25" height="25" /> </p> <p> <input type="radio" name="Sex" value="05" onclick="document.all.gSex.value=this.value;" /> <img src="[!--news.url--]images/05.gif"width="25" height="25" /> <input type="radio" name="Sex" value="06" onclick="document.all.gSex.value=this.value;" /> <img src="[!--news.url--]images/06.gif"width="25" height="25" /> <input type="radio" name="Sex" value="07" onclick="document.all.gSex.value=this.value;" /> <img src="[!--news.url--]images/07.gif"width="25" height="25" /> <input type="radio" name="Sex" value="08" onclick="document.all.gSex.value=this.value;" /> <img src="[!--news.url--]images/08.gif"width="25" height="25" /></p></td> </tr> <tr bgcolor="#ffffff" class="writetable"> <td nowrap="nowrap" height="2"><p> </p></td> <td nowrap="nowrap"><p> </p></td> </tr> <tr bgcolor="#ffffff" class="writetable"> <td nowrap="nowrap" height="2">女:</td> <td nowrap="nowrap"><p> <input type="radio" name="Sex" value="09" onclick="document.all.gSex.value=this.value;" /> <img src="[!--news.url--]images/09.gif"width="25" height="25" /> <input type="radio" name="Sex" value="10" onclick="document.all.gSex.value=this.value;" /> <img src="[!--news.url--]images/10.gif"width="25" height="25" /> <input type="radio" name="Sex" value="11" onclick="document.all.gSex.value=this.value;" /> <img src="[!--news.url--]images/11.gif"width="25" height="25" /> <input type="radio" name="Sex" value="12" onclick="document.all.gSex.value=this.value;" /> <img src="[!--news.url--]images/12.gif"width="25" height="25" /></p> <p> <input type="radio" name="Sex" value="13" onclick="document.all.gSex.value=this.value;" /> <img src="[!--news.url--]images/13.gif"width="25" height="25" /> <input type="radio" name="Sex" value="14" onclick="document.all.gSex.value=this.value;" /> <img src="[!--news.url--]images/14.gif"width="25" height="25" /> <input type="radio" name="Sex" value="15" onclick="document.all.gSex.value=this.value;" /> <img src="[!--news.url--]images/15.gif"width="25" height="25" /> <input type="radio" name="Sex" value="16" onclick="document.all.gSex.value=this.value;" /> <img src="[!--news.url--]images/16.gif"width="25" height="25" /> <input type="hidden" name="gSex" id="gSex" value="01" /> </p></td> </tr> </table></td> </tr> <tr bgcolor="#FFFFFF"> <td>QQ:</td> <td height="23"><input name="mycall" type="text" id="mycall" /> *</td> </tr> <tr bgcolor="#FFFFFF"> <td>留言内容(*):</td> <td height="23" colspan="3"><textarea name="lytext" cols="60" rows="12" id="lytext"></textarea></td> </tr> <tr bgcolor="#FFFFFF"> <td height="23"> </td> <td height="23" colspan="4"><input type="submit" name="Submit3" value="提交" /> <input type="reset" name="Submit22" value="重置" /> <input name="enews" type="hidden" id="enews" value="AddGbook" /></td> </tr> </table> </form></td> </tr> </table></td> </tr> </table></td> </tr> </table></td> </tr> </table> [!--temp.footer--] </body> </html>
到处安装成功。
前台留言板界面:
后台管理界面:
注:此插件适合帝国cms7.0以上版本,编码是utf8,其他请自行转码。
当您找我们仿站的时候,下订单后,就需要给我们网站的栏目,以及修改的地方等等要求。然后呢您准备好您的域名跟空间,当我们做好网站,就可以直接帮您...
仿站网下面教大家如何确定站点目标?在创建网站时,决定站点的目标是第一步。设计者应清楚建立站点的目标,即确定它将提供什么样的服务,网页中...
从使用上讲是一样的; 仿站是指 参考某一个网站,全部或者大部分的仿照他的样式或功能 这样做出来,这样做简单,因为不用再进行页面的设计,及功能需...
帝国cms7.5不论是前提模板还是后台其实都很简陋,对于想修改首页模板的朋友,可以在后台--栏目-模板修改模板的修改无非就是静态页面使用灵动标...
网站分为动态网站,和静态网站。动态网站又称为交互式网站,也就是可以让访问者参与,典型的就百度知道,你可在这里提问题,别人可回答问题,管理员可审...
怎么仿站应该是每一个希望学习仿站的人都必须要了解的。如果不在仿站之前了解一下,仿站可能不成功,或者仿出来的网站没有真正的意义。下面仿...
仿站网专业提供帝国cms仿站及二次开发,质量保证!仿站价格请询问客服。请在咨询时将仿站目标网址发送给客服。
您给我们一个目标站,我们还您一个相同的网站
按照您的要求,全新设计+开发您独一无二的网页
模板使用遇到问题,我们协助您快速解决
给我新功能需求,帮您定制开发并免费集成到网站
对现有程序不满意,需要做程序调整和效果增加
提供效果图/psd文件,还您一个网页设计
下面列出来了仿站建站的流程