mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
- 날짜, 유닉스 타임스탬프, 16진수(CKEditor) 등 여러 가지 포맷을 혼용하고 있던 캐시 방지용 쿼리스트링의 형태를 "유닉스 타임스탬프"로 통일 - 표준 시간대 처리 등 은근히 많은 자원을 소모하는 date() 함수를 사용하지 않음 - t=를 붙여서 정상적인 쿼리스트링 구조가 나오도록 하여, 웹방화벽이나 CDN 등에서 문제를 일으킬 가능성을 줄임 - 덤으로, 길이도 2바이트씩 짧아짐
54 lines
1.4 KiB
PHP
54 lines
1.4 KiB
PHP
<?php
|
|
/* Copyright (C) NAVER <http://www.navercorp.com> */
|
|
/**
|
|
* The model class of the rss module
|
|
*
|
|
* @author NAVER (developers@xpressengine.com)
|
|
*/
|
|
class rssModel extends rss
|
|
{
|
|
public static function getRssURL($format = 'rss', $mid = '')
|
|
{
|
|
return getFullUrl('', 'mid', $mid, 'act', $format);
|
|
}
|
|
|
|
public static function getConfig()
|
|
{
|
|
$config = ModuleModel::getModuleConfig('rss') ?: new stdClass;
|
|
$config->use_total_feed = $config->use_total_feed ?? 'Y';
|
|
$config->feed_document_count = intval($config->feed_document_count ?? 15) ?: 15;
|
|
if (isset($config->image) && $config->image)
|
|
{
|
|
$config->image_url = $config->image . '?t=' . filemtime($config->image);
|
|
}
|
|
|
|
return $config;
|
|
}
|
|
|
|
public static function getRssModuleConfig($module_srl)
|
|
{
|
|
$config = ModuleModel::getModulePartConfig('rss', $module_srl) ?: new stdClass;
|
|
$config->module_srl = $module_srl;
|
|
$config->open_rss = $config->open_rss ?? 'N';
|
|
$config->open_total_feed = $config->open_total_feed ?? 'N';
|
|
|
|
return $config;
|
|
}
|
|
|
|
/**
|
|
* Compatible function
|
|
*/
|
|
public static function getModuleFeedUrl($vid, $mid, $format = 'rss', $absolute_url = false)
|
|
{
|
|
if($absolute_url)
|
|
{
|
|
return getFullUrl('', 'vid', $vid, 'mid', $mid, 'act', $format);
|
|
}
|
|
else
|
|
{
|
|
return getUrl('', 'vid', $vid, 'mid', $mid, 'act', $format);
|
|
}
|
|
}
|
|
}
|
|
/* End of file rss.model.php */
|
|
/* Location: ./modules/rss/rss.model.php */
|