仿站网>网站插件 > 帝国cms默认留言板模板加上头像主页地址的留言本插件
帝国cms默认留言板模板加上头像主页地址的留言本插件

帝国cms默认留言板模板加上头像主页地址的留言本插件

  • 购买费用:50 元
  • 发布时间:2020-10-26 09:11:00
  • 浏览次数:1113
前往下载 在线客服

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>&nbsp;>&nbsp;[!--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> &nbsp;&nbsp; <a href='mailto:[!--email--]'><img src='[!--news.url--]images/qq.gif' border="0" width='16' height='16' /></a>:[!--mycall--] &nbsp;&nbsp;  <a href='/' target='_blank'><img src='[!--news.url--]images/home.gif' border="0" width='16' height='16' /></a>:[!--homepage--]&nbsp;</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>&nbsp;</p></td>
<td nowrap="nowrap"><p>&nbsp;</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">&nbsp;</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>

到处安装成功。

前台留言板界面:

帝国cms默认留言板模板加上头像主页地址的留言本插件

后台管理界面:

帝国cms默认留言板模板加上头像主页地址的留言本插件

注:此插件适合帝国cms7.0以上版本,编码是utf8,其他请自行转码。

网站源码

网站插件

仿站常见问题

帝国教程

网站优化

建站经验

仿站项目

仿站网专业提供帝国cms仿站及二次开发,质量保证!仿站价格请询问客服。请在咨询时将仿站目标网址发送给客服。

仿站流程

下面列出来了仿站建站的流程

仿站网专注于帝国CMS仿站及二次开发、模板定制等各种有关帝国CMS程序疑难杂症!
  • 首页
  • 客服
  • 头部