mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
삭제
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2327 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
commit
8326004cb2
2773 changed files with 91485 additions and 0 deletions
17
modules/trackback/conf/info.xml
Normal file
17
modules/trackback/conf/info.xml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<module version="0.1">
|
||||
<title xml:lang="ko">엮인글</title>
|
||||
<title xml:lang="zh-CN">引用</title>
|
||||
<title xml:lang="jp">トラックバック</title>
|
||||
<title xml:lang="en">Trackback</title>
|
||||
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
|
||||
<name xml:lang="ko">제로</name>
|
||||
<name xml:lang="zh-CN">zero</name>
|
||||
<name xml:lang="jp">Zero</name>
|
||||
<name xml:lang="en">Zero</name>
|
||||
<description xml:lang="ko">엮인글 관리 모듈</description>
|
||||
<description xml:lang="zh-CN">管理引用模块。</description>
|
||||
<description xml:lang="jp">トラックバック管理モジュール</description>
|
||||
<description xnl:lang="en">Module for managing trackbacks</description>
|
||||
</author>
|
||||
</module>
|
||||
10
modules/trackback/conf/module.xml
Normal file
10
modules/trackback/conf/module.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<module>
|
||||
<grants />
|
||||
<actions>
|
||||
<action name="dispTrackbackAdminList" type="view" admin_index="true" standalone="true" />
|
||||
<action name="procTrackbackAdminDeleteChecked" type="controller" standalone="true" />
|
||||
<action name="procTrackbackAdminInsertConfig" type="controller" standalone="true" />
|
||||
<action name="trackback" type="controller" standalone="true" />
|
||||
</actions>
|
||||
</module>
|
||||
24
modules/trackback/lang/en.lang.php
Normal file
24
modules/trackback/lang/en.lang.php
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
/**
|
||||
* @file modules/trackback/lang/en.lang.php
|
||||
* @author zero <zero@nzeo.com>
|
||||
* @brief trackback module / basic language pack
|
||||
**/
|
||||
|
||||
$lang->cmd_delete_checked_trackback = 'Delete selected trackback(s)';
|
||||
|
||||
$lang->msg_cart_is_null = 'Please select a trackback to be deleted.';
|
||||
$lang->msg_checked_trackback_is_deleted = '%d trackback(s) deleted.';
|
||||
|
||||
$lang->search_target_list = array(
|
||||
'url' => 'Target URL',
|
||||
'blog_name' => 'Target Site Name',
|
||||
'title' => 'Title',
|
||||
'excerpt' => 'Excerpt',
|
||||
'regdate' => 'Posting Date',
|
||||
'ipaddress' => 'IP Address',
|
||||
);
|
||||
|
||||
$lang->enable_trackback = "엮인글 사용";
|
||||
$lang->about_enable_trackback = "체크를 해제하시면 사이트내에 모든 글의 엮인글 접수를 중지합니다";
|
||||
?>
|
||||
24
modules/trackback/lang/jp.lang.php
Normal file
24
modules/trackback/lang/jp.lang.php
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
/**
|
||||
* @file modules/trackback/lang/jp.lang.php
|
||||
* @author zero <zero@nzeo.com> 翻訳:RisaPapa
|
||||
* @brief トラックバック(trackback)モジュール基本言語パッケージ
|
||||
**/
|
||||
|
||||
$lang->cmd_delete_checked_trackback = '選択トラックバック削除';
|
||||
|
||||
$lang->msg_cart_is_null = '削除する書き込みを選択してください。';
|
||||
$lang->msg_checked_trackback_is_deleted = '%d個のトラックバックが削除されました。';
|
||||
|
||||
$lang->search_target_list = array(
|
||||
'url' => 'URL',
|
||||
'blog_name' => 'サイト名',
|
||||
'title' => 'ブログ名',
|
||||
'excerpt' => '要約内容',
|
||||
'regdate' => '登録日',
|
||||
'ipaddress' => 'IPアドレス',
|
||||
);
|
||||
|
||||
$lang->enable_trackback = "トラックバック使用";
|
||||
$lang->about_enable_trackback = "チェックを外すと、すべてのコンテンツに対してトラックバックの受信を中止します。";
|
||||
?>
|
||||
24
modules/trackback/lang/ko.lang.php
Normal file
24
modules/trackback/lang/ko.lang.php
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
/**
|
||||
* @file modules/trackback/lang/ko.lang.php
|
||||
* @author zero <zero@nzeo.com>
|
||||
* @brief 엮인글(trackback) 모듈의 기본 언어팩
|
||||
**/
|
||||
|
||||
$lang->cmd_delete_checked_trackback = '선택항목 삭제';
|
||||
|
||||
$lang->msg_cart_is_null = '삭제할 글을 선택해주세요';
|
||||
$lang->msg_checked_trackback_is_deleted = '%d개의 엮인글이 삭제되었습니다';
|
||||
|
||||
$lang->search_target_list = array(
|
||||
'url' => '대상 URL',
|
||||
'blog_name' => '대상 사이트 이름',
|
||||
'title' => '제목',
|
||||
'excerpt' => '내용',
|
||||
'regdate' => '등록일',
|
||||
'ipaddress' => 'IP 주소',
|
||||
);
|
||||
|
||||
$lang->enable_trackback = "엮인글 사용";
|
||||
$lang->about_enable_trackback = "체크를 해제하시면 사이트내에 모든 글의 엮인글 접수를 중지합니다";
|
||||
?>
|
||||
24
modules/trackback/lang/zh-CN.lang.php
Normal file
24
modules/trackback/lang/zh-CN.lang.php
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
/**
|
||||
* @file modules/trackback/lang/ko.lang.php
|
||||
* @author zero <zero@nzeo.com>
|
||||
* @brief 引用(trackback) 模块的基本语言包
|
||||
**/
|
||||
|
||||
$lang->cmd_delete_checked_trackback = '删除所选项目';
|
||||
|
||||
$lang->msg_cart_is_null = '请选择要删除的文章';
|
||||
$lang->msg_checked_trackback_is_deleted = '已删除%d个引用';
|
||||
|
||||
$lang->search_target_list = array(
|
||||
'url' => '对象URL',
|
||||
'blog_name' => '对象网站名称',
|
||||
'title' => '标题',
|
||||
'excerpt' => '内容',
|
||||
'regdate' => '登录日期',
|
||||
'ipaddress' => 'IP地址',
|
||||
);
|
||||
|
||||
$lang->enable_trackback = "使用引用";
|
||||
$lang->about_enable_trackback = "取消此项勾选将对网站内的所有主题中止接收引用。";
|
||||
?>
|
||||
8
modules/trackback/queries/deleteModuleTrackbacks.xml
Normal file
8
modules/trackback/queries/deleteModuleTrackbacks.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<query id="deleteTrackbacks" action="delete">
|
||||
<tables>
|
||||
<table name="trackbacks" />
|
||||
</tables>
|
||||
<conditions>
|
||||
<condition operation="equal" column="module_srl" var="module_srl" filter="number" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
8
modules/trackback/queries/deleteTrackback.xml
Normal file
8
modules/trackback/queries/deleteTrackback.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<query id="deleteTrackback" action="delete">
|
||||
<tables>
|
||||
<table name="trackbacks" />
|
||||
</tables>
|
||||
<conditions>
|
||||
<condition operation="equal" column="trackback_srl" var="trackback_srl" filter="number" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
8
modules/trackback/queries/deleteTrackbacks.xml
Normal file
8
modules/trackback/queries/deleteTrackbacks.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<query id="deleteTrackbacks" action="delete">
|
||||
<tables>
|
||||
<table name="trackbacks" />
|
||||
</tables>
|
||||
<conditions>
|
||||
<condition operation="equal" column="document_srl" var="document_srl" filter="number" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
15
modules/trackback/queries/getNewestTrackbackList.xml
Normal file
15
modules/trackback/queries/getNewestTrackbackList.xml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<query id="getNewestTrackbackList" action="select">
|
||||
<tables>
|
||||
<table name="trackbacks" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="*" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="in" column="module_srl" var="module_srl" filter="number" />
|
||||
</conditions>
|
||||
<navigation>
|
||||
<index var="sort_index" default="list_order" order="asc" />
|
||||
<list_count var="list_count" default="20" />
|
||||
</navigation>
|
||||
</query>
|
||||
25
modules/trackback/queries/getTotalTrackbackList.xml
Normal file
25
modules/trackback/queries/getTotalTrackbackList.xml
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<query id="getTotalTrackbackList" action="select">
|
||||
<tables>
|
||||
<table name="trackbacks" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="*" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="module_srl" var="s_module_srl" />
|
||||
<group pipe="and">
|
||||
<condition operation="like" column="url" var="s_url" />
|
||||
<condition operation="like" column="blog_name" var="s_blog_name" pipe="or" />
|
||||
<condition operation="like" column="title" var="s_title" pipe="or" />
|
||||
<condition operation="like" column="excerpt" var="s_excerpt" pipe="or" />
|
||||
<condition operation="like_prefix" column="regdate" var="s_regdate" pipe="or" />
|
||||
<condition operation="like_prefix" column="ipaddress" var="s_ipaddress" pipe="or" />
|
||||
</group>
|
||||
</conditions>
|
||||
<navigation>
|
||||
<index var="sort_index" default="list_order" order="asc" />
|
||||
<list_count var="list_count" default="20" />
|
||||
<page_count var="page_count" default="10" />
|
||||
<page var="page" default="1" />
|
||||
</navigation>
|
||||
</query>
|
||||
8
modules/trackback/queries/getTrackback.xml
Normal file
8
modules/trackback/queries/getTrackback.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<query id="getTrackback" action="select">
|
||||
<tables>
|
||||
<table name="trackbacks" />
|
||||
</tables>
|
||||
<conditions>
|
||||
<condition operation="equal" column="trackback_srl" var="trackback_srl" filter="number" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
11
modules/trackback/queries/getTrackbackCount.xml
Normal file
11
modules/trackback/queries/getTrackbackCount.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<query id="getTrackbackCount" action="select">
|
||||
<tables>
|
||||
<table name="trackbacks" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="count(*)" alias="count" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="document_srl" var="document_srl" filter="number" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
12
modules/trackback/queries/getTrackbackCountByIPAddress.xml
Normal file
12
modules/trackback/queries/getTrackbackCountByIPAddress.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<query id="getTrackbackCountByIPAddress" action="select">
|
||||
<tables>
|
||||
<table name="trackbacks" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="count(*)" alias="count" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="document_srl" var="document_srl" filter="number" notnull="notnull" />
|
||||
<condition operation="equal" column="ipaddress" var="ipaddress" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
14
modules/trackback/queries/getTrackbackList.xml
Normal file
14
modules/trackback/queries/getTrackbackList.xml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<query id="getTrackbackList" action="select">
|
||||
<tables>
|
||||
<table name="trackbacks" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="*" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="document_srl" var="document_srl" filter="number" notnull="notnull" />
|
||||
</conditions>
|
||||
<navigation>
|
||||
<index var="list_order" default="list_order" order="asc" />
|
||||
</navigation>
|
||||
</query>
|
||||
17
modules/trackback/queries/insertTrackback.xml
Normal file
17
modules/trackback/queries/insertTrackback.xml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<query id="insertTrackback" action="insert">
|
||||
<tables>
|
||||
<table name="trackbacks" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="trackback_srl" var="trackback_srl" notnull="notnull" />
|
||||
<column name="module_srl" var="module_srl" filter="number" notnull="notnull" />
|
||||
<column name="document_srl" var="document_srl" filter="number" notnull="notnull" />
|
||||
<column name="url" var="url" notnull="notnull" minlength="2" maxlength="250" />
|
||||
<column name="title" var="title" notnull="notnull" minlength="2" maxlength="250" />
|
||||
<column name="blog_name" var="blog_name" notnull="notnull" minlength="2" maxlength="250" />
|
||||
<column name="excerpt" var="excerpt" notnull="notnull" />
|
||||
<column name="regdate" var="regdate" default="curdate()" />
|
||||
<column name="ipaddress" var="ipaddress" default="ipaddress()" />
|
||||
<column name="list_order" var="list_order" default="0" />
|
||||
</columns>
|
||||
</query>
|
||||
11
modules/trackback/queries/updateTrackbackModule.xml
Normal file
11
modules/trackback/queries/updateTrackbackModule.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<query id="updateTrackbackModule" action="update">
|
||||
<tables>
|
||||
<table name="trackbacks" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="module_srl" var="module_srl" filter="number" default="0" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="in" column="document_srl" var="document_srls" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
12
modules/trackback/schemas/trackbacks.xml
Normal file
12
modules/trackback/schemas/trackbacks.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<table name="trackbacks">
|
||||
<column name="trackback_srl" type="number" size="11" notnull="notnull" primary_key="primary_key" />
|
||||
<column name="module_srl" type="number" size="11" default="0" notnull="notnull" index="idx_module_srl" />
|
||||
<column name="document_srl" type="number" size="11" default="0" notnull="notnull" index="idx_document_srl" />
|
||||
<column name="url" type="varchar" size="250" notnull="notnull" />
|
||||
<column name="title" type="varchar" size="250" notnull="notnull" />
|
||||
<column name="blog_name" type="varchar" size="250" notnull="notnull" />
|
||||
<column name="excerpt" type="text" notnull="notnull" />
|
||||
<column name="regdate" type="date" index="idx_regdate" />
|
||||
<column name="ipaddress" type="varchar" size="128" notnull="notnull" index="idx_ipaddress" />
|
||||
<column name="list_order" type="number" size="11" notnull="notnull" index="idx_list_order" />
|
||||
</table>
|
||||
12
modules/trackback/tpl/filter/delete_checked.xml
Normal file
12
modules/trackback/tpl/filter/delete_checked.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<filter name="delete_checked" module="trackback" act="procTrackbackAdminDeleteChecked" confirm_msg_code="confirm_delete">
|
||||
<form>
|
||||
<node target="cart" required="true" />
|
||||
</form>
|
||||
<parameter>
|
||||
<param name="cart" target="cart" />
|
||||
</parameter>
|
||||
<response>
|
||||
<tag name="error" />
|
||||
<tag name="message" />
|
||||
</response>
|
||||
</filter>
|
||||
5
modules/trackback/tpl/filter/insert_config.xml
Normal file
5
modules/trackback/tpl/filter/insert_config.xml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<filter name="insert_config" module="trackback" act="procTrackbackAdminInsertConfig" confirm_msg_code="confirm_delete">
|
||||
<form />
|
||||
<parameter />
|
||||
<response />
|
||||
</filter>
|
||||
116
modules/trackback/tpl/trackback_list.html
Normal file
116
modules/trackback/tpl/trackback_list.html
Normal file
|
|
@ -0,0 +1,116 @@
|
|||
<!--%import("filter/delete_checked.xml")-->
|
||||
<!--%import("filter/insert_config.xml")-->
|
||||
|
||||
<h3>{$lang->trackback} <span class="gray">{$lang->cmd_management}</span></h3>
|
||||
|
||||
<form action="./" method="get" onsubmit="return procFilter(this, insert_config)">
|
||||
<table cellspacing="0" class="tableType2 gap1">
|
||||
<col width="150" />
|
||||
<col />
|
||||
<tr>
|
||||
<th scope="col">{$lang->enable_trackback}</th>
|
||||
<td>
|
||||
<input type="checkbox" name="enable_trackback" value="Y" size="3" <!--@if($config->enable_trackback!='N')-->checked="checked"<!--@end-->/> {$lang->cmd_use}
|
||||
<p>{$lang->about_enable_trackback}</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- 버튼 -->
|
||||
<div class="tRight gap1">
|
||||
<span class="button"><input type="submit" value="{$lang->cmd_registration}" accesskey="s" /></span>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- 정보 -->
|
||||
<div class="tableSummaryType1">
|
||||
Total <strong>{number_format($total_count)}</strong>, Page <strong>{number_format($page)}</strong>/{number_format($total_page)}
|
||||
</div>
|
||||
|
||||
<form action="./" method="get" onsubmit="return procFilter(this, delete_checked)">
|
||||
<input type="hidden" name="page" value="{$page}" />
|
||||
|
||||
<!-- 목록 -->
|
||||
<table cellspacing="0" class="tableType4">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">{$lang->no}</th>
|
||||
<th scope="col">
|
||||
<div class="nowrap">
|
||||
<select name="module_srl" class="mid_list" id="module_srl">
|
||||
<option value="">{$lang->module}</option>
|
||||
<!--@foreach($mid_list as $key => $val)-->
|
||||
<option value="{$val->module_srl}" <!--@if($module_srl == $val->module_srl)-->selected="selected"<!--@end-->>{$val->browser_title}</option>
|
||||
<!--@end-->
|
||||
</select><a href="#" onclick="location.href=current_url.setQuery('module_srl',xGetElementById('module_srl').options[xGetElementById('module_srl').selectedIndex].value);return false;" class="button"><span>GO</span></a>
|
||||
</div>
|
||||
</th>
|
||||
<th scope="col">{$lang->blog_name}</th>
|
||||
<th scope="col">{$lang->title}</th>
|
||||
<th scope="col">{$lang->date}</th>
|
||||
<th scope="col">{$lang->ipaddress}</th>
|
||||
<th scope="col">{$lang->cmd_move}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!--@foreach($trackback_list as $no => $val)-->
|
||||
<tr>
|
||||
<th rowspan="2" class="tahoma" scope="col">
|
||||
{$no}
|
||||
</th>
|
||||
<td class="left blue"><a href="./?mid={$module_list[$val->module_srl]->mid}" onclick="window.open(this.href);return false">{$module_list[$val->module_srl]->browser_title}</a></td>
|
||||
<td class="blue"><a href="{$val->url}" onclick="window.open(this.href); return false;">{htmlspecialchars($val->blog_name)}</a></td>
|
||||
<td>{htmlspecialchars($val->title)}</td>
|
||||
<td class="tahoma">{zdate($val->regdate,"Y-m-d")}</td>
|
||||
<td class="tahoma">{$val->ipaddress}</td>
|
||||
<td class="blue"><a href="{getUrl('','document_srl',$val->document_srl)}#trackback_{$val->trackback_srl}')" onclick="window.open(this.href);return false;">{$lang->cmd_move}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
<input type="checkbox" name="cart" value="{$val->trackback_srl}" />
|
||||
{$val->excerpt}
|
||||
</td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- 버튼 -->
|
||||
<div class="fr gap1">
|
||||
<span class="button"><input type="submit" value="{$lang->cmd_delete_checked_trackback}" /></span>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
<!-- 페이지 네비게이션 -->
|
||||
<div class="pageNavigation">
|
||||
<a href="{getUrl('page','','module_srl','')}" class="goToFirst"><img src="../../admin/tpl/images/bottomGotoFirst.gif" alt="{$lang->first_page}" width="7" height="5" /></a>
|
||||
<!--@while($page_no = $page_navigation->getNextPage())-->
|
||||
<!--@if($page == $page_no)-->
|
||||
<span class="current">{$page_no}</span>
|
||||
<!--@else-->
|
||||
<a href="{getUrl('page',$page_no,'module_srl','')}">{$page_no}</a>
|
||||
<!--@end-->
|
||||
<!--@end-->
|
||||
<a href="{getUrl('page',$page_navigation->last_page,'module_srl','')}" class="goToLast"><img src="../../admin/tpl/images/bottomGotoLast.gif" alt="{$lang->last_page}" width="7" height="5" /></a>
|
||||
</div>
|
||||
|
||||
<!-- 검색 -->
|
||||
<form action="./" method="get" class="adminSearch">
|
||||
<input type="hidden" name="module" value="{$module}" />
|
||||
<input type="hidden" name="act" value="{$act}" />
|
||||
<input type="hidden" name="module_srl" value="{$module_srl}" />
|
||||
|
||||
<fieldset>
|
||||
<select name="search_target">
|
||||
<option value="">{$lang->search_target}</option>
|
||||
<!--@foreach($lang->search_target_list as $key => $val)-->
|
||||
<option value="{$key}" <!--@if($search_target==$key)-->selected="selected"<!--@end-->>{$val}</option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
<input type="text" name="search_keyword" value="{htmlspecialchars($search_keyword)}" class="inputTypeText" />
|
||||
<span class="button"><input type="submit" value="{$lang->cmd_search}" /></span>
|
||||
<a href="{getUrl('','module',$module,'act',$act)}" onclick="window.open(this.href);return false;" class="button"><span>{$lang->cmd_cancel}</span></a>
|
||||
</fieldset>
|
||||
</form>
|
||||
65
modules/trackback/trackback.admin.controller.php
Normal file
65
modules/trackback/trackback.admin.controller.php
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
<?php
|
||||
/**
|
||||
* @class trackbackAdminController
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief trackback모듈의 admin controller class
|
||||
**/
|
||||
|
||||
class trackbackAdminController extends trackback {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 관리자 페이지에서 선택된 엮인글들을 삭제
|
||||
**/
|
||||
function procTrackbackAdminDeleteChecked() {
|
||||
// 선택된 글이 없으면 오류 표시
|
||||
$cart = Context::get('cart');
|
||||
if(!$cart) return $this->stop('msg_cart_is_null');
|
||||
$trackback_srl_list= explode('|@|', $cart);
|
||||
$trackback_count = count($trackback_srl_list);
|
||||
if(!$trackback_count) return $this->stop('msg_cart_is_null');
|
||||
|
||||
$oTrackbackController = &getController('trackback');
|
||||
|
||||
// 글삭제
|
||||
for($i=0;$i<$trackback_count;$i++) {
|
||||
$trackback_srl = trim($trackback_srl_list[$i]);
|
||||
if(!$trackback_srl) continue;
|
||||
|
||||
$oTrackbackController->deleteTrackback($trackback_srl, true);
|
||||
}
|
||||
|
||||
$this->setMessage( sprintf(Context::getLang('msg_checked_trackback_is_deleted'), $trackback_count) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 모듈에 속한 모든 트랙백 삭제
|
||||
**/
|
||||
function deleteModuleTrackbacks($module_srl) {
|
||||
// 삭제
|
||||
$args->module_srl = $module_srl;
|
||||
$output = executeQuery('trackback.deleteModuleTrackbacks', $args);
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설정 저장
|
||||
**/
|
||||
function procTrackbackAdminInsertConfig() {
|
||||
$config->enable_trackback = Context::get('enable_trackback');
|
||||
if($config->enable_trackback != 'Y') $config->enable_trackback = 'N';
|
||||
|
||||
// module Controller 객체 생성하여 입력
|
||||
$oModuleController = &getController('module');
|
||||
$output = $oModuleController->insertModuleConfig('trackback',$config);
|
||||
return $output;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
67
modules/trackback/trackback.admin.model.php
Normal file
67
modules/trackback/trackback.admin.model.php
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
<?php
|
||||
/**
|
||||
* @class trackbackAdminModel
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief trackback 모듈의 admin model class
|
||||
**/
|
||||
|
||||
class trackbackAdminModel extends trackback {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 모든 엮인글를 시간 역순으로 가져옴 (관리자용)
|
||||
**/
|
||||
function getTotalTrackbackList($obj) {
|
||||
// 검색 옵션 정리
|
||||
$search_target = trim(Context::get('search_target'));
|
||||
$search_keyword = trim(Context::get('search_keyword'));
|
||||
|
||||
if($search_target && $search_keyword) {
|
||||
switch($search_target) {
|
||||
case 'url' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_url = $search_keyword;
|
||||
break;
|
||||
case 'title' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_title= $search_keyword;
|
||||
break;
|
||||
case 'blog_name' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_blog_name= $search_keyword;
|
||||
break;
|
||||
case 'excerpt' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_excerpt = $search_keyword;
|
||||
break;
|
||||
case 'regdate' :
|
||||
$args->s_regdate = $search_keyword;
|
||||
break;
|
||||
case 'ipaddress' :
|
||||
$args->s_ipaddress= $search_keyword;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 변수 설정
|
||||
$args->sort_index = $obj->sort_index;
|
||||
$args->page = $obj->page?$obj->page:1;
|
||||
$args->list_count = $obj->list_count?$obj->list_count:20;
|
||||
$args->page_count = $obj->page_count?$obj->page_count:10;
|
||||
$args->s_module_srl = $obj->module_srl;
|
||||
|
||||
// trackback.getTotalTrackbackList 쿼리 실행
|
||||
$output = executeQuery('trackback.getTotalTrackbackList', $args);
|
||||
|
||||
// 결과가 없거나 오류 발생시 그냥 return
|
||||
if(!$output->toBool()||!count($output->data)) return $output;
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
?>
|
||||
75
modules/trackback/trackback.admin.view.php
Normal file
75
modules/trackback/trackback.admin.view.php
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
<?php
|
||||
/**
|
||||
* @class trackbackAdminView
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief trackback모듈의 admin view class
|
||||
**/
|
||||
|
||||
class trackbackAdminView extends trackback {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 목록 출력 (관리자용)
|
||||
**/
|
||||
function dispTrackbackAdminList() {
|
||||
// 설정 구함
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('trackback');
|
||||
Context::set('config',$config);
|
||||
|
||||
// 목록을 구하기 위한 옵션
|
||||
$args->page = Context::get('page'); ///< 페이지
|
||||
$args->list_count = 50; ///< 한페이지에 보여줄 글 수
|
||||
$args->page_count = 10; ///< 페이지 네비게이션에 나타날 페이지의 수
|
||||
|
||||
$args->sort_index = 'list_order'; ///< 소팅 값
|
||||
$args->module_srl = Context::get('module_srl');
|
||||
|
||||
// mid목록을 구함
|
||||
$oModuleModel = &getModel('module');
|
||||
$mid_list = $oModuleModel->getMidList();
|
||||
Context::set('mid_list', $mid_list);
|
||||
|
||||
// 목록 구함
|
||||
$oTrackbackAdminModel = &getAdminModel('trackback');
|
||||
$output = $oTrackbackAdminModel->getTotalTrackbackList($args);
|
||||
|
||||
// 목록의 loop를 돌면서 mid를 구하기 위한 module_srl값을 구함
|
||||
$trackback_count = count($output->data);
|
||||
if($trackback_count) {
|
||||
$module_srl_list = array();
|
||||
foreach($output->data as $key => $val) {
|
||||
$module_srl = $val->module_srl;
|
||||
if(!in_array($module_srl, $module_srl_list)) $module_srl_list[] = $module_srl;
|
||||
}
|
||||
if(count($module_srl_list)) {
|
||||
$args->module_srls = implode(',',$module_srl_list);
|
||||
$mid_output = executeQuery('module.getModuleInfoByModuleSrl', $args);
|
||||
if($mid_output->data && !is_array($mid_output->data)) $mid_output->data = array($mid_output->data);
|
||||
for($i=0;$i<count($mid_output->data);$i++) {
|
||||
$mid_info = $mid_output->data[$i];
|
||||
$module_list[$mid_info->module_srl] = $mid_info;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 템플릿에 쓰기 위해서 변수 설정
|
||||
Context::set('total_count', $output->total_count);
|
||||
Context::set('total_page', $output->total_page);
|
||||
Context::set('page', $output->page);
|
||||
Context::set('trackback_list', $output->data);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
Context::set('module_list', $module_list);
|
||||
|
||||
// 템플릿 지정
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('trackback_list');
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
37
modules/trackback/trackback.class.php
Normal file
37
modules/trackback/trackback.class.php
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
/**
|
||||
* @class trackback
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief trackback모듈의 high class
|
||||
**/
|
||||
|
||||
class trackback extends ModuleObject {
|
||||
|
||||
/**
|
||||
* @brief 설치시 추가 작업이 필요할시 구현
|
||||
**/
|
||||
function moduleInstall() {
|
||||
// action forward에 등록 (관리자 모드에서 사용하기 위함)
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->insertActionForward('trackback', 'controller', 'trackback');
|
||||
$oModuleController->insertActionForward('trackback', 'view', 'dispTrackbackAdminList');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설치가 이상이 없는지 체크하는 method
|
||||
**/
|
||||
function checkUpdate() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 업데이트 실행
|
||||
**/
|
||||
function moduleUpdate() {
|
||||
return new Object();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
200
modules/trackback/trackback.controller.php
Normal file
200
modules/trackback/trackback.controller.php
Normal file
|
|
@ -0,0 +1,200 @@
|
|||
<?php
|
||||
/**
|
||||
* @class trackbackController
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief trackback모듈의 Controller class
|
||||
**/
|
||||
|
||||
class trackbackController extends trackback {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 엮인글 입력
|
||||
**/
|
||||
function trackback() {
|
||||
// 설정 구함
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('trackback');
|
||||
if($config->enable_trackback == 'N') return $this->stop('fail');
|
||||
|
||||
Context::setRequestMethod("XMLRPC");
|
||||
$obj = Context::gets('document_srl','blog_name','url','title','excerpt');
|
||||
if(!$obj->document_srl || !$obj->url || !$obj->title || !$obj->excerpt) return $this->stop('fail');
|
||||
return $this->insertTrackback($obj);
|
||||
}
|
||||
|
||||
function insertTrackback($obj, $manual_inserted = false) {
|
||||
// GET으로 넘어온 document_srl을 참조, 없으면 오류~
|
||||
$document_srl = $obj->document_srl;
|
||||
|
||||
if(!$manual_inserted) {
|
||||
// document model 객체 생성후 원본글을 가져옴
|
||||
$oDocumentModel = &getModel('document');
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl);
|
||||
|
||||
// 원본글이 없거나 트랙백 허용을 하지 않으면 오류 표시
|
||||
if(!$oDocument->isExists()) return $this->stop('fail');
|
||||
if(!$oDocument->allowTrackback()) return new Object(-1,'fail');
|
||||
|
||||
$obj->module_srl = $oDocument->get('module_srl');
|
||||
}
|
||||
|
||||
// 엮인글 정리
|
||||
$obj = Context::convertEncoding($obj);
|
||||
if(!$obj->blog_name) $obj->blog_name = $obj->title;
|
||||
$obj->excerpt = strip_tags($obj->excerpt);
|
||||
|
||||
// 엮인글를 입력
|
||||
$obj->trackback_srl = getNextSequence();
|
||||
$obj->list_order = $obj->trackback_srl*-1;
|
||||
$output = executeQuery('trackback.insertTrackback', $obj);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
// 입력에 이상이 없으면 해당 글의 엮인글 수를 올림
|
||||
if(!$manual_inserted) {
|
||||
// trackback model 객체 생성
|
||||
$oTrackbackModel = &getModel('trackback');
|
||||
|
||||
// 해당 글의 전체 엮인글 수를 구해옴
|
||||
$trackback_count = $oTrackbackModel->getTrackbackCount($document_srl);
|
||||
|
||||
// document controller 객체 생성
|
||||
$oDocumentController = &getController('document');
|
||||
|
||||
// 해당글의 엮인글 수를 업데이트
|
||||
$output = $oDocumentController->updateTrackbackCount($document_srl, $trackback_count);
|
||||
|
||||
// 결과 return
|
||||
if(!$output->toBool()) return $output;
|
||||
}
|
||||
|
||||
// 원본글에 알림(notify_message)가 설정되어 있으면 메세지 보냄
|
||||
if(!$manual_inserted) $oDocument->notify(Context::getLang('trackback'), $obj->excerpt);
|
||||
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 단일 엮인글 삭제
|
||||
**/
|
||||
function deleteTrackback($trackback_srl, $is_admin = false) {
|
||||
// trackback model 객체 생성
|
||||
$oTrackbackModel = &getModel('trackback');
|
||||
|
||||
// 삭제하려는 엮인글이 있는지 확인
|
||||
$trackback = $oTrackbackModel->getTrackback($trackback_srl);
|
||||
if($trackback->data->trackback_srl != $trackback_srl) return new Object(-1, 'msg_invalid_request');
|
||||
$document_srl = $trackback->data->document_srl;
|
||||
|
||||
// document model 객체 생성
|
||||
$oDocumentModel = &getModel('document');
|
||||
|
||||
// 권한이 있는지 확인
|
||||
if(!$is_admin && !$oDocumentModel->isGranted($document_srl)) return new Object(-1, 'msg_not_permitted');
|
||||
|
||||
$args->trackback_srl = $trackback_srl;
|
||||
$output = executeQuery('trackback.deleteTrackback', $args);
|
||||
if(!$output->toBool()) return new Object(-1, 'msg_error_occured');
|
||||
|
||||
// 엮인글 수를 구해서 업데이트
|
||||
$trackback_count = $oTrackbackModel->getTrackbackCount($document_srl);
|
||||
|
||||
// document controller 객체 생성
|
||||
$oDocumentController = &getController('document','controller');
|
||||
|
||||
// 해당글의 엮인글 수를 업데이트
|
||||
$output = $oDocumentController->updateTrackbackCount($document_srl, $trackback_count);
|
||||
$output->add('document_srl', $document_srl);
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 글에 속한 모든 트랙백 삭제
|
||||
**/
|
||||
function deleteTrackbacks($document_srl) {
|
||||
// 삭제
|
||||
$args->document_srl = $document_srl;
|
||||
$output = executeQuery('trackback.deleteTrackbacks', $args);
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 엮인글을 발송
|
||||
*
|
||||
* 발송 후 결과처리는 하지 않는 구조임
|
||||
**/
|
||||
function sendTrackback($document, $trackback_url, $charset) {
|
||||
// 발송할 정보를 정리
|
||||
$http = parse_url($trackback_url);
|
||||
$obj->blog_name = Context::getBrowserTitle();
|
||||
$obj->title = $document->title;
|
||||
$obj->excerpt = cut_str(strip_tags($document->content), 240);
|
||||
$obj->url = sprintf("%s?document_srl=%d", Context::getRequestUri(), $document->document_srl);
|
||||
|
||||
// blog_name, title, excerpt, url의 문자열을 요청된 charset으로 변경
|
||||
if($charset && function_exists('iconv')) {
|
||||
foreach($obj as $key=>$val) {
|
||||
$obj->{$key} = iconv('UTF-8',$charset,$val);
|
||||
}
|
||||
}
|
||||
|
||||
// socket으로 발송할 내용 작성
|
||||
if($http['query']) $http['query'].="&";
|
||||
if(!$http['port']) $http['port'] = 80;
|
||||
|
||||
$content =
|
||||
sprintf(
|
||||
"title=%s&".
|
||||
"url=%s&".
|
||||
"blog_name=%s&".
|
||||
"excerpt=%s",
|
||||
urlencode($obj->title),
|
||||
urlencode($obj->url),
|
||||
urlencode($obj->blog_name),
|
||||
urlencode($obj->excerpt)
|
||||
);
|
||||
if($http['query']) $content .= '&'.$http['query'];
|
||||
$content_length = strlen($content);
|
||||
|
||||
// header 정리
|
||||
$header =
|
||||
sprintf(
|
||||
"POST %s HTTP/1.1\r\n".
|
||||
"Host: %s\r\n".
|
||||
"Content-Type: %s\r\n".
|
||||
"Content-Length: %s\r\n\r\n".
|
||||
"%s\r\n",
|
||||
$http['path'],
|
||||
$http['host'],
|
||||
"application/x-www-form-urlencoded",
|
||||
$content_length,
|
||||
$content
|
||||
);
|
||||
if(!$http['host']||!$http['port']) return;
|
||||
|
||||
// 발송하려는 대상 서버의 socket을 연다
|
||||
$fp = @fsockopen($http['host'], $http['port'], $errno, $errstr, 5);
|
||||
if(!$fp) return;
|
||||
|
||||
// 작성한 헤더 정보를 발송
|
||||
fputs($fp, $header);
|
||||
|
||||
// 결과를 기다림 (특정 서버의 경우 EOF가 떨어지지 않을 수가 있음
|
||||
while(!feof($fp)) {
|
||||
$line = trim(fgets($fp, 4096));
|
||||
if(eregi("^<error>",$line)) break;
|
||||
}
|
||||
|
||||
// socket 닫음
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
?>
|
||||
85
modules/trackback/trackback.model.php
Normal file
85
modules/trackback/trackback.model.php
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
<?php
|
||||
/**
|
||||
* @class trackbackModel
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief trackback 모듈의 model class
|
||||
**/
|
||||
|
||||
class trackbackModel extends trackback {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 하나의 트랙백 정보를 구함
|
||||
**/
|
||||
function getTrackback($trackback_srl) {
|
||||
$args->trackback_srl = $trackback_srl;
|
||||
return executeQuery('trackback.getTrackback', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief document_srl 에 해당하는 엮인글의 전체 갯수를 가져옴
|
||||
**/
|
||||
function getTrackbackCount($document_srl) {
|
||||
$args->document_srl = $document_srl;
|
||||
$output = executeQuery('trackback.getTrackbackCount', $args);
|
||||
$total_count = $output->data->count;
|
||||
|
||||
return (int)$total_count;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 특정 document에 특정 ip로 기록된 트랙백의 갯수
|
||||
* spamfilter 에서 사용할 method임
|
||||
**/
|
||||
function getTrackbackCountByIPAddress($document_srl, $ipaddress) {
|
||||
$args->document_srl = $document_srl;
|
||||
$args->ipaddress = $ipaddress;
|
||||
$output = executeQuery('trackback.getTrackbackCountByIPAddress', $args);
|
||||
$total_count = $output->data->count;
|
||||
|
||||
return (int)$total_count;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 특정 문서에 속한 엮인글의 목록을 가져옴
|
||||
**/
|
||||
function getTrackbackList($document_srl) {
|
||||
$args->document_srl = $document_srl;
|
||||
$args->list_order = 'list_order';
|
||||
$output = executeQuery('trackback.getTrackbackList', $args);
|
||||
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$trackback_list = $output->data;
|
||||
|
||||
if(!is_array($trackback_list)) $trackback_list = array($trackback_list);
|
||||
|
||||
return $trackback_list;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief mid 에 해당하는 엮인글을 가져옴
|
||||
**/
|
||||
function getNewestTrackbackList($obj) {
|
||||
if($obj->mid) {
|
||||
$oModuleModel = &getModel('module');
|
||||
$obj->module_srl = $oModuleModel->getModuleSrlByMid($obj->mid);
|
||||
unset($obj->mid);
|
||||
}
|
||||
|
||||
// 넘어온 module_srl은 array일 수도 있기에 array인지를 체크
|
||||
if(is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl);
|
||||
else $args->module_srl = $obj->module_srl;
|
||||
$args->list_count = $obj->list_count;
|
||||
|
||||
$output = executeQuery('trackback.getNewestTrackbackList', $args);
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue