From b667808d95af0d7f70d35403fe136b08942af32f Mon Sep 17 00:00:00 2001 From: conory Date: Tue, 5 Sep 2017 10:18:26 +0900 Subject: [PATCH] =?UTF-8?q?Feed=20=EC=9C=A0=ED=9A=A8=EC=84=B1=20=ED=86=B5?= =?UTF-8?q?=EA=B3=BC!=20https://validator.w3.org/feed/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/document/document.item.php | 8 ++++---- modules/rss/rss.view.php | 13 ++++++++++--- modules/rss/tpl/format/atom10.html | 2 +- modules/rss/tpl/format/rss10.html | 4 ++-- modules/rss/tpl/format/rss20.html | 11 ++++++----- modules/rss/tpl/format/xe.html | 8 ++++---- 6 files changed, 27 insertions(+), 19 deletions(-) diff --git a/modules/document/document.item.php b/modules/document/document.item.php index b5359c132..dfde4a1f7 100644 --- a/modules/document/document.item.php +++ b/modules/document/document.item.php @@ -689,12 +689,12 @@ class documentItem extends Object function getRegdateGM() { - return gmdate('r', ztime($this->get('regdate'))); + return Rhymix\Framework\DateTime::formatTimestampForCurrentUser('r', $this->getRegdateTime()); } function getRegdateDT() { - return zdate($this->get('regdate'), 'c', false); + return Rhymix\Framework\DateTime::formatTimestampForCurrentUser('c', $this->getRegdateTime()); } function getUpdate($format = 'Y.m.d H:i:s', $conversion = true) @@ -709,12 +709,12 @@ class documentItem extends Object function getUpdateGM() { - return gmdate('r', ztime($this->get('last_update'))); + return Rhymix\Framework\DateTime::formatTimestampForCurrentUser('r', $this->getUpdateTime()); } function getUpdateDT() { - return zdate($this->get('last_update'), 'c', false); + return Rhymix\Framework\DateTime::formatTimestampForCurrentUser('c', $this->getUpdateTime()); } function getPermanentUrl() diff --git a/modules/rss/rss.view.php b/modules/rss/rss.view.php index 0136bba9b..fb5e1534e 100644 --- a/modules/rss/rss.view.php +++ b/modules/rss/rss.view.php @@ -47,6 +47,7 @@ class rssView extends rss $obj = new stdClass; } + $act = Context::get('act'); $page = $obj->page ?: Context::get('page'); $start = $obj->start_date ?: Context::get('start_date'); $end = $obj->end_date ?: Context::get('end_date'); @@ -71,7 +72,6 @@ class rssView extends rss break; // RSS 2.0 (default) default: - $format = ''; $template = 'rss20'; break; } @@ -81,6 +81,12 @@ class rssView extends rss $module_config = $oRssModel->getRssModuleConfig($target_module_srl); $module_info = getModel('module')->getModuleInfoByModuleSrl($target_module_srl); + // Get URL + $format = ($act != $format) ? $format : ''; + $mid = $is_part_feed ? $module_info->mid : ''; + $channel_url = getFullUrl('', 'mid', $mid, 'act', $act, 'format', $format, 'page', $page, 'start_date', $start, 'end_date', $end); + + // Check error if($obj->error) { Context::set('target_modules', array()); @@ -167,13 +173,14 @@ class rssView extends rss $info->feed_copyright = $config->feed_copyright; } - $info->id = getFullUrl('', 'mid', $module_info->mid, 'act', 'rss', 'format', $format, 'page', $page, 'start_date', $start, 'end_date', $end); + $info->id = $channel_url; $info->title = $obj->title ?: $info->title; $info->feed_title = $config->feed_title; $info->description = $obj->description ?: $info->description; $info->language = Context::getLangType(); $info->site_url = Context::getRequestUri(); - $info->date = Rhymix\Framework\DateTime::formatTimestampForCurrentUser('c'); + $info->dateGM = Rhymix\Framework\DateTime::formatTimestampForCurrentUser('r'); + $info->dateDT = Rhymix\Framework\DateTime::formatTimestampForCurrentUser('c'); $info->image = $config->image ? Context::getRequestUri() . $config->image : ''; getController('module')->replaceDefinedLangCode($info->title); diff --git a/modules/rss/tpl/format/atom10.html b/modules/rss/tpl/format/atom10.html index 1c2f7f4d2..4fafda379 100644 --- a/modules/rss/tpl/format/atom10.html +++ b/modules/rss/tpl/format/atom10.html @@ -6,7 +6,7 @@ {$info->description} - {$info->date} + {$info->dateDT} {$info->id} Rhymix {$info->feed_copyright} diff --git a/modules/rss/tpl/format/rss10.html b/modules/rss/tpl/format/rss10.html index 4c9060c04..0b23212d8 100644 --- a/modules/rss/tpl/format/rss10.html +++ b/modules/rss/tpl/format/rss10.html @@ -7,7 +7,7 @@ {$info->link} {$info->description} {$info->language} - {$info->date} + {$info->dateDT} {$info->feed_copyright} @@ -28,7 +28,7 @@ {$oDocument->getTitleText()} {$oDocument->getPermanentUrl()} - {$oDocument->getSummary(400)} + {$oDocument->getSummary(400)|escape} {$oDocument->getNickName()} {$oDocument->getRegdateDT()} diff --git a/modules/rss/tpl/format/rss20.html b/modules/rss/tpl/format/rss20.html index c0e658f4a..d11801736 100644 --- a/modules/rss/tpl/format/rss20.html +++ b/modules/rss/tpl/format/rss20.html @@ -1,13 +1,14 @@ {''} - + {$info->title} {$info->link} {$info->description} + {$info->language} - {$info->date} + {$info->dateGM} Rhymix {$info->feed_copyright} @@ -21,15 +22,15 @@ {utf8_trim(utf8_normalize_spaces($oDocument->get('content')))|escape} - {$oDocument->getSummary(400)} + {$oDocument->getSummary(400)|escape} {$oDocument->getModuleName()} {$category_name} {$tag} - {$oDocument->getNickName()} + {$oDocument->getNickName()} {$oDocument->getPermanentUrl()} {$oDocument->getPermanentUrl()}#comment - {$oDocument->getRegdateDT()} + {$oDocument->getRegdateGM()} diff --git a/modules/rss/tpl/format/xe.html b/modules/rss/tpl/format/xe.html index 8eac113a5..287a34d28 100644 --- a/modules/rss/tpl/format/xe.html +++ b/modules/rss/tpl/format/xe.html @@ -7,7 +7,7 @@ {$info->link} {$info->description} {$info->language} - {$info->date} + {$info->dateGM} {$info->total_count} {$info->total_page} @@ -17,13 +17,13 @@ {utf8_trim(utf8_normalize_spaces($oDocument->get('content')))|escape} - {$oDocument->getSummary(400)} + {$oDocument->getSummary(400)|escape} {$oDocument->get('tags')} {$oDocument->getCommentCount()} {$oDocument->getTrackbackCount()} - {$oDocument->getRegdateDT()} - {$oDocument->getUpdateDT()} + {$oDocument->getRegdateGM()} + {$oDocument->getUpdateGM()}