ticket:418

리퍼러 스팸을 지우기 위해 통계에서 해당 호스트를 지우는 기능 추가.
Added a feature deleting host from statistics to remove referer spams.


git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4073 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
haneul 2008-04-06 11:15:34 +00:00
parent b514953161
commit 8974765953
11 changed files with 111 additions and 7 deletions

View file

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<module version="0.1" category="accessory">
<module version="0.15" category="accessory">
<title xml:lang="ko">리퍼러 통계</title>
<title xml:lang="jp">リファラー統計</title>
<title xml:lang="zh-CN">反向链接统计</title>
<title xml:lang="en">Referer Statistics</title>
<title xml:lang="ru">Статистика рефералов</title>
<author email_address="haneul0318@gmail.com" link="http://haneul.zetyx.net" date="2007. 11. 29">
<author email_address="haneul0318@gmail.com" link="http://seungyeop.kr" date="2007. 11. 29">
<name xml:lang="ko">haneul</name>
<name xml:lang="jp">Haneul</name>
<name xml:lang="jp">haneul</name>
<name xml:lang="zh-CN">haneul</name>
<name xml:lang="en">haneul</name>
<name xml:lang="ru">haneul</name>

View file

@ -4,5 +4,7 @@
<actions>
<action name="procRefererExecute" type="controller" standalone="true" />
<action name="dispRefererAdminIndex" type="view" standalone="true" admin_index="true" />
<action name="dispRefererAdminDeleteStat" type="view" standalone="true" />
<action name="procRefererAdminDeleteStat" type="controller" standalone="true" />
</actions>
</module>

View file

@ -0,0 +1,8 @@
<query id="deleteRefererStat" action="delete">
<tables>
<table name="referer_statistics" />
</tables>
<conditions>
<condition operation="equal" column="host" var="host" notnull="notnull" />
</conditions>
</query>

View file

@ -0,0 +1,25 @@
<?php
/**
* @class refererAdminController
* @author haneul (haneul0318@gmail.com)
* @brief referer 모듈의 admin controller class
**/
class refererAdminController extends referer {
/**
* @brief 초기화
**/
function init() {
}
function procRefererAdminDeleteStat() {
$args->host = Context::get('host');
$output = executeQuery('referer.deleteRefererStat', $args);
if(!$output->toBool()) return $output;
$this->setMessage('success_deleted');
}
}
?>

View file

@ -22,6 +22,11 @@
$this->dispRefererAdminList();
}
function dispRefererAdminDeleteStat () {
if(!Context::get('host')) return $this->dispRefererAdminIndex();
$this->setTemplateFile('delete_stat');
}
function dispRefererAdminList() {
// 목록을 구하기 위한 옵션

View file

@ -14,6 +14,9 @@
// action forward에 등록 (관리자 모드에서 사용하기 위함)
$oModuleController = &getController('module');
$oModuleController->insertActionForward('referer', 'view', 'dispRefererAdminIndex');
// 2008. 04. 06 To remove referer spams
$oModuleController->insertActionForward('referer', 'view', 'dispRefererAdminDeleteStat');
return new Object();
}
@ -22,6 +25,9 @@
* @brief 설치가 이상이 없는지 체크하는 method
**/
function checkUpdate() {
$oModuleModel = &getModel('module');
if(!$oModuleModel->getActionForward('dispRefererAdminDeleteStat')) return true;
return false;
}
@ -29,7 +35,13 @@
* @brief 업데이트 실행
**/
function moduleUpdate() {
return new Object();
$oModuleModel = &getModel('module');
$oModuleController = &getController('module');
if(!$oModuleModel->getActionForward('dispRefererAdminDeleteStat'))
$oModuleController->insertActionForward('referer', 'view', 'dispRefererAdminDeleteStat');
return new Object(0, 'success_updated');
}
/**

View file

@ -1,5 +1,5 @@
.refererLeft { width:230px; float:left; margin-top:10px;}
.refererLeft { width:260px; float:left; margin-top:10px;}
.refererRight { width:530px; float:left; margin-left:20px;margin-top:10px; }
.refererRight { width:500px; float:left; margin-left:20px;margin-top:10px; }
.refererRight .refererList { table-layout:fixed; }
.refererRight .refererList .refererUrl { white-space:nowrap; overflow:hidden; }

View file

@ -0,0 +1,24 @@
<!--%import("filter/delete_stat.xml")-->
<!--%import("js/referer_admin.js")-->
<!--%import("css/referer.css")-->
<h3>{$lang->referer} <span class="gray">{$lang->cmd_management}</span></h3>
<form action="./" method="get" onsubmit="return procFilter(this, delete_stat)">
<input type="hidden" name="host" value="{$host}" />
<table cellspacing="0" class="adminTable">
<col width="150" />
<col />
<caption>{$lang->confirm_delete}</caption>
<tr>
<th scope="row">Host Name</th>
<td>{$host}</td>
</tr>
</table>
<div class="tRight gap1">
<a href="{getUrl('act','dispRefererAdminIndex')}" class="button"><span>{$lang->cmd_back}</span></a>
<span class="button"><input type="submit" value="{$lang->cmd_delete}" /></span>
</div>
</form>

View file

@ -0,0 +1,10 @@
<filter name="delete_stat" module="referer" act="procRefererAdminDeleteStat">
<form>
<node target="host" required="true" />
</form>
<response callback_func="completeDeleteStat">
<tag name="error" />
<tag name="message" />
<tag name="page" />
</response>
</filter>

View file

@ -0,0 +1,16 @@
/**
* @file modules/referer/js/referer_admin.js
* @author haneul
* @brief referer 모듈의 관리자용 javascript
**/
/* stat 삭제 후 */
function completeDeleteStat(ret_obj) {
var error = ret_obj['error'];
var message = ret_obj['message'];
var page = ret_obj['page'];
alert(message);
var url = current_url.setQuery('act','dispRefererAdminIndex').setQuery('host','');
location.href = url;
}

View file

@ -7,9 +7,10 @@
<div class="tableSummaryType1">
<table cellspacing="0" class="adminTable">
<col width="50" />
<col width="30" />
<col />
<col width="50" />
<col width="50" />
<tbody>
<!--{$rank = 1}-->
<!--@foreach($referer_status as $no => $val)-->
@ -17,6 +18,7 @@
<td class="tahoma">{$rank} </td>
<td class="tahoma">{$val->host}</td>
<td class="tahoma">{$val->count}</td>
<td class="tahoma red"><a href="{getUrl('act','dispRefererAdminDeleteStat','host',$val->host)}">{$lang->cmd_delete}</a></td>
</td>
<!--{$rank += 1} -->
<!--@end-->