mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-02 00:32:15 +09:00
issue 2662 trash, widget, session, trackback, spamfilter, tag
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@12260 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
e1a22ca6f0
commit
5219a360c6
31 changed files with 3465 additions and 3173 deletions
|
|
@ -1,140 +1,150 @@
|
|||
<?php
|
||||
/**
|
||||
* trackbackAdminController class
|
||||
* trackback module admin controller class
|
||||
*
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @package /modules/trackback
|
||||
* @version 0.1
|
||||
*/
|
||||
class trackbackAdminController extends trackback
|
||||
{
|
||||
/**
|
||||
* trackbackAdminController class
|
||||
* trackback module admin controller class
|
||||
*
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @package /modules/trackback
|
||||
* @version 0.1
|
||||
* Initialization
|
||||
* @return void
|
||||
*/
|
||||
class trackbackAdminController extends trackback {
|
||||
/**
|
||||
* Initialization
|
||||
* @return void
|
||||
*/
|
||||
function init() {
|
||||
}
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Trackbacks delete selected in admin page
|
||||
* @return void|Object
|
||||
*/
|
||||
function procTrackbackAdminDeleteChecked() {
|
||||
// An error appears if no document is selected
|
||||
$cart = Context::get('cart');
|
||||
if(!is_array($cart)) $trackback_srl_list= explode('|@|', $cart);
|
||||
else $trackback_srl_list = $cart;
|
||||
/**
|
||||
* Trackbacks delete selected in admin page
|
||||
* @return void|Object
|
||||
*/
|
||||
function procTrackbackAdminDeleteChecked()
|
||||
{
|
||||
// An error appears if no document is selected
|
||||
$cart = Context::get('cart');
|
||||
if(!is_array($cart)) $trackback_srl_list= explode('|@|', $cart);
|
||||
else $trackback_srl_list = $cart;
|
||||
|
||||
$trackback_count = count($trackback_srl_list);
|
||||
if(!$trackback_count) return $this->stop('msg_cart_is_null');
|
||||
$trackback_count = count($trackback_srl_list);
|
||||
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;
|
||||
|
||||
$oTrackbackController->deleteTrackback($trackback_srl, true);
|
||||
}
|
||||
|
||||
$this->setMessage( sprintf(Context::getLang('msg_checked_trackback_is_deleted'), $trackback_count) );
|
||||
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispTrackbackAdminList');
|
||||
$this->setRedirectUrl($returnUrl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save Settings
|
||||
* @return object
|
||||
*/
|
||||
function procTrackbackAdminInsertConfig() {
|
||||
$config->enable_trackback = Context::get('enable_trackback');
|
||||
if($config->enable_trackback != 'Y') $config->enable_trackback = 'N';
|
||||
|
||||
$oModuleController = &getController('module');
|
||||
$output = $oModuleController->insertModuleConfig('trackback',$config);
|
||||
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispTrackbackAdminList');
|
||||
return $this->setRedirectUrl($returnUrl, $output);
|
||||
}
|
||||
|
||||
/**
|
||||
* Trackback Module Settings
|
||||
* @return void|Object
|
||||
*/
|
||||
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);
|
||||
|
||||
$enable_trackback = Context::get('enable_trackback');
|
||||
if(!in_array($enable_trackback, array('Y','N'))) $enable_trackback = 'N';
|
||||
|
||||
if(!$module_srl || !$enable_trackback) return new Object(-1, 'msg_invalid_request');
|
||||
|
||||
for($i=0;$i<count($module_srl);$i++) {
|
||||
$srl = trim($module_srl[$i]);
|
||||
if(!$srl) continue;
|
||||
$output = $this->setTrackbackModuleConfig($srl, $enable_trackback);
|
||||
}
|
||||
|
||||
$this->setError(-1);
|
||||
$this->setMessage('success_updated', 'info');
|
||||
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispBoardAdminContent');
|
||||
$this->setRedirectUrl($returnUrl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Trackback Module Settings
|
||||
* @return void
|
||||
*/
|
||||
function procTrackbackAdminAddCart()
|
||||
$oTrackbackController = &getController('trackback');
|
||||
// Delete the post
|
||||
for($i=0;$i<$trackback_count;$i++)
|
||||
{
|
||||
$trackback_srl = (int)Context::get('trackback_srl');
|
||||
$trackback_srl = trim($trackback_srl_list[$i]);
|
||||
if(!$trackback_srl) continue;
|
||||
|
||||
$oTrackbackAdminModel = &getAdminModel('trackback');
|
||||
//$columnList = array('trackback_srl');
|
||||
$args->trackbackSrlList = array($trackback_srl);
|
||||
$oTrackbackController->deleteTrackback($trackback_srl, true);
|
||||
}
|
||||
|
||||
$output = $oTrackbackAdminModel->getTotalTrackbackList($args);
|
||||
$this->setMessage( sprintf(Context::getLang('msg_checked_trackback_is_deleted'), $trackback_count) );
|
||||
|
||||
if(is_array($output->data))
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispTrackbackAdminList');
|
||||
$this->setRedirectUrl($returnUrl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save Settings
|
||||
* @return object
|
||||
*/
|
||||
function procTrackbackAdminInsertConfig()
|
||||
{
|
||||
$config->enable_trackback = Context::get('enable_trackback');
|
||||
if($config->enable_trackback != 'Y') $config->enable_trackback = 'N';
|
||||
|
||||
$oModuleController = &getController('module');
|
||||
$output = $oModuleController->insertModuleConfig('trackback',$config);
|
||||
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispTrackbackAdminList');
|
||||
return $this->setRedirectUrl($returnUrl, $output);
|
||||
}
|
||||
|
||||
/**
|
||||
* Trackback Module Settings
|
||||
* @return void|Object
|
||||
*/
|
||||
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);
|
||||
|
||||
$enable_trackback = Context::get('enable_trackback');
|
||||
if(!in_array($enable_trackback, array('Y','N'))) $enable_trackback = 'N';
|
||||
|
||||
if(!$module_srl || !$enable_trackback) return new Object(-1, 'msg_invalid_request');
|
||||
|
||||
for($i=0;$i<count($module_srl);$i++)
|
||||
{
|
||||
$srl = trim($module_srl[$i]);
|
||||
if(!$srl) continue;
|
||||
$output = $this->setTrackbackModuleConfig($srl, $enable_trackback);
|
||||
}
|
||||
|
||||
$this->setError(-1);
|
||||
$this->setMessage('success_updated', 'info');
|
||||
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispBoardAdminContent');
|
||||
$this->setRedirectUrl($returnUrl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Trackback Module Settings
|
||||
* @return void
|
||||
*/
|
||||
function procTrackbackAdminAddCart()
|
||||
{
|
||||
$trackback_srl = (int)Context::get('trackback_srl');
|
||||
|
||||
$oTrackbackAdminModel = &getAdminModel('trackback');
|
||||
//$columnList = array('trackback_srl');
|
||||
$args->trackbackSrlList = array($trackback_srl);
|
||||
|
||||
$output = $oTrackbackAdminModel->getTotalTrackbackList($args);
|
||||
|
||||
if(is_array($output->data))
|
||||
{
|
||||
foreach($output->data AS $key=>$value)
|
||||
{
|
||||
foreach($output->data AS $key=>$value)
|
||||
{
|
||||
if($_SESSION['trackback_management'][$value->trackback_srl]) unset($_SESSION['trackback_management'][$value->trackback_srl]);
|
||||
else $_SESSION['trackback_management'][$value->trackback_srl] = true;
|
||||
}
|
||||
if($_SESSION['trackback_management'][$value->trackback_srl]) unset($_SESSION['trackback_management'][$value->trackback_srl]);
|
||||
else $_SESSION['trackback_management'][$value->trackback_srl] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Trackback modular set function
|
||||
* @param int $module_srl
|
||||
* @param string $enable_trackback 'Y' or 'N'
|
||||
* @return Object
|
||||
*/
|
||||
function setTrackbackModuleConfig($module_srl, $enable_trackback) {
|
||||
$config->enable_trackback = $enable_trackback;
|
||||
/**
|
||||
* Trackback modular set function
|
||||
* @param int $module_srl
|
||||
* @param string $enable_trackback 'Y' or 'N'
|
||||
* @return Object
|
||||
*/
|
||||
function setTrackbackModuleConfig($module_srl, $enable_trackback)
|
||||
{
|
||||
$config->enable_trackback = $enable_trackback;
|
||||
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->insertModulePartConfig('trackback', $module_srl, $config);
|
||||
return new Object();
|
||||
}
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->insertModulePartConfig('trackback', $module_srl, $config);
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* Modules belonging to remove all trackbacks
|
||||
* @param int $module_srl
|
||||
* @return object
|
||||
*/
|
||||
function deleteModuleTrackbacks($module_srl) {
|
||||
// Delete
|
||||
$args->module_srl = $module_srl;
|
||||
$output = executeQuery('trackback.deleteModuleTrackbacks', $args);
|
||||
/**
|
||||
* Modules belonging to remove all trackbacks
|
||||
* @param int $module_srl
|
||||
* @return object
|
||||
*/
|
||||
function deleteModuleTrackbacks($module_srl)
|
||||
{
|
||||
// Delete
|
||||
$args->module_srl = $module_srl;
|
||||
$output = executeQuery('trackback.deleteModuleTrackbacks', $args);
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
?>
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
/* End of file trackback.admin.controller.php */
|
||||
/* Location: ./modules/trackback/trackback.admin.controller.php */
|
||||
|
|
|
|||
|
|
@ -1,87 +1,93 @@
|
|||
<?php
|
||||
/**
|
||||
* @class trackbackAdminModel
|
||||
* @brief trackback module admin model class
|
||||
*
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @package /modules/trackback
|
||||
* @version 0.1
|
||||
*/
|
||||
class trackbackAdminModel extends trackback
|
||||
{
|
||||
/**
|
||||
* @class trackbackAdminModel
|
||||
* @brief trackback module admin model class
|
||||
*
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @package /modules/trackback
|
||||
* @version 0.1
|
||||
* Initialization
|
||||
* @return void
|
||||
*/
|
||||
class trackbackAdminModel extends trackback {
|
||||
/**
|
||||
* Initialization
|
||||
* @return void
|
||||
*/
|
||||
function init() {
|
||||
}
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Trackbacks Bringing all the time in reverse order (administrative)
|
||||
* @param object $obj
|
||||
* @return object
|
||||
*/
|
||||
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'));
|
||||
/**
|
||||
* Trackbacks Bringing all the time in reverse order (administrative)
|
||||
* @param object $obj
|
||||
* @return object
|
||||
*/
|
||||
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'));
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
// 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;
|
||||
$args->trackbackSrlList = $obj->trackbackSrlList;
|
||||
// trackback.getTotalTrackbackList query execution
|
||||
$output = executeQuery('trackback.getTotalTrackbackList', $args);
|
||||
// Return if no result or an error occurs
|
||||
if(!$output->toBool()||!count($output->data)) return $output;
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return trackback count by date
|
||||
* @param strgin $date
|
||||
* @param array $moduleSrlList
|
||||
* @return int
|
||||
*/
|
||||
function getTrackbackCountByDate($date = '', $moduleSrlList = array())
|
||||
if($search_target && $search_keyword)
|
||||
{
|
||||
if($date) $args->regDate = date('Ymd', strtotime($date));
|
||||
if(count($moduleSrlList)>0) $args->module_srl = $moduleSrlList;
|
||||
|
||||
$output = executeQuery('trackback.getTrackbackCount', $args);
|
||||
if(!$output->toBool()) return 0;
|
||||
|
||||
return $output->data->count;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
// 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;
|
||||
$args->trackbackSrlList = $obj->trackbackSrlList;
|
||||
// trackback.getTotalTrackbackList query execution
|
||||
$output = executeQuery('trackback.getTotalTrackbackList', $args);
|
||||
// Return if no result or an error occurs
|
||||
if(!$output->toBool()||!count($output->data)) return $output;
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return trackback count by date
|
||||
* @param strgin $date
|
||||
* @param array $moduleSrlList
|
||||
* @return int
|
||||
*/
|
||||
function getTrackbackCountByDate($date = '', $moduleSrlList = array())
|
||||
{
|
||||
if($date) $args->regDate = date('Ymd', strtotime($date));
|
||||
if(count($moduleSrlList)>0) $args->module_srl = $moduleSrlList;
|
||||
|
||||
$output = executeQuery('trackback.getTrackbackCount', $args);
|
||||
if(!$output->toBool()) return 0;
|
||||
|
||||
return $output->data->count;
|
||||
}
|
||||
}
|
||||
/* End of file trackback.admin.model.php */
|
||||
/* Location: ./modules/trackback/trackback.admin.model.php */
|
||||
|
|
|
|||
|
|
@ -1,56 +1,59 @@
|
|||
<?php
|
||||
/**
|
||||
* trackbackAdminView class
|
||||
* trackback module admin view class
|
||||
*
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @package /modules/trackback
|
||||
* @version 0.1
|
||||
*/
|
||||
class trackbackAdminView extends trackback
|
||||
{
|
||||
/**
|
||||
* trackbackAdminView class
|
||||
* trackback module admin view class
|
||||
*
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @package /modules/trackback
|
||||
* @version 0.1
|
||||
* Initialization
|
||||
* @return void
|
||||
*/
|
||||
class trackbackAdminView extends trackback {
|
||||
/**
|
||||
* Initialization
|
||||
* @return void
|
||||
*/
|
||||
function init() {
|
||||
}
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Display output list (administrative)
|
||||
* @return void
|
||||
*/
|
||||
function dispTrackbackAdminList() {
|
||||
// Wanted set
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('trackback');
|
||||
Context::set('config',$config);
|
||||
/**
|
||||
* Display output list (administrative)
|
||||
* @return void
|
||||
*/
|
||||
function dispTrackbackAdminList()
|
||||
{
|
||||
// Wanted set
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('trackback');
|
||||
Context::set('config',$config);
|
||||
|
||||
// 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
|
||||
// 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'; // / "Sorting values
|
||||
$args->module_srl = Context::get('module_srl');
|
||||
// Get a list
|
||||
$oTrackbackAdminModel = &getAdminModel('trackback');
|
||||
$output = $oTrackbackAdminModel->getTotalTrackbackList($args);
|
||||
$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);
|
||||
//Security
|
||||
$security = new Security();
|
||||
$security->encodeHTML('config.');
|
||||
$security->encodeHTML('trackback_list..');
|
||||
// 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);
|
||||
//Security
|
||||
$security = new Security();
|
||||
$security->encodeHTML('config.');
|
||||
$security->encodeHTML('trackback_list..');
|
||||
|
||||
// Set a template
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('trackback_list');
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
// Set a template
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('trackback_list');
|
||||
}
|
||||
}
|
||||
/* End of file trackback.admin.view.php */
|
||||
/* Location: ./modules/trackback/trackback.admin.view.php */
|
||||
|
|
|
|||
|
|
@ -1,89 +1,94 @@
|
|||
<?php
|
||||
/**
|
||||
* trackback class
|
||||
* trackback module's high class
|
||||
*
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @package /modules/trackback
|
||||
* @version 0.1
|
||||
*/
|
||||
class trackback extends ModuleObject
|
||||
{
|
||||
/**
|
||||
* trackback class
|
||||
* trackback module's high class
|
||||
*
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @package /modules/trackback
|
||||
* @version 0.1
|
||||
* Implement if additional tasks are necessary when installing
|
||||
* @return Object
|
||||
*/
|
||||
class trackback extends ModuleObject {
|
||||
/**
|
||||
* Implement if additional tasks are necessary when installing
|
||||
* @return Object
|
||||
*/
|
||||
function moduleInstall() {
|
||||
// Register action forward (to use in administrator mode)
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->insertActionForward('trackback', 'controller', 'trackback');
|
||||
// 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 modules are deleted when you delete all registered triggers that add Trackbacks
|
||||
$oModuleController->insertTrigger('module.deleteModule', 'trackback', 'controller', 'triggerDeleteModuleTrackbacks', 'after');
|
||||
// 2007. 10. Yeokingeul sent from the popup menu features 18 additional posts
|
||||
$oModuleController->insertTrigger('document.getDocumentMenu', 'trackback', 'controller', 'triggerSendTrackback', 'after');
|
||||
// 2007. 10. The ability to receive 19 additional modular yeokingeul
|
||||
$oModuleController->insertTrigger('module.dispAdditionSetup', 'trackback', 'view', 'triggerDispTrackbackAdditionSetup', 'before');
|
||||
function moduleInstall()
|
||||
{
|
||||
// Register action forward (to use in administrator mode)
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->insertActionForward('trackback', 'controller', 'trackback');
|
||||
// 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 modules are deleted when you delete all registered triggers that add Trackbacks
|
||||
$oModuleController->insertTrigger('module.deleteModule', 'trackback', 'controller', 'triggerDeleteModuleTrackbacks', 'after');
|
||||
// 2007. 10. Yeokingeul sent from the popup menu features 18 additional posts
|
||||
$oModuleController->insertTrigger('document.getDocumentMenu', 'trackback', 'controller', 'triggerSendTrackback', 'after');
|
||||
// 2007. 10. The ability to receive 19 additional modular yeokingeul
|
||||
$oModuleController->insertTrigger('module.dispAdditionSetup', 'trackback', 'view', 'triggerDispTrackbackAdditionSetup', 'before');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* A method to check if successfully installed
|
||||
* @return bool
|
||||
*/
|
||||
function checkUpdate() {
|
||||
$oModuleModel = &getModel('module');
|
||||
// 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 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. Yeokingeul sent from the popup menu features 18 additional posts
|
||||
if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'trackback', 'controller', 'triggerSendTrackback', 'after')) return true;
|
||||
// 2007. 10. The ability to receive 19 additional modular yeokingeul
|
||||
if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'trackback', 'view', 'triggerDispTrackbackAdditionSetup', 'before')) return true;
|
||||
/**
|
||||
* A method to check if successfully installed
|
||||
* @return bool
|
||||
*/
|
||||
function checkUpdate()
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
// 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 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. Yeokingeul sent from the popup menu features 18 additional posts
|
||||
if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'trackback', 'controller', 'triggerSendTrackback', 'after')) return true;
|
||||
// 2007. 10. The ability to receive 19 additional modular yeokingeul
|
||||
if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'trackback', 'view', 'triggerDispTrackbackAdditionSetup', 'before')) return true;
|
||||
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'trackback', 'controller', 'triggerCopyModule', 'after')) return true;
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'trackback', 'controller', 'triggerCopyModule', 'after')) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute update
|
||||
* @return Object
|
||||
*/
|
||||
function moduleUpdate() {
|
||||
$oModuleModel = &getModel('module');
|
||||
$oModuleController = &getController('module');
|
||||
// 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 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. 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. 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');
|
||||
/**
|
||||
* Execute update
|
||||
* @return Object
|
||||
*/
|
||||
function moduleUpdate()
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
$oModuleController = &getController('module');
|
||||
// 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 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. 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. 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');
|
||||
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'trackback', 'controller', 'triggerCopyModule', 'after'))
|
||||
{
|
||||
$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'trackback', 'controller', 'triggerCopyModule', 'after');
|
||||
}
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'trackback', 'controller', 'triggerCopyModule', 'after'))
|
||||
{
|
||||
$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'trackback', 'controller', 'triggerCopyModule', 'after');
|
||||
}
|
||||
|
||||
return new Object(0, 'success_updated');
|
||||
}
|
||||
return new Object(0, 'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
* Re-generate the cache file
|
||||
* @return void
|
||||
*/
|
||||
function recompileCache() {
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
/**
|
||||
* Re-generate the cache file
|
||||
* @return void
|
||||
*/
|
||||
function recompileCache()
|
||||
{
|
||||
}
|
||||
}
|
||||
/* End of file trackback.class.php */
|
||||
/* Location: ./modules/trackback/trackback.class.php */
|
||||
|
|
|
|||
|
|
@ -1,373 +1,393 @@
|
|||
<?php
|
||||
/**
|
||||
* trackbackController class
|
||||
* trackback module's Controller class
|
||||
*
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @package /modules/trackback
|
||||
* @version 0.1
|
||||
*/
|
||||
class trackbackController extends trackback
|
||||
{
|
||||
/**
|
||||
* trackbackController class
|
||||
* trackback module's Controller class
|
||||
*
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @package /modules/trackback
|
||||
* @version 0.1
|
||||
* Initialization
|
||||
* @return void
|
||||
*/
|
||||
class trackbackController extends trackback {
|
||||
/**
|
||||
* Initialization
|
||||
* @return void
|
||||
*/
|
||||
function init() {
|
||||
}
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Trackbacks sent
|
||||
* @return object
|
||||
*/
|
||||
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() || !$oDocument->getSummary()) 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
|
||||
$output = $this->sendTrackback($oDocument, $trackback_url, $charset);
|
||||
if($output->toBool() && !in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
|
||||
global $lang;
|
||||
htmlHeader();
|
||||
alertScript($lang->success_registed);
|
||||
reload(true);
|
||||
closePopupScript();
|
||||
htmlFooter();
|
||||
Context::close();
|
||||
exit;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Trackback List
|
||||
* @return void
|
||||
*/
|
||||
function procTrackbackGetList()
|
||||
/**
|
||||
* Trackbacks sent
|
||||
* @return object
|
||||
*/
|
||||
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() || !$oDocument->getSummary()) 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
|
||||
$output = $this->sendTrackback($oDocument, $trackback_url, $charset);
|
||||
if($output->toBool() && !in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
|
||||
{
|
||||
if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
|
||||
$trackbackSrls = Context::get('trackback_srls');
|
||||
if($trackbackSrls) $trackbackSrlList = explode(',', $trackbackSrls);
|
||||
|
||||
global $lang;
|
||||
if(count($trackbackSrlList) > 0) {
|
||||
$oTrackbackAdminModel = &getAdminModel('trackback');
|
||||
$args->trackbackSrlList = $trackbackSrlList;
|
||||
$args->list_count = 100;
|
||||
$output = $oTrackbackAdminModel->getTotalTrackbackList($args);
|
||||
htmlHeader();
|
||||
alertScript($lang->success_registed);
|
||||
reload(true);
|
||||
closePopupScript();
|
||||
htmlFooter();
|
||||
Context::close();
|
||||
exit;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
if(is_array($output->data)) $trackbackList = $output->data;
|
||||
else
|
||||
{
|
||||
unset($_SESSION['trackback_management']);
|
||||
$trackbackList = array();
|
||||
$this->setMessage($lang->no_trackbacks);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Trackback List
|
||||
* @return void
|
||||
*/
|
||||
function procTrackbackGetList()
|
||||
{
|
||||
if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
|
||||
$trackbackSrls = Context::get('trackback_srls');
|
||||
if($trackbackSrls) $trackbackSrlList = explode(',', $trackbackSrls);
|
||||
|
||||
global $lang;
|
||||
if(count($trackbackSrlList) > 0)
|
||||
{
|
||||
$oTrackbackAdminModel = &getAdminModel('trackback');
|
||||
$args->trackbackSrlList = $trackbackSrlList;
|
||||
$args->list_count = 100;
|
||||
$output = $oTrackbackAdminModel->getTotalTrackbackList($args);
|
||||
|
||||
if(is_array($output->data)) $trackbackList = $output->data;
|
||||
else
|
||||
{
|
||||
unset($_SESSION['trackback_management']);
|
||||
$trackbackList = array();
|
||||
$this->setMessage($lang->no_trackbacks);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$trackbackList = array();
|
||||
$this->setMessage($lang->no_trackbacks);
|
||||
}
|
||||
|
||||
$this->add('trackback_list', $trackbackList);
|
||||
}
|
||||
$this->add('trackback_list', $trackbackList);
|
||||
}
|
||||
|
||||
/**
|
||||
* Trackbacks send documents from the popup menu add a menu
|
||||
* @parma array $menu_list
|
||||
*/
|
||||
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','','popup');
|
||||
/**
|
||||
* Trackbacks send documents from the popup menu add a menu
|
||||
* @parma array $menu_list
|
||||
*/
|
||||
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','','popup');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete document in the document to delete the trigger Trackbacks
|
||||
* @param object $obj
|
||||
* @return Object
|
||||
*/
|
||||
function triggerDeleteDocumentTrackbacks(&$obj) {
|
||||
$document_srl = $obj->document_srl;
|
||||
if(!$document_srl) return new Object();
|
||||
/**
|
||||
* Delete document in the document to delete the trigger Trackbacks
|
||||
* @param object $obj
|
||||
* @return Object
|
||||
*/
|
||||
function triggerDeleteDocumentTrackbacks(&$obj)
|
||||
{
|
||||
$document_srl = $obj->document_srl;
|
||||
if(!$document_srl) return new Object();
|
||||
|
||||
return $this->deleteTrackbacks($document_srl, true);
|
||||
}
|
||||
return $this->deleteTrackbacks($document_srl, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletion module that deletes all the trigger yeokingeul
|
||||
* @param object $obj
|
||||
* @return Object
|
||||
*/
|
||||
function triggerDeleteModuleTrackbacks(&$obj) {
|
||||
$module_srl = $obj->module_srl;
|
||||
if(!$module_srl) return new Object();
|
||||
/**
|
||||
* Deletion module that deletes all the trigger yeokingeul
|
||||
* @param object $obj
|
||||
* @return Object
|
||||
*/
|
||||
function triggerDeleteModuleTrackbacks(&$obj)
|
||||
{
|
||||
$module_srl = $obj->module_srl;
|
||||
if(!$module_srl) return new Object();
|
||||
|
||||
$oTrackbackController = &getAdminController('trackback');
|
||||
return $oTrackbackController->deleteModuleTrackbacks($module_srl);
|
||||
}
|
||||
$oTrackbackController = &getAdminController('trackback');
|
||||
return $oTrackbackController->deleteModuleTrackbacks($module_srl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Trackback inserted
|
||||
* @return Object
|
||||
*/
|
||||
function trackback() {
|
||||
// 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');
|
||||
// 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);
|
||||
$enable_trackback = $config->enable_trackback;
|
||||
if(!$enable_trackback) {
|
||||
$config = $oModuleModel->getModuleConfig('trackback');
|
||||
$enable_trackback = $config->enable_trackback;
|
||||
}
|
||||
|
||||
// If managers were banned does not Trackbacks
|
||||
if($enable_trackback == 'N') return $this->stop('fail');
|
||||
/**
|
||||
* Trackback inserted
|
||||
* @return Object
|
||||
*/
|
||||
function trackback()
|
||||
{
|
||||
// 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');
|
||||
// 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);
|
||||
$enable_trackback = $config->enable_trackback;
|
||||
if(!$enable_trackback)
|
||||
{
|
||||
$config = $oModuleModel->getModuleConfig('trackback');
|
||||
$enable_trackback = $config->enable_trackback;
|
||||
}
|
||||
|
||||
return $this->insertTrackback($obj);
|
||||
}
|
||||
// If managers were banned does not Trackbacks
|
||||
if($enable_trackback == 'N') return $this->stop('fail');
|
||||
|
||||
/**
|
||||
* Trackback inserted
|
||||
* @param object $obj
|
||||
* @param bool $manual_inserted
|
||||
* @return Object
|
||||
*/
|
||||
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);
|
||||
// Call a trigger (before)
|
||||
$output = ModuleHandler::triggerCall('trackback.insertTrackback', 'before', $obj);
|
||||
if(!$output->toBool()) return $output;
|
||||
// Document_srl see passed in GET, if an error ~
|
||||
$document_srl = $obj->document_srl;
|
||||
return $this->insertTrackback($obj);
|
||||
}
|
||||
|
||||
if(!$manual_inserted) {
|
||||
// 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');
|
||||
/**
|
||||
* Trackback inserted
|
||||
* @param object $obj
|
||||
* @param bool $manual_inserted
|
||||
* @return Object
|
||||
*/
|
||||
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);
|
||||
// Call a trigger (before)
|
||||
$output = ModuleHandler::triggerCall('trackback.insertTrackback', 'before', $obj);
|
||||
if(!$output->toBool()) return $output;
|
||||
// Document_srl see passed in GET, if an error ~
|
||||
$document_srl = $obj->document_srl;
|
||||
|
||||
$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 object creation
|
||||
$oTrackbackModel = &getModel('trackback');
|
||||
// All the article number yeokingeul guhaeom
|
||||
$trackback_count = $oTrackbackModel->getTrackbackCount($document_srl);
|
||||
// document controller object creation
|
||||
$oDocumentController = &getController('document');
|
||||
// Update the number of posts that yeokingeul
|
||||
$output = $oDocumentController->updateTrackbackCount($document_srl, $trackback_count);
|
||||
// Return result
|
||||
if(!$output->toBool()) return $output;
|
||||
}
|
||||
// Notify wonbongeul (notify_message) if there is a Send a message
|
||||
if(!$manual_inserted) $oDocument->notify(Context::getLang('trackback'), $obj->excerpt);
|
||||
// Call a trigger (after)
|
||||
$output = ModuleHandler::triggerCall('trackback.insertTrackback', 'after', $obj);
|
||||
if(!$output->toBool()) return $output;
|
||||
if(!$manual_inserted)
|
||||
{
|
||||
// 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');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
$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 object creation
|
||||
$oTrackbackModel = &getModel('trackback');
|
||||
// All the article number yeokingeul guhaeom
|
||||
$trackback_count = $oTrackbackModel->getTrackbackCount($document_srl);
|
||||
// document controller object creation
|
||||
$oDocumentController = &getController('document');
|
||||
// Update the number of posts that yeokingeul
|
||||
$output = $oDocumentController->updateTrackbackCount($document_srl, $trackback_count);
|
||||
// Return result
|
||||
if(!$output->toBool()) return $output;
|
||||
}
|
||||
// Notify wonbongeul (notify_message) if there is a Send a message
|
||||
if(!$manual_inserted) $oDocument->notify(Context::getLang('trackback'), $obj->excerpt);
|
||||
// Call a trigger (after)
|
||||
$output = ModuleHandler::triggerCall('trackback.insertTrackback', 'after', $obj);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
/**
|
||||
* Deleting a single yeokingeul
|
||||
* @param int $trackback_srl
|
||||
* @param bool $is_admin
|
||||
* @return object
|
||||
*/
|
||||
function deleteTrackback($trackback_srl, $is_admin = false) {
|
||||
// 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;
|
||||
// Call a trigger (before)
|
||||
$output = ModuleHandler::triggerCall('trackback.deleteTrackback', 'before', $trackback);
|
||||
if(!$output->toBool()) return $output;
|
||||
// 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');
|
||||
return new Object();
|
||||
}
|
||||
|
||||
$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 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);
|
||||
// Call a trigger (before)
|
||||
$output = ModuleHandler::triggerCall('trackback.deleteTrackback', 'after', $trackback);
|
||||
if(!$output->toBool()) return $output;
|
||||
/**
|
||||
* Deleting a single yeokingeul
|
||||
* @param int $trackback_srl
|
||||
* @param bool $is_admin
|
||||
* @return object
|
||||
*/
|
||||
function deleteTrackback($trackback_srl, $is_admin = false)
|
||||
{
|
||||
// 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;
|
||||
// Call a trigger (before)
|
||||
$output = ModuleHandler::triggerCall('trackback.deleteTrackback', 'before', $trackback);
|
||||
if(!$output->toBool()) return $output;
|
||||
// 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');
|
||||
|
||||
return $output;
|
||||
}
|
||||
$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 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);
|
||||
// Call a trigger (before)
|
||||
$output = ModuleHandler::triggerCall('trackback.deleteTrackback', 'after', $trackback);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
/**
|
||||
* Delete All RSS Trackback
|
||||
* @param int $document_srl
|
||||
* @return object
|
||||
*/
|
||||
function deleteTrackbacks($document_srl) {
|
||||
// Delete
|
||||
$args->document_srl = $document_srl;
|
||||
$output = executeQuery('trackback.deleteTrackbacks', $args);
|
||||
return $output;
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
/**
|
||||
* Delete All RSS Trackback
|
||||
* @param int $document_srl
|
||||
* @return object
|
||||
*/
|
||||
function deleteTrackbacks($document_srl)
|
||||
{
|
||||
// Delete
|
||||
$args->document_srl = $document_srl;
|
||||
$output = executeQuery('trackback.deleteTrackbacks', $args);
|
||||
|
||||
/**
|
||||
* Trackbacks sent to
|
||||
* After sending the results are not sticky and handling
|
||||
* @param documentItem $oDocument
|
||||
* @param string $trackback_url
|
||||
* @param string $charset
|
||||
* @return Object
|
||||
*/
|
||||
function sendTrackback($oDocument, $trackback_url, $charset) {
|
||||
$oModuleController = &getController('module');
|
||||
return $output;
|
||||
}
|
||||
|
||||
// Information sent by
|
||||
$http = parse_url($trackback_url);
|
||||
/**
|
||||
* Trackbacks sent to
|
||||
* After sending the results are not sticky and handling
|
||||
* @param documentItem $oDocument
|
||||
* @param string $trackback_url
|
||||
* @param string $charset
|
||||
* @return Object
|
||||
*/
|
||||
function sendTrackback($oDocument, $trackback_url, $charset)
|
||||
{
|
||||
$oModuleController = &getController('module');
|
||||
|
||||
$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);
|
||||
// Information sent by
|
||||
$http = parse_url($trackback_url);
|
||||
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
$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);
|
||||
|
||||
$content =
|
||||
sprintf(
|
||||
"title=%s&".
|
||||
"url=%s&".
|
||||
"blog_name=%s&".
|
||||
"excerpt=%s",
|
||||
urlencode($obj->title),
|
||||
urlencode($obj->url),
|
||||
urlencode($obj->blog_name),
|
||||
urlencode($obj->excerpt)
|
||||
);
|
||||
|
||||
$buff = FileHandler::getRemoteResource($trackback_url, $content, 3, 'POST', 'application/x-www-form-urlencoded');
|
||||
|
||||
$oXmlParser = new XmlParser();
|
||||
$xmlDoc = $oXmlParser->parse($buff);
|
||||
|
||||
if($xmlDoc->response->error->body == '0')
|
||||
// blog_name, title, excerpt, url charset of the string to the requested change
|
||||
if($charset && function_exists('iconv'))
|
||||
{
|
||||
foreach($obj as $key=>$val)
|
||||
{
|
||||
return new Object(0, 'msg_trackback_send_success');
|
||||
$obj->{$key} = iconv('UTF-8',$charset,$val);
|
||||
}
|
||||
}
|
||||
|
||||
$content = sprintf(
|
||||
"title=%s&".
|
||||
"url=%s&".
|
||||
"blog_name=%s&".
|
||||
"excerpt=%s",
|
||||
urlencode($obj->title),
|
||||
urlencode($obj->url),
|
||||
urlencode($obj->blog_name),
|
||||
urlencode($obj->excerpt)
|
||||
);
|
||||
|
||||
$buff = FileHandler::getRemoteResource($trackback_url, $content, 3, 'POST', 'application/x-www-form-urlencoded');
|
||||
|
||||
$oXmlParser = new XmlParser();
|
||||
$xmlDoc = $oXmlParser->parse($buff);
|
||||
|
||||
if($xmlDoc->response->error->body == '0')
|
||||
{
|
||||
return new Object(0, 'msg_trackback_send_success');
|
||||
}
|
||||
else
|
||||
{
|
||||
if($xmlDoc->response->message->body)
|
||||
{
|
||||
return new Object(-1, sprintf('%s: %s', Context::getLang('msg_trackback_send_failed'), $xmlDoc->response->message->body));
|
||||
}
|
||||
else
|
||||
{
|
||||
if($xmlDoc->response->message->body)
|
||||
{
|
||||
return new Object(-1, sprintf('%s: %s', Context::getLang('msg_trackback_send_failed'), $xmlDoc->response->message->body));
|
||||
}
|
||||
else
|
||||
{
|
||||
return new Object(-1, 'msg_trackback_send_failed');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Within a specific time of a specific ipaddress Trackbacks delete all
|
||||
* @param int $time
|
||||
* @param string $ipaddress
|
||||
* @param string $url
|
||||
* @param string $blog_name
|
||||
* @param string $title
|
||||
* @param string $excerpt
|
||||
* @return void
|
||||
*/
|
||||
function deleteTrackbackSender($time, $ipaddress, $url, $blog_name, $title, $excerpt) {
|
||||
$obj->regdate = date("YmdHis",time()-$time);
|
||||
$obj->ipaddress = $ipaddress;
|
||||
$obj->url = $url;
|
||||
$obj->blog_name = $blog_name;
|
||||
$obj->title = $title;
|
||||
$obj->excerpt = $excerpt;
|
||||
$output = executeQueryArray('trackback.getRegistedTrackbacks', $obj);
|
||||
if(!$output->data || !count($output->data)) return;
|
||||
|
||||
foreach($output->data as $trackback) {
|
||||
$trackback_srl = $trackback->trackback_srl;
|
||||
$this->deleteTrackback($trackback_srl, true);
|
||||
}
|
||||
}
|
||||
|
||||
function triggerCopyModule(&$obj)
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
$trackbackConfig = $oModuleModel->getModulePartConfig('trackback', $obj->originModuleSrl);
|
||||
|
||||
$oModuleController = &getController('module');
|
||||
if(is_array($obj->moduleSrlList))
|
||||
{
|
||||
foreach($obj->moduleSrlList AS $key=>$moduleSrl)
|
||||
{
|
||||
$oModuleController->insertModulePartConfig('trackback', $moduleSrl, $trackbackConfig);
|
||||
}
|
||||
return new Object(-1, 'msg_trackback_send_failed');
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
}
|
||||
|
||||
/**
|
||||
* Within a specific time of a specific ipaddress Trackbacks delete all
|
||||
* @param int $time
|
||||
* @param string $ipaddress
|
||||
* @param string $url
|
||||
* @param string $blog_name
|
||||
* @param string $title
|
||||
* @param string $excerpt
|
||||
* @return void
|
||||
*/
|
||||
function deleteTrackbackSender($time, $ipaddress, $url, $blog_name, $title, $excerpt)
|
||||
{
|
||||
$obj->regdate = date("YmdHis",time()-$time);
|
||||
$obj->ipaddress = $ipaddress;
|
||||
$obj->url = $url;
|
||||
$obj->blog_name = $blog_name;
|
||||
$obj->title = $title;
|
||||
$obj->excerpt = $excerpt;
|
||||
$output = executeQueryArray('trackback.getRegistedTrackbacks', $obj);
|
||||
if(!$output->data || !count($output->data)) return;
|
||||
|
||||
foreach($output->data as $trackback)
|
||||
{
|
||||
$trackback_srl = $trackback->trackback_srl;
|
||||
$this->deleteTrackback($trackback_srl, true);
|
||||
}
|
||||
}
|
||||
|
||||
function triggerCopyModule(&$obj)
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
$trackbackConfig = $oModuleModel->getModulePartConfig('trackback', $obj->originModuleSrl);
|
||||
|
||||
$oModuleController = &getController('module');
|
||||
if(is_array($obj->moduleSrlList))
|
||||
{
|
||||
foreach($obj->moduleSrlList AS $key=>$moduleSrl)
|
||||
{
|
||||
$oModuleController->insertModulePartConfig('trackback', $moduleSrl, $trackbackConfig);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* End of file trackback.controller.php */
|
||||
/* Location: ./modules/trackback/trackback.controller.php */
|
||||
|
|
|
|||
|
|
@ -1,180 +1,193 @@
|
|||
<?php
|
||||
/**
|
||||
* trackbackModel class
|
||||
* trackback module model class
|
||||
*
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @package /modules/trackback
|
||||
* @version 0.1
|
||||
*/
|
||||
class trackbackModel extends trackback
|
||||
{
|
||||
/**
|
||||
* trackbackModel class
|
||||
* trackback module model class
|
||||
*
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @package /modules/trackback
|
||||
* @version 0.1
|
||||
* Initialization
|
||||
* @return void
|
||||
*/
|
||||
class trackbackModel extends trackback {
|
||||
/**
|
||||
* Initialization
|
||||
* @return void
|
||||
*/
|
||||
function init() {
|
||||
}
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Wanted a trackback information
|
||||
* @param int $trackback_srl
|
||||
* @param array $columnList
|
||||
* @return object
|
||||
*/
|
||||
function getTrackback($trackback_srl, $columnList = array()) {
|
||||
$args->trackback_srl = $trackback_srl;
|
||||
$output = executeQuery('trackback.getTrackback', $args, $columnList);
|
||||
return $output;
|
||||
}
|
||||
/**
|
||||
* Wanted a trackback information
|
||||
* @param int $trackback_srl
|
||||
* @param array $columnList
|
||||
* @return object
|
||||
*/
|
||||
function getTrackback($trackback_srl, $columnList = array())
|
||||
{
|
||||
$args->trackback_srl = $trackback_srl;
|
||||
$output = executeQuery('trackback.getTrackback', $args, $columnList);
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Trackbacks document_srl corresponding to the bringing of the total number of
|
||||
* @param int $document_srl
|
||||
* @return int
|
||||
*/
|
||||
function getTrackbackCount($document_srl) {
|
||||
$args->document_srl = $document_srl;
|
||||
$output = executeQuery('trackback.getTrackbackCount', $args);
|
||||
$total_count = $output->data->count;
|
||||
/**
|
||||
* Trackbacks document_srl corresponding to the bringing of the total number of
|
||||
* @param int $document_srl
|
||||
* @return int
|
||||
*/
|
||||
function getTrackbackCount($document_srl)
|
||||
{
|
||||
$args->document_srl = $document_srl;
|
||||
$output = executeQuery('trackback.getTrackbackCount', $args);
|
||||
$total_count = $output->data->count;
|
||||
|
||||
return (int)$total_count;
|
||||
}
|
||||
return (int)$total_count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Trackbacks module_srl corresponding to the bringing of the total number of
|
||||
* @param int $module_srl
|
||||
* @return int
|
||||
*/
|
||||
function getTrackbackAllCount($module_srl)
|
||||
{
|
||||
$args->module_srl = $module_srl;
|
||||
$output = executeQuery('trackback.getTrackbackCount', $args);
|
||||
$total_count = $output->data->count;
|
||||
|
||||
/**
|
||||
* Trackbacks module_srl corresponding to the bringing of the total number of
|
||||
* @param int $module_srl
|
||||
* @return int
|
||||
*/
|
||||
function getTrackbackAllCount($module_srl) {
|
||||
$args->module_srl = $module_srl;
|
||||
$output = executeQuery('trackback.getTrackbackCount', $args);
|
||||
$total_count = $output->data->count;
|
||||
return (int)$total_count;
|
||||
}
|
||||
|
||||
return (int)$total_count;
|
||||
}
|
||||
/**
|
||||
* For a particular document to a specific ip number of trackbacks recorded
|
||||
* Im spamfilter method used in
|
||||
* @param int $document_srl
|
||||
* @param string $ipaddress
|
||||
* @return int
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* For a particular document to a specific ip number of trackbacks recorded
|
||||
* Im spamfilter method used in
|
||||
* @param int $document_srl
|
||||
* @param string $ipaddress
|
||||
* @return int
|
||||
*/
|
||||
function getTrackbackCountByIPAddress($document_srl, $ipaddress) {
|
||||
$args->document_srl = $document_srl;
|
||||
$args->ipaddress = $ipaddress;
|
||||
$output = executeQuery('trackback.getTrackbackCountByIPAddress', $args);
|
||||
$total_count = $output->data->count;
|
||||
/**
|
||||
* Trackbacks certain documents belonging to the bringing of the list
|
||||
* @param int $document_srl
|
||||
* @return array
|
||||
*/
|
||||
function getTrackbackList($document_srl)
|
||||
{
|
||||
$args->document_srl = $document_srl;
|
||||
$args->list_order = 'list_order';
|
||||
$output = executeQuery('trackback.getTrackbackList', $args);
|
||||
|
||||
return (int)$total_count;
|
||||
}
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
/**
|
||||
* Trackbacks certain documents belonging to the bringing of the list
|
||||
* @param int $document_srl
|
||||
* @return array
|
||||
*/
|
||||
function getTrackbackList($document_srl) {
|
||||
$args->document_srl = $document_srl;
|
||||
$args->list_order = 'list_order';
|
||||
$output = executeQuery('trackback.getTrackbackList', $args);
|
||||
$trackback_list = $output->data;
|
||||
|
||||
if(!$output->toBool()) return $output;
|
||||
if(!is_array($trackback_list)) $trackback_list = array($trackback_list);
|
||||
|
||||
$trackback_list = $output->data;
|
||||
return $trackback_list;
|
||||
}
|
||||
|
||||
if(!is_array($trackback_list)) $trackback_list = array($trackback_list);
|
||||
/**
|
||||
* Bringing a mid Trackbacks
|
||||
* @param object $obj
|
||||
* @return object
|
||||
*/
|
||||
function getNewestTrackbackList($obj)
|
||||
{
|
||||
if($obj->mid)
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
$obj->module_srl = $oModuleModel->getModuleSrlByMid($obj->mid);
|
||||
unset($obj->mid);
|
||||
}
|
||||
// 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;
|
||||
if($obj->site_srl) $args->site_srl = (int)$obj->site_srl;
|
||||
$args->sort_index = 'trackbacks.list_order';
|
||||
$args->order = 'asc';
|
||||
|
||||
return $trackback_list;
|
||||
}
|
||||
$output = executeQueryArray('trackback.getNewestTrackbackList', $args);
|
||||
|
||||
/**
|
||||
* Bringing a mid Trackbacks
|
||||
* @param object $obj
|
||||
* @return object
|
||||
*/
|
||||
function getNewestTrackbackList($obj) {
|
||||
if($obj->mid) {
|
||||
$oModuleModel = &getModel('module');
|
||||
$obj->module_srl = $oModuleModel->getModuleSrlByMid($obj->mid);
|
||||
unset($obj->mid);
|
||||
}
|
||||
// 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;
|
||||
if($obj->site_srl) $args->site_srl = (int)$obj->site_srl;
|
||||
$args->sort_index = 'trackbacks.list_order';
|
||||
$args->order = 'asc';
|
||||
return $output;
|
||||
}
|
||||
|
||||
$output = executeQueryArray('trackback.getNewestTrackbackList', $args);
|
||||
/**
|
||||
* Return to a specific set of modules trackback
|
||||
* @param int $module_srl
|
||||
* @return object
|
||||
*/
|
||||
function getTrackbackModuleConfig($module_srl)
|
||||
{
|
||||
// Bringing trackback module config
|
||||
$oModuleModel = &getModel('module');
|
||||
$module_trackback_config = $oModuleModel->getModulePartConfig('trackback', $module_srl);
|
||||
if(!$module_trackback_config)
|
||||
{
|
||||
$trackback_config = $oModuleModel->getModuleConfig('trackback');
|
||||
$module_trackback_config->enable_trackback = $trackback_config->enable_trackback!='N'?'Y':'N';
|
||||
}
|
||||
$module_trackback_config->module_srl = $module_srl;
|
||||
return $module_trackback_config;
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return to a specific set of modules trackback
|
||||
* @param int $module_srl
|
||||
* @return object
|
||||
*/
|
||||
function getTrackbackModuleConfig($module_srl) {
|
||||
// Bringing trackback module config
|
||||
$oModuleModel = &getModel('module');
|
||||
$module_trackback_config = $oModuleModel->getModulePartConfig('trackback', $module_srl);
|
||||
if(!$module_trackback_config) {
|
||||
$trackback_config = $oModuleModel->getModuleConfig('trackback');
|
||||
$module_trackback_config->enable_trackback = $trackback_config->enable_trackback!='N'?'Y':'N';
|
||||
}
|
||||
$module_trackback_config->module_srl = $module_srl;
|
||||
return $module_trackback_config;
|
||||
}
|
||||
/**
|
||||
* Fixed in time for the entire yeokingeul Wanted to Register
|
||||
* @param int $time
|
||||
* @param string $ipaddress
|
||||
* @param string $url
|
||||
* @param string $blog_name
|
||||
* @param string $title
|
||||
* @param string excerpt
|
||||
* @return int
|
||||
*/
|
||||
function getRegistedTrackback($time, $ipaddress, $url, $blog_name, $title, $excerpt)
|
||||
{
|
||||
$obj->regdate = date("YmdHis",time()-$time);
|
||||
$obj->ipaddress = $ipaddress;
|
||||
$obj->url = $url;
|
||||
$obj->blog_name = $blog_name;
|
||||
$obj->title = $title;
|
||||
$obj->excerpt = $excerpt;
|
||||
$output = executeQuery('trackback.getRegistedTrackback', $obj);
|
||||
return $output->data->count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fixed in time for the entire yeokingeul Wanted to Register
|
||||
* @param int $time
|
||||
* @param string $ipaddress
|
||||
* @param string $url
|
||||
* @param string $blog_name
|
||||
* @param string $title
|
||||
* @param string excerpt
|
||||
* @return int
|
||||
*/
|
||||
function getRegistedTrackback($time, $ipaddress, $url, $blog_name, $title, $excerpt) {
|
||||
$obj->regdate = date("YmdHis",time()-$time);
|
||||
$obj->ipaddress = $ipaddress;
|
||||
$obj->url = $url;
|
||||
$obj->blog_name = $blog_name;
|
||||
$obj->title = $title;
|
||||
$obj->excerpt = $excerpt;
|
||||
$output = executeQuery('trackback.getRegistedTrackback', $obj);
|
||||
return $output->data->count;
|
||||
}
|
||||
/**
|
||||
* Return by creating a trackback url
|
||||
* Adds the key value in the trackback url.
|
||||
* @param int $document_srl
|
||||
* @return string
|
||||
*/
|
||||
function getTrackbackUrl($document_srl, $mid = NULL)
|
||||
{
|
||||
$url = getFullUrl('', 'mid', $mid, 'document_srl',$document_srl,'act','trackback','key',$this->getTrackbackKey($document_srl));
|
||||
return $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return by creating a trackback url
|
||||
* Adds the key value in the trackback url.
|
||||
* @param int $document_srl
|
||||
* @return string
|
||||
*/
|
||||
function getTrackbackUrl($document_srl, $mid = NULL) {
|
||||
$url = getFullUrl('', 'mid', $mid, 'document_srl',$document_srl,'act','trackback','key',$this->getTrackbackKey($document_srl));
|
||||
return $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @param int $document_srl
|
||||
* @return string
|
||||
*/
|
||||
function getTrackbackKey($document_srl) {
|
||||
$time = (int) (time()/(60*10));
|
||||
$db_info = Context::getDBInfo();
|
||||
$key = md5($document_srl.$db_info->db_password.$time);
|
||||
return sprintf("%s%s%s",substr($key,1,1),substr($key,10,1),substr($key,20,1));
|
||||
}
|
||||
}
|
||||
?>
|
||||
/**
|
||||
* 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
|
||||
* @param int $document_srl
|
||||
* @return string
|
||||
*/
|
||||
function getTrackbackKey($document_srl)
|
||||
{
|
||||
$time = (int) (time()/(60*10));
|
||||
$db_info = Context::getDBInfo();
|
||||
$key = md5($document_srl.$db_info->db_password.$time);
|
||||
return sprintf("%s%s%s",substr($key,1,1),substr($key,10,1),substr($key,20,1));
|
||||
}
|
||||
}
|
||||
/* End of file trackback.model.php */
|
||||
/* Location: ./modules/trackback/trackback.model.php */
|
||||
|
|
|
|||
|
|
@ -1,71 +1,77 @@
|
|||
<?php
|
||||
/**
|
||||
* @class trackbackView
|
||||
* @brief trackback module's view class
|
||||
*
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @package /modules/trackback
|
||||
* @version 0.1
|
||||
*/
|
||||
class trackbackView extends trackback
|
||||
{
|
||||
/**
|
||||
* @class trackbackView
|
||||
* @brief trackback module's view class
|
||||
*
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @package /modules/trackback
|
||||
* @version 0.1
|
||||
* Initialization
|
||||
* @return void
|
||||
*/
|
||||
class trackbackView extends trackback {
|
||||
/**
|
||||
* Initialization
|
||||
* @return void
|
||||
*/
|
||||
function init() {
|
||||
}
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Display output list (administrative)
|
||||
* @return void
|
||||
*/
|
||||
function dispTrackbackSend() {
|
||||
$document_srl = Context::get('document_srl');
|
||||
if(!$document_srl) return $this->stop('msg_invalid_request');
|
||||
/**
|
||||
* Display output list (administrative)
|
||||
* @return void
|
||||
*/
|
||||
function dispTrackbackSend()
|
||||
{
|
||||
$document_srl = Context::get('document_srl');
|
||||
if(!$document_srl) return $this->stop('msg_invalid_request');
|
||||
|
||||
$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');
|
||||
if($oDocument->isSecret()) return $this->stop('msg_invalid_request');
|
||||
$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');
|
||||
if($oDocument->isSecret()) return $this->stop('msg_invalid_request');
|
||||
|
||||
if($oDocument->getMemberSrl() != $logged_info->member_srl) return $this->stop('msg_not_permitted');
|
||||
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');
|
||||
}
|
||||
Context::set('oDocument', $oDocument);
|
||||
// Set a template
|
||||
$this->setLayoutFile('popup_layout');
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('send_trackback_form');
|
||||
}
|
||||
|
||||
/**
|
||||
* An additional set of parts for a service module
|
||||
* Use the form out of the settings for trackback
|
||||
* @param string $obj
|
||||
* @return Object
|
||||
*/
|
||||
function triggerDispTrackbackAdditionSetup(&$obj) {
|
||||
$current_module_srl = Context::get('module_srl');
|
||||
$current_module_srls = Context::get('module_srls');
|
||||
/**
|
||||
* An additional set of parts for a service module
|
||||
* Use the form out of the settings for trackback
|
||||
* @param string $obj
|
||||
* @return Object
|
||||
*/
|
||||
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();
|
||||
}
|
||||
// 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;
|
||||
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();
|
||||
}
|
||||
// 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;
|
||||
|
||||
return new Object();
|
||||
}
|
||||
}
|
||||
?>
|
||||
return new Object();
|
||||
}
|
||||
}
|
||||
/* End of file trackback.view.php */
|
||||
/* Location: ./modules/trackback/trackback.view.php */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue