mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 19:21:40 +09:00
Syndication API를 XE Core에 추가
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7640 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
ee1fc6237a
commit
1675d4c8d9
38 changed files with 1025 additions and 0 deletions
9
modules/syndication/a
Normal file
9
modules/syndication/a
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
rm -rf ./.svn
|
||||
rm -rf ./schemas/.svn
|
||||
rm -rf ./lang/.svn
|
||||
rm -rf ./tpl/js/.svn
|
||||
rm -rf ./tpl/filter/.svn
|
||||
rm -rf ./tpl/.svn
|
||||
rm -rf ./tpl/css/.svn
|
||||
rm -rf ./queries/.svn
|
||||
rm -rf ./conf/.svn
|
||||
12
modules/syndication/conf/info.xml
Normal file
12
modules/syndication/conf/info.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module version="0.2">
|
||||
<title xml:lang="ko">Syndication</title>
|
||||
<description xml:lang="ko">검색서비스업체와 직접 통신을 통해 컨텐츠를 잘 검색되도록 하는 Syndication 규약을 따라 정보를 주고받는 모듈</description>
|
||||
<version>0.2</version>
|
||||
<date>2010-03-12</date>
|
||||
<category>interlock</category>
|
||||
|
||||
<author email_address="developers@xpressengine.com" link="http://dev.naver.com/projects/syndication">
|
||||
<name xml:lang="ko">XE</name>
|
||||
</author>
|
||||
</module>
|
||||
12
modules/syndication/conf/module.xml
Normal file
12
modules/syndication/conf/module.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<module>
|
||||
<grants />
|
||||
<permissions />
|
||||
<actions>
|
||||
<action name="getSyndicationList" type="model" standalone="true" />
|
||||
|
||||
<action name="dispSyndicationAdminConfig" type="view" standalone="true" admin_index="true" />
|
||||
|
||||
<action name="procSyndicationAdminInsertService" type="controller" standalone="true" />
|
||||
</actions>
|
||||
</module>
|
||||
16
modules/syndication/lang/ko.lang.php
Normal file
16
modules/syndication/lang/ko.lang.php
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
$lang->syndication = '신디케이션';
|
||||
$lang->about_syndication = '신디케이션이란 검색 서비스 업체와 syndication 이라는 표준 규약을 통해서 보다 더 잘 검색되게 하는 기능입니다.<br/>최소한의 요청만으로 효과적으로 컨텐츠를 검색 서비스 업체와 동기화합니다';
|
||||
|
||||
$lang->syndication_service = '신디케이션 서비스';
|
||||
$lang->about_syndication_service = '신디케이션 표준 규약에 맞춰 신디케이션 서비스를 제공하는 곳입니다.<br/>[적용하기] 버튼을 선택하시면 선택 또는 해제된 서비스에 Ping 을 통해서 결과를 통보하게 됩니다';
|
||||
|
||||
$lang->my_syndication_url = '사이트 주소';
|
||||
$lang->about_my_syndication_url = '신디케이션 정보를 제공할때 사용되는 사이트의 주소를 입력해주세요. 이 주소는 대표 주소를 이용해주시고 가능한 바꾸시지 않는 것이 좋습니다';
|
||||
|
||||
$lang->except_module = '제외시킬 모듈';
|
||||
$lang->about_except_module = '신디케이션 대상에서 제외시켜 검색서비스 업체와 동기화를 시키지 않을 모듈을 선택해주세요';
|
||||
|
||||
$lang->msg_site_url_is_null = '사이트 주소를 입력해주세요';
|
||||
$lang->success_applied = '적용되었습니다';
|
||||
?>
|
||||
5
modules/syndication/queries/deleteExceptModules.xml
Normal file
5
modules/syndication/queries/deleteExceptModules.xml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<query id="deleteExceptModules" action="delete">
|
||||
<tables>
|
||||
<table name="syndication_except_modules" />
|
||||
</tables>
|
||||
</query>
|
||||
19
modules/syndication/queries/getDeletedList.xml
Normal file
19
modules/syndication/queries/getDeletedList.xml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<query id="getDeletedList" action="select">
|
||||
<tables>
|
||||
<table name="syndication_logs" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="*" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="module_srl" var="module_srl" filter="number" />
|
||||
<condition operation="more" column="regdate" var="start_date" filter="number" pipe="and" />
|
||||
<condition operation="less" column="regdate" var="end_date" filter="number" pipe="and" />
|
||||
</conditions>
|
||||
<navigation>
|
||||
<index var="sort_index" default="log_srl" order="asc" />
|
||||
<list_count var="list_count" default="100" />
|
||||
<page_count var="page_count" default="10" />
|
||||
<page var="page" default="1" />
|
||||
</navigation>
|
||||
</query>
|
||||
31
modules/syndication/queries/getDocumentList.xml
Normal file
31
modules/syndication/queries/getDocumentList.xml
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<query id="getDocumentList" action="select">
|
||||
<tables>
|
||||
<table name="documents" alias="doc" />
|
||||
<table name="modules" alias="modules" />
|
||||
<table name="syndication_except_modules" alias="except_modules" type="left join">
|
||||
<conditions>
|
||||
<condition operation="equal" column="modules.module_srl" default="except_modules.module_srl" />
|
||||
</conditions>
|
||||
</table>
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="doc.*" />
|
||||
<column name="modules.mid" alias="mid" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="doc.module_srl" var="module_srl" filter="number" />
|
||||
<condition operation="notin" column="doc.module_srl" var="except_module_srls" pipe="and" />
|
||||
<condition operation="null" column="except_modules.module_srl" default="1" pipe="and" />
|
||||
<condition operation="equal" column="doc.is_secret" default="N" pipe="and" />
|
||||
<condition operation="equal" column="modules.module_srl" default="doc.module_srl" filter="number" pipe="and" />
|
||||
<condition operation="notin" column="modules.module_srl" var="except_modules" filter="numbers" pipe="and" />
|
||||
<condition operation="more" column="doc.last_update" var="start_date" filter="number" pipe="and" />
|
||||
<condition operation="less" column="doc.last_update" var="end_date" filter="number" pipe="and" />
|
||||
</conditions>
|
||||
<navigation>
|
||||
<index var="sort_index" default="doc.update_order" order="asc" />
|
||||
<list_count var="list_count" default="100" />
|
||||
<page_count var="page_count" default="10" />
|
||||
<page var="page" default="1" />
|
||||
</navigation>
|
||||
</query>
|
||||
11
modules/syndication/queries/getExceptModule.xml
Normal file
11
modules/syndication/queries/getExceptModule.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<query id="getExceptModule" action="select">
|
||||
<tables>
|
||||
<table name="syndication_except_modules" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="count(*)" alias="count" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="module_srl" var="module_srl" filter="number" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
14
modules/syndication/queries/getExceptModules.xml
Normal file
14
modules/syndication/queries/getExceptModules.xml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<query id="getExceptModules" action="select">
|
||||
<tables>
|
||||
<table name="syndication_except_modules" />
|
||||
<table name="modules" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="syndication_except_modules.*" />
|
||||
<column name="modules.mid" alias="mid" />
|
||||
<column name="modules.browser_title" alias="browser_title" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="syndication_except_modules.module_srl" default="modules.module_srl" filter="number" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
17
modules/syndication/queries/getGrantedModule.xml
Normal file
17
modules/syndication/queries/getGrantedModule.xml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<query id="getGrantedModule" action="select">
|
||||
<tables>
|
||||
<table name="module_grants" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="count(*)" alias="count" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="module_srl" var="module_srl" filter="number" notnull="notnull" />
|
||||
<condition operation="in" column="name" default="'access','view','list'" notnull="notnull" pipe="and" />
|
||||
<group pipe="and">
|
||||
<condition operation="more" column="group_srl" default="1" notnull="notnull" />
|
||||
<condition operation="equal" column="group_srl" default="-1" notnull="notnull" pipe="or" />
|
||||
<condition operation="equal" column="group_srl" default="-2" notnull="notnull" pipe="or" />
|
||||
</group>
|
||||
</conditions>
|
||||
</query>
|
||||
19
modules/syndication/queries/getGrantedModules.xml
Normal file
19
modules/syndication/queries/getGrantedModules.xml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<query id="getGrantedModules" action="select">
|
||||
<tables>
|
||||
<table name="module_grants" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="module_srl" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="in" column="name" default="'access','view','list'" notnull="notnull" />
|
||||
<group pipe="and">
|
||||
<condition operation="more" column="group_srl" default="1" notnull="notnull" />
|
||||
<condition operation="equal" column="group_srl" default="-1" notnull="notnull" pipe="or" />
|
||||
<condition operation="equal" column="group_srl" default="-2" notnull="notnull" pipe="or" />
|
||||
</group>
|
||||
</conditions>
|
||||
<groups>
|
||||
<group column="module_srl" />
|
||||
</groups>
|
||||
</query>
|
||||
12
modules/syndication/queries/getLang.xml
Normal file
12
modules/syndication/queries/getLang.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<query id="getLang" action="select">
|
||||
<tables>
|
||||
<table name="lang" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="*" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="site_srl" var="site_srl" notnull="notnull" filter="number" />
|
||||
<condition operation="equal" column="lang_code" var="lang_code" pipe="and" />
|
||||
</conditions>
|
||||
</query>
|
||||
15
modules/syndication/queries/getModuleSiteInfo.xml
Normal file
15
modules/syndication/queries/getModuleSiteInfo.xml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<query id="getModuleSiteInfo" action="select">
|
||||
<tables>
|
||||
<table name="modules" alias="modules" />
|
||||
<table name="sites" alias="sites" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="modules.module_srl" alias="module_srl" />
|
||||
<column name="modules.mid" alias="mid" />
|
||||
<column name="sites.domain" alias="domain" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="modules.module_srl" var="module_srl" filter="number" />
|
||||
<condition operation="equal" column="sites.site_srl" default="modules.site_srl" notnull="notnull" filter="number" pipe="and" />
|
||||
</conditions>
|
||||
</query>
|
||||
26
modules/syndication/queries/getModules.xml
Normal file
26
modules/syndication/queries/getModules.xml
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<query id="getModules" action="select">
|
||||
<tables>
|
||||
<table name="sites" />
|
||||
<table name="modules" />
|
||||
<table name="syndication_except_modules" alias="except_modules" type="left join">
|
||||
<conditions>
|
||||
<condition operation="equal" column="modules.module_srl" default="except_modules.module_srl" />
|
||||
</conditions>
|
||||
</table>
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="modules.site_srl" alias="site_srl" />
|
||||
<column name="modules.module_srl" alias="module_srl" />
|
||||
<column name="sites.domain" alias="domain" />
|
||||
<column name="modules.mid" alias="mid" />
|
||||
<column name="modules.module" alias="module" />
|
||||
<column name="modules.browser_title" alias="browser_title" />
|
||||
<column name="modules.description" alias="description" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="in" column="modules.module_srl" var="module_srls" />
|
||||
<condition operation="notin" column="modules.module_srl" var="except_module_srls" pipe="and" />
|
||||
<condition operation="equal" column="sites.site_srl" default="modules.site_srl" notnull="notnull" pipe="and" />
|
||||
<condition operation="null" column="except_modules.module_srl" default="1" pipe="and" />
|
||||
</conditions>
|
||||
</query>
|
||||
15
modules/syndication/queries/getSiteUpdatedTime.xml
Normal file
15
modules/syndication/queries/getSiteUpdatedTime.xml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<query id="getSiteUpdatedTime" action="select">
|
||||
<tables>
|
||||
<table name="documents" alias="doc" />
|
||||
<table name="syndication_except_modules" alias="except_module"/>
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="max(doc.last_update)" alias="last_update" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="doc.module_srl" var="module_srl" filter="number" />
|
||||
<condition operation="more" column="doc.last_update" var="start_date" filter="number" pipe="and" />
|
||||
<condition operation="less" column="doc.last_update" var="end_date" filter="number" pipe="and" />
|
||||
<condition operation="notin" column="doc.module_srl" default="except_module.module_srl" pipe="and" />
|
||||
</conditions>
|
||||
</query>
|
||||
9
modules/syndication/queries/insertExceptModule.xml
Normal file
9
modules/syndication/queries/insertExceptModule.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<query id="insertExceptModule" action="insert">
|
||||
<tables>
|
||||
<table name="syndication_except_modules" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="module_srl" var="module_srl" filter="number" notnull="notnull" />
|
||||
<column name="regdate" default="curdate()" notnull="notnull" />
|
||||
</columns>
|
||||
</query>
|
||||
13
modules/syndication/queries/insertLog.xml
Normal file
13
modules/syndication/queries/insertLog.xml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<query id="insertLog" action="insert">
|
||||
<tables>
|
||||
<table name="syndication_logs" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="log_srl" default="sequence()" />
|
||||
<column name="module_srl" var="module_srl" />
|
||||
<column name="document_srl" var="document_srl" />
|
||||
<column name="title" var="title" />
|
||||
<column name="summary" var="summary" />
|
||||
<column name="regdate" default="curdate()" notnull="notnull" />
|
||||
</columns>
|
||||
</query>
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
<table name="syndication_except_modules">
|
||||
<column name="module_srl" type="number" size="11" notnull="notnull" primary_key="primary_key" />
|
||||
<column name="regdate" type="date" />
|
||||
</table>
|
||||
8
modules/syndication/schemas/syndication_logs.xml
Normal file
8
modules/syndication/schemas/syndication_logs.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<table name="syndication_logs">
|
||||
<column name="log_srl" type="number" size="11" notnull="notnull" unique="primary_key" />
|
||||
<column name="module_srl" type="number" size="11" default="0" />
|
||||
<column name="document_srl" type="number" size="11" default="0" />
|
||||
<column name="title" type="varchar" size="255" />
|
||||
<column name="summary" type="varchar" size="255" />
|
||||
<column name="regdate" type="date" index="idx_regdate" />
|
||||
</table>
|
||||
40
modules/syndication/syndication.admin.controller.php
Normal file
40
modules/syndication/syndication.admin.controller.php
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
/**
|
||||
* @class syndicationAdminController
|
||||
* @author zero (skklove@gmail.com)
|
||||
* @brief syndication 모듈의 admin Controller class
|
||||
**/
|
||||
|
||||
class syndicationAdminController extends syndication {
|
||||
|
||||
function init() {
|
||||
}
|
||||
|
||||
function procSyndicationAdminInsertService() {
|
||||
$oModuleController = &getController('module');
|
||||
$oSyndicationController = &getController('syndication');
|
||||
$oSyndicationModel = &getModel('syndication');
|
||||
|
||||
$config->target_services = explode('|@|',Context::get('target_services'));
|
||||
$config->site_url = preg_replace('/\/+$/is','',Context::get('site_url'));
|
||||
$config->year = Context::get('year');
|
||||
if(!$config->site_url) return new Object(-1,'msg_site_url_is_null');
|
||||
|
||||
$oModuleController->insertModuleConfig('syndication',$config);
|
||||
$oSyndicationController->ping($oSyndicationModel->getID('site'), 'site');
|
||||
|
||||
$except_module = Context::get('except_module');
|
||||
$output = executeQuery('syndication.deleteExceptModules');
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$modules = explode(',',$except_module);
|
||||
for($i=0,$c=count($modules);$i<$c;$i++) {
|
||||
$args->module_srl = $modules[$i];
|
||||
$output = executeQuery('syndication.insertExceptModule',$args);
|
||||
if(!$output->toBool()) return $output;
|
||||
}
|
||||
|
||||
$this->setMessage('success_applied');
|
||||
}
|
||||
}
|
||||
?>
|
||||
50
modules/syndication/syndication.admin.view.php
Normal file
50
modules/syndication/syndication.admin.view.php
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
<?php
|
||||
/**
|
||||
* @class syndicationAdminView
|
||||
* @author zero (skklove@gmail.com)
|
||||
* @brief syndication admin view class
|
||||
**/
|
||||
|
||||
class syndicationAdminView extends syndication {
|
||||
|
||||
function init() {
|
||||
}
|
||||
|
||||
function dispSyndicationAdminConfig() {
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
$module_config = $oModuleModel->getModuleConfig('syndication');
|
||||
if(!$module_config->target_services) $module_config->target_services = array();
|
||||
|
||||
foreach($this->services as $key => $val) {
|
||||
unset($obj);
|
||||
$obj->service = $key;
|
||||
$obj->ping = $val;
|
||||
$obj->selected = in_array($key, $module_config->target_services)?true:false;
|
||||
$services[] = $obj;
|
||||
}
|
||||
Context::set('services', $services);
|
||||
|
||||
if(!$module_config->site_url) {
|
||||
$module_config->site_url = Context::getDefaultUrl()?Context::getDefaultUrl():getFullUrl();
|
||||
}
|
||||
Context::set('site_url', preg_replace('/^(http|https):\/\//i','',$module_config->site_url));
|
||||
|
||||
if(!$module_config->year) {
|
||||
$module_config->year = date("Y");
|
||||
}
|
||||
Context::set('year', $module_config->year);
|
||||
|
||||
$output = executeQueryArray('syndication.getExceptModules');
|
||||
$except_module_list = array();
|
||||
for($i=0,$c=count($output->data);$i<$c;$i++) {
|
||||
$except_module_list[] = $output->data[$i];
|
||||
}
|
||||
Context::set('except_module', $except_module_list);
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('config');
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
39
modules/syndication/syndication.class.php
Normal file
39
modules/syndication/syndication.class.php
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
/**
|
||||
* @class syndication
|
||||
* @author zero (skklove@gmail.com)
|
||||
* @brief syndication 모듈의 high class
|
||||
**/
|
||||
|
||||
define('SyndicationModule', 'M');
|
||||
define('SyndicationDocument', 'D');
|
||||
|
||||
define('SyndicationInserted', 'I');
|
||||
define('SyndicationUpdated', 'U');
|
||||
define('SyndicationDeleted', 'D');
|
||||
|
||||
class syndication extends ModuleObject {
|
||||
|
||||
var $services = array(
|
||||
'Naver' => 'http://syndication.openapi.naver.com/ping/',
|
||||
);
|
||||
|
||||
function moduleInstall() {
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->insertTrigger('document.insertDocument', 'syndication', 'controller', 'triggerInsertDocument', 'after');
|
||||
$oModuleController->insertTrigger('document.updateDocument', 'syndication', 'controller', 'triggerUpdateDocument', 'after');
|
||||
$oModuleController->insertTrigger('document.deleteDocument', 'syndication', 'controller', 'triggerDeleteDocument', 'after');
|
||||
$oModuleController->insertTrigger('module.deleteModule', 'syndication', 'controller', 'triggerDeleteModule', 'after');
|
||||
}
|
||||
|
||||
function checkUpdate() {
|
||||
return false;
|
||||
}
|
||||
|
||||
function moduleUpdate() {
|
||||
}
|
||||
|
||||
function recompileCache() {
|
||||
}
|
||||
}
|
||||
?>
|
||||
101
modules/syndication/syndication.controller.php
Normal file
101
modules/syndication/syndication.controller.php
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
<?php
|
||||
/**
|
||||
* @class syndicationController
|
||||
* @author zero (skklove@gmail.com)
|
||||
* @brief syndication 모듈의 Controller class
|
||||
**/
|
||||
|
||||
class syndicationController extends syndication {
|
||||
|
||||
function triggerInsertDocument(&$obj) {
|
||||
if($obj->module_srl < 1) return new Object();
|
||||
|
||||
$oSyndicationModel = &getModel('syndication');
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
if($oSyndicationModel->isExceptedModules($obj->module_srl)) return new Object();
|
||||
|
||||
$config = $oModuleModel->getModuleConfig('syndication');
|
||||
|
||||
$id = $oSyndicationModel->getID('channel', $obj->module_srl);
|
||||
$this->ping($id, 'article');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
function triggerUpdateDocument(&$obj) {
|
||||
if($obj->module_srl < 1) return new Object();
|
||||
|
||||
$oSyndicationModel = &getModel('syndication');
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
if($oSyndicationModel->isExceptedModules($obj->module_srl)) return new Object();
|
||||
|
||||
$config = $oModuleModel->getModuleConfig('syndication');
|
||||
|
||||
$id = $oSyndicationModel->getID('channel', $obj->module_srl);
|
||||
$this->ping($id, 'article');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
function triggerDeleteDocument(&$obj) {
|
||||
if($obj->module_srl < 1) return new Object();
|
||||
|
||||
$oSyndicationModel = &getModel('syndication');
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
if($oSyndicationModel->isExceptedModules($obj->module_srl)) return new Object();
|
||||
|
||||
$this->insertLog($obj->module_srl, $obj->document_srl, $obj->title, $obj->content);
|
||||
|
||||
$config = $oModuleModel->getModuleConfig('syndication');
|
||||
|
||||
$id = $oSyndicationModel->getID('channel', $obj->module_srl);
|
||||
$this->ping($id, 'deleted');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
function triggerDeleteModule(&$obj) {
|
||||
$oSyndicationModel = &getModel('syndication');
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
if($oSyndicationModel->isExceptedModules($obj->module_srl)) return new Object();
|
||||
|
||||
$this->insertLog($obj->module_srl, $obj->document_srl, $obj->title, $obj->content);
|
||||
|
||||
$output = executeQuery('syndication.getExceptModule', $obj);
|
||||
if($output->data->count) return new Object();
|
||||
|
||||
$config = $oModuleModel->getModuleConfig('syndication');
|
||||
|
||||
$id = $oSyndicationModel->getID('site', $obj->module_srl);
|
||||
$this->ping($id, 'deleted');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
function insertLog($module_srl, $document_srl, $title = null, $summary = null) {
|
||||
$args->module_srl = $module_srl;
|
||||
$args->document_srl = $document_srl;
|
||||
$args->title = $title;
|
||||
$args->summary = $summary;
|
||||
$output = executeQuery('syndication.insertLog', $args);
|
||||
}
|
||||
|
||||
function ping($id, $type) {
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('syndication');
|
||||
|
||||
if(!count($config->target_services)) return;
|
||||
if(substr($config->site_url,-1)!='/') $config->site_url .= '/';
|
||||
foreach($config->target_services as $key => $val) {
|
||||
$ping_url = trim($this->services[$val]);
|
||||
if(!$ping_url) continue;
|
||||
$ping_body = sprintf('http://%s?module=syndication&act=getSyndicationList&id=%s&type=%s', $config->site_url, $id, $type);
|
||||
FileHandler::getRemoteResource($ping_url, null, 3, 'POST', 'application/x-www-form-urlencoded', array(), array(), array('link'=>$ping_body));
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
337
modules/syndication/syndication.model.php
Normal file
337
modules/syndication/syndication.model.php
Normal file
|
|
@ -0,0 +1,337 @@
|
|||
<?php
|
||||
/**
|
||||
* @class getSyndicationList
|
||||
* @author zero (skklove@gmail.com)
|
||||
* @brief syndication 모듈의 model class
|
||||
**/
|
||||
|
||||
class syndicationModel extends syndication {
|
||||
|
||||
var $site_url = null;
|
||||
var $target_services = array();
|
||||
var $year = null;
|
||||
var $langs = array();
|
||||
var $granted_modules = array();
|
||||
|
||||
function init() {
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('syndication');
|
||||
$this->site_url = preg_replace('/\/+$/is','',$config->site_url);
|
||||
$this->target_services = $config->target_services;
|
||||
$this->year = $config->year;
|
||||
|
||||
$output = executeQueryArray('syndication.getGrantedModules');
|
||||
if($output->data) {
|
||||
foreach($output->data as $key => $val) {
|
||||
$this->granted_modules[] = $val->module_srl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function isExceptedModules($module_srl) {
|
||||
$args->module_srl = $module_srl;
|
||||
$output = executeQuery('syndication.getExceptModule', $args);
|
||||
if($output->data->count) return true;
|
||||
$output = executeQuery('syndication.getGrantedModule', $args);
|
||||
if($output->data->count) return true;
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
function getLang($key, $site_srl)
|
||||
{
|
||||
if(!$this->langs[$site_srl])
|
||||
{
|
||||
$this->langs[$site_srl] = array();
|
||||
$args->site_srl = $site_srl;
|
||||
$args->lang_code = Context::getLangType();
|
||||
$output = executeQueryArray("syndication.getLang", $args);
|
||||
if(!$output->toBool() || !$output->data) return $key;
|
||||
foreach($output->data as $value)
|
||||
{
|
||||
$this->langs[$site_srl][$value->name] = $value->value;
|
||||
}
|
||||
}
|
||||
if($this->langs[$site_srl][$key])
|
||||
{
|
||||
return $this->langs[$site_srl][$key];
|
||||
}
|
||||
else return $key;
|
||||
}
|
||||
|
||||
function handleLang($title, $site_srl)
|
||||
{
|
||||
$matches = null;
|
||||
if(!preg_match("/\\\$user_lang->(.+)/",$title, $matches)) return $title;
|
||||
else
|
||||
{
|
||||
return $this->getLang($matches[1], $site_srl);
|
||||
}
|
||||
}
|
||||
|
||||
function getSyndicationList() {
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('syndication');
|
||||
|
||||
$id = Context::get('id');
|
||||
$type = Context::get('type');
|
||||
$page = Context::get('page');
|
||||
if(!$id || !$type) return new Object(-1,'msg_invalid_request');
|
||||
|
||||
preg_match('/^tag:([^,]+),([0-9]+):([^:]+):(.*)$/i',$id,$match);
|
||||
|
||||
$url = $match[1];
|
||||
$year = $match[2];
|
||||
$target = $match[3];
|
||||
$id = $match[4];
|
||||
if($id && strpos($id,'-')!==false) list($module_srl, $document_srl) = explode('-',$id);
|
||||
elseif($id) $module_srl = $id;
|
||||
if(!$url || !$year || !$target) return new Object(-1,'msg_invalid_request');
|
||||
|
||||
$startTime = Context::get('start-time');
|
||||
$endTime = Context::get('end-time');
|
||||
|
||||
$time_zone = substr($GLOBALS['_time_zone'],0,3).':'.substr($GLOBALS['_time_zone'],3);
|
||||
Context::set('time_zone', $time_zone);
|
||||
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
|
||||
if($target == 'channel' && !$module_srl) $target = 'site';
|
||||
if($target == 'channel' && $module_srl) {
|
||||
$args->module_srls = $module_srl;
|
||||
$output = executeQuery('syndication.getModules', $args);
|
||||
$module_info = $output->data;
|
||||
if($module_info) {
|
||||
$args->module_srl = $module_srl;
|
||||
$output = executeQuery('syndication.getExceptModules', $args);
|
||||
if($output->data->count) $error = 'target is not founded';
|
||||
} else $error = 'target is not founded';
|
||||
|
||||
unset($args);
|
||||
}
|
||||
|
||||
if(!$error) {
|
||||
Context::set('target', $target);
|
||||
Context::set('type', $type);
|
||||
|
||||
switch($target) {
|
||||
case 'site' :
|
||||
$site_info->id = $this->getID('site');
|
||||
$site_info->title = $this->handleLang($site_module_info->browser_title, $site_module_info->site_srl);
|
||||
|
||||
$output = executeQuery('syndication.getSiteUpdatedTime');
|
||||
if($output->data) $site_info->updated = date("Y-m-d\\TH:i:s", ztime($output->data->last_update)).$time_zone;
|
||||
$site_info->self_href = $this->getSelfHref($site_info->id,$type);
|
||||
$site_info->alternative_href =$this->getAlternativeHref();
|
||||
Context::set('site_info', $site_info);
|
||||
|
||||
$this->setTemplateFile('site');
|
||||
switch($type) {
|
||||
case 'channel' :
|
||||
Context::set('channels', $this->getChannels());
|
||||
break;
|
||||
case 'article' :
|
||||
Context::set('articles', $this->getArticles(null, $page, $startTime, $endTime, 'article',$site_info->id));
|
||||
break;
|
||||
case 'deleted' :
|
||||
Context::set('deleted', $this->getDeleted(null, $page, $startTime, $endTime, 'deleted',$site_info->id));
|
||||
break;
|
||||
default :
|
||||
$this->setTemplateFile('site.info');
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'channel' :
|
||||
$channel_info->id = $this->getID('channel', $module_info->module_srl);
|
||||
$channel_info->title = $this->handleLang($module_info->browser_title, $module_info->site_srl);
|
||||
$channel_info->updated = date("Y-m-d\\TH:i:s").$time_zone;
|
||||
$channel_info->self_href = $this->getSelfHref($channel_info->id, $type);
|
||||
$channel_info->alternative_href = $this->getAlternativeHref($module_info);
|
||||
$channel_info->summary = $module_info->description;
|
||||
if($module_info->module == "textyle")
|
||||
{
|
||||
$channel_info->type = "blog";
|
||||
$channel_info->rss_href = getFullSiteUrl($module_info->domain, '', 'mid', $module_info->mid, 'act', 'rss');
|
||||
}
|
||||
else
|
||||
{
|
||||
$channel_info->type = "web";
|
||||
}
|
||||
$output = executeQuery('syndication.getSiteUpdatedTime');
|
||||
if($output->data) $channel_info->updated = date("Y-m-d\\TH:i:s", ztime($output->data->last_update)).$time_zone;
|
||||
Context::set('channel_info', $channel_info);
|
||||
|
||||
$this->setTemplateFile('channel');
|
||||
switch($type) {
|
||||
case 'article' :
|
||||
Context::set('articles', $this->getArticles($module_srl, $page, $startTime, $endTime, 'article', $channel_info->id));
|
||||
break;
|
||||
case 'deleted' :
|
||||
Context::set('deleted', $this->getDeleted($module_srl, $page, $startTime, $endTime, 'deleted', $channel_info->id));
|
||||
break;
|
||||
default :
|
||||
$this->setTemplateFile('channel.info');
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
Context::set('message', $error);
|
||||
$this->setTemplateFile('error');
|
||||
}
|
||||
|
||||
Context::setResponseMethod('XML');
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
}
|
||||
|
||||
function getChannels() {
|
||||
if($module_srls) $args->module_srls = $module_srls;
|
||||
if(count($this->granted_modules)) $args->except_module_srls = implode(',',$this->granted_modules);
|
||||
$output = executeQueryArray('syndication.getModules', $args);
|
||||
if($output->data) {
|
||||
foreach($output->data as $module_info) {
|
||||
unset($obj);
|
||||
$obj->id = $this->getID('channel', $module_info->module_srl);
|
||||
$obj->title = $this->handleLang($module_info->browser_title, $module_info->site_srl);
|
||||
$obj->updated = date("Y-m-d\\TH:i:s").$time_zone;
|
||||
$obj->self_href = $this->getSelfHref($obj->id, 'channel');
|
||||
$obj->alternative_href = $this->getAlternativeHref($module_info);
|
||||
$obj->summary = $module_info->description;
|
||||
if($module_info->module == "textyle")
|
||||
{
|
||||
$obj->type = "blog";
|
||||
$obj->rss_href = getFullSiteUrl($module_info->domain, '', 'mid', $module_info->mid, 'act', 'rss');
|
||||
}
|
||||
else
|
||||
{
|
||||
$obj->type = "web";
|
||||
}
|
||||
|
||||
$list[] = $obj;
|
||||
}
|
||||
}
|
||||
return $list;
|
||||
}
|
||||
|
||||
function getArticles($module_srl = null, $page=1, $startTime = null, $endTime = null, $type = null, $id = null) {
|
||||
if($this->site_url==null) $this->init();
|
||||
|
||||
if($module_srl) $args->module_srl = $module_srl;
|
||||
if($startTime) $args->start_date = $this->getDate($startTime);
|
||||
if($endTime) $args->end_date = $this->getDate($endTime);
|
||||
if(count($this->granted_modules)) $args->except_module_srls = implode(',',$this->granted_modules);
|
||||
$args->page = $page;
|
||||
$output = executeQueryArray('syndication.getDocumentList', $args);
|
||||
$cur_page = $output->page_navigation->cur_page;
|
||||
$total_page = $output->page_navigation->last_page;
|
||||
|
||||
$result->next_url = null;
|
||||
$result->list = array();
|
||||
|
||||
if($cur_page<$total_page) {
|
||||
$next_url = $this->getSelfHref($id, $type);
|
||||
if($startTime) $next_url .= '&startTime='.$startTime;
|
||||
if($endTime) $next_url .= '&endTime='.$endTime;
|
||||
$result->next_url = $next_url.'&page='.($cur_page+1);
|
||||
}
|
||||
|
||||
if($output->data) {
|
||||
foreach($output->data as $key => $val) {
|
||||
$val->id = $this->getID('article', $val->module_srl.'-'.$val->document_srl);
|
||||
$val->updated = date("Y-m-d\\TH:i:s", ztime($val->last_update)).$GLOBALS['_time_zone'];
|
||||
$val->alternative_href = getFullSiteUrl($this->site_url, '', 'document_srl', $val->document_srl);
|
||||
$val->channel_alternative_href = $this->getChannelAlternativeHref($val->module_srl);
|
||||
$val->channel_id = $this->getID('channel', $val->module_srl.'-'.$val->document_srl);
|
||||
if(!$val->nick_name) $val->nick_name = $val->user_name;
|
||||
$output->data[$key] = $val;
|
||||
}
|
||||
$result->list = $output->data;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
function getDeleted($module_srl = null, $page = 1, $startTime = null, $endTime = null, $type = null, $id = null) {
|
||||
if($this->site_url==null) $this->init();
|
||||
|
||||
if($module_srl) $args->module_srl= $module_srl;
|
||||
if($startTime) $args->start_date = $this->getDate($startTime);
|
||||
if($endTime) $args->end_date = $this->getDate($endTime);
|
||||
$args->page = $page;
|
||||
|
||||
$output = executeQueryArray('syndication.getDeletedList', $args);
|
||||
|
||||
$cur_page = $output->page_navigation->cur_page;
|
||||
$total_page = $output->page_navigation->last_page;
|
||||
|
||||
$result->next_url = null;
|
||||
$result->list = array();
|
||||
|
||||
if($cur_page<$total_page) {
|
||||
$next_url = $this->getSelfHref($id, $type);
|
||||
if($startTime) $next_url .= '&startTime='.$startTime;
|
||||
if($endTime) $next_url .= '&endTime='.$endTime;
|
||||
$result->next_url = $next_url . '&page='.($cur_page+1);
|
||||
}
|
||||
|
||||
if($output->data) {
|
||||
foreach($output->data as $key => $val) {
|
||||
$val->id = $this->getID('article', $val->module_srl.'-'.$val->document_srl);
|
||||
$val->deleted = date("Y-m-d\\TH:i:s", ztime($val->regdate)).$GLOBALS['_time_zone'];
|
||||
$val->alternative_href = getFullSiteUrl($this->site_url, '', 'document_srl', $val->document_srl);
|
||||
$val->channel_id = $this->getID('channel', $val->module_srl.'-'.$val->document_srl);
|
||||
$output->data[$key] = $val;
|
||||
}
|
||||
$result->list = $output->data;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
function getID($type, $target_id = null) {
|
||||
if($this->site_url==null) $this->init();
|
||||
|
||||
return sprintf('tag:%s,%d:%s:%s', $this->site_url, $this->year, $type, $target_id);
|
||||
}
|
||||
|
||||
function getChannelAlternativeHref($module_srl) {
|
||||
static $module_info = array();
|
||||
if(!isset($module_info[$module_srl])) {
|
||||
$args->module_srl = $module_srl;
|
||||
$output = executeQuery('syndication.getModuleSiteInfo', $args);
|
||||
if($output->data) $module_info[$module_srl] = $output->data;
|
||||
else $module_info[$module_srl] = null;
|
||||
}
|
||||
|
||||
if(is_null($module_info[$module_srl])) return $this->site_url;
|
||||
|
||||
$domain = $module_info[$module_srl]->domain;
|
||||
$url = getFullSiteUrl($domain, '', 'mid', $module_info[$module_srl]->mid);
|
||||
if(substr($url,0,1)=='/') $domain = 'http://'.$this->site_url.$url;
|
||||
return $url;
|
||||
}
|
||||
|
||||
function getSelfHref($id, $type = null) {
|
||||
if($this->site_url==null) $this->init();
|
||||
|
||||
return sprintf('http://%s/?module=syndication&act=getSyndicationList&id=%s&type=%s', $this->site_url, $id, $type);
|
||||
}
|
||||
|
||||
function getAlternativeHref($module_info = null) {
|
||||
if($this->site_url==null) $this->init();
|
||||
|
||||
if(!$module_info) return sprintf('http://%s', $this->site_url);
|
||||
if(!$module_info->site_srl) return getFullUrl('', 'mid', $module_info->mid);
|
||||
|
||||
$domain = $module_info->domain;
|
||||
$url = getFullSiteUrl($domain, '', 'mid', $module_info->mid);
|
||||
|
||||
if(substr($url,0,1)=='/') $domain = 'http://'.$this->site_url.$url;
|
||||
return $url;
|
||||
}
|
||||
|
||||
function getDate($date) {
|
||||
$time = strtotime($date);
|
||||
if($time == -1) $time = ztime(str_replace(array('-','T',':'),'',$date));
|
||||
return date('YmdHis', $time);
|
||||
}
|
||||
}
|
||||
?>
|
||||
16
modules/syndication/tpl/channel.html
Normal file
16
modules/syndication/tpl/channel.html
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{'<?xml version="1.0" encoding="utf-8"?>'}
|
||||
|
||||
<feed xmlns="http://www.w3.org/2005/Atom">
|
||||
<!--#include("./include.channel.html")-->
|
||||
<!--@if($articles->list)-->
|
||||
<!--@if($articles->next_url)--><link rel="next-in-thread" href="{htmlspecialchars($articles->next_url)}" /><!--@end-->
|
||||
<!--@foreach($articles->list as $key => $article)-->
|
||||
<!--#include("./include.articles.html")-->
|
||||
<!--@end-->
|
||||
<!--@elseif($deleted->list)-->
|
||||
<!--@if($deleted->next_url)--><link rel="next-in-thread" href="{htmlspecialchars($deleted->next_url)}" /><!--@end-->
|
||||
<!--@foreach($deleted->list as $key => $delete)-->
|
||||
<!--#include("./include.deleted.html")-->
|
||||
<!--@end-->
|
||||
<!--@end-->
|
||||
</feed>
|
||||
5
modules/syndication/tpl/channel.info.html
Normal file
5
modules/syndication/tpl/channel.info.html
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{'<?xml version="1.0" encoding="utf-8"?>'}
|
||||
|
||||
<entry xmlns="http://www.w3.org/2005/Atom">
|
||||
<!--#include("./include.channel.html")-->
|
||||
</entry>
|
||||
56
modules/syndication/tpl/config.html
Normal file
56
modules/syndication/tpl/config.html
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
<!--%import("css/syndication.css")-->
|
||||
<!--%import("js/syndication.js")-->
|
||||
<!--%import("filter/insert_service.xml")-->
|
||||
|
||||
<h3 class="xeAdmin">{$lang->syndication} <span class="gray">{$lang->cmd_management}</span></h3>
|
||||
<p class="summary">{$lang->about_syndication}</p>
|
||||
|
||||
<form action="./" method="get" onsubmit="return procFilter(this, insert_service);">
|
||||
<input type="hidden" name="year" value="{$year}" />
|
||||
<table cellspacing="0" class="rowTable">
|
||||
<tr>
|
||||
<th scope="row"><div>{$lang->my_syndication_url}</div></th>
|
||||
<td>
|
||||
http://<input type="text" name="site_url" value="{$site_url}" class="inputTypeText siteUrl" />
|
||||
<p>{$lang->about_my_syndication_url}</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><div>{$lang->syndication_service}</div></th>
|
||||
<td>
|
||||
<ul class="syndiService">
|
||||
<!--@foreach($services as $key => $val)-->
|
||||
<li>
|
||||
<input type="checkbox" name="target_services" value="{$val->service}" id="target_service_{$val->service}" <!--@if($val->selected)-->checked="checked"<!--@end--> />
|
||||
<label for="target_service_{$val->service}">{$val->service}</label>
|
||||
</li>
|
||||
<!--@end-->
|
||||
</ul>
|
||||
<p>{$lang->about_syndication}</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><div>{$lang->except_module}</div></th>
|
||||
<td>
|
||||
<select name="_except_module" id="_except_module" size="10" class="exceptModuleList">
|
||||
{@$except_module_srls = array()}
|
||||
<!--@foreach($except_module as $v)-->
|
||||
{@$except_module_srls[] = $v->module_srl}
|
||||
<option value="{$v->module_srl}">{$v->browser_title} ({$v->mid})</option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
<ul class="midCommand">
|
||||
<li><a href="{getUrl('','module','module','act','dispModuleSelectList','id','except_module')}" onclick="popopen(this.href, 'ModuleSelect');return false;" class="button blue"><span>{$lang->cmd_insert}</span></a></li>
|
||||
<li><a href="#" onclick="removeExceptModule('except_module');return false;" class="button red"><span>{$lang->cmd_delete}</span></a></li>
|
||||
</ul>
|
||||
<p>{$lang->about_except_module}</p>
|
||||
<input type="hidden" name="except_module" id="except_module" value="{implode(',',$except_module_srls)}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2" class="button">
|
||||
<span class="button black strong"><input type="submit" value="{$lang->cmd_apply}" accesskey="s" /></span>
|
||||
</th>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
8
modules/syndication/tpl/css/syndication.css
Normal file
8
modules/syndication/tpl/css/syndication.css
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
@charset "utf-8";
|
||||
|
||||
input.siteUrl { width:400px; }
|
||||
ul.syndiService { list-style:none; margin:0; padding:0;}
|
||||
ul.syndiService li { padding:10px 0; margin:0;}
|
||||
select.exceptModuleList { width:400px; }
|
||||
ul.midCommand { margin:20px 0 0 0; padding:0; list-style:none; }
|
||||
ul.midCommand li { display:inline; margin:0 20px 0 0; padding:0;}
|
||||
5
modules/syndication/tpl/error.html
Normal file
5
modules/syndication/tpl/error.html
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{'<?xml version="1.0" encoding="utf-8"?>'}
|
||||
<feed xmlns="http://www.w3.org/2005/Atom">
|
||||
<error>-1</error>
|
||||
<message>{$message}</message>
|
||||
</feed>
|
||||
8
modules/syndication/tpl/filter/insert_service.xml
Normal file
8
modules/syndication/tpl/filter/insert_service.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<filter name="insert_service" module="syndication" act="procSyndicationAdminInsertService" confirm_msg_code="confirm_submit">
|
||||
<form />
|
||||
<parameter />
|
||||
<response>
|
||||
<tag name="error" />
|
||||
<tag name="message" />
|
||||
</response>
|
||||
</filter>
|
||||
14
modules/syndication/tpl/include.articles.html
Normal file
14
modules/syndication/tpl/include.articles.html
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
|
||||
<entry>
|
||||
<id>{htmlspecialchars($article->id)}</id>
|
||||
<title>{htmlspecialchars($article->title)}</title>
|
||||
<updated>{$article->updated}</updated>
|
||||
<link rel="alternative" href="{$article->alternative_href}" />
|
||||
<link rel="channel" href="{htmlspecialchars($article->channel_id)}" />
|
||||
<link rel="channel-alternative" href="{$article->channel_alternative_href}" />
|
||||
<published>{date('Y-m-d\TH:i:s',ztime($article->regdate)).$time_zone}</published>
|
||||
<author>
|
||||
<name>{htmlspecialchars($article->nick_name)}</name>
|
||||
</author>
|
||||
<content>{htmlspecialchars($article->content)}</content>
|
||||
</entry>
|
||||
8
modules/syndication/tpl/include.channel.html
Normal file
8
modules/syndication/tpl/include.channel.html
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<id>{htmlspecialchars($channel_info->id)}</id>
|
||||
<title>{htmlspecialchars($channel_info->title)}</title>
|
||||
<updated>{$channel_info->updated}</updated>
|
||||
<link rel="self" href="{htmlspecialchars($channel_info->self_href)}" />
|
||||
<link rel="alternative" href="{$channel_info->alternative_href}" />
|
||||
<!--@if($channel_info->rss_href)--><link rel="rss" href="{$channel_info->rss_href}" /><!--@end-->
|
||||
<type>{$channel_info->type}</type>
|
||||
<summary>{htmlspecialchars($channel_info->summary)}</summary>
|
||||
8
modules/syndication/tpl/include.channels.html
Normal file
8
modules/syndication/tpl/include.channels.html
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<entry>
|
||||
<id>{htmlspecialchars($channel_info->id)}</id>
|
||||
<title>{htmlspecialchars($channel_info->title)}</title>
|
||||
<updated>{$channel_info->updated}</updated>
|
||||
<link rel="self" href="{htmlspecialchars($channel_info->self_href)}" />
|
||||
<link rel="alternative" href="{$channel_info->alternative_href}" />
|
||||
<summary>{htmlspecialchars($channel_info->summary)}</summary>
|
||||
</entry>
|
||||
8
modules/syndication/tpl/include.deleted.html
Normal file
8
modules/syndication/tpl/include.deleted.html
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
|
||||
<entry>
|
||||
<id>{htmlspecialchars($delete->id)}</id>
|
||||
<title>{htmlspecialchars($delete->title)}</title>
|
||||
<updated>{$delete->deleted}</updated>
|
||||
<link rel="alternative" href="{$delete->alternative_href}" />
|
||||
<deleted>{$delete->deleted}</deleted>
|
||||
</entry>
|
||||
5
modules/syndication/tpl/include.site.html
Normal file
5
modules/syndication/tpl/include.site.html
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<id>{htmlspecialchars($site_info->id)}</id>
|
||||
<title>{htmlspecialchars($site_info->title)}</title>
|
||||
<updated>{$site_info->updated}</updated>
|
||||
<link rel="self" href="{htmlspecialchars($site_info->self_href)}" />
|
||||
<link rel="alternative" href="{$site_info->alternative_href}" />
|
||||
25
modules/syndication/tpl/js/syndication.js
Normal file
25
modules/syndication/tpl/js/syndication.js
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
function insertSelectedModules(id, module_srl, mid, browser_title) {
|
||||
var sel_obj = xGetElementById('_'+id);
|
||||
for(var i=0;i<sel_obj.options.length;i++) if(sel_obj.options[i].value==module_srl) return;
|
||||
var opt = new Option(browser_title+' ('+mid+')', module_srl, false, false);
|
||||
sel_obj.options[sel_obj.options.length] = opt;
|
||||
if(sel_obj.options.length>8) sel_obj.size = sel_obj.options.length;
|
||||
|
||||
doSyncExceptModules(id);
|
||||
}
|
||||
|
||||
function removeExceptModule(id) {
|
||||
var sel_obj = xGetElementById('_'+id);
|
||||
sel_obj.remove(sel_obj.selectedIndex);
|
||||
if(sel_obj.options.length) sel_obj.selectedIndex = sel_obj.options.length-1;
|
||||
doSyncExceptModules(id);
|
||||
}
|
||||
|
||||
function doSyncExceptModules(id) {
|
||||
var selected_module_srls = new Array();
|
||||
var sel_obj = xGetElementById('_'+id);
|
||||
for(var i=0;i<sel_obj.options.length;i++) {
|
||||
selected_module_srls.push(sel_obj.options[i].value);
|
||||
}
|
||||
xGetElementById(id).value = selected_module_srls.join(',');
|
||||
}
|
||||
21
modules/syndication/tpl/site.html
Normal file
21
modules/syndication/tpl/site.html
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{'<?xml version="1.0" encoding="utf-8"?>'}
|
||||
<feed xmlns="http://www.w3.org/2005/Atom">
|
||||
<!--#include("./include.site.html")-->
|
||||
<!--@if(count($channels))-->
|
||||
<!--@foreach($channels as $key => $channel_info)-->
|
||||
<entry>
|
||||
<!--#include("./include.channel.html")-->
|
||||
</entry>
|
||||
<!--@end-->
|
||||
<!--@elseif(count($articles->list))-->
|
||||
<!--@if($articles->next_url)--><link rel="next-in-thread" href="{htmlspecialchars($articles->next_url)}" /><!--@end-->
|
||||
<!--@foreach($articles->list as $key => $article)-->
|
||||
<!--#include("./include.articles.html")-->
|
||||
<!--@end-->
|
||||
<!--@elseif(count($deleted->list))-->
|
||||
<!--@if($deleted->next_url)--><link rel="next-in-thread" href="{htmlspecialchars($deleted->next_url)}" /><!--@end-->
|
||||
<!--@foreach($deleted->list as $key => $delete)-->
|
||||
<!--#include("./include.deleted.html")-->
|
||||
<!--@end-->
|
||||
<!--@end-->
|
||||
</feed>
|
||||
4
modules/syndication/tpl/site.info.html
Normal file
4
modules/syndication/tpl/site.info.html
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{'<?xml version="1.0" encoding="utf-8"?>'}
|
||||
<entry xmlns="http://www.w3.org/2005/Atom">
|
||||
<!--#include("./include.site.html")-->
|
||||
</entry>
|
||||
Loading…
Add table
Add a link
Reference in a new issue