mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
planet, cafeXE 메인 사이트들에 대해서도 RSS를 통합 출력할 수 있게 기능 수정
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6441 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
125d8f829c
commit
83b406492e
12 changed files with 204 additions and 87 deletions
|
|
@ -37,6 +37,7 @@
|
|||
</permissions>
|
||||
<actions>
|
||||
<action name="dispHomepageIndex" type="view" standalone="true" index="true" />
|
||||
<action name="rss" type="view" />
|
||||
|
||||
<action name="dispHomepageManage" type="view" standalone="true" />
|
||||
<action name="dispHomepageMemberGroupManage" type="view" standalone="true" />
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
$args->default_layout = $vars->default_layout;
|
||||
$args->enable_change_layout = $vars->enable_change_layout;
|
||||
$args->use_rss = $vars->use_rss;
|
||||
foreach($vars as $key => $val) {
|
||||
if(strpos($key,'allow_service_')===false) continue;
|
||||
$args->allow_service[substr($key, strlen('allow_service_'))] = $val;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
function init() {
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
|
||||
if($this->act != 'dispHomepageIndex' && strpos($this->act,'Homepage')!==false) {
|
||||
// 현재 접속 권한 체크하여 사이트 관리자가 아니면 접근 금지
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
|
@ -54,6 +53,7 @@
|
|||
function dispHomepageIndex() {
|
||||
$oHomepageAdminModel = &getAdminModel('homepage');
|
||||
$oHomepageModel = &getModel('homepage');
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
$template_path = sprintf("%sskins/%s/",$this->module_path, $this->module_info->skin);
|
||||
if(!is_dir($template_path)||!$this->module_info->skin) {
|
||||
|
|
@ -98,6 +98,9 @@
|
|||
Context::set('my_cafes', $output->data);
|
||||
}
|
||||
|
||||
$homepage_info = $oModuleModel->getModuleConfig('homepage');
|
||||
if($homepage_info->use_rss == 'Y') Context::set('rss_url',getUrl('','mid',$this->module_info->mid,'act','rss'));
|
||||
|
||||
$this->setTemplateFile('index');
|
||||
}
|
||||
|
||||
|
|
@ -280,8 +283,6 @@
|
|||
$this->setTemplateFile('category_list');
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief 홈페이지 게시판 추가 설정
|
||||
**/
|
||||
|
|
@ -403,5 +404,31 @@
|
|||
// 표시
|
||||
$this->setTemplateFile('components');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief rss
|
||||
**/
|
||||
function rss() {
|
||||
$oRss = &getView('rss');
|
||||
$oDocumentModel = &getModel('document');
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
$homepage_info = $oModuleModel->getModuleConfig('homepage');
|
||||
if($homepage_info->use_rss != 'Y') return new Object(-1,'msg_rss_is_disabled');
|
||||
|
||||
$output = executeQueryArray('homepage.getRssList', $args);
|
||||
if($output->data) {
|
||||
foreach($output->data as $key => $val) {
|
||||
unset($obj);
|
||||
$obj = new DocumentItem(0);
|
||||
$obj->setAttribute($val);
|
||||
$document_list[] = $obj;
|
||||
}
|
||||
}
|
||||
|
||||
$oRss->rss($document_list, $homepage_info->browser_title);
|
||||
$this->setTemplatePath($oRss->getTemplatePath());
|
||||
$this->setTemplateFile($oRss->getTemplateFile());
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
21
modules/homepage/queries/getRssList.xml
Normal file
21
modules/homepage/queries/getRssList.xml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<query id="getRssList" action="select">
|
||||
<tables>
|
||||
<table name="homepages" alias="homepages" />
|
||||
<table name="modules" alias="modules" />
|
||||
<table name="documents" alias="documents" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="documents.*" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="modules.site_srl" default="homepages.site_srl" />
|
||||
<condition operation="equal" column="documents.module_srl" default="modules.module_srl" pipe="and" />
|
||||
<condition operation="notequal" column="documents.is_secret" default="Y" pipe="and" />
|
||||
</conditions>
|
||||
<navigation>
|
||||
<index var="sort_index" default="documents.list_order" order="asc" />
|
||||
<list_count var="list_count" default="15" />
|
||||
<page_count var="page_count" default="10" />
|
||||
<page var="page" default="1" />
|
||||
</navigation>
|
||||
</query>
|
||||
|
|
@ -196,6 +196,14 @@
|
|||
<p>{$lang->about_allow_service}</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row" colspan="2"><div>RSS</div></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<input type="checkbox" name="use_rss" value="Y" <!--@if($homepage_config->use_rss=='Y')-->checked="checked"<!--@end-->/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row2" colspan="2">
|
||||
<td class="button"><span class="button black strong"><input type="submit" value="{$lang->cmd_save}" accesskey="s" /></span></div></td>
|
||||
</tr>
|
||||
|
|
|
|||
|
|
@ -35,6 +35,8 @@
|
|||
<action name="dispPlanetLogin" type="view" />
|
||||
<action name="dispPlanetCreate" type="view" />
|
||||
|
||||
<action name="rss" type="view" />
|
||||
|
||||
<action name="dispPlanetHome" type="view" />
|
||||
<action name="dispPlanet" type="view" index="true" />
|
||||
<action name="dispPlanetInfo" type="view" />
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@
|
|||
$module_info->planet_default_skin = Context::get('planet_default_skin');
|
||||
$module_info->use_mobile = Context::get('use_mobile');
|
||||
$module_info->use_me2day = Context::get('use_me2day');
|
||||
$module_info->use_rss = Context::get('use_rss');
|
||||
|
||||
$tagtab = explode(',',Context::get('planet_tagtab'));
|
||||
for($i=0,$c=count($tagtab);$i<$c;$i++){
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
if(!preg_match('/planet/i', $this->act) && !in_array($this->act, array('favorite','countContentTagSearch','dispReplyList'))) return;
|
||||
if(!preg_match('/planet/i', $this->act) && !in_array($this->act, array('favorite','countContentTagSearch','dispReplyList','rss'))) return;
|
||||
|
||||
/**
|
||||
* @brief 플래닛 모듈의 기본 설정은 view에서는 언제든지 사용하도록 load하여 Context setting
|
||||
|
|
@ -44,12 +44,11 @@
|
|||
Context::set('planet', $this->planet = $oPlanetModel->getPlanet($this->module_srl));
|
||||
|
||||
// 메인 페이지 일 경우 특정 액션이 아니라면 무조건 메인 화면 뿌려줌
|
||||
if($this->planet->isHome() && !in_array($this->act, array('dispPlanetCreate','dispPlanetLogin','dispPlanetTagSearch','dispPlanetContentSearch','dispPlanetContentTagSearch')) ) {
|
||||
if($this->planet->isHome() && !in_array($this->act, array('dispPlanetCreate','dispPlanetLogin','dispPlanetTagSearch','dispPlanetContentSearch','dispPlanetContentTagSearch','rss')) ) {
|
||||
Context::set('act',$this->act = 'dispPlanetHome');
|
||||
}
|
||||
|
||||
// 플래닛은 별도 레이아웃 동작하지 않도록 변경
|
||||
//Context::set('layout', 'none');
|
||||
if(!Context::get('mid')) Context::set('mid', $this->module_info->mid, true);
|
||||
}
|
||||
|
||||
|
|
@ -169,6 +168,9 @@
|
|||
Context::set('tagtab_after_list', $tagtab_after_list);
|
||||
}
|
||||
|
||||
// RSS 링크
|
||||
if($this->module_info->use_rss=='Y') Context::set('rss_url', getUrl('','mid',$this->module_info->mid,'act','rss'));
|
||||
|
||||
// 템플릿 지정
|
||||
$this->setTemplateFile('main');
|
||||
}
|
||||
|
|
@ -383,6 +385,36 @@
|
|||
$this->setTemplateFile('message');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief rss
|
||||
**/
|
||||
function rss() {
|
||||
$oRss = &getView('rss');
|
||||
$oRssModel = &getModel('rss');
|
||||
$oDocumentModel = &getModel('document');
|
||||
|
||||
if($this->planet->isHome()) {
|
||||
if($this->module_info->use_rss!='Y') return new Object(-1,'msg_rss_is_disabled');
|
||||
} else {
|
||||
$rss_config = $oRssModel->getRssModuleConfig($this->module_srl);
|
||||
if($rss_config->open_rss != 'Y') return new Object(-1,'msg_rss_is_disabled');
|
||||
$args->module_srl = $this->module_srl;
|
||||
}
|
||||
|
||||
$output = executeQueryArray('planet.getRssList', $args);
|
||||
if($output->data) {
|
||||
foreach($output->data as $key => $val) {
|
||||
unset($obj);
|
||||
$obj = new DocumentItem(0);
|
||||
$obj->setAttribute($val);
|
||||
$document_list[] = $obj;
|
||||
}
|
||||
}
|
||||
|
||||
$oRss->rss($document_list, $this->planet->getBrowserTitle());
|
||||
$this->setTemplatePath($oRss->getTemplatePath());
|
||||
$this->setTemplateFile($oRss->getTemplateFile());
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
20
modules/planet/queries/getRssList.xml
Normal file
20
modules/planet/queries/getRssList.xml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<query id="getRssList" action="select">
|
||||
<tables>
|
||||
<table name="modules" alias="modules" />
|
||||
<table name="documents" alias="documents" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="documents.*" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="modules.module" default="planet" />
|
||||
<condition operation="equal" column="documents.module_srl" default="modules.module_srl" pipe="and" />
|
||||
<condition operation="equal" column="documents.module_srl" var="module_srl" pipe="and" />
|
||||
</conditions>
|
||||
<navigation>
|
||||
<index var="sort_index" default="documents.list_order" order="asc" />
|
||||
<list_count var="list_count" default="15" />
|
||||
<page_count var="page_count" default="10" />
|
||||
<page var="page" default="1" />
|
||||
</navigation>
|
||||
</query>
|
||||
|
|
@ -21,6 +21,7 @@
|
|||
<param name="planet_smstag" target="planet_smstag" />
|
||||
<param name="use_mobile" target="use_mobile" />
|
||||
<param name="use_me2day" target="use_me2day" />
|
||||
<param name="use_rss" target="use_rss" />
|
||||
</parameter>
|
||||
<response callback_func="completeInsertConfig">
|
||||
<tag name="error" />
|
||||
|
|
|
|||
|
|
@ -82,8 +82,6 @@
|
|||
<label for="fld_for_signup">{$lang->about_use_signup}</label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<th scope="row"><div>{$lang->planet_use_mobile}</div></th>
|
||||
<td colspan="3">
|
||||
|
|
@ -91,7 +89,6 @@
|
|||
<label for="fld_for_use_mobile">{$lang->about_use_mobile}</label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="row2">
|
||||
<th scope="row"><div>{$lang->planet_use_me2day}</div></th>
|
||||
<td colspan="3">
|
||||
|
|
@ -99,6 +96,12 @@
|
|||
<label for="fld_for_use_me2day">{$lang->about_use_me2day}</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><div>RSS</div></th>
|
||||
<td colspan="3">
|
||||
<input type="checkbox" name="use_rss" value="Y" <!--@if($module_info->use_rss=='Y')-->checked="checked"<!--@end--> />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="button" colspan="4">
|
||||
<span class="button black strong"><input type="submit" value="{$lang->cmd_registration}" accesskey="s" /></span>
|
||||
|
|
|
|||
|
|
@ -18,19 +18,21 @@
|
|||
|
||||
/**
|
||||
* @brief 피드 출력
|
||||
* 직접 RSS를 출력하려고 할때에는 $oRssView->rss($document_list)를 통해서 결과값을 직접 지정 가능
|
||||
**/
|
||||
function rss() {
|
||||
/**
|
||||
* 피드 출력을 위한 변수 설정
|
||||
**/
|
||||
function rss($document_list = null, $rss_title = null) {
|
||||
$oDocumentModel = &getModel('document');
|
||||
$oModuleModel = &getModel('module');
|
||||
$oModuleController = &getController('module');
|
||||
|
||||
// 다른 모듈에서 method로 호출되는 것이 아니라면 현재 요청된 모듈을 대상으로 글과 정보를 구함
|
||||
if(!$document_list) {
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$site_srl = $site_module_info->site_srl;
|
||||
$mid = Context::get('mid'); ///< 대상 모듈 id, 없으면 전체로
|
||||
$start_date = (int)Context::get('start_date');
|
||||
$end_date = (int)Context::get('end_date');
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
$module_srls = array();
|
||||
$rss_config = array();
|
||||
$total_config = '';
|
||||
|
|
@ -78,12 +80,8 @@
|
|||
|
||||
$args->sort_index = 'list_order';
|
||||
$args->order_type = 'asc';
|
||||
|
||||
// 대상 문서들을 가져옴
|
||||
$oDocumentModel = &getModel('document');
|
||||
$output = $oDocumentModel->getDocumentList($args);
|
||||
$document_list = $output->data;
|
||||
$oModuleController = &getController('module');
|
||||
|
||||
// 피드 제목 및 정보등을 추출 Context::getBrowserTitle
|
||||
if($mid) {
|
||||
|
|
@ -102,8 +100,12 @@
|
|||
if(!$info->feed_copyright) {
|
||||
$info->feed_copyright = str_replace('\'', ''', htmlspecialchars($total_config->feed_copyright));
|
||||
}
|
||||
} else {
|
||||
if($total_config->feed_title) $info->title = $total_config->feed_title;
|
||||
}
|
||||
}
|
||||
|
||||
if(!$info->title) {
|
||||
if($rss_title) $info->title = $rss_title;
|
||||
else if($total_config->feed_title) $info->title = $total_config->feed_title;
|
||||
else {
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$info->title = $site_module_info->browser_title;
|
||||
|
|
@ -117,8 +119,6 @@
|
|||
}
|
||||
|
||||
if($total_config->image) $info->image = Context::getRequestUri().str_replace('\'', ''', htmlspecialchars($total_config->image));
|
||||
$info->total_count = $output->total_count;
|
||||
$info->total_page = $output->total_page;
|
||||
switch (Context::get('format')) {
|
||||
case 'atom':
|
||||
$info->date = date('Y-m-d\TH:i:sP');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue