帝国CMS错误报告功能启用、防垃圾灌水、统计、增加报告分类
发布时间:2021-07-29作者:帝国建站网
一、错误报告启用
内容模板加
<a href="[!--news.url--]e/public/report/?classid=[!--classid--]&id=[!--id--]">错误报告</a>
如果做了分类,请链接地址加个&cid=分类ID。如:&cid=1
<a href="[!--news.url--]e/public/report/?classid=[!--classid--]&id=[!--id--]&cid=1">错误报告</a>
二、错误报告防灌水
方法1、会员登录才能使用“错误报告”功能
可以设置仅注册会员才可以进行报告
修改 e\public\report\index.php
在里面加入判断语句,如加在$empire=new mysqlquery();该行下面:
$userid=(int)getcvar('mluserid');
if(!$userid)
{
printerror('未登录用户禁用此功能','history.go(-1)',1,0,1);
}
方法2、使用验证码
三、错误报告统计
错误报告全部统计
<?=$empire->gettotal("select count(*) as total from {$dbtbpre}enewsdownerror")?>
注释:统计enewsdownerror表的记录总数
当前列表页页统计(列表页)
<?=$empire->gettotal("select count(*) as total from {$dbtbpre}enewsdownerror where classid='$GLOBALS[navclassid]'")?>
注释:只能统计终极栏目,一级栏目不能统计
指定列表页页统计(首页、列表页)
如:“影视频道”下的“动作片”
<?=$empire->gettotal("select count(*) as total from {$dbtbpre}enewsdownerror where classid='42' ")?>
注释:1、多个栏目时用:classid in('栏目ID1','栏目ID2','栏目ID3')
2、只能统计终极栏目,一级栏目不能统计
当前内容页统计(内容页)
<?=$empire->gettotal("select count(*) as total from {$dbtbpre}enewsdownerror where classid='$navinfor[classid]' and id='$navinfor[id]'")?>
四、错误报告页面增加选择分类
说明:在填写错误报告的页面增加可选择的分类(后台增加的分类) 如:默认、新建 等信息分类
方法1、增加下拉框选择分类
在\e\template\public\report.php 中加入以下代码
<select name="cid" id="cid">
<option value="" selected="selected">请选择</option>
<option value="1">默认</option>
<option value="2">新建</option>
</select>
--------------------------------------------------------------
实例:表单部分
<form name="form1" method="post" action="../../enews/index.php">
<table width="600" border="0" align="center" cellpadding="3" cellspacing="1"class=tableborder>
<input type="hidden" name="cid" value="<?=$cid?>">
<tr class=header>
<td height="23" colspan="2">提交错误报告</td>
</tr>
<tr>
<td width='16%' height=25 bgcolor='ffffff'><div align="right">选需求:</div></td>
<td bgcolor='ffffff'>
<select name="cid" id="cid">
<option value="" selected="selected">请选择</option>
<option value="1">默认</option>
<option value="2">新建</option>
</select></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="137" height="23"><div align="left">信息标题:</div></td>
<td width="448" height="23"><a href='<?=$titleurl?>' target=_blank><?=$r[title]?></a></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="23"><div align="left">您的邮箱:</div></td>
<td height="23"><input name="email" type="text" id="email">
(方便回复您)</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="23"><div align="left">报告内容(*):</div></td>
<td height="23"><textarea name="errortext" cols="60" rows="12" id="name4"></textarea></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="23"> </td>
<td height="23"><input type="submit" name="Submit" value="提交"> <input type="reset" name="Submit2" value="重置">
<input name="enews" type="hidden" id="enews" value="AddError">
<input name="id" type="hidden" id="id" value="<?=$id?>">
<input name="classid" type="hidden" id="classid" value="<?=$classid?>"></td>
</tr>
</table>
</form>
==============================================================================================
方法2、单选方式
在\e\template\public\report.php 中的“信息标题:”下面加入以下代码(在“信息标题:”以上添加时,信息标题会不显示)
<?php
$sql=$empire->query("select classid,classname from {$dbtbpre}enewserrorclass order by classid desc");
?>
<?
while($r=$empire->fetch($sql))
{
?>
<input name="cid" type="radio" value="<?=$r[classid]?>"><?=$r[classname]?>
<?
}
db_close();
$empire=null;
?>
--------------------------------------------------------------
实例:表单部分
<form name="form1" method="post" action="../../enews/index.php">
<table width="600" border="0" align="center" cellpadding="3" cellspacing="1"class=tableborder>
<input type="hidden" name="cid" value="<?=$cid?>">
<tr class=header>
<td height="23" colspan="2">提交错误报告</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="137" height="23"><div align="left">信息标题:</div></td>
<td width="448" height="23"><a href='<?=$titleurl?>' target=_blank><?=$r[title]?></a></td>
</tr>
<tr bgcolor="#FFFFFF"> <td height="23"><div align="left">选择分类:</div></td>
<td height="23"><?php $sql=$empire->query("select classid,classname from {$dbtbpre}enewserrorclass order by classid desc");?>
<? while($r=$empire->fetch($sql)){ ?><input name="cid" type="radio" value="<?=$r[classid]?>"><?=$r[classname]?>
<? } db_close();$empire=null;?></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="23"><div align="left">您的邮箱:</div></td>
<td height="23"><input name="email" type="text" id="email">
(方便回复您)</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="23"><div align="left">报告内容(*):</div></td>
<td height="23"><textarea name="errortext" cols="60" rows="12" id="name4"></textarea></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="23"> </td>
<td height="23"><input type="submit" name="Submit" value="提交"> <input type="reset" name="Submit2" value="重置">
<input name="enews" type="hidden" id="enews" value="AddError">
<input name="id" type="hidden" id="id" value="<?=$id?>">
<input name="classid" type="hidden" id="classid" value="<?=$classid?>"></td>
</tr>
</table>
</form>
内容模板加
<a href="[!--news.url--]e/public/report/?classid=[!--classid--]&id=[!--id--]">错误报告</a>
如果做了分类,请链接地址加个&cid=分类ID。如:&cid=1
<a href="[!--news.url--]e/public/report/?classid=[!--classid--]&id=[!--id--]&cid=1">错误报告</a>
二、错误报告防灌水
方法1、会员登录才能使用“错误报告”功能
可以设置仅注册会员才可以进行报告
修改 e\public\report\index.php
在里面加入判断语句,如加在$empire=new mysqlquery();该行下面:
$userid=(int)getcvar('mluserid');
if(!$userid)
{
printerror('未登录用户禁用此功能','history.go(-1)',1,0,1);
}
方法2、使用验证码
三、错误报告统计
错误报告全部统计
<?=$empire->gettotal("select count(*) as total from {$dbtbpre}enewsdownerror")?>
注释:统计enewsdownerror表的记录总数
当前列表页页统计(列表页)
<?=$empire->gettotal("select count(*) as total from {$dbtbpre}enewsdownerror where classid='$GLOBALS[navclassid]'")?>
注释:只能统计终极栏目,一级栏目不能统计
指定列表页页统计(首页、列表页)
如:“影视频道”下的“动作片”
<?=$empire->gettotal("select count(*) as total from {$dbtbpre}enewsdownerror where classid='42' ")?>
注释:1、多个栏目时用:classid in('栏目ID1','栏目ID2','栏目ID3')
2、只能统计终极栏目,一级栏目不能统计
当前内容页统计(内容页)
<?=$empire->gettotal("select count(*) as total from {$dbtbpre}enewsdownerror where classid='$navinfor[classid]' and id='$navinfor[id]'")?>
四、错误报告页面增加选择分类
说明:在填写错误报告的页面增加可选择的分类(后台增加的分类) 如:默认、新建 等信息分类
方法1、增加下拉框选择分类
在\e\template\public\report.php 中加入以下代码
<select name="cid" id="cid">
<option value="" selected="selected">请选择</option>
<option value="1">默认</option>
<option value="2">新建</option>
</select>
--------------------------------------------------------------
实例:表单部分
<form name="form1" method="post" action="../../enews/index.php">
<table width="600" border="0" align="center" cellpadding="3" cellspacing="1"class=tableborder>
<input type="hidden" name="cid" value="<?=$cid?>">
<tr class=header>
<td height="23" colspan="2">提交错误报告</td>
</tr>
<tr>
<td width='16%' height=25 bgcolor='ffffff'><div align="right">选需求:</div></td>
<td bgcolor='ffffff'>
<select name="cid" id="cid">
<option value="" selected="selected">请选择</option>
<option value="1">默认</option>
<option value="2">新建</option>
</select></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="137" height="23"><div align="left">信息标题:</div></td>
<td width="448" height="23"><a href='<?=$titleurl?>' target=_blank><?=$r[title]?></a></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="23"><div align="left">您的邮箱:</div></td>
<td height="23"><input name="email" type="text" id="email">
(方便回复您)</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="23"><div align="left">报告内容(*):</div></td>
<td height="23"><textarea name="errortext" cols="60" rows="12" id="name4"></textarea></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="23"> </td>
<td height="23"><input type="submit" name="Submit" value="提交"> <input type="reset" name="Submit2" value="重置">
<input name="enews" type="hidden" id="enews" value="AddError">
<input name="id" type="hidden" id="id" value="<?=$id?>">
<input name="classid" type="hidden" id="classid" value="<?=$classid?>"></td>
</tr>
</table>
</form>
==============================================================================================
方法2、单选方式
在\e\template\public\report.php 中的“信息标题:”下面加入以下代码(在“信息标题:”以上添加时,信息标题会不显示)
<?php
$sql=$empire->query("select classid,classname from {$dbtbpre}enewserrorclass order by classid desc");
?>
<?
while($r=$empire->fetch($sql))
{
?>
<input name="cid" type="radio" value="<?=$r[classid]?>"><?=$r[classname]?>
<?
}
db_close();
$empire=null;
?>
--------------------------------------------------------------
实例:表单部分
<form name="form1" method="post" action="../../enews/index.php">
<table width="600" border="0" align="center" cellpadding="3" cellspacing="1"class=tableborder>
<input type="hidden" name="cid" value="<?=$cid?>">
<tr class=header>
<td height="23" colspan="2">提交错误报告</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="137" height="23"><div align="left">信息标题:</div></td>
<td width="448" height="23"><a href='<?=$titleurl?>' target=_blank><?=$r[title]?></a></td>
</tr>
<tr bgcolor="#FFFFFF"> <td height="23"><div align="left">选择分类:</div></td>
<td height="23"><?php $sql=$empire->query("select classid,classname from {$dbtbpre}enewserrorclass order by classid desc");?>
<? while($r=$empire->fetch($sql)){ ?><input name="cid" type="radio" value="<?=$r[classid]?>"><?=$r[classname]?>
<? } db_close();$empire=null;?></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="23"><div align="left">您的邮箱:</div></td>
<td height="23"><input name="email" type="text" id="email">
(方便回复您)</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="23"><div align="left">报告内容(*):</div></td>
<td height="23"><textarea name="errortext" cols="60" rows="12" id="name4"></textarea></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="23"> </td>
<td height="23"><input type="submit" name="Submit" value="提交"> <input type="reset" name="Submit2" value="重置">
<input name="enews" type="hidden" id="enews" value="AddError">
<input name="id" type="hidden" id="id" value="<?=$id?>">
<input name="classid" type="hidden" id="classid" value="<?=$classid?>"></td>
</tr>
</table>
</form>
相关帝国教程
- 05-01帝国CMS怎么调用购物车商品数量
- 06-02帝国cms专题调用标题、简介、文章数、时间、点击数
- 01-18帝国二次开发会员中心 新消息声音提示方法
- 06-25帝国二次开发JS调用登陆模板调用会员头像
- 04-15帝国CMS模板前端判断PC/手机访问端跳转手机端代码
- 02-23利用gettotal统计查询来调用帝国CMS当前栏目缩略图方法
- 11-27帝国CMS怎么批量修改字段内容
- 05-25帝国CMS模板中信息反馈开启验证码
- 02-25帝国cms模板中灵动标签调用序号
- 10-05帝国cms好不好帝国CMS优势
- 06-21让帝国cms7.5发送邮件支持465端口的方法
- 06-05在帝国cms内容页根据关键字调用相关内容
- 10-30帝国CMS内容页模板调用作者和判断作者为空
- 01-01帝国CMS无限极栏目导航函数
- 12-11帝国CMS怎么调用信息发布人的IP地址
- 10-23帝国CMS获取当前目(父栏目)ID、名称、别名、链接
- 04-07帝国CMS7.5增加栏目生成拼音乱码解决方法
- 10-30帝国cms的栏目别名怎么获取的两种方法
- 01-08帝国cms可以做商城么
- 03-12帝国cms7.5内容页模板和会员中心显示会员实名状态代码是什么?