帝国cms默认留言板模板加上头像主页地址的留言本插件
- 下载方式:50积分
- 插件类型: 收费帝国CMS插件
- 插件大小:216.90 KB
- 发布时间:2014-02-02
- 插件编码:UTF-8
- 浏览次数:2.7万+
下载插件
收藏
点赞(41)
插件介绍
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,其他请自行转码。
相关插件
最新帝国CMS插件
推荐帝国CMS插件
帝国CMS教程
没有找到您需要的帝国CMS插件?
提交您的需求,定制插件。
立即咨询-
1.2千+ 1千+ 300
-
1.4千+ 16 300
-
1.5千+ 24 300
-
1.2千+ 3 200
-
1.4千+ 8 300
-
1.4千+ 12 500
-
1.3千+ 28 200
-
2.9千+ 22 200