mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-04 01:23:32 +09:00
english comments added
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0_english@8278 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
693e215bc1
commit
4d272994dd
219 changed files with 6407 additions and 8705 deletions
|
|
@ -2,22 +2,22 @@
|
|||
/**
|
||||
* @class trackbackAdminController
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief trackback모듈의 admin controller class
|
||||
* @brief trackback module admin controller class
|
||||
**/
|
||||
|
||||
class trackbackAdminController extends trackback {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
* @brief Initialization
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 관리자 페이지에서 선택된 엮인글들을 삭제
|
||||
* @brief Trackbacks delete selected in admin page
|
||||
**/
|
||||
function procTrackbackAdminDeleteChecked() {
|
||||
// 선택된 글이 없으면 오류 표시
|
||||
// An error appears if no document is selected
|
||||
$cart = Context::get('cart');
|
||||
if(!$cart) return $this->stop('msg_cart_is_null');
|
||||
$trackback_srl_list= explode('|@|', $cart);
|
||||
|
|
@ -25,8 +25,7 @@
|
|||
if(!$trackback_count) return $this->stop('msg_cart_is_null');
|
||||
|
||||
$oTrackbackController = &getController('trackback');
|
||||
|
||||
// 글삭제
|
||||
// Delete the post
|
||||
for($i=0;$i<$trackback_count;$i++) {
|
||||
$trackback_srl = trim($trackback_srl_list[$i]);
|
||||
if(!$trackback_srl) continue;
|
||||
|
|
@ -38,7 +37,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 설정 저장
|
||||
* @brief Save Settings
|
||||
**/
|
||||
function procTrackbackAdminInsertConfig() {
|
||||
$config->enable_trackback = Context::get('enable_trackback');
|
||||
|
|
@ -50,10 +49,10 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief Trackback 모듈별 설정
|
||||
* @brief Trackback Module Settings
|
||||
**/
|
||||
function procTrackbackAdminInsertModuleConfig() {
|
||||
// 필요한 변수를 받아옴
|
||||
// Get variables
|
||||
$module_srl = Context::get('target_module_srl');
|
||||
if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl);
|
||||
else $module_srl = array($module_srl);
|
||||
|
|
@ -74,7 +73,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief Trackback 모듈별 설정 함수
|
||||
* @brief Trackback modular set function
|
||||
**/
|
||||
function setTrackbackModuleConfig($module_srl, $enable_trackback) {
|
||||
$config->enable_trackback = $enable_trackback;
|
||||
|
|
@ -85,10 +84,10 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 모듈에 속한 모든 트랙백 삭제
|
||||
* @brief Modules belonging to remove all trackbacks
|
||||
**/
|
||||
function deleteModuleTrackbacks($module_srl) {
|
||||
// 삭제
|
||||
// Delete
|
||||
$args->module_srl = $module_srl;
|
||||
$output = executeQuery('trackback.deleteModuleTrackbacks', $args);
|
||||
|
||||
|
|
|
|||
|
|
@ -2,22 +2,22 @@
|
|||
/**
|
||||
* @class trackbackAdminModel
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief trackback 모듈의 admin model class
|
||||
* @brief trackback module admin model class
|
||||
**/
|
||||
|
||||
class trackbackAdminModel extends trackback {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
* @brief Initialization
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 모든 엮인글를 시간 역순으로 가져옴 (관리자용)
|
||||
* @brief Trackbacks Bringing all the time in reverse order (administrative)
|
||||
**/
|
||||
function getTotalTrackbackList($obj) {
|
||||
// 검색 옵션 정리
|
||||
// Search options
|
||||
$search_target = $obj->search_target?$obj->search_target:trim(Context::get('search_target'));
|
||||
$search_keyword = $obj->search_keyword?$obj->search_keyword:trim(Context::get('search_keyword'));
|
||||
|
||||
|
|
@ -47,19 +47,16 @@
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 변수 설정
|
||||
// Variables
|
||||
$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;
|
||||
$args->exclude_module_srl = $obj->exclude_module_srl;
|
||||
|
||||
// trackback.getTotalTrackbackList 쿼리 실행
|
||||
// trackback.getTotalTrackbackList query execution
|
||||
$output = executeQuery('trackback.getTotalTrackbackList', $args);
|
||||
|
||||
// 결과가 없거나 오류 발생시 그냥 return
|
||||
// Return if no result or an error occurs
|
||||
if(!$output->toBool()||!count($output->data)) return $output;
|
||||
|
||||
return $output;
|
||||
|
|
|
|||
|
|
@ -2,46 +2,43 @@
|
|||
/**
|
||||
* @class trackbackAdminView
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief trackback모듈의 admin view class
|
||||
* @brief trackback module admin view class
|
||||
**/
|
||||
|
||||
class trackbackAdminView extends trackback {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
* @brief Initialization
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 목록 출력 (관리자용)
|
||||
* @brief Display output list (administrative)
|
||||
**/
|
||||
function dispTrackbackAdminList() {
|
||||
// 설정 구함
|
||||
// Wanted set
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('trackback');
|
||||
Context::set('config',$config);
|
||||
|
||||
// 목록을 구하기 위한 옵션
|
||||
$args->page = Context::get('page'); ///< 페이지
|
||||
$args->list_count = 30; ///< 한페이지에 보여줄 글 수
|
||||
$args->page_count = 10; ///< 페이지 네비게이션에 나타날 페이지의 수
|
||||
// Options to get a list
|
||||
$args->page = Context::get('page'); // / "Page
|
||||
$args->list_count = 30; // / "One page of posts to show the
|
||||
$args->page_count = 10; // / "Number of pages that appear in the page navigation
|
||||
|
||||
$args->sort_index = 'list_order'; ///< 소팅 값
|
||||
$args->sort_index = 'list_order'; // / "Sorting values
|
||||
$args->module_srl = Context::get('module_srl');
|
||||
|
||||
// 목록 구함
|
||||
// Get a list
|
||||
$oTrackbackAdminModel = &getAdminModel('trackback');
|
||||
$output = $oTrackbackAdminModel->getTotalTrackbackList($args);
|
||||
|
||||
// 템플릿에 쓰기 위해서 변수 설정
|
||||
// To write to a template parameter settings
|
||||
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);
|
||||
|
||||
// 템플릿 지정
|
||||
// Set a template
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('trackback_list');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,75 +2,63 @@
|
|||
/**
|
||||
* @class trackback
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief trackback모듈의 high class
|
||||
* @brief trackback module's high class
|
||||
**/
|
||||
|
||||
class trackback extends ModuleObject {
|
||||
|
||||
/**
|
||||
* @brief 설치시 추가 작업이 필요할시 구현
|
||||
* @brief Implement if additional tasks are necessary when installing
|
||||
**/
|
||||
function moduleInstall() {
|
||||
// action forward에 등록 (관리자 모드에서 사용하기 위함)
|
||||
// Register action forward (to use in administrator mode)
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->insertActionForward('trackback', 'controller', 'trackback');
|
||||
|
||||
// 2007. 10. 17 게시글이 삭제될때 엮인글도 삭제되도록 trigger 등록
|
||||
// 2007. 10. 17 posts deleted and will be deleted when the trigger property Trackbacks
|
||||
$oModuleController->insertTrigger('document.deleteDocument', 'trackback', 'controller', 'triggerDeleteDocumentTrackbacks', 'after');
|
||||
|
||||
// 2007. 10. 17 모듈이 삭제될때 등록된 엮인글도 모두 삭제하는 트리거 추가
|
||||
// 2007. 10. 17 modules are deleted when you delete all registered triggers that add Trackbacks
|
||||
$oModuleController->insertTrigger('module.deleteModule', 'trackback', 'controller', 'triggerDeleteModuleTrackbacks', 'after');
|
||||
|
||||
// 2007. 10. 18 게시글 팝업메뉴에서 엮인글 발송 기능 추가
|
||||
// 2007. 10. Yeokingeul sent from the popup menu features 18 additional posts
|
||||
$oModuleController->insertTrigger('document.getDocumentMenu', 'trackback', 'controller', 'triggerSendTrackback', 'after');
|
||||
|
||||
// 2007. 10. 19 모듈별 엮인글 받는 기능 추가
|
||||
// 2007. 10. The ability to receive 19 additional modular yeokingeul
|
||||
$oModuleController->insertTrigger('module.dispAdditionSetup', 'trackback', 'view', 'triggerDispTrackbackAdditionSetup', 'before');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설치가 이상이 없는지 체크하는 method
|
||||
* @brief a method to check if successfully installed
|
||||
**/
|
||||
function checkUpdate() {
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
// 2007. 10. 17 게시글이 삭제될때 댓글도 삭제되도록 trigger 등록
|
||||
// 2007. 10. 17 posts deleted, even when the comments will be deleted trigger property
|
||||
if(!$oModuleModel->getTrigger('document.deleteDocument', 'trackback', 'controller', 'triggerDeleteDocumentTrackbacks', 'after')) return true;
|
||||
|
||||
// 2007. 10. 17 모듈이 삭제될때 등록된 엮인글도 모두 삭제하는 트리거 추가
|
||||
// 2007. 10. 17 modules are deleted when you delete all registered triggers that add Trackbacks
|
||||
if(!$oModuleModel->getTrigger('module.deleteModule', 'trackback', 'controller', 'triggerDeleteModuleTrackbacks', 'after')) return true;
|
||||
|
||||
// 2007. 10. 18 게시글 팝업메뉴에서 엮인글 발송 기능 추가
|
||||
// 2007. 10. Yeokingeul sent from the popup menu features 18 additional posts
|
||||
if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'trackback', 'controller', 'triggerSendTrackback', 'after')) return true;
|
||||
|
||||
// 2007. 10. 19 모듈별 엮인글 받는 기능 추가
|
||||
// 2007. 10. The ability to receive 19 additional modular yeokingeul
|
||||
if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'trackback', 'view', 'triggerDispTrackbackAdditionSetup', 'before')) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 업데이트 실행
|
||||
* @brief Execute update
|
||||
**/
|
||||
function moduleUpdate() {
|
||||
$oModuleModel = &getModel('module');
|
||||
$oModuleController = &getController('module');
|
||||
|
||||
// 2007. 10. 17 게시글이 삭제될때 댓글도 삭제되도록 trigger 등록
|
||||
// 2007. 10. 17 posts deleted, even when the comments will be deleted trigger property
|
||||
if(!$oModuleModel->getTrigger('document.deleteDocument', 'trackback', 'controller', 'triggerDeleteDocumentTrackbacks', 'after'))
|
||||
$oModuleController->insertTrigger('document.deleteDocument', 'trackback', 'controller', 'triggerDeleteDocumentTrackbacks', 'after');
|
||||
|
||||
// 2007. 10. 17 모듈이 삭제될때 등록된 엮인글도 모두 삭제하는 트리거 추가
|
||||
// 2007. 10. 17 modules are deleted when you delete all registered triggers that add Trackbacks
|
||||
if(!$oModuleModel->getTrigger('module.deleteModule', 'trackback', 'controller', 'triggerDeleteModuleTrackbacks', 'after'))
|
||||
$oModuleController->insertTrigger('module.deleteModule', 'trackback', 'controller', 'triggerDeleteModuleTrackbacks', 'after');
|
||||
|
||||
// 2007. 10. 18 게시글 팝업메뉴에서 엮인글 발송 기능 추가
|
||||
// 2007. 10. Yeokingeul sent from the popup menu features 18 additional posts
|
||||
if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'trackback', 'controller', 'triggerSendTrackback', 'after'))
|
||||
$oModuleController->insertTrigger('document.getDocumentMenu', 'trackback', 'controller', 'triggerSendTrackback', 'after');
|
||||
|
||||
// 2007. 10. 19 모듈별 엮인글 받는 기능 추가
|
||||
// 2007. 10. The ability to receive 19 additional modular yeokingeul
|
||||
if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'trackback', 'view', 'triggerDispTrackbackAdditionSetup', 'before'))
|
||||
$oModuleController->insertTrigger('module.dispAdditionSetup', 'trackback', 'view', 'triggerDispTrackbackAdditionSetup', 'before');
|
||||
|
||||
|
|
@ -78,7 +66,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 캐시 파일 재생성
|
||||
* @brief Re-generate the cache file
|
||||
**/
|
||||
function recompileCache() {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,61 +2,55 @@
|
|||
/**
|
||||
* @class trackbackController
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief trackback모듈의 Controller class
|
||||
* @brief trackback module's Controller class
|
||||
**/
|
||||
|
||||
class trackbackController extends trackback {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
* @brief Initialization
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 트랙백 발송
|
||||
* @brief Trackbacks sent
|
||||
**/
|
||||
function procTrackbackSend() {
|
||||
// 게시물 번호와 발송하려는 엮인글 주소를 구함
|
||||
// Yeokingeul to post numbers and shipping addresses Wanted
|
||||
$document_srl = Context::get('target_srl');
|
||||
$trackback_url = Context::get('trackback_url');
|
||||
$charset = Context::get('charset');
|
||||
if(!$document_srl || !$trackback_url || !$charset) return new Object(-1, 'msg_invalid_request');
|
||||
|
||||
// 로그인 정보 구함
|
||||
// Login Information Wanted
|
||||
$logged_info = Context::get('logged_info');
|
||||
if(!$logged_info->member_srl) return new Object(-1, 'msg_not_permitted');
|
||||
|
||||
// 게시물의 정보를 구해와서 있는지 여부와 권한을 체크
|
||||
// Posts of the information obtained permission to come and check whether
|
||||
$oDocumentModel = &getModel('document');
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl);
|
||||
if(!$oDocument->isExists()) return new Object(-1, 'msg_invalid_request');
|
||||
if($oDocument->getMemberSrl() != $logged_info->member_srl) return new Object(-1, 'msg_not_permitted');
|
||||
|
||||
// 현재 글이 있는 모듈의 타이틀 지정
|
||||
// Specify the title of the module, the current article
|
||||
$oModuleModel = &getModel('module');
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($oDocument->get('module_srl'));
|
||||
Context::setBrowserTitle($module_info->browser_title);
|
||||
|
||||
// 엮인글 발송
|
||||
// Shipping yeokingeul
|
||||
return $this->sendTrackback($oDocument, $trackback_url, $charset);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 문서 팝업메뉴에서 엮인글을 발송하는 메뉴 추가
|
||||
* @brief Trackbacks send documents from the popup menu add a menu
|
||||
**/
|
||||
function triggerSendTrackback(&$menu_list) {
|
||||
$logged_info = Context::get('logged_info');
|
||||
if(!$logged_info->member_srl) return new Object();
|
||||
|
||||
// 요청된 게시물 번호와 현재 로그인 정보 구함
|
||||
// Post number and the current login information requested Wanted
|
||||
$document_srl = Context::get('target_srl');
|
||||
$oDocumentModel = &getModel('document');
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl);
|
||||
if(!$oDocument->isExists()) return new Object();
|
||||
if($oDocument->getMemberSrl() != $logged_info->member_srl) return new Object();
|
||||
|
||||
// 엮인글 발송 링크 추가
|
||||
// Add a link sent yeokingeul
|
||||
$oDocumentController = &getController('document');
|
||||
$url = getUrl('','module','trackback','act','dispTrackbackSend','document_srl', $document_srl);
|
||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_send_trackback','./modules/document/tpl/icons/send_trackback.gif','popup');
|
||||
|
|
@ -65,7 +59,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief document삭제시 해당 document의 엮인글을 삭제하는 trigger
|
||||
* @brief delete document in the document to delete the trigger Trackbacks
|
||||
**/
|
||||
function triggerDeleteDocumentTrackbacks(&$obj) {
|
||||
$document_srl = $obj->document_srl;
|
||||
|
|
@ -75,7 +69,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief module 삭제시 해당 엮인글 모두 삭제하는 trigger
|
||||
* @brief deletion module that deletes all the trigger yeokingeul
|
||||
**/
|
||||
function triggerDeleteModuleTrackbacks(&$obj) {
|
||||
$module_srl = $obj->module_srl;
|
||||
|
|
@ -86,23 +80,20 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 엮인글 입력
|
||||
* @brief Trackback inserted
|
||||
**/
|
||||
function trackback() {
|
||||
// 출력을 XMLRPC로 설정
|
||||
// Output is set to XMLRPC
|
||||
Context::setRequestMethod("XMLRPC");
|
||||
|
||||
// 엮인글 받을때 필요한 변수를 구함
|
||||
// When receiving the necessary variables yeokingeul Wanted
|
||||
$obj = Context::gets('document_srl','blog_name','url','title','excerpt');
|
||||
if(!$obj->document_srl || !$obj->url || !$obj->title || !$obj->excerpt) return $this->stop('fail');
|
||||
|
||||
// 올바른 trackback url인지 검사
|
||||
// Checks for correct trackback url
|
||||
$given_key = Context::get('key');
|
||||
$oTrackbackModel = &getModel('trackback');
|
||||
$key = $oTrackbackModel->getTrackbackKey($obj->document_srl);
|
||||
if($key != $given_key) return $this->stop('fail');
|
||||
|
||||
// 엮인글 모듈의 기본 설정을 받음
|
||||
// Yeokingeul module out of the default settings
|
||||
$module_srl = Context::get('module_srl');
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModulePartConfig('trackback', $module_srl);
|
||||
|
|
@ -112,65 +103,54 @@
|
|||
$enable_trackback = $config->enable_trackback;
|
||||
}
|
||||
|
||||
// 관리자가 금지하였을 경우에는 엮인글을 받지 않음
|
||||
// If managers were banned does not Trackbacks
|
||||
if($enable_trackback == 'N') return $this->stop('fail');
|
||||
|
||||
return $this->insertTrackback($obj);
|
||||
}
|
||||
|
||||
function insertTrackback($obj, $manual_inserted = false) {
|
||||
// 엮인글 정리
|
||||
// List trackback
|
||||
$obj = Context::convertEncoding($obj);
|
||||
if(!$obj->blog_name) $obj->blog_name = $obj->title;
|
||||
$obj->excerpt = strip_tags($obj->excerpt);
|
||||
|
||||
// trigger 호출 (before)
|
||||
// Call a trigger (before)
|
||||
$output = ModuleHandler::triggerCall('trackback.insertTrackback', 'before', $obj);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
// GET으로 넘어온 document_srl을 참조, 없으면 오류~
|
||||
// Document_srl see passed in GET, if an error ~
|
||||
$document_srl = $obj->document_srl;
|
||||
|
||||
if(!$manual_inserted) {
|
||||
// document model 객체 생성후 원본글을 가져옴
|
||||
// Imported document model object, it permits you to wonbongeul
|
||||
$oDocumentModel = &getModel('document');
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl);
|
||||
|
||||
// 원본글이 없거나 트랙백 허용을 하지 않으면 오류 표시
|
||||
// If you do not allow two or trackback wonbongeul error display
|
||||
if(!$oDocument->isExists()) return $this->stop('fail');
|
||||
if(!$oDocument->allowTrackback()) return new Object(-1,'fail');
|
||||
|
||||
$obj->module_srl = $oDocument->get('module_srl');
|
||||
}
|
||||
|
||||
// 엮인글을 입력
|
||||
// Enter Trackbacks
|
||||
$obj->trackback_srl = getNextSequence();
|
||||
$obj->list_order = $obj->trackback_srl*-1;
|
||||
$output = executeQuery('trackback.insertTrackback', $obj);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
// 입력에 이상이 없으면 해당 글의 엮인글 수를 올림
|
||||
// If there is more to enter the article number yeokingeul Rounds
|
||||
if(!$manual_inserted) {
|
||||
// trackback model 객체 생성
|
||||
// trackback model object creation
|
||||
$oTrackbackModel = &getModel('trackback');
|
||||
|
||||
// 해당 글의 전체 엮인글 수를 구해옴
|
||||
// All the article number yeokingeul guhaeom
|
||||
$trackback_count = $oTrackbackModel->getTrackbackCount($document_srl);
|
||||
|
||||
// document controller 객체 생성
|
||||
// document controller object creation
|
||||
$oDocumentController = &getController('document');
|
||||
|
||||
// 해당글의 엮인글 수를 업데이트
|
||||
// Update the number of posts that yeokingeul
|
||||
$output = $oDocumentController->updateTrackbackCount($document_srl, $trackback_count);
|
||||
|
||||
// 결과 return
|
||||
// Return result
|
||||
if(!$output->toBool()) return $output;
|
||||
}
|
||||
|
||||
// 원본글에 알림(notify_message)가 설정되어 있으면 메세지 보냄
|
||||
// Notify wonbongeul (notify_message) if there is a Send a message
|
||||
if(!$manual_inserted) $oDocument->notify(Context::getLang('trackback'), $obj->excerpt);
|
||||
|
||||
// trigger 호출 (after)
|
||||
// Call a trigger (after)
|
||||
$output = ModuleHandler::triggerCall('trackback.insertTrackback', 'after', $obj);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
|
|
@ -178,42 +158,34 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 단일 엮인글 삭제
|
||||
* @brief Deleting a single yeokingeul
|
||||
**/
|
||||
function deleteTrackback($trackback_srl, $is_admin = false) {
|
||||
// trackback model 객체 생성
|
||||
// trackback model object creation
|
||||
$oTrackbackModel = &getModel('trackback');
|
||||
|
||||
// 삭제하려는 엮인글이 있는지 확인
|
||||
// Make sure that you want to delete Trackbacks
|
||||
$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;
|
||||
|
||||
// trigger 호출 (before)
|
||||
// Call a trigger (before)
|
||||
$output = ModuleHandler::triggerCall('trackback.deleteTrackback', 'before', $trackback);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
// document model 객체 생성
|
||||
// Create a document model object
|
||||
$oDocumentModel = &getModel('document');
|
||||
|
||||
// 권한이 있는지 확인
|
||||
// Check if a permossion is granted
|
||||
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');
|
||||
|
||||
// 엮인글 수를 구해서 업데이트
|
||||
// Obtain the number of yeokingeul Update
|
||||
$trackback_count = $oTrackbackModel->getTrackbackCount($document_srl);
|
||||
|
||||
// document controller 객체 생성
|
||||
// document controller object creation
|
||||
$oDocumentController = &getController('document','controller');
|
||||
|
||||
// 해당글의 엮인글 수를 업데이트
|
||||
// Update the number of posts that yeokingeul
|
||||
$output = $oDocumentController->updateTrackbackCount($document_srl, $trackback_count);
|
||||
$output->add('document_srl', $document_srl);
|
||||
|
||||
// trigger 호출 (before)
|
||||
// Call a trigger (before)
|
||||
$output = ModuleHandler::triggerCall('trackback.deleteTrackback', 'after', $trackback);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
|
|
@ -221,10 +193,10 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 글에 속한 모든 트랙백 삭제
|
||||
* @brief Delete All RSS Trackback
|
||||
**/
|
||||
function deleteTrackbacks($document_srl) {
|
||||
// 삭제
|
||||
// Delete
|
||||
$args->document_srl = $document_srl;
|
||||
$output = executeQuery('trackback.deleteTrackbacks', $args);
|
||||
|
||||
|
|
@ -232,29 +204,26 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 엮인글을 발송
|
||||
* @brief Trackbacks sent to
|
||||
*
|
||||
* 발송 후 결과처리는 하지 않는 구조임
|
||||
* After sending the results are not sticky and handling
|
||||
**/
|
||||
function sendTrackback($oDocument, $trackback_url, $charset) {
|
||||
$oModuleController = &getController('module');
|
||||
|
||||
// 발송할 정보를 정리
|
||||
// Information sent by
|
||||
$http = parse_url($trackback_url);
|
||||
$obj->blog_name = str_replace(array('<','>','&','"'), array('<','>','&','"'), Context::getBrowserTitle());
|
||||
$oModuleController->replaceDefinedLangCode($obj->blog_name);
|
||||
$obj->title = $oDocument->getTitleText();
|
||||
$obj->excerpt = $oDocument->getSummary(200);
|
||||
$obj->url = getFullUrl('','document_srl',$oDocument->document_srl);
|
||||
|
||||
// blog_name, title, excerpt, url의 문자열을 요청된 charset으로 변경
|
||||
// blog_name, title, excerpt, url charset of the string to the requested change
|
||||
if($charset && function_exists('iconv')) {
|
||||
foreach($obj as $key=>$val) {
|
||||
$obj->{$key} = iconv('UTF-8',$charset,$val);
|
||||
}
|
||||
}
|
||||
|
||||
// socket으로 발송할 내용 작성
|
||||
// written information sent to socket
|
||||
if($http['query']) $http['query'].="&";
|
||||
if(!$http['port']) $http['port'] = 80;
|
||||
|
||||
|
|
@ -271,8 +240,7 @@
|
|||
);
|
||||
if($http['query']) $content .= '&'.$http['query'];
|
||||
$content_length = strlen($content);
|
||||
|
||||
// header 정리
|
||||
// header by
|
||||
$header =
|
||||
sprintf(
|
||||
"POST %s HTTP/1.1\r\n".
|
||||
|
|
@ -287,15 +255,12 @@
|
|||
$content
|
||||
);
|
||||
if(!$http['host']||!$http['port']) return new Object(-1,'msg_trackback_url_is_invalid');
|
||||
|
||||
// 발송하려는 대상 서버의 socket을 연다
|
||||
// Opens a socket on the target server you want to send
|
||||
$fp = @fsockopen($http['host'], $http['port'], $errno, $errstr, 5);
|
||||
if(!$fp) return new Object(-1,'msg_trackback_url_is_invalid');
|
||||
|
||||
// 작성한 헤더 정보를 발송
|
||||
// Header information sent by
|
||||
fputs($fp, $header);
|
||||
|
||||
// 결과를 기다림 (특정 서버의 경우 EOF가 떨어지지 않을 수가 있음
|
||||
// Waiting for the results (in particular the server may not be falling EOF
|
||||
while(!feof($fp)) {
|
||||
$line = trim(fgets($fp, 4096));
|
||||
if(preg_match("/^<error>/i",$line)){
|
||||
|
|
@ -303,8 +268,7 @@
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// socket 닫음
|
||||
// Close socket
|
||||
fclose($fp);
|
||||
|
||||
if($error == "0") return new Object(0, 'msg_trackback_send_success');
|
||||
|
|
@ -313,7 +277,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 특정 ipaddress의 특정 시간대 내의 엮인글을 모두 삭제
|
||||
* @brief Within a specific time of a specific ipaddress Trackbacks delete all
|
||||
**/
|
||||
function deleteTrackbackSender($time, $ipaddress, $url, $blog_name, $title, $excerpt) {
|
||||
$obj->regdate = date("YmdHis",time()-$time);
|
||||
|
|
|
|||
|
|
@ -2,19 +2,19 @@
|
|||
/**
|
||||
* @class trackbackModel
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief trackback 모듈의 model class
|
||||
* @brief trackback module model class
|
||||
**/
|
||||
|
||||
class trackbackModel extends trackback {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
* @brief Initialization
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 하나의 트랙백 정보를 구함
|
||||
* @brief Wanted a trackback information
|
||||
**/
|
||||
function getTrackback($trackback_srl) {
|
||||
$args->trackback_srl = $trackback_srl;
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief document_srl 에 해당하는 엮인글의 전체 갯수를 가져옴
|
||||
* @brief Trackbacks document_srl corresponding to the bringing of the total number of
|
||||
**/
|
||||
function getTrackbackCount($document_srl) {
|
||||
$args->document_srl = $document_srl;
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
|
||||
/**
|
||||
* @brief module_srl 에 해당하는 엮인글의 전체 갯수를 가져옴
|
||||
* @brief Trackbacks module_srl corresponding to the bringing of the total number of
|
||||
**/
|
||||
function getTrackbackAllCount($module_srl) {
|
||||
$args->module_srl = $module_srl;
|
||||
|
|
@ -46,8 +46,8 @@
|
|||
|
||||
|
||||
/**
|
||||
* @brief 특정 document에 특정 ip로 기록된 트랙백의 갯수
|
||||
* spamfilter 에서 사용할 method임
|
||||
* @brief For a particular document to a specific ip number of trackbacks recorded
|
||||
* Im spamfilter method used in
|
||||
**/
|
||||
function getTrackbackCountByIPAddress($document_srl, $ipaddress) {
|
||||
$args->document_srl = $document_srl;
|
||||
|
|
@ -59,7 +59,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 특정 문서에 속한 엮인글의 목록을 가져옴
|
||||
* @brief Trackbacks certain documents belonging to the bringing of the list
|
||||
**/
|
||||
function getTrackbackList($document_srl) {
|
||||
$args->document_srl = $document_srl;
|
||||
|
|
@ -76,7 +76,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief mid 에 해당하는 엮인글을 가져옴
|
||||
* @brief Bringing a mid Trackbacks
|
||||
**/
|
||||
function getNewestTrackbackList($obj) {
|
||||
if($obj->mid) {
|
||||
|
|
@ -84,8 +84,7 @@
|
|||
$obj->module_srl = $oModuleModel->getModuleSrlByMid($obj->mid);
|
||||
unset($obj->mid);
|
||||
}
|
||||
|
||||
// 넘어온 module_srl은 array일 수도 있기에 array인지를 체크
|
||||
// Module_srl passed the array may be a check whether the 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;
|
||||
|
|
@ -99,10 +98,10 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 특정 모듈의 trackback 설정을 return
|
||||
* @brief Return to a specific set of modules trackback
|
||||
**/
|
||||
function getTrackbackModuleConfig($module_srl) {
|
||||
// trackback 모듈의 config를 가져옴
|
||||
// Bringing trackback module config
|
||||
$oModuleModel = &getModel('module');
|
||||
$module_trackback_config = $oModuleModel->getModulePartConfig('trackback', $module_srl);
|
||||
if(!$module_trackback_config) {
|
||||
|
|
@ -114,7 +113,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 정해진 시간내에 전체 엮인글 등록수를 구함
|
||||
* @brief Fixed in time for the entire yeokingeul Wanted to Register
|
||||
**/
|
||||
function getRegistedTrackback($time, $ipaddress, $url, $blog_name, $title, $excerpt) {
|
||||
$obj->regdate = date("YmdHis",time()-$time);
|
||||
|
|
@ -128,8 +127,8 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief trackback url을 생성하여 return
|
||||
* trackback url에 key값을 추가함.
|
||||
* @brief return by creating a trackback url
|
||||
* Adds the key value in the trackback url.
|
||||
**/
|
||||
function getTrackbackUrl($document_srl) {
|
||||
$url = getFullUrl('','document_srl',$document_srl,'act','trackback','key',$this->getTrackbackKey($document_srl));
|
||||
|
|
@ -137,9 +136,9 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 키값을 생성하여 return
|
||||
* key값은 db 비번 정보 + 10분 단위의 시간값을 합쳐서 hash결과를 이용함
|
||||
* 단 url이 너무 길어져서 1, 10, 20 자리수의 글자 하나씩만을 조합해서 return
|
||||
* @brief Return keys by generating
|
||||
* db key value information, plus a 10 minute off-duty time together and hash values and deal with the results
|
||||
* So was extended only url, 1, 10, 20-digit combination of letters only, one return
|
||||
**/
|
||||
function getTrackbackKey($document_srl) {
|
||||
$time = (int) (time()/(60*10));
|
||||
|
|
|
|||
|
|
@ -2,19 +2,19 @@
|
|||
/**
|
||||
* @class trackbackView
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief trackback모듈의 view class
|
||||
* @brief trackback module's view class
|
||||
**/
|
||||
|
||||
class trackbackView extends trackback {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
* @brief Initialization
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 목록 출력 (관리자용)
|
||||
* @brief Display output list (administrative)
|
||||
**/
|
||||
function dispTrackbackSend() {
|
||||
$document_srl = Context::get('document_srl');
|
||||
|
|
@ -22,8 +22,7 @@
|
|||
|
||||
$logged_info = Context::get('logged_info');
|
||||
if(!$logged_info->member_srl) return $this->stop('msg_not_permitted');
|
||||
|
||||
// 원본 글의 정보를 구함
|
||||
// Wanted Original article information
|
||||
$oDocumentModel = &getModel('document');
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl);
|
||||
if(!$oDocument->isExists()) return $this->stop('msg_invalid_document');
|
||||
|
|
@ -32,34 +31,31 @@
|
|||
if($oDocument->getMemberSrl() != $logged_info->member_srl) return $this->stop('msg_not_permitted');
|
||||
|
||||
Context::set('oDocument', $oDocument);
|
||||
|
||||
// 템플릿 지정
|
||||
// Set a template
|
||||
$this->setLayoutFile('popup_layout');
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('send_trackback_form');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 서비스형 모듈의 추가 설정을 위한 부분
|
||||
* trackback의 사용 형태에 대한 설정만 받음
|
||||
* @brief An additional set of parts for a service module
|
||||
* Use the form out of the settings for trackback
|
||||
**/
|
||||
function triggerDispTrackbackAdditionSetup(&$obj) {
|
||||
$current_module_srl = Context::get('module_srl');
|
||||
$current_module_srls = Context::get('module_srls');
|
||||
|
||||
if(!$current_module_srl && !$current_module_srls) {
|
||||
// 선택된 모듈의 정보를 가져옴
|
||||
// Get information of the current module
|
||||
$current_module_info = Context::get('current_module_info');
|
||||
$current_module_srl = $current_module_info->module_srl;
|
||||
if(!$current_module_srl) return new Object();
|
||||
}
|
||||
|
||||
// 선택된 모듈의 trackback설정을 가져옴
|
||||
// Imported trackback settings of the selected module
|
||||
$oTrackbackModel = &getModel('trackback');
|
||||
$trackback_config = $oTrackbackModel->getTrackbackModuleConfig($current_module_srl);
|
||||
Context::set('trackback_config', $trackback_config);
|
||||
|
||||
// 템플릿 파일 지정
|
||||
// Set a template file
|
||||
$oTemplate = &TemplateHandler::getInstance();
|
||||
$tpl = $oTemplate->compile($this->module_path.'tpl', 'trackback_module_config');
|
||||
$obj .= $tpl;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue