国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > CMS教程 > 帝國Empire > 正文

帝國CMS錯誤報告功能啟用、防垃圾灌水、統計、增加報告分類

2024-04-25 20:54:58
字體:
來源:轉載
供稿:網友
一、錯誤報告啟用
內容模板加
<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">&nbsp;</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">&nbsp;</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>
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表

圖片精選

主站蜘蛛池模板: 神木县| 临汾市| 德惠市| 沙湾县| 屯留县| 桐城市| 南阳市| 梁河县| 固阳县| 舒城县| 嘉鱼县| 新宾| 布尔津县| 常宁市| 宁明县| 阳信县| 青阳县| 交口县| 凭祥市| 平遥县| 固原市| 涿鹿县| 高密市| 腾冲县| 吕梁市| 河北省| 通化市| 广昌县| 弋阳县| 富蕴县| 弥渡县| 上林县| 阳江市| 浏阳市| 韶山市| 安塞县| 舟山市| 漳州市| 防城港市| 平塘县| 运城市|