planet, cafeXE 메인 사이트들에 대해서도 RSS를 통합 출력할 수 있게 기능 수정

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6441 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2009-05-29 06:45:36 +00:00
parent 125d8f829c
commit 83b406492e
12 changed files with 204 additions and 87 deletions

View file

@ -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" />

View file

@ -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++){

View file

@ -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());
}
}
?>

View 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>

View file

@ -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" />

View file

@ -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>