mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-10 20:44:28 +09:00
Atom피드 id에 경로문제 수정, 통합 RSS와 개별 RSS가 같이 있을때 문제... 두 피드 변수를 분리, 피드가 없을때 메세지 해당 피드 포맷으로 출력하게 수정
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6644 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
eeacc2c2b8
commit
e6af9efc0d
3 changed files with 63 additions and 47 deletions
|
|
@ -41,8 +41,12 @@
|
||||||
<!--@end-->
|
<!--@end-->
|
||||||
<!--@end-->
|
<!--@end-->
|
||||||
<!--@if($rss_url)-->
|
<!--@if($rss_url)-->
|
||||||
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="{$rss_url}" />
|
<link rel="alternate" type="application/rss+xml" title="RSS" href="{$rss_url}" />
|
||||||
<link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="{$atom_url}" />
|
<link rel="alternate" type="application/atom+xml" title="Atom" href="{$atom_url}" />
|
||||||
|
<!--@end-->
|
||||||
|
<!--@if($general_rss_url)-->
|
||||||
|
<link rel="alternate" type="application/rss+xml" title="Site RSS" href="{$general_rss_url}" />
|
||||||
|
<link rel="alternate" type="application/atom+xml" title="Site Atom" href="{$general_atom_url}" />
|
||||||
<!--@end-->
|
<!--@end-->
|
||||||
|
|
||||||
{@ $ssl_actions = Context::getSSLActions() }
|
{@ $ssl_actions = Context::getSSLActions() }
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,8 @@
|
||||||
* @brief RSS 사용 유무를 체크하여 rss url 추가
|
* @brief RSS 사용 유무를 체크하여 rss url 추가
|
||||||
**/
|
**/
|
||||||
function triggerRssUrlInsert() {
|
function triggerRssUrlInsert() {
|
||||||
|
$oModuleModel = &getModel('module');
|
||||||
|
$total_config = $oModuleModel->getModuleConfig('rss');
|
||||||
$current_module_srl = Context::get('module_srl');
|
$current_module_srl = Context::get('module_srl');
|
||||||
$site_module_info = Context::get('site_module_info');
|
$site_module_info = Context::get('site_module_info');
|
||||||
|
|
||||||
|
|
@ -53,15 +55,15 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Context::isInstalled() && $site_module_info->mid == Context::get('mid')) {
|
if(Context::isInstalled() && $site_module_info->mid == Context::get('mid') && $total_config->use_total_feed != 'N') {
|
||||||
if(Context::isAllowRewrite() && !Context::get('vid')) {
|
if(Context::isAllowRewrite() && !Context::get('vid')) {
|
||||||
$request_uri = Context::getRequestUri();
|
$request_uri = Context::getRequestUri();
|
||||||
Context::set('rss_url', $request_uri.'rss');
|
Context::set('general_rss_url', $request_uri.'rss');
|
||||||
Context::set('atom_url', $request_uri.'atom');
|
Context::set('general_atom_url', $request_uri.'atom');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Context::set('rss_url', getUrl('','module','rss','act','rss'));
|
Context::set('general_rss_url', getUrl('','module','rss','act','rss'));
|
||||||
Context::set('atom_url', getUrl('','module','rss','act','atom'));
|
Context::set('general_atom_url', getUrl('','module','rss','act','atom'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
* @brief 피드 출력
|
* @brief 피드 출력
|
||||||
* 직접 RSS를 출력하려고 할때에는 $oRssView->rss($document_list)를 통해서 결과값을 직접 지정 가능
|
* 직접 RSS를 출력하려고 할때에는 $oRssView->rss($document_list)를 통해서 결과값을 직접 지정 가능
|
||||||
**/
|
**/
|
||||||
function rss($document_list = null, $rss_title = null) {
|
function rss($document_list = null, $rss_title = null, $add_description = null) {
|
||||||
$oDocumentModel = &getModel('document');
|
$oDocumentModel = &getModel('document');
|
||||||
$oModuleModel = &getModel('module');
|
$oModuleModel = &getModel('module');
|
||||||
$oModuleController = &getController('module');
|
$oModuleController = &getController('module');
|
||||||
|
|
@ -62,8 +62,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!count($module_srls)) return $this->dispError();
|
if(!count($module_srls) && !$add_description) return $this->dispError();
|
||||||
|
|
||||||
|
if($module_srls) {
|
||||||
$args->module_srl = implode(',',$module_srls);
|
$args->module_srl = implode(',',$module_srls);
|
||||||
$module_list = $oModuleModel->getMidList($args);
|
$module_list = $oModuleModel->getMidList($args);
|
||||||
|
|
||||||
|
|
@ -102,6 +103,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(!$info->title) {
|
if(!$info->title) {
|
||||||
if($rss_title) $info->title = $rss_title;
|
if($rss_title) $info->title = $rss_title;
|
||||||
|
|
@ -117,6 +119,7 @@
|
||||||
$info->link = Context::getRequestUri();
|
$info->link = Context::getRequestUri();
|
||||||
$info->feed_copyright = str_replace('\'', ''', htmlspecialchars($total_config->feed_copyright));
|
$info->feed_copyright = str_replace('\'', ''', htmlspecialchars($total_config->feed_copyright));
|
||||||
}
|
}
|
||||||
|
if($add_description) $info->description .= "\r\n".$add_description;
|
||||||
|
|
||||||
if($total_config->image) $info->image = Context::getRequestUri().str_replace('\'', ''', htmlspecialchars($total_config->image));
|
if($total_config->image) $info->image = Context::getRequestUri().str_replace('\'', ''', htmlspecialchars($total_config->image));
|
||||||
switch (Context::get('format')) {
|
switch (Context::get('format')) {
|
||||||
|
|
@ -132,8 +135,20 @@
|
||||||
$info->date = date("D, d M Y H:i:s").' '.$GLOBALS['_time_zone'];
|
$info->date = date("D, d M Y H:i:s").' '.$GLOBALS['_time_zone'];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($_SERVER['HTTPS']=='on') $proctcl = 'https://';
|
||||||
|
else $proctcl = 'http://';
|
||||||
|
|
||||||
$temp_link = explode('/', $info->link);
|
$temp_link = explode('/', $info->link);
|
||||||
if($temp_link[0]=='' && $info->link) $info->link = Context::getRequestUri().substr($info->link, 1);
|
if($temp_link[0]=='' && $info->link) {
|
||||||
|
$info->link = $proctcl.$_SERVER['HTTP_HOST'].$info->link;
|
||||||
|
}
|
||||||
|
|
||||||
|
$temp_id = explode('/', $info->id);
|
||||||
|
if($temp_id[0]=='' && $info->id) {
|
||||||
|
$info->id = $proctcl.$_SERVER['HTTP_HOST'].$info->id;
|
||||||
|
}
|
||||||
|
|
||||||
$info->language = Context::getLangType();
|
$info->language = Context::getLangType();
|
||||||
|
|
||||||
// RSS 출력물에서 사용될 변수 세팅
|
// RSS 출력물에서 사용될 변수 세팅
|
||||||
|
|
@ -189,12 +204,7 @@
|
||||||
Context::setResponseMethod("XMLRPC");
|
Context::setResponseMethod("XMLRPC");
|
||||||
|
|
||||||
// 출력 메세지 작성
|
// 출력 메세지 작성
|
||||||
Context::set('error', -1);
|
$this->rss(null, null, Context::getLang('msg_rss_is_disabled') );
|
||||||
Context::set('message', Context::getLang('msg_rss_is_disabled') );
|
|
||||||
|
|
||||||
// 템플릿 파일 지정
|
|
||||||
$this->setTemplatePath($this->module_path.'tpl');
|
|
||||||
$this->setTemplateFile("error");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue