mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
RSS 모듈 재정비
This commit is contained in:
parent
cc21af669f
commit
2440058557
27 changed files with 613 additions and 764 deletions
|
|
@ -1,15 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module version="0.2">
|
||||
<title xml:lang="ko">RSS</title>
|
||||
<title xml:lang="zh-CN">整站RSS</title>
|
||||
<title xml:lang="jp">RSS</title>
|
||||
<title xml:lang="en">RSS</title>
|
||||
<title xml:lang="vi">RSS</title>
|
||||
<title xml:lang="es">RSS</title>
|
||||
<title xml:lang="ru">RSS</title>
|
||||
<title xml:lang="zh-TW">RSS</title>
|
||||
<title xml:lang="tr">RSS</title>
|
||||
<description xml:lang="ko">RSS 출력을 담당</description>
|
||||
<description xml:lang="ko">RSS 출력을 담당하는 모듈입니다.</description>
|
||||
<description xml:lang="zh-CN">负责输出RSS的模块。</description>
|
||||
<description xml:lang="jp">RSS出力を担うモジュールです。</description>
|
||||
<description xml:lang="en">This modules is for printing RSS.</description>
|
||||
|
|
@ -18,8 +10,8 @@
|
|||
<description xml:lang="ru">Этот модуль служит для печати RSS.</description>
|
||||
<description xml:lang="zh-TW">負責輸出 RSS 的模組。</description>
|
||||
<description xml:lang="tr">Bu modül RSS çıktısı almak içindir.</description>
|
||||
<version>1.7</version>
|
||||
<date>2013-11-27</date>
|
||||
<version>2.0</version>
|
||||
<date>2017-09-01</date>
|
||||
<category>utility</category>
|
||||
|
||||
<author email_address="developers@xpressengine.com" link="http://xpressengine.com/">
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
<action name="dispRssAdminIndex" type="view" index="true" admin_index="true" menu_name="rss" menu_index="true" />
|
||||
<action name="procRssAdminInsertConfig" type="controller" ruleset="insertRssConfig" />
|
||||
<action name="procRssAdminDeleteFeedImage" type="controller" />
|
||||
<action name="procRssAdminInsertModuleConfig" type="controller" permission="manager" check_var="target_module_srl" />
|
||||
<action name="procRssAdminDeleteFeedImage" type="controller" />
|
||||
</actions>
|
||||
<menus>
|
||||
<menu name="rss">
|
||||
|
|
|
|||
|
|
@ -18,4 +18,4 @@ $lang->about_feed_description = 'You can enter the description on the RSS feed t
|
|||
$lang->about_feed_copyright = 'You can enter copyright information on the RSS feed. If you don\'t enter this, the copyright of the entire RSS feeds is applied.';
|
||||
$lang->about_feed_document_count = 'Number of articles to be displayed on one feed page (default: 15)';
|
||||
$lang->msg_rss_is_disabled = 'RSS function is disabled.';
|
||||
$lang->msg_rss_invalid_image_format = 'Invalid image format. \\nOnly JPEG, GIF, and PNG files are supported.';
|
||||
$lang->msg_rss_invalid_image_format = 'Invalid image format. Only JPG, JPEG, GIF, and PNG files are supported.';
|
||||
|
|
|
|||
|
|
@ -18,4 +18,4 @@ $lang->about_feed_description = '発行するRSSに関する説明を入力し
|
|||
$lang->about_feed_copyright = '発行するRSSのコンテンツに対する著作権情報です。未入力の場合、全体RSS著作権の設定と同様に適用されます。';
|
||||
$lang->about_feed_document_count = 'RSSに配信するコンテンツの数 (デフォルト : 15)';
|
||||
$lang->msg_rss_is_disabled = 'RSS機能がロックされています。';
|
||||
$lang->msg_rss_invalid_image_format = 'サポートしないイメージファイルです。\\nJPEG, GIF, PNGファイルのみサポートします。';
|
||||
$lang->msg_rss_invalid_image_format = 'サポートしないイメージファイルです。JPG, JPEG, GIF, PNGファイルのみサポートします。';
|
||||
|
|
|
|||
|
|
@ -18,4 +18,4 @@ $lang->about_feed_description = '발행될 피드에 대한 설명을 입력할
|
|||
$lang->about_feed_copyright = '발행될 피드에 대한 저작권 정보를 입력할 수 있습니다. 입력하지 않으면 전체 피드 저작권 설정과 동일하게 적용됩니다.';
|
||||
$lang->about_feed_document_count = '피드 한 페이지에 공개되는 글 수. (기본 값 : 15)';
|
||||
$lang->msg_rss_is_disabled = '피드(Feed) 기능이 잠겨 있습니다.';
|
||||
$lang->msg_rss_invalid_image_format = '이미지의 형식이 잘못되었습니다.\\nJPEG, GIF, PNG 파일만 지원합니다.';
|
||||
$lang->msg_rss_invalid_image_format = '이미지의 형식이 잘못되었습니다. JPG, JPEG, GIF, PNG 파일만 지원합니다.';
|
||||
|
|
|
|||
|
|
@ -15,4 +15,4 @@ $lang->about_rss_disable = 'Если выбрано, RSS будет отключ
|
|||
$lang->about_rss_type = 'Вы можете присвоить тип RSS.';
|
||||
$lang->about_open_rss = 'Вы можете выбрать для того, чтобы RSS доступен публично.\\nНезависимо от разрешений для статьи, RSS будет доступна публично согласно ее настройке.';
|
||||
$lang->msg_rss_is_disabled = 'Функция RSS выключена.';
|
||||
$lang->msg_rss_invalid_image_format = 'Неправильный тип картинки\\nПоддерживаются только JPEG, GIF, PNG файлы';
|
||||
$lang->msg_rss_invalid_image_format = 'Неправильный тип картинки Поддерживаются только JPG, JPEG, GIF, PNG файлы';
|
||||
|
|
|
|||
|
|
@ -18,4 +18,4 @@ $lang->about_feed_description = '可以输入简单说明,留空输出该模块
|
|||
$lang->about_feed_copyright = 'RSS Feed版权信息。留空版权信息参照整站RSS的版权信息。';
|
||||
$lang->about_feed_document_count = '每页要显示的主题数(默认: 15)。';
|
||||
$lang->msg_rss_is_disabled = 'RSS功能处于锁定状态。';
|
||||
$lang->msg_rss_invalid_image_format = '上传的文件格式错误!\\n只允许上传JPEG, GIF, PNG图片文件。';
|
||||
$lang->msg_rss_invalid_image_format = '上传的文件格式错误! 只允许上传JPG, JPEG, GIF, PNG图片文件。';
|
||||
|
|
|
|||
|
|
@ -18,4 +18,4 @@ $lang->about_feed_description = '請輸入簡介。 也可輸入相關管理使
|
|||
$lang->about_feed_copyright = '請輸入 Feed 著作權資料。著作權將會適用所有的 Feed 內容。';
|
||||
$lang->about_feed_document_count = '每頁要顯示的主題數。(預設: 15)';
|
||||
$lang->msg_rss_is_disabled = 'RSS Feed 功能未開啟。';
|
||||
$lang->msg_rss_invalid_image_format = '錯誤的檔案格式,無法上傳。\\n只允許上傳 JPEG, GIF, PNG 等檔案格式。';
|
||||
$lang->msg_rss_invalid_image_format = '錯誤的檔案格式,無法上傳。 只允許上傳 JPG, JPEG, GIF, PNG 等檔案格式。';
|
||||
|
|
|
|||
|
|
@ -7,180 +7,180 @@
|
|||
*/
|
||||
class rssAdminController extends rss
|
||||
{
|
||||
/**
|
||||
* Initialization
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* All RSS feeds configurations
|
||||
*
|
||||
* @return void
|
||||
* configuration
|
||||
*/
|
||||
function procRssAdminInsertConfig()
|
||||
{
|
||||
$oModuleModel = getModel('module');
|
||||
$total_config = $oModuleModel->getModuleConfig('rss');
|
||||
|
||||
$config_vars = Context::getRequestVars();
|
||||
$config_vars->feed_document_count = (int)$config_vars->feed_document_count;
|
||||
|
||||
if(!$config_vars->use_total_feed) $alt_message = 'msg_invalid_request';
|
||||
if(!in_array($config_vars->use_total_feed, array('Y','N'))) $config_vars->open_rss = 'Y';
|
||||
|
||||
if($config_vars->image || $config_vars->del_image)
|
||||
$vars = Context::getRequestVars();
|
||||
$config = getModel('rss')->getConfig();
|
||||
|
||||
if($img_file = $vars->image)
|
||||
{
|
||||
$image_obj = $config_vars->image;
|
||||
$config_vars->image = $total_config->image;
|
||||
// Get a variable for the delete request
|
||||
if($config_vars->del_image == 'Y' || $image_obj)
|
||||
// Delete image file
|
||||
if($config->image)
|
||||
{
|
||||
FileHandler::removeFile($config_vars->image);
|
||||
$config_vars->image = '';
|
||||
$total_config->image = '';
|
||||
FileHandler::removeFile($config->image);
|
||||
}
|
||||
// Ignore if the file is not the one which has been successfully uploaded
|
||||
if($image_obj['tmp_name'] && is_uploaded_file($image_obj['tmp_name']))
|
||||
|
||||
$vars->image = '';
|
||||
|
||||
// Upload image file
|
||||
if($img_file['tmp_name'] && is_uploaded_file($img_file['tmp_name']))
|
||||
{
|
||||
// Ignore if the file is not an image (swf is accepted ~)
|
||||
$image_obj['name'] = Context::convertEncodingStr($image_obj['name']);
|
||||
|
||||
if(!preg_match("/\.(jpg|jpeg|gif|png)$/i", $image_obj['name'])) $alt_message = 'msg_rss_invalid_image_format';
|
||||
$path = 'files/attach/images/rss';
|
||||
$file_ext = strtolower(array_pop(explode('.', $img_file['name'])));
|
||||
$file_name = sprintf('%s/feed_image.%s', $path, $file_ext);
|
||||
|
||||
// If file exists, delete
|
||||
if(file_exists($file_name))
|
||||
{
|
||||
FileHandler::removeFile($file_name);
|
||||
}
|
||||
|
||||
// Check image file extension
|
||||
if(!in_array($file_ext, array('jpg', 'jpeg', 'gif', 'png')))
|
||||
{
|
||||
$msg['error'] = 'msg_rss_invalid_image_format';
|
||||
}
|
||||
// Move the file
|
||||
else if(!FileHandler::makeDir($path) || !@move_uploaded_file($img_file['tmp_name'], $file_name))
|
||||
{
|
||||
$msg['error'] = 'file.msg_file_upload_error';
|
||||
}
|
||||
// Success
|
||||
else
|
||||
{
|
||||
// Upload the file to a path
|
||||
$path = './files/attach/images/rss/';
|
||||
// Create a directory
|
||||
if(!FileHandler::makeDir($path)) $alt_message = 'msg_error_occured';
|
||||
else
|
||||
{
|
||||
$filename = $path.$image_obj['name'];
|
||||
|
||||
// Move the file
|
||||
if(!move_uploaded_file($image_obj['tmp_name'], $filename)) $alt_message = 'msg_error_occured';
|
||||
else
|
||||
{
|
||||
$config_vars->image = $filename;
|
||||
}
|
||||
}
|
||||
$vars->image = $file_name;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!$config_vars->image && $config_vars->del_image != 'Y') $config_vars->image = $total_config->image;
|
||||
|
||||
$output = $this->setFeedConfig($config_vars);
|
||||
|
||||
if(!$alt_message) $alt_message = 'success_updated';
|
||||
|
||||
$alt_message = lang($alt_message);
|
||||
$this->setMessage($alt_message, 'info');
|
||||
|
||||
//$this->setLayoutPath('./common/tpl');
|
||||
//$this->setLayoutFile('default_layout.html');
|
||||
//$this->setTemplatePath($this->module_path.'tpl');
|
||||
//$this->setTemplateFile("top_refresh.html");
|
||||
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispRssAdminIndex');
|
||||
$this->setRedirectUrl($returnUrl);
|
||||
}
|
||||
|
||||
public function procRssAdminDeleteFeedImage()
|
||||
{
|
||||
$delImage = Context::get('del_image');
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
$originConfig = $oModuleModel->getModuleConfig('rss');
|
||||
|
||||
// Get a variable for the delete request
|
||||
if($delImage == 'Y')
|
||||
|
||||
if(!in_array($vars->use_total_feed, array('Y','N')))
|
||||
{
|
||||
FileHandler::removeFile($originConfig->image);
|
||||
|
||||
$originConfig->image = '';
|
||||
$output = $this->setFeedConfig($originConfig);
|
||||
return new Object(0, 'success_updated');
|
||||
$vars->open_rss = 'Y';
|
||||
}
|
||||
return new Object(-1, 'fail_to_delete');
|
||||
$vars->feed_document_count = (int) $vars->feed_document_count;
|
||||
|
||||
getController('module')->updateModuleConfig('rss', $vars);
|
||||
|
||||
if(isset($msg['error']))
|
||||
{
|
||||
return new Object(-1, $msg['error']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->setMessage(isset($msg) ? $msg : 'success_updated');
|
||||
}
|
||||
|
||||
$this->setRedirectUrl(Context::get('success_return_url') ?: getNotEncodedUrl('', 'module', 'admin', 'act', 'dispRssAdminIndex'));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* RSS Module configurations
|
||||
*
|
||||
* @return void
|
||||
* Part configuration
|
||||
*/
|
||||
function procRssAdminInsertModuleConfig()
|
||||
{
|
||||
$vars = Context::getRequestVars();
|
||||
|
||||
if (!in_array($vars->open_rss, array('Y', 'H', 'N')))
|
||||
|
||||
if($vars->target_module_srl)
|
||||
{
|
||||
$vars->open_rss = 'N';
|
||||
$target_module_srls = explode(',', $vars->target_module_srl);
|
||||
}
|
||||
else
|
||||
{
|
||||
$target_module_srls = array_keys($vars->open_rss);
|
||||
}
|
||||
|
||||
if (!in_array($vars->open_total_feed, array('N', 'T_N')))
|
||||
{
|
||||
$vars->open_total_feed = 'T_N';
|
||||
}
|
||||
|
||||
$target_module_srls = explode(',', $vars->target_module_srl);
|
||||
if (!count($target_module_srls))
|
||||
if(!count($target_module_srls))
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
}
|
||||
|
||||
foreach ($target_module_srls as $target_module_srl)
|
||||
foreach($target_module_srls as $module_srl)
|
||||
{
|
||||
$target_module_srl = intval($target_module_srl);
|
||||
if (!$target_module_srl)
|
||||
if(!$module_srl = intval($module_srl))
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->setRssModuleConfig($target_module_srl, $vars->open_rss, $vars->open_total_feed, $vars->feed_description, $vars->feed_copyright);
|
||||
$config = new stdClass;
|
||||
if(isset($vars->open_rss[$module_srl]))
|
||||
{
|
||||
$config->open_rss = $vars->open_rss[$module_srl];
|
||||
$config->open_total_feed = $vars->open_total_feed[$module_srl];
|
||||
$config->feed_description = $vars->feed_description[$module_srl];
|
||||
}
|
||||
else
|
||||
{
|
||||
$config->open_rss = $vars->open_rss;
|
||||
$config->open_total_feed = $vars->open_total_feed;
|
||||
$config->feed_description = $vars->feed_description;
|
||||
$config->feed_copyright = $vars->feed_copyright;
|
||||
}
|
||||
|
||||
if(!in_array($config->open_rss, array('Y', 'H', 'N')))
|
||||
{
|
||||
$config->open_rss = 'N';
|
||||
}
|
||||
if(!in_array($config->open_total_feed, array('N', 'T_N')))
|
||||
{
|
||||
$config->open_total_feed = 'T_N';
|
||||
}
|
||||
|
||||
getController('module')->updateModulePartConfig('rss', $module_srl, $config);
|
||||
}
|
||||
|
||||
$this->setMessage('success_updated', 'info');
|
||||
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispBoardAdminContent');
|
||||
$this->setRedirectUrl($returnUrl);
|
||||
$this->setMessage('success_updated');
|
||||
$this->setRedirectUrl(Context::get('success_return_url') ?: getNotEncodedUrl('', 'module', 'admin', 'act', 'dispRssAdminIndex'));
|
||||
}
|
||||
|
||||
|
||||
function procRssAdminDeleteFeedImage()
|
||||
{
|
||||
$config = getModel('rss')->getConfig();
|
||||
if(!$config->image)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
}
|
||||
|
||||
FileHandler::removeFile($config->image);
|
||||
|
||||
$config->image = '';
|
||||
getController('module')->insertModuleConfig('rss', $config);
|
||||
}
|
||||
|
||||
/**
|
||||
* A funciton to configure all Feeds of the RSS module
|
||||
*
|
||||
* @param Object $config RSS all feeds config list
|
||||
* @return Object
|
||||
* Compatible function
|
||||
*/
|
||||
function setFeedConfig($config)
|
||||
{
|
||||
$oModuleController = getController('module');
|
||||
$oModuleController->insertModuleConfig('rss',$config);
|
||||
getController('module')->insertModuleConfig('rss', $config);
|
||||
return new Object();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A function t configure the RSS module
|
||||
*
|
||||
* @param integer $module_srl Module_srl
|
||||
* @param string $open_rss Choose open rss type. Y : Open all, H : Open summary, N : Not open
|
||||
* @param string $open_total_feed N : use open total feed, T_N : not use open total feed
|
||||
* @param string $feed_description Default value is 'N'
|
||||
* @param string $feed_copyright Default value is 'N'
|
||||
* @return Object
|
||||
* Compatible function
|
||||
*/
|
||||
function setRssModuleConfig($module_srl, $open_rss, $open_total_feed = 'N', $feed_description = 'N', $feed_copyright = 'N')
|
||||
{
|
||||
$oModuleController = getController('module');
|
||||
$config = new stdClass;
|
||||
$config->open_rss = $open_rss;
|
||||
$config->open_total_feed = $open_total_feed;
|
||||
if($feed_description != 'N') { $config->feed_description = $feed_description; }
|
||||
if($feed_copyright != 'N') { $config->feed_copyright = $feed_copyright; }
|
||||
$oModuleController->insertModulePartConfig('rss',$module_srl,$config);
|
||||
|
||||
if($feed_description != 'N')
|
||||
{
|
||||
$config->feed_description = $feed_description;
|
||||
}
|
||||
if($feed_copyright != 'N')
|
||||
{
|
||||
$config->feed_copyright = $feed_copyright;
|
||||
}
|
||||
|
||||
getController('module')->insertModulePartConfig('rss', $module_srl, $config);
|
||||
return new Object();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,64 +7,35 @@
|
|||
*/
|
||||
class rssAdminView extends rss
|
||||
{
|
||||
/**
|
||||
* Initialization
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
//Set template path
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
Context::set('config', getModel('rss')->getConfig());
|
||||
|
||||
$this->setTemplatePath($this->module_path . 'tpl');
|
||||
}
|
||||
|
||||
/**
|
||||
* In case an administrator page has been initialized
|
||||
*
|
||||
* @return Object
|
||||
*/
|
||||
|
||||
function dispRssAdminIndex()
|
||||
{
|
||||
$oModuleModel = getModel('module');
|
||||
$rss_config = $oModuleModel->getModulePartConfigs('rss');
|
||||
$total_config = $oModuleModel->getModuleConfig('rss');
|
||||
if(!$total_config)
|
||||
{
|
||||
$total_config = new stdClass();
|
||||
}
|
||||
$oRssModel = getModel('rss');
|
||||
|
||||
if($rss_config)
|
||||
$oModuleModel = getModel('module');
|
||||
|
||||
$rss_list = array();
|
||||
foreach($oModuleModel->getModulePartConfigs('rss') as $module_srl => $module_config)
|
||||
{
|
||||
$feed_config = array();
|
||||
foreach($rss_config as $module_srl => $config)
|
||||
{
|
||||
if($config)
|
||||
{
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
||||
$columnList = array('sites.domain');
|
||||
$site = $oModuleModel->getSiteInfo($module_info->site_srl, $columnList);
|
||||
if(!strpos($site->domain, '.')) $vid = $site->domain;
|
||||
else $site = null;
|
||||
if($site) $feed_config[$module_srl]['url'] = $oRssModel->getModuleFeedUrl($vid, $module_info->mid, 'rss');
|
||||
$feed_config[$module_srl]['mid'] = $module_info->mid;
|
||||
$feed_config[$module_srl]['open_feed'] = $config->open_rss;
|
||||
$feed_config[$module_srl]['open_total_feed'] = $config->open_total_feed;
|
||||
$feed_config[$module_srl]['feed_description'] = $config->feed_description;
|
||||
}
|
||||
}
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
||||
|
||||
$args = new stdClass;
|
||||
$args->mid = $module_info->mid;
|
||||
$args->url = $oRssModel->getRssURL('rss', $module_info->mid);
|
||||
$args->open_feed = $module_config->open_rss;
|
||||
$args->open_total_feed = $module_config->open_total_feed;
|
||||
$args->feed_description = $module_config->feed_description;
|
||||
|
||||
$rss_list[$module_srl] = $args;
|
||||
}
|
||||
if(!$total_config->feed_document_count) $total_config->feed_document_count = 15;
|
||||
$total_config->url = $oRssModel->getModuleFeedUrl(NULL, '', 'rss', true);
|
||||
|
||||
Context::set('feed_config', $feed_config);
|
||||
Context::set('total_config', $total_config);
|
||||
|
||||
$security = new Security();
|
||||
$security->encodeHTML('feed_config..mid','feed_config..url');
|
||||
$security->encodeHTML('total_config..');
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
Context::set('rss_list', $rss_list);
|
||||
Context::set('general_rss_url', $oRssModel->getRssURL('rss'));
|
||||
|
||||
$this->setTemplateFile('rss_admin_index');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,85 +7,108 @@
|
|||
*/
|
||||
class rss extends ModuleObject
|
||||
{
|
||||
public $gzhandler_enable = false;
|
||||
|
||||
// Add forwards
|
||||
protected static $add_forwards = array(
|
||||
array('rss', 'view', 'rss'),
|
||||
array('rss', 'view', 'atom'),
|
||||
);
|
||||
|
||||
// Add triggers
|
||||
protected static $add_triggers = array(
|
||||
array('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after'),
|
||||
array('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before'),
|
||||
array('module.procModuleAdminCopyModule', 'rss', 'controller', 'triggerCopyModule', 'after'),
|
||||
);
|
||||
|
||||
// Remove triggers
|
||||
protected static $remove_triggers = array(
|
||||
array('display', 'rss', 'controller', 'triggerRssUrlInsert', 'before'),
|
||||
);
|
||||
|
||||
/**
|
||||
* Additional tasks required to accomplish during the installation
|
||||
*
|
||||
* @return Object
|
||||
* Install
|
||||
*/
|
||||
function moduleInstall()
|
||||
{
|
||||
// Register in action forward
|
||||
$oModuleController = getController('module');
|
||||
|
||||
$oModuleController->insertActionForward('rss', 'view', 'rss');
|
||||
$oModuleController->insertActionForward('rss', 'view', 'atom');
|
||||
// 2007.10.18 Add a trigger for participating additional configurations of the service module
|
||||
$oModuleController->insertTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before');
|
||||
// 2007. 10. 19 Call the trigger to set RSS URL before outputing
|
||||
$oModuleController->insertTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after');
|
||||
|
||||
$this->moduleUpdate();
|
||||
return new Object();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A method to check if the installation has been successful
|
||||
* @return bool
|
||||
* Check update
|
||||
*/
|
||||
function checkUpdate()
|
||||
{
|
||||
$oModuleModel = getModel('module');
|
||||
// Add the Action forward for atom
|
||||
if(!$oModuleModel->getActionForward('atom')) return true;
|
||||
// 2007. 10. Add a trigger for participating additional configurations of the service module
|
||||
if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before')) return true;
|
||||
// 2007. 10. 19 Call the trigger to set RSS URL before outputing
|
||||
if(!$oModuleModel->getTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after')) return true;
|
||||
|
||||
if($oModuleModel->getTrigger('display', 'rss', 'controller', 'triggerRssUrlInsert', 'before')) return true;
|
||||
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'rss', 'controller', 'triggerCopyModule', 'after')) return true;
|
||||
|
||||
|
||||
// Check forwards for add
|
||||
foreach(self::$add_forwards as $forward)
|
||||
{
|
||||
if(!$oModuleModel->getActionForward($forward[2]))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Check triggers for add
|
||||
foreach(self::$add_triggers as $trigger)
|
||||
{
|
||||
if(!$oModuleModel->getTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Check triggers for remove
|
||||
foreach(self::$remove_triggers as $trigger)
|
||||
{
|
||||
if($oModuleModel->getTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Execute update
|
||||
*
|
||||
* @return Object
|
||||
* Update
|
||||
*/
|
||||
function moduleUpdate()
|
||||
{
|
||||
$oModuleModel = getModel('module');
|
||||
$oModuleController = getController('module');
|
||||
// Add atom act
|
||||
if(!$oModuleModel->getActionForward('atom'))
|
||||
$oModuleController->insertActionForward('rss', 'view', 'atom');
|
||||
// 2007. 10. An additional set of 18 to participate in a service module, add a trigger
|
||||
if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before'))
|
||||
$oModuleController->insertTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before');
|
||||
// 2007. 10. 19 outputs the trigger before you call to set up rss url
|
||||
if(!$oModuleModel->getTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after'))
|
||||
$oModuleController->insertTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after');
|
||||
if($oModuleModel->getTrigger('display', 'rss', 'controller', 'triggerRssUrlInsert', 'before'))
|
||||
$oModuleController->deleteTrigger('display', 'rss', 'controller', 'triggerRssUrlInsert', 'before');
|
||||
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'rss', 'controller', 'triggerCopyModule', 'after'))
|
||||
|
||||
// Add forwards
|
||||
foreach(self::$add_forwards as $forward)
|
||||
{
|
||||
$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'rss', 'controller', 'triggerCopyModule', 'after');
|
||||
if(!$oModuleModel->getActionForward($forward[2]))
|
||||
{
|
||||
$oModuleController->insertActionForward($forward[0], $forward[1], $forward[2]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Add triggers
|
||||
foreach(self::$add_triggers as $trigger)
|
||||
{
|
||||
if(!$oModuleModel->getTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]))
|
||||
{
|
||||
$oModuleController->insertTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]);
|
||||
}
|
||||
}
|
||||
|
||||
// Remove triggers
|
||||
foreach(self::$remove_triggers as $trigger)
|
||||
{
|
||||
if($oModuleModel->getTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]))
|
||||
{
|
||||
$oModuleController->deleteTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]);
|
||||
}
|
||||
}
|
||||
|
||||
return new Object(0, 'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
* Re-generate the cache file
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
function recompileCache()
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,77 +7,49 @@
|
|||
*/
|
||||
class rssController extends rss
|
||||
{
|
||||
/**
|
||||
* Initialization
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check whether to use RSS rss url by adding
|
||||
*
|
||||
* @return Object
|
||||
* Set RSS URL
|
||||
*/
|
||||
function triggerRssUrlInsert()
|
||||
function triggerRssUrlInsert($obj)
|
||||
{
|
||||
$oModuleModel = getModel('module');
|
||||
$total_config = $oModuleModel->getModuleConfig('rss');
|
||||
$current_module_srl = Context::get('module_srl');
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
|
||||
if(is_array($current_module_srl))
|
||||
if(!$current_module_srl = Context::get('current_module_info')->module_srl)
|
||||
{
|
||||
unset($current_module_srl);
|
||||
return new Object();
|
||||
}
|
||||
if(!$current_module_srl) {
|
||||
$current_module_info = Context::get('current_module_info');
|
||||
$current_module_srl = $current_module_info->module_srl;
|
||||
}
|
||||
|
||||
if(!$current_module_srl) return new Object();
|
||||
// Imported rss settings of the selected module
|
||||
|
||||
$oRssModel = getModel('rss');
|
||||
$rss_config = $oRssModel->getRssModuleConfig($current_module_srl);
|
||||
|
||||
if($rss_config->open_rss != 'N')
|
||||
$config = $oRssModel->getConfig();
|
||||
$module_config = $oRssModel->getRssModuleConfig($current_module_srl);
|
||||
|
||||
if($config->use_total_feed != 'N' && Context::get('site_module_info')->mid == Context::get('mid'))
|
||||
{
|
||||
Context::set('rss_url', $oRssModel->getModuleFeedUrl(Context::get('vid'), Context::get('mid'), 'rss'));
|
||||
Context::set('atom_url', $oRssModel->getModuleFeedUrl(Context::get('vid'), Context::get('mid'), 'atom'));
|
||||
Context::set('general_rss_url', $oRssModel->getRssURL('rss'));
|
||||
Context::set('general_atom_url', $oRssModel->getRssURL('atom'));
|
||||
}
|
||||
|
||||
if(Context::isInstalled() && $site_module_info->mid == Context::get('mid') && $total_config->use_total_feed != 'N')
|
||||
|
||||
if($module_config->open_rss != 'N')
|
||||
{
|
||||
if(Context::isAllowRewrite() && !Context::get('vid'))
|
||||
{
|
||||
$request_uri = Context::getRequestUri();
|
||||
Context::set('general_rss_url', $request_uri.'rss');
|
||||
Context::set('general_atom_url', $request_uri.'atom');
|
||||
}
|
||||
else
|
||||
{
|
||||
Context::set('general_rss_url', getUrl('','module','rss','act','rss'));
|
||||
Context::set('general_atom_url', getUrl('','module','rss','act','atom'));
|
||||
}
|
||||
Context::set('rss_url', $oRssModel->getRssURL('rss', Context::get('mid')));
|
||||
Context::set('atom_url', $oRssModel->getRssURL('atom', Context::get('mid')));
|
||||
}
|
||||
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Copy RSS configuration
|
||||
*/
|
||||
function triggerCopyModule(&$obj)
|
||||
{
|
||||
$oModuleModel = getModel('module');
|
||||
$rssConfig = $oModuleModel->getModulePartConfig('rss', $obj->originModuleSrl);
|
||||
|
||||
$oModuleController = getController('module');
|
||||
if(is_array($obj->moduleSrlList))
|
||||
$module_config = getModel('rss')->getRssModuleConfig($obj->originModuleSrl);
|
||||
|
||||
foreach($obj->moduleSrlList as $module_srl)
|
||||
{
|
||||
foreach($obj->moduleSrlList AS $key=>$moduleSrl)
|
||||
{
|
||||
$oModuleController->insertModulePartConfig('rss', $moduleSrl, $rssConfig);
|
||||
}
|
||||
getController('module')->insertModulePartConfig('rss', $module_srl, $module_config);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,46 +7,45 @@
|
|||
*/
|
||||
class rssModel extends rss
|
||||
{
|
||||
function getRssURL($format = 'rss', $mid = '')
|
||||
{
|
||||
return getFullUrl('', 'mid', $mid, 'act', $format);
|
||||
}
|
||||
|
||||
function getConfig()
|
||||
{
|
||||
$config = getModel('module')->getModuleConfig('rss');
|
||||
$config->use_total_feed = $config->use_total_feed ?: 'Y';
|
||||
$config->feed_document_count = $config->feed_document_count ?: 15;
|
||||
$config->image_url = $config->image . '?' . date('YmdHis', filemtime($config->image));
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
||||
function getRssModuleConfig($module_srl)
|
||||
{
|
||||
$config = getModel('module')->getModulePartConfig('rss', $module_srl);
|
||||
$config->module_srl = $module_srl;
|
||||
$config->open_rss = $config->open_rss ?: 'N';
|
||||
$config->open_total_feed = $config->open_total_feed ?: 'N';
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the Feed url.
|
||||
*
|
||||
* @param string $vid Vid
|
||||
* @param string $mid mid
|
||||
* @param string $format Feed format. rss | atom
|
||||
* @param bool $absolute_url
|
||||
* @return string
|
||||
* Compatible function
|
||||
*/
|
||||
function getModuleFeedUrl($vid, $mid, $format = 'rss', $absolute_url = false)
|
||||
{
|
||||
if($absolute_url)
|
||||
{
|
||||
return getFullUrl('','vid',$vid, 'mid',$mid, 'act',$format);
|
||||
return getFullUrl('', 'vid', $vid, 'mid', $mid, 'act', $format);
|
||||
}
|
||||
else
|
||||
{
|
||||
return getUrl('','vid',$vid, 'mid',$mid, 'act',$format);
|
||||
return getUrl('', 'vid', $vid, 'mid', $mid, 'act', $format);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the RSS configurations of the specific modules
|
||||
*
|
||||
* @param integer $module_srl Module_srl
|
||||
* @return Object
|
||||
*/
|
||||
function getRssModuleConfig($module_srl)
|
||||
{
|
||||
// Get the configurations of the rss module
|
||||
$oModuleModel = getModel('module');
|
||||
$module_rss_config = $oModuleModel->getModulePartConfig('rss', $module_srl);
|
||||
if(!$module_rss_config)
|
||||
{
|
||||
$module_rss_config = new stdClass();
|
||||
$module_rss_config->open_rss = 'N';
|
||||
}
|
||||
$module_rss_config->module_srl = $module_srl;
|
||||
return $module_rss_config;
|
||||
}
|
||||
}
|
||||
/* End of file rss.model.php */
|
||||
/* Location: ./modules/rss/rss.model.php */
|
||||
|
|
|
|||
|
|
@ -7,261 +7,203 @@
|
|||
*/
|
||||
class rssView extends rss
|
||||
{
|
||||
/**
|
||||
* Initialization
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
// Disable gzhandler
|
||||
public $gzhandler_enable = false;
|
||||
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Feed output.
|
||||
* When trying to directly print out the RSS, the results variable can be directly specified through $oRssView->rss($document_list)
|
||||
*
|
||||
* @param Object $document_list Document list
|
||||
* @param string $rss_title Rss title
|
||||
* @param string $add_description Add description
|
||||
*/
|
||||
|
||||
function rss($document_list = null, $rss_title = null, $add_description = null)
|
||||
{
|
||||
$oDocumentModel = getModel('document');
|
||||
$oModuleModel = getModel('module');
|
||||
$oModuleController = getController('module');
|
||||
// Get the content and information for the current requested module if the method is not called from another module
|
||||
if(!$document_list)
|
||||
$obj = new stdClass;
|
||||
$obj->title = $rss_title;
|
||||
$obj->description = $add_description;
|
||||
$obj->document_list = $document_list;
|
||||
$this->output(Context::get('format'), $obj);
|
||||
}
|
||||
|
||||
function atom()
|
||||
{
|
||||
$this->output('atom');
|
||||
}
|
||||
|
||||
function dispError($module_srl = null)
|
||||
{
|
||||
$obj = new stdClass;
|
||||
$obj->error = true;
|
||||
$obj->module_srl = $module_srl;
|
||||
$obj->description = lang('msg_rss_is_disabled');
|
||||
$this->output(Context::get('format'), $obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* Feed output
|
||||
*/
|
||||
function output($format, $obj = null)
|
||||
{
|
||||
if(!$obj)
|
||||
{
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$site_srl = $site_module_info->site_srl;
|
||||
$mid = isset($_REQUEST['mid']) ? Context::get('mid') : null;
|
||||
$start_date = (int)Context::get('start_date');
|
||||
$end_date = (int)Context::get('end_date');
|
||||
|
||||
$module_srls = array();
|
||||
$rss_config = array();
|
||||
$total_config = '';
|
||||
$total_config = $oModuleModel->getModuleConfig('rss');
|
||||
|
||||
// If one is specified, extract only for this mid
|
||||
if($mid)
|
||||
$obj = new stdClass;
|
||||
}
|
||||
|
||||
$page = $obj->page ?: Context::get('page');
|
||||
$start = $obj->start_date ?: Context::get('start_date');
|
||||
$end = $obj->end_date ?: Context::get('end_date');
|
||||
$site_module_srl = Context::get('site_module_info')->module_srl;
|
||||
$target_module_srl = $obj->module_srl ?: (Context::get('current_module_info')->module_srl ?: $site_module_srl);
|
||||
$is_part_feed = ($obj->module_srl || $target_module_srl !== $site_module_srl) ? true : false;
|
||||
|
||||
// Set format
|
||||
switch($format)
|
||||
{
|
||||
// Atom 1.0
|
||||
case 'atom':
|
||||
$template = 'atom10';
|
||||
break;
|
||||
// RSS 1.0
|
||||
case 'rss1.0':
|
||||
$template = 'rss10';
|
||||
break;
|
||||
// XE compatibility
|
||||
case 'xe':
|
||||
$template = 'xe';
|
||||
break;
|
||||
// RSS 2.0 (default)
|
||||
default:
|
||||
$format = '';
|
||||
$template = 'rss20';
|
||||
break;
|
||||
}
|
||||
|
||||
$oRssModel = getModel('rss');
|
||||
$config = $oRssModel->getConfig();
|
||||
$module_config = $oRssModel->getRssModuleConfig($target_module_srl);
|
||||
$module_info = getModel('module')->getModuleInfoByModuleSrl($target_module_srl);
|
||||
|
||||
if($obj->error)
|
||||
{
|
||||
Context::set('target_modules', array());
|
||||
Context::set('category_list', array());
|
||||
Context::set('document_list', array());
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!$target_module_srl || !$module_info->module_srl)
|
||||
{
|
||||
$module_srl = $this->module_info->module_srl;
|
||||
$config = $oModuleModel->getModulePartConfig('rss', $module_srl);
|
||||
if($config->open_rss && $config->open_rss != 'N')
|
||||
return $this->dispError();
|
||||
}
|
||||
|
||||
// Set target module
|
||||
$target_modules = array();
|
||||
if($is_part_feed)
|
||||
{
|
||||
if($module_config->open_rss != 'N')
|
||||
{
|
||||
$module_srls[] = $module_srl;
|
||||
$open_rss_config[$module_srl] = $config->open_rss;
|
||||
$target_modules[$module_config->module_srl] = $module_config->open_rss;
|
||||
}
|
||||
}
|
||||
// If mid is not selected, then get all
|
||||
else
|
||||
{
|
||||
if($total_config->use_total_feed != 'N')
|
||||
if($config->use_total_feed == 'Y')
|
||||
{
|
||||
$rss_config = $oModuleModel->getModulePartConfigs('rss', $site_srl);
|
||||
if($rss_config)
|
||||
foreach(getModel('module')->getModulePartConfigs('rss') as $module_srl => $part_config)
|
||||
{
|
||||
foreach($rss_config as $module_srl => $config)
|
||||
if($part_config->open_rss != 'N' && $part_config->open_total_feed != 'T_N')
|
||||
{
|
||||
if($config && $config->open_rss != 'N' && $config->open_total_feed != 'T_N')
|
||||
{
|
||||
$module_srls[] = $module_srl;
|
||||
$open_rss_config[$module_srl] = $config->open_rss;
|
||||
}
|
||||
$target_modules[$module_srl] = $part_config->open_rss;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!count($module_srls) && !$add_description)
|
||||
Context::set('target_modules', $target_modules);
|
||||
|
||||
// Set document list
|
||||
$document_list = $obj->document_list;
|
||||
if(!is_array($document_list))
|
||||
{
|
||||
return $this->dispError();
|
||||
}
|
||||
|
||||
$info = new stdClass;
|
||||
$args = new stdClass;
|
||||
|
||||
if($module_srls)
|
||||
{
|
||||
$args->module_srl = implode(',',$module_srls);
|
||||
//$module_list = $oModuleModel->getMidList($args); //perhaps module_list varialbles not use
|
||||
|
||||
if(!$target_modules)
|
||||
{
|
||||
return $this->dispError($module_info->module_srl);
|
||||
}
|
||||
|
||||
$args = new stdClass;
|
||||
$args->start_date = $start;
|
||||
$args->end_date = $end;
|
||||
$args->search_target = 'is_secret';
|
||||
$args->search_keyword = 'N';
|
||||
$args->page = (int)Context::get('page');
|
||||
$args->list_count = 15;
|
||||
if($total_config->feed_document_count) $args->list_count = $total_config->feed_document_count;
|
||||
if(!$args->page || $args->page < 1) $args->page = 1;
|
||||
if($start_date || $start_date != 0) $args->start_date = $start_date;
|
||||
if($end_date || $end_date != 0) $args->end_date = $end_date;
|
||||
if($start_date == 0) unset($start_date);
|
||||
if($end_date == 0) unset($end_date);
|
||||
|
||||
$args->page = $page > 0 ? $page : 1;
|
||||
$args->module_srl = implode(',', array_keys($target_modules));
|
||||
$args->list_count = $config->feed_document_count;
|
||||
$args->sort_index = 'list_order';
|
||||
$args->order_type = 'asc';
|
||||
$output = $oDocumentModel->getDocumentList($args);
|
||||
$document_list = $output->data;
|
||||
// Extract the feed title and information with Context::getBrowserTitle
|
||||
if($mid)
|
||||
{
|
||||
$info->title = Context::getBrowserTitle();
|
||||
$oModuleController->replaceDefinedLangCode($info->title);
|
||||
|
||||
$info->title = str_replace('\'', ''',$info->title);
|
||||
if($config->feed_description)
|
||||
{
|
||||
$info->description = str_replace('\'', ''', htmlspecialchars($config->feed_description, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
|
||||
}
|
||||
else
|
||||
{
|
||||
$info->description = str_replace('\'', ''', htmlspecialchars($this->module_info->description, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
|
||||
}
|
||||
$info->link = getUrl('','mid',$mid);
|
||||
$info->feed_copyright = str_replace('\'', ''', htmlspecialchars($feed_config->feed_copyright, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
|
||||
if(!$info->feed_copyright)
|
||||
{
|
||||
$info->feed_copyright = str_replace('\'', ''', htmlspecialchars($total_config->feed_copyright, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
|
||||
}
|
||||
}
|
||||
$document_list = getModel('document')->getDocumentList($args)->data;
|
||||
}
|
||||
}
|
||||
|
||||
if(!$info->title)
|
||||
{
|
||||
if($rss_title) $info->title = $rss_title;
|
||||
else if($total_config->feed_title) $info->title = $total_config->feed_title;
|
||||
else
|
||||
Context::set('document_list', $document_list);
|
||||
|
||||
// Set category list
|
||||
$category_list = array();
|
||||
foreach($target_modules as $module_srl => $open_rss)
|
||||
{
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$info->title = $site_module_info->browser_title;
|
||||
$category_list[$module_srl] = getModel('document')->getCategoryList($module_srl);
|
||||
}
|
||||
|
||||
$oModuleController->replaceDefinedLangCode($info->title);
|
||||
$info->title = str_replace('\'', ''', htmlspecialchars($info->title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
|
||||
$info->description = str_replace('\'', ''', htmlspecialchars($total_config->feed_description, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
|
||||
Context::set('category_list', $category_list);
|
||||
}
|
||||
|
||||
// Set feed information
|
||||
$info = new stdClass;
|
||||
if($is_part_feed)
|
||||
{
|
||||
$info->title = $module_info->browser_title ?: Context::getBrowserTitle();
|
||||
$info->link = getFullUrl('', 'mid', $module_info->mid);
|
||||
$info->description = $module_config->feed_description ?: $module_info->description;
|
||||
$info->feed_copyright = $module_config->feed_copyright ?: $config->feed_copyright;
|
||||
}
|
||||
else
|
||||
{
|
||||
$info->title = $config->feed_title ?: Context::get('site_module_info')->browser_title;
|
||||
$info->link = Context::getRequestUri();
|
||||
$info->feed_copyright = str_replace('\'', ''', htmlspecialchars($total_config->feed_copyright, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
|
||||
$info->description = $config->feed_description;
|
||||
$info->feed_copyright = $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, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
|
||||
switch(Context::get('format'))
|
||||
{
|
||||
case 'atom':
|
||||
$info->date = date('Y-m-d\TH:i:sP');
|
||||
if($mid) { $info->id = getUrl('','mid',$mid,'act','atom','page',Context::get('page'),'start_date',Context::get('start_date'),'end_date',Context::get('end_date')); }
|
||||
else { $info->id = getUrl('','module','rss','act','atom','page',Context::get('page'),'start_date',Context::get('start_date'),'end_date',Context::get('end_date')); }
|
||||
break;
|
||||
case 'rss1.0':
|
||||
$info->date = date('Y-m-d\TH:i:sP');
|
||||
break;
|
||||
default:
|
||||
$info->date = date("r");
|
||||
break;
|
||||
}
|
||||
|
||||
$proctcl = RX_SSL ? 'https://' : 'http://';
|
||||
|
||||
$temp_link = explode('/', $info->link);
|
||||
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 = str_replace('jp','ja',Context::getLangType());
|
||||
// Set the variables used in the RSS output
|
||||
|
||||
$info->id = getFullUrl('', 'mid', $module_info->mid, 'act', 'rss', 'format', $format, 'page', $page, 'start_date', $start, 'end_date', $end);
|
||||
$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->image = $config->image ? Context::getRequestUri() . $config->image : '';
|
||||
getController('module')->replaceDefinedLangCode($info->title);
|
||||
|
||||
Context::set('info', $info);
|
||||
Context::set('feed_config', $config);
|
||||
Context::set('open_rss_config', $open_rss_config);
|
||||
Context::set('document_list', $document_list);
|
||||
// Force the result output to be of XMLRPC
|
||||
Context::setResponseMethod("XMLRPC");
|
||||
// Perform the preprocessing function of the editor component as the results are obtained
|
||||
$path = $this->module_path.'tpl/';
|
||||
//if($args->start_date || $args->end_date) $file = 'xe_rss';
|
||||
//else $file = 'rss20';
|
||||
switch (Context::get('format'))
|
||||
{
|
||||
case 'xe':
|
||||
$file = 'xe_rss';
|
||||
break;
|
||||
case 'atom':
|
||||
$file = 'atom10';
|
||||
break;
|
||||
case 'rss1.0':
|
||||
$file = 'rss10';
|
||||
break;
|
||||
default:
|
||||
$file = 'rss20';
|
||||
break;
|
||||
}
|
||||
|
||||
$oTemplate = new TemplateHandler();
|
||||
|
||||
$content = $oTemplate->compile($path, $file);
|
||||
Context::set('content', $content);
|
||||
// Set the template file
|
||||
$this->setTemplatePath($path);
|
||||
$this->setTemplateFile('display');
|
||||
|
||||
// Set XML Output
|
||||
Context::setResponseMethod('XMLRPC');
|
||||
$this->setTemplatePath($this->module_path . 'tpl/format');
|
||||
$this->setTemplateFile($template);
|
||||
}
|
||||
|
||||
/**
|
||||
* ATOM output
|
||||
*
|
||||
* @return Object
|
||||
*/
|
||||
function atom()
|
||||
{
|
||||
Context::set('format', 'atom');
|
||||
$this->rss();
|
||||
}
|
||||
|
||||
/**
|
||||
* Error output
|
||||
*
|
||||
* @return Object
|
||||
*/
|
||||
function dispError()
|
||||
{
|
||||
// Prepare the output message
|
||||
$this->rss(null, null, lang('msg_rss_is_disabled') );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Additional configurations for a service module
|
||||
* Receive the form for the form used by rss
|
||||
*
|
||||
* @param string $obj Will be inserted content in template
|
||||
* @return Object
|
||||
*/
|
||||
function triggerDispRssAdditionSetup(&$obj)
|
||||
function triggerDispRssAdditionSetup(&$output)
|
||||
{
|
||||
$current_module_srl = Context::get('module_srl');
|
||||
$current_module_srls = Context::get('module_srls');
|
||||
|
||||
if(!$current_module_srl && !$current_module_srls)
|
||||
if(!($current_module_srl = Context::get('module_srl')) && !Context::get('module_srls'))
|
||||
{
|
||||
// Get information of the selected module
|
||||
$current_module_info = Context::get('current_module_info');
|
||||
$current_module_srl = $current_module_info->module_srl;
|
||||
if(!$current_module_srl) return new Object();
|
||||
if(!$current_module_srl = Context::get('current_module_info')->module_srl)
|
||||
{
|
||||
return new Object();
|
||||
}
|
||||
}
|
||||
// Get teh RSS configurations for the selected module
|
||||
$oRssModel = getModel('rss');
|
||||
$rss_config = $oRssModel->getRssModuleConfig($current_module_srl);
|
||||
Context::set('rss_config', $rss_config);
|
||||
// Set the template file
|
||||
$oTemplate = &TemplateHandler::getInstance();
|
||||
$tpl = $oTemplate->compile($this->module_path.'tpl', 'rss_module_config');
|
||||
$obj .= $tpl;
|
||||
|
||||
|
||||
// Get part configuration
|
||||
Context::set('module_config', getModel('rss')->getRssModuleConfig($current_module_srl));
|
||||
|
||||
// Add output after compile template
|
||||
$output .= TemplateHandler::getInstance()->compile($this->module_path . 'tpl', 'rss_module_config');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,37 +0,0 @@
|
|||
{'<?xml version="1.0" encoding="UTF-8" ?>'}
|
||||
|
||||
<feed xmlns="http://www.w3.org/2005/Atom">
|
||||
<title type="text">{$info->title}</title>
|
||||
<!--@if($info->description)-->
|
||||
<subtitle type="html">{escape($info->description, false)}</subtitle>
|
||||
<!--@end-->
|
||||
<updated>{$info->date}</updated>
|
||||
<id>{$info->id}</id>
|
||||
<link rel="alternate" type="text/html" hreflang="{$info->language}" href="{$info->link}"/>
|
||||
<link rel="self" type="application/atom+xml" href="{$info->id}"/>
|
||||
<generator uri="https://www.xpressengine.com/">XpressEngine</generator>
|
||||
<!--@foreach($document_list as $oDocument)--> <entry>
|
||||
<title>{$oDocument->getTitleText()}</title>
|
||||
<id>{$oDocument->getPermanentUrl()}</id>
|
||||
<published>{$oDocument->getRegdate('Y-m-d\TH:i:sP')}</published>
|
||||
<updated>{zdate($oDocument->get('last_update'),'Y-m-d\TH:i:sP')}</updated>
|
||||
<link rel="alternate" type="text/html" href="{$oDocument->getPermanentUrl()}"/>
|
||||
<link rel="replies" type="text/html" href="{$oDocument->getPermanentUrl()}#comment"/>
|
||||
<author>
|
||||
<name>{str_replace('\'', ''',$oDocument->getNickName())}</name>
|
||||
<!--@if($oDocument->isExistsHomepage())-->
|
||||
<uri>{$oDocument->getHomepageUrl()}</uri>
|
||||
<!--@end-->
|
||||
</author>
|
||||
<!--@if($open_rss_config[$oDocument->get('module_srl')]=='Y')-->
|
||||
<content type="html">{$oDocument->getTransContent(false,false,true)}</content>
|
||||
<!--@else-->
|
||||
<summary type="text">{$oDocument->getContentText(100)}</summary>
|
||||
<!--@end-->
|
||||
<!--@foreach($oDocument->get('tag_list') as $tag)-->
|
||||
<category term="{escape($tag, false)}"/>
|
||||
<!--@end-->
|
||||
|
||||
</entry>
|
||||
<!--@end-->
|
||||
</feed>
|
||||
|
|
@ -1 +0,0 @@
|
|||
{$content}
|
||||
28
modules/rss/tpl/format/atom10.html
Normal file
28
modules/rss/tpl/format/atom10.html
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{'<?xml version="1.0" encoding="UTF-8" ?>'}
|
||||
|
||||
<config autoescape="on" />
|
||||
<feed xmlns="http://www.w3.org/2005/Atom">
|
||||
<title>{$info->title}</title>
|
||||
<subtitle cond="$info->description">{$info->description}</subtitle>
|
||||
<link rel="alternate" type="text/html" hreflang="{$info->language}" href="{$info->link}"/>
|
||||
<link rel="self" type="application/atom+xml" href="{$info->id}"/>
|
||||
<updated>{$info->date}</updated>
|
||||
<id>{$info->id}</id>
|
||||
<generator>Rhymix</generator>
|
||||
<rights cond="$info->feed_copyright">{$info->feed_copyright}</rights>
|
||||
<entry loop="$document_list=>$oDocument">
|
||||
<title>{$oDocument->getTitleText()}</title>
|
||||
<link rel="alternate" type="text/html" href="{$oDocument->getPermanentUrl()}"/>
|
||||
<link cond="$oDocument->allowComment()" rel="replies" type="text/html" href="{$oDocument->getPermanentUrl()}#comment"/>
|
||||
<id>{$oDocument->getPermanentUrl()}</id>
|
||||
<published>{$oDocument->getRegdateDT()}</published>
|
||||
<updated>{$oDocument->getUpdateDT()}</updated>
|
||||
<author>
|
||||
<name>{$oDocument->getNickName()}</name>
|
||||
</author>
|
||||
<summary type="text">{$oDocument->getSummary(400)}</summary>
|
||||
<content type="html" cond="$target_modules[$oDocument->get('module_srl')] == 'Y'">{utf8_trim(utf8_normalize_spaces($oDocument->get('content')))|escape}</content>
|
||||
<category cond="$oDocument->get('category_srl') && $category_name = $category_list[$oDocument->get('module_srl')][$oDocument->get('category_srl')]->title" term="{$oDocument->get('category_srl')}" label="{$category_name}"/>
|
||||
<category loop="$oDocument->get('tag_list')=>$tag" term="{$tag}"/>
|
||||
</entry>
|
||||
</feed>
|
||||
35
modules/rss/tpl/format/rss10.html
Normal file
35
modules/rss/tpl/format/rss10.html
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{'<?xml version="1.0" encoding="UTF-8" ?>'}
|
||||
|
||||
<config autoescape="on" />
|
||||
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns="http://purl.org/rss/1.0/">
|
||||
<channel rdf:about="{$info->id}">
|
||||
<title>{$info->title}</title>
|
||||
<link>{$info->link}</link>
|
||||
<description>{$info->description}</description>
|
||||
<dc:language>{$info->language}</dc:language>
|
||||
<dc:date>{$info->date}</dc:date>
|
||||
<!--@if($info->feed_copyright)-->
|
||||
<dc:rights>{$info->feed_copyright}</dc:rights>
|
||||
<!--@end-->
|
||||
<image cond="$info->image" rdf:resource="{$info->image}"/>
|
||||
<items>
|
||||
<rdf:Seq>
|
||||
<!--@foreach($document_list as $oDocument)-->
|
||||
<rdf:li resource="{$oDocument->getPermanentUrl()}"/>
|
||||
<!--@end-->
|
||||
</rdf:Seq>
|
||||
</items>
|
||||
</channel>
|
||||
<image cond="$info->image" rdf:about="{$info->image}">
|
||||
<title>{$info->feed_title}</title>
|
||||
<link>{$info->link}</link>
|
||||
<url>{$info->image}</url>
|
||||
</image>
|
||||
<item loop="$document_list=>$oDocument" rdf:about="{$oDocument->getPermanentUrl()}">
|
||||
<title>{$oDocument->getTitleText()}</title>
|
||||
<link>{$oDocument->getPermanentUrl()}</link>
|
||||
<description>{$oDocument->getSummary(400)}</description>
|
||||
<dc:creator>{$oDocument->getNickName()}</dc:creator>
|
||||
<dc:date>{$oDocument->getRegdateDT()}</dc:date>
|
||||
</item>
|
||||
</rdf:RDF>
|
||||
35
modules/rss/tpl/format/rss20.html
Normal file
35
modules/rss/tpl/format/rss20.html
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{'<?xml version="1.0" encoding="UTF-8" ?>'}
|
||||
|
||||
<config autoescape="on" />
|
||||
<rss version="2.0">
|
||||
<channel>
|
||||
<title>{$info->title}</title>
|
||||
<link>{$info->link}</link>
|
||||
<description>{$info->description}</description>
|
||||
<language>{$info->language}</language>
|
||||
<pubDate>{$info->date}</pubDate>
|
||||
<generator>Rhymix</generator>
|
||||
<copyright cond="$info->feed_copyright">{$info->feed_copyright}</copyright>
|
||||
<image cond="$info->image">
|
||||
<url>{$info->image}</url>
|
||||
<title>{$info->feed_title}</title>
|
||||
<link>{$info->site_url}</link>
|
||||
</image>
|
||||
<item loop="$document_list=>$oDocument">
|
||||
<title>{$oDocument->getTitleText()}</title>
|
||||
<link>{$oDocument->getPermanentUrl()}</link>
|
||||
<!--@if($target_modules[$oDocument->get('module_srl')]->open_rss == 'Y')-->
|
||||
<description>{utf8_trim(utf8_normalize_spaces($oDocument->get('content')))|escape}</description>
|
||||
<!--@else-->
|
||||
<description>{$oDocument->getSummary(400)}</description>
|
||||
<!--@end-->
|
||||
<category cond="$oDocument->getModuleName()">{$oDocument->getModuleName()}</category>
|
||||
<category cond="$oDocument->get('category_srl') && $category_name = $category_list[$oDocument->get('module_srl')][$oDocument->get('category_srl')]->title">{$category_name}</category>
|
||||
<category loop="$oDocument->get('tag_list')=>$tag">{$tag}</category>
|
||||
<author>{$oDocument->getNickName()}</author>
|
||||
<guid isPermaLink="true">{$oDocument->getPermanentUrl()}</guid>
|
||||
<comments cond="$oDocument->allowComment()">{$oDocument->getPermanentUrl()}#comment</comments>
|
||||
<pubDate>{$oDocument->getRegdateDT()}</pubDate>
|
||||
</item>
|
||||
</channel>
|
||||
</rss>
|
||||
29
modules/rss/tpl/format/xe.html
Normal file
29
modules/rss/tpl/format/xe.html
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{'<?xml version="1.0" encoding="UTF-8" ?>'}
|
||||
|
||||
<config autoescape="on" />
|
||||
<rss version="1.0">
|
||||
<channel>
|
||||
<title>{$info->title}</title>
|
||||
<link>{$info->link}</link>
|
||||
<description>{$info->description}</description>
|
||||
<language>{$info->language}</language>
|
||||
<pubDate>{$info->date}</pubDate>
|
||||
<totalCount>{$info->total_count}</totalCount>
|
||||
<totalPage>{$info->total_page}</totalPage>
|
||||
<item loop="$document_list=>$oDocument">
|
||||
<title>{$oDocument->getTitleText()}</title>
|
||||
<author>{$oDocument->getNickName()}</author>
|
||||
<link>{$oDocument->getPermanentUrl()}</link>
|
||||
<!--@if($target_modules[$oDocument->get('module_srl')]->open_rss == 'Y')-->
|
||||
<description>{utf8_trim(utf8_normalize_spaces($oDocument->get('content')))|escape}</description>
|
||||
<!--@else-->
|
||||
<description>{$oDocument->getSummary(400)}</description>
|
||||
<!--@end-->
|
||||
<tags>{$oDocument->get('tags')}</tags>
|
||||
<comment_count>{$oDocument->getCommentCount()}</comment_count>
|
||||
<trackback_count>{$oDocument->getTrackbackCount()}</trackback_count>
|
||||
<pubDate>{$oDocument->getRegdateDT()}</pubDate>
|
||||
<upDate>{$oDocument->getUpdateDT()}</upDate>
|
||||
</item>
|
||||
</channel>
|
||||
</rss>
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
<!--%import("filter/insert_config.xml")-->
|
||||
|
||||
<form action="./" method="get" onsubmit="return procFilter(this, insert_config)">
|
||||
<table border="1">
|
||||
<tr>
|
||||
<th rowspan="2">{$lang->rss_disable}</th>
|
||||
<td><input type="checkbox" name="rss_disable" value="Y" <!--@if($config->rss_disable=="Y")-->checked="checked"<!--@end--> />
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{$lang->about_rss_disable}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th rowspan="2">{$lang->rss_type}</th>
|
||||
<td>
|
||||
<select name="rss_type">
|
||||
<!--@foreach($rss_types as $key => $val)-->
|
||||
<option value="{$key}" <!--@if($key==$config->rss_type)-->selected="selected"<!--@end-->>{$val}</option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{$lang->about_rss_type}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<input type="button" value="{$lang->cmd_cancel}" onclick="location.href='{getUrl('act','')}'" />
|
||||
<input type="submit" value="{$lang->cmd_registration}" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
{'<?xml version="1.0" encoding="UTF-8" ?>'}
|
||||
|
||||
<rdf:RDF xmlns="http://purl.org/rss/1.0/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">
|
||||
<channel rdf:about="{getUrl('','mid',$mid,'module','rss','act','rss','format','rss1.0','page',Context::get('page'),'start_date',Context::get('start_date'),'end_date',Context::get('end_date'))}">
|
||||
<title>{$info->title}</title>
|
||||
<link>{$info->link}</link>
|
||||
<description>{$info->description}</description>
|
||||
<items>
|
||||
<rdf:Seq>
|
||||
<!--@foreach($document_list as $oDocument)-->
|
||||
<rdf:li resource="{$oDocument->getPermanentUrl()}" />
|
||||
<!--@end-->
|
||||
</rdf:Seq>
|
||||
</items>
|
||||
<dc:date>{$info->date}</dc:date>
|
||||
<dc:language>{$info->language}</dc:language>
|
||||
</channel>
|
||||
<!--@foreach($document_list as $oDocument)-->
|
||||
<item rdf:about="{$oDocument->getPermanentUrl()}">
|
||||
<title>{$oDocument->getTitleText()}</title>
|
||||
<link>{$oDocument->getPermanentUrl()}</link>
|
||||
<!--@if($open_rss_config[$oDocument->get('module_srl')]=='Y')-->
|
||||
<description>{$oDocument->getContentPlainText()}</description>
|
||||
<!--@else-->
|
||||
<description>{$oDocument->getContentText(100)}</description>
|
||||
<!--@end-->
|
||||
<dc:date>{$oDocument->getRegdate('Y-m-d\TH:i:sP')}</dc:date>
|
||||
</item>
|
||||
<!--@end-->
|
||||
</rdf:RDF>
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
{'<?xml version="1.0" encoding="UTF-8" ?>'}
|
||||
|
||||
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
|
||||
<channel>
|
||||
<title>{$info->title}</title>
|
||||
<link>{$info->link}</link>
|
||||
<description>{$info->description}</description>
|
||||
<language>{$info->language}</language>
|
||||
<pubDate>{$info->date}</pubDate>
|
||||
<lastBuildDate>{$info->date}</lastBuildDate>
|
||||
<generator>Rhymix</generator>
|
||||
<!--@if($info->feed_copyright)-->
|
||||
<copyright>{$info->feed_copyright}</copyright>
|
||||
<!--@end-->
|
||||
<!--@if($info->image)-->
|
||||
<image>
|
||||
<url>{$info->image}</url>
|
||||
<title>{$info->title}</title>
|
||||
<link>{$info->link}</link>
|
||||
</image>
|
||||
<!--@end-->
|
||||
<!--@foreach($document_list as $oDocument)-->
|
||||
<item>
|
||||
<title>{$oDocument->getTitleText()}</title>
|
||||
<dc:creator>{escape($oDocument->getNickName(), false)}</dc:creator>
|
||||
<link>{$oDocument->getPermanentUrl()}</link>
|
||||
<guid isPermaLink="true">{$oDocument->getPermanentUrl()}</guid>
|
||||
<!--@if($oDocument->allowComment()) -->
|
||||
<comments>{$oDocument->getPermanentUrl()}#comment</comments>
|
||||
<!--@end-->
|
||||
<!--@if($open_rss_config[$oDocument->get('module_srl')]=='Y')-->
|
||||
<description>{escape($oDocument->getTransContent(false,false,true))}</description>
|
||||
<!--@else-->
|
||||
<description>{$oDocument->getContentText(100)}</description>
|
||||
<!--@end-->
|
||||
<pubDate>{$oDocument->getRegdateGM()}</pubDate>
|
||||
<!--@foreach($oDocument->get('tag_list') as $tag)-->
|
||||
<category>{escape($tag, false)}</category>
|
||||
<!--@end-->
|
||||
<!--@if($oDocument->getCommentcount()>0)-->
|
||||
<slash:comments>{$oDocument->getCommentcount()}</slash:comments>
|
||||
<!--@end-->
|
||||
</item>
|
||||
<!--@end-->
|
||||
</channel>
|
||||
</rss>
|
||||
|
|
@ -12,58 +12,54 @@
|
|||
<input type="hidden" name="xe_validator_id" value="modules/rss/tpl/rss_admin_index/1" />
|
||||
<div class="x_control-group">
|
||||
<div class="x_control-label">{$lang->url}</div>
|
||||
<div class="x_controls" style="padding-top:5px"><a href="{$total_config->url}" target="_blank">{$total_config->url}</a></div>
|
||||
<div class="x_controls" style="padding-top:5px"><a href="{$general_rss_url}" target="_blank">{$general_rss_url}</a></div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label">{$lang->total_feed}</label>
|
||||
<div class="x_controls">
|
||||
<label class="x_inline">
|
||||
<input type="radio" name="use_total_feed" value="Y" id="use_total_feed_yes" checked="checked"|cond="!$total_config->use_total_feed || $total_config->use_total_feed == 'Y'" /> {$lang->use}
|
||||
<input type="radio" name="use_total_feed" value="Y" id="use_total_feed_yes" checked="checked"|cond="$config->use_total_feed == 'Y'" /> {$lang->use}
|
||||
</label>
|
||||
<label class="x_inline">
|
||||
<input type="radio" name="use_total_feed" value="N" id="use_total_feed_no" checked="checked"|cond="$total_config->use_total_feed == 'N'" /> {$lang->notuse}
|
||||
<input type="radio" name="use_total_feed" value="N" id="use_total_feed_no" checked="checked"|cond="$config->use_total_feed == 'N'" /> {$lang->notuse}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label" for="feed_title">{$lang->title}</label>
|
||||
<div class="x_controls">
|
||||
<input type="text" name="feed_title" value="{htmlspecialchars($total_config->feed_title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)}" id="feed_title" />
|
||||
<input type="text" name="feed_title" value="{escape($config->feed_title)}" id="feed_title" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label" for="feed_description">{$lang->description}</label>
|
||||
<div class="x_controls">
|
||||
<textarea name="feed_description" id="feed_description" rows="4" cols="42" style="float:left;margin-right:8px">{$total_config->feed_description}</textarea>
|
||||
<textarea name="feed_description" id="feed_description" rows="4" cols="42" style="float:left;margin-right:8px">{$config->feed_description}</textarea>
|
||||
<p class="x_help-block">{$lang->about_feed_description}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label" for="image">{$lang->feed_image}</label>
|
||||
<div class="x_controls">
|
||||
|
||||
<!--@if($total_config->image)-->
|
||||
<div class="_rss_image_container">
|
||||
<div class="x_thumbnail" cond="$total_config->image" style="display:inline-block;margin:0 0 5px 0">
|
||||
<img src="../../../{$total_config->image}" alt="image" style="max-width:210px;max-height:150px" />
|
||||
<input type="button" class="_delete_rss_image x_icon-remove" value="{$lang->cmd_delete}" style="width:14px" />
|
||||
<div class="_rss_image_container" cond="$config->image">
|
||||
<div class="x_thumbnail" style="display:inline-block;margin:0 0 5px 0">
|
||||
<img src="{$config->image_url}" alt="image" style="max-width:210px;max-height:150px" />
|
||||
<input type="button" class="_delete_rss_image x_icon-remove" value="{$lang->cmd_delete}" style="width:14px" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--@end-->
|
||||
<p><input type="file" name="image" value="" id="image" /></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label" for="feed_copyright">{$lang->feed_copyright}</label>
|
||||
<div class="x_controls">
|
||||
<input type="text" name="feed_copyright" value="{htmlspecialchars($total_config->feed_copyright, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)}" id="feed_copyright" />
|
||||
<input type="text" name="feed_copyright" value="{escape($config->feed_copyright)}" id="feed_copyright" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label" for="feed_document_count">{$lang->feed_document_count}</label>
|
||||
<div class="x_controls">
|
||||
<input type="number" min="1" max="100" name="feed_document_count" value="{$total_config->feed_document_count}" id="feed_document_count" />
|
||||
<input type="number" min="1" max="100" name="feed_document_count" value="{$config->feed_document_count}" id="feed_document_count" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="btnArea x_clearfix">
|
||||
|
|
@ -77,6 +73,7 @@
|
|||
<input type="hidden" name="act" value="procRssAdminInsertModuleConfig" />
|
||||
<input type="hidden" name="success_return_url" value="{getUrl('', 'module', $module, 'act', 'dispRssAdminIndex')}" />
|
||||
<input type="hidden" name="xe_validator_id" value="modules/rss/tpl/rss_admin_index/1" />
|
||||
|
||||
<table class="x_table x_table-striped x_table-hover" style="border-top:0;margin-top:0">
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
@ -87,27 +84,33 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr loop="$feed_config => $key,$value">
|
||||
<th cond="!$value['url']">
|
||||
{$value['mid']}
|
||||
</th>
|
||||
<th cond="$value['url']">
|
||||
<a href="{$value['url']}" target="_blank">{$value['mid']}</a>
|
||||
</th>
|
||||
<td class="title">{$value['feed_description']}<textarea name="feed_description[{$key}]" hidden>{$value['feed_description']}</textarea></td>
|
||||
<tr loop="$rss_list => $module_srl,$module_config">
|
||||
<td>
|
||||
<label class="x_inline" loop="$lang->open_rss_types => $key2,$value2"><input type="radio" name="open_rss[{$key}]" value="{$key2}" checked="checked"|cond="$key2 == $value['open_feed']" /> {$value2}</label>
|
||||
<a href="{$module_config->url}" target="_blank">{$module_config->mid}</a>
|
||||
</td>
|
||||
<td class="title">
|
||||
<textarea name="feed_description[{$module_srl}]">{escape($module_config->feed_description)}</textarea>
|
||||
</td>
|
||||
<td>
|
||||
<label class="x_inline"><input type="radio" name="open_total_feed[{$key}]" value="N" checked="checked"|cond="$value['open_total_feed'] != 'T_N'" /> {$lang->use}</label>
|
||||
<label class="x_inline"><input type="radio" name="open_total_feed[{$key}]" value="T_N" checked="checked"|cond="$value['open_total_feed'] == 'T_N'" /> {$lang->notuse}</label>
|
||||
<label class="x_inline" loop="$lang->open_rss_types => $key,$value">
|
||||
<input type="radio" name="open_rss[{$module_srl}]" value="{$key}" checked="checked"|cond="$module_config->open_feed == $key" /> {$value}
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<label class="x_inline">
|
||||
<input type="radio" name="open_total_feed[{$module_srl}]" value="N" checked="checked"|cond="$module_config->open_total_feed != 'T_N'" /> {$lang->use}
|
||||
</label>
|
||||
<label class="x_inline">
|
||||
<input type="radio" name="open_total_feed[{$module_srl}]" value="T_N" checked="checked"|cond="$module_config->open_total_feed == 'T_N'" /> {$lang->notuse}
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr cond="!$feed_config">
|
||||
<td style="text-align:center">{$lang->no_data}</td>
|
||||
<tr cond="!$rss_list">
|
||||
<td colspan="4" style="text-align:center">{$lang->no_data}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="x_clearfix">
|
||||
<button type="submit" class="x_btn x_btn-primary x_pull-right">{$lang->cmd_save}</button>
|
||||
</div>
|
||||
|
|
@ -116,7 +119,7 @@
|
|||
<script>
|
||||
jQuery(function($){
|
||||
$("._delete_rss_image").click(function(){
|
||||
$.exec_json('rss.procRssAdminDeleteFeedImage', {del_image:'Y'}, function(){
|
||||
$.exec_json('rss.procRssAdminDeleteFeedImage', {}, function(){
|
||||
$("._rss_image_container").hide();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
<section class="section">
|
||||
<h1>{$lang->open_rss}</h1>
|
||||
<p>{$lang->about_open_rss}</p>
|
||||
|
||||
|
||||
<form ruleset="insertRssModuleConfig" action="./" method="post" class="x_form-horizontal">
|
||||
<input type="hidden" name="module" value="rss" />
|
||||
<input type="hidden" name="act" value="procRssAdminInsertModuleConfig" />
|
||||
<input type="hidden" name="success_return_url" value="{getRequestUriByServerEnviroment()}" />
|
||||
<input type="hidden" name="target_module_srl" value="{$rss_config->module_srl?$rss_config->module_srl:$module_srls}" />
|
||||
<input type="hidden" name="target_module_srl" value="{$module_config->module_srl ?: $module_srls}" />
|
||||
|
||||
<div class="x_control-group">
|
||||
<label for="open_rss" class="x_control-label">{$lang->open_rss}</label>
|
||||
<div class="x_controls">
|
||||
<select name="open_rss" id="open_rss">
|
||||
<option loop="$lang->open_rss_types => $key, $val" value="{$key}" selected="selected"|cond="(!$rss_config->open_rss && $key == 'N') || ($rss_config->open_rss == $key)">{$val}</option>
|
||||
<option loop="$lang->open_rss_types => $key, $val" value="{$key}" selected="selected"|cond="$module_config->open_rss == $key">{$val}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -20,22 +20,22 @@
|
|||
<label for="open_total_feed" class="x_control-label">{$lang->open_feed_to_total}</label>
|
||||
<div class="x_controls">
|
||||
<select name="open_total_feed" id="open_total_feed">
|
||||
<option value="N" selected="selected"|cond="!$rss_config->open_total_feed || $rss_config->open_total_feed == 'N'">{$lang->use}</option>
|
||||
<option value="T_N" selected="selected"|cond="$rss_config->open_total_feed == 'T_N'">{$lang->notuse}</option>
|
||||
<option value="N" selected="selected"|cond="$module_config->open_total_feed == 'N'">{$lang->use}</option>
|
||||
<option value="T_N" selected="selected"|cond="$module_config->open_total_feed == 'T_N'">{$lang->notuse}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label for="feed_description" class="x_control-label">{$lang->description}</label>
|
||||
<div class="x_controls">
|
||||
<textarea name="feed_description" id="feed_description" rows="4" cols="42" style="float:left;margin-right:8px">{htmlspecialchars($rss_config->feed_description, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)}</textarea>
|
||||
<textarea name="feed_description" id="feed_description" rows="4" cols="42" style="float:left;margin-right:8px">{escape($module_config->feed_description)}</textarea>
|
||||
<p class="x_help-block">{$lang->about_feed_description}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label for="feed_copyright" class="x_control-label">{$lang->feed_copyright}</label>
|
||||
<div class="x_controls">
|
||||
<textarea name="feed_copyright" id="feed_copyright" rows="4" cols="42" style="float:left;margin-right:8px">{htmlspecialchars($rss_config->feed_copyright, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)}</textarea>
|
||||
<textarea name="feed_copyright" id="feed_copyright" rows="4" cols="42" style="float:left;margin-right:8px">{escape($module_config->feed_copyright)}</textarea>
|
||||
<p class="x_help-block">{$lang->about_feed_copyright}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
<script>//<![CDATA[
|
||||
alert('{$msg}');
|
||||
top.location.href = top.location.href;
|
||||
//]]></script>
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
{'<?xml version="1.0" encoding="UTF-8" ?>'}
|
||||
|
||||
<rss version="1.0">
|
||||
<channel>
|
||||
<title>{$info->title}</title>
|
||||
<link>{$info->link}</link>
|
||||
<description>{escape($info->description, false)}</description>
|
||||
<language>{$info->language}</language>
|
||||
<pubDate>{$info->date}</pubDate>
|
||||
<totalCount>{$info->total_count}</totalCount>
|
||||
<totalPage>{$info->total_page}</totalPage>
|
||||
<!--@foreach($document_list as $oDocument)-->
|
||||
<item>
|
||||
<title>{$oDocument->getTitleText()}</title>
|
||||
<author>{escape($oDocument->getNickName(), false)}</author>
|
||||
<link>{$oDocument->getPermanentUrl()}</link>
|
||||
<!--@if($open_rss_config[$oDocument->get('module_srl')]->open_rss=='Y')-->
|
||||
<description>{escape($oDocument->getTransContent(false, false, true), false)}</description>
|
||||
<!--@else-->
|
||||
<description>{escape($oDocument->getContentText(100), false)}</description>
|
||||
<!--@end-->
|
||||
<tags>{escape($oDocument->get('tags'), false)}</tags>
|
||||
<comment_count>{$oDocument->getCommentCount()}</comment_count>
|
||||
<trackback_count>{$oDocument->getTrackbackCount()}</trackback_count>
|
||||
<pubDate>{$oDocument->getRegdateGM()}</pubDate>
|
||||
<upDate>{$oDocument->getUpdateGM()}</upDate>
|
||||
</item>
|
||||
<!--@end-->
|
||||
</channel>
|
||||
</rss>
|
||||
Loading…
Add table
Add a link
Reference in a new issue