XpressEngine에 관련 내용에 대해서 이야기 합니다.
글 수 193
이상한 댓글이 생기면서 제 게시물이 안릭혀졌습니다. -ㅅ-;;
어찌하다보니 게시물이 없어져 버려서 다시 적을게요 ^^
어찌하다보니 게시물이 없어져 버려서 다시 적을게요 ^^
미령전설님의 압박에 만들어봤습니다. ㅠㅠ
함수 내용이 깁니다. 아래 파란 색 내용을 클릭해서 복사하여 사용하세요.
modules/document/document.model.php
제일 하단에 "}" 전에 추가해주세요.
function getDivision_next($order,$division){
$oDocumentModel = &getModel('document');
return $oDocumentModel->_getDocumentDivision('next',$order,$division);
}
function getDivision_prev($order,$division){
$oDocumentModel = &getModel('document');
return $oDocumentModel->_getDocumentDivision('prev',$order,$division);
}
function _getDocumentDivision($type,$order,$division){
if(!$division->document_srl) {
if(context::get('document_srl')) $division->document_srl = context::get('document_srl');
else return;
}
if(!$division->search_target) {
if(context::get('search_target')) $division->search_target = context::get('search_target');
}
if(!$division->search_keyword) {
if(context::get('search_keyword')) $division->search_keyword = context::get('search_keyword');
}
if(!$division->list_count) $division->list_count = 1;
if(!$type) $type = 'next';
if(!$order) $order = 'list_order';
$oDocumentModel = &getModel('document');
$oDocument = $oDocumentModel->getDocument($division->document_srl, '');
if($order == 'list_order') {
$args->list_order = $oDocument->get('list_order');
if($type == 'next') $args->first_list_order = $oDocument->get('list_order');
elseif($type == 'prev') $args->last_list_order = $oDocument->get('list_order');
} elseif($order == 'update_order') {
$args->update_order = $oDocument->get('update_order');
if($type == 'next') $args->first_update_order = $oDocument->get('update_order');
elseif($type == 'prev') $args->last_update_order = $oDocument->get('update_order');
}
$args->module_srl = $oDocument->get('module_srl');
$args->sort_index = ($order == 'list_order')?'list_order':'update_order';
$args->order_type = ($type == 'next')? ($division->list_count > 0)? 'desc':'asc' :'asc';
$args->list_count = ($division->list_count > 1)? $division->list_count:1;
$args->page_count = 1;
$args->page = 1;
// 검색 옵션 정리
$search_target = (!$division->no_search)? $division->search_target:'';
$search_keyword = (!$division->no_search)? $division->search_keyword:'';
$query_id = "document.getDivisionDocument";
if($search_target && $search_keyword) {
switch($search_target) {
case 'title' :
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
$args->{"s_".$search_target} = $search_keyword;
case 'content' :
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
$args->{"s_".$search_target} = $search_keyword;
break;
case 'title_content' :
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
$args->s_title = $search_keyword;
$args->s_content = $search_keyword;
break;
case 'user_id' :
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
$args->s_user_id = $search_keyword;
$args->sort_index = 'documents.'.$args->sort_index;
break;
case 'user_name' :
case 'nick_name' :
case 'email_address' :
case 'homepage' :
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
$args->{"s_".$search_target} = $search_keyword;
break;
case 'is_notice' :
case 'is_secret' :
if($search_keyword=='Y') $args->{"s_".$search_target} = 'Y';
else $args->{"s_".$search_target} = '';
break;
case 'member_srl' :
case 'readed_count' :
case 'voted_count' :
case 'comment_count' :
case 'trackback_count' :
case 'uploaded_count' :
$args->{"s_".$search_target} = (int)$search_keyword;
break;
case 'regdate' :
case 'last_update' :
case 'ipaddress' :
$args->{"s_".$search_target} = $search_keyword;
break;
case 'comment' :
$args->s_comment = $search_keyword;
$args->sort_index = 'documents.'.$args->sort_index;
$query_id = 'document.getDivisionComment';
break;
case 'tag' :
$args->s_tags = str_replace(' ','%',$search_keyword);
$args->sort_index = 'documents.'.$args->sort_index;
$query_id = 'document.getDivisionTag';
break;
default :
preg_match('/^extra_vars([0-9]+)$/',$search_target,$matches);
if($matches[1]) {
$args->{"s_extra_vars".$matches[1]} = $search_keyword;
}
break;
}
}
$output = executeQuery($query_id, $args);
if($output->data) {
if($type == 'next'){
$division_count = $division->list_count;
foreach($output->data as $division_no2){
$division_next[$division_count--] = $division_no2;
}
for($i=($division_count+1);$i<($division->list_count+1);$i++){
$division_document[$i] = $division_next[$i];
}
}elseif($type == 'prev'){
$division_document = $output->data;
}
return $division_document;
}
}
추가설명
/**
* @brief 문서 설정 정보를 구함
**/
function getDocumentConfig() {
if(!$GLOBLAS['__document_config__']) {
$oModuleModel = &getModel('module');
$config = $oModuleModel->getModuleConfig('document');
if(!$config->thumbnail_type) $config->thumbnail_type = 'crop';
$GLOBLAS['__document_config__'] = $config;
}
return $GLOBLAS['__document_config__'];
}
-- 여기다가 추가해주세요 --
}
$oDocumentModel = &getModel('document');
return $oDocumentModel->_getDocumentDivision('next',$order,$division);
}
function getDivision_prev($order,$division){
$oDocumentModel = &getModel('document');
return $oDocumentModel->_getDocumentDivision('prev',$order,$division);
}
function _getDocumentDivision($type,$order,$division){
if(!$division->document_srl) {
if(context::get('document_srl')) $division->document_srl = context::get('document_srl');
else return;
}
if(!$division->search_target) {
if(context::get('search_target')) $division->search_target = context::get('search_target');
}
if(!$division->search_keyword) {
if(context::get('search_keyword')) $division->search_keyword = context::get('search_keyword');
}
if(!$division->list_count) $division->list_count = 1;
if(!$type) $type = 'next';
if(!$order) $order = 'list_order';
$oDocumentModel = &getModel('document');
$oDocument = $oDocumentModel->getDocument($division->document_srl, '');
if($order == 'list_order') {
$args->list_order = $oDocument->get('list_order');
if($type == 'next') $args->first_list_order = $oDocument->get('list_order');
elseif($type == 'prev') $args->last_list_order = $oDocument->get('list_order');
} elseif($order == 'update_order') {
$args->update_order = $oDocument->get('update_order');
if($type == 'next') $args->first_update_order = $oDocument->get('update_order');
elseif($type == 'prev') $args->last_update_order = $oDocument->get('update_order');
}
$args->module_srl = $oDocument->get('module_srl');
$args->sort_index = ($order == 'list_order')?'list_order':'update_order';
$args->order_type = ($type == 'next')? ($division->list_count > 0)? 'desc':'asc' :'asc';
$args->list_count = ($division->list_count > 1)? $division->list_count:1;
$args->page_count = 1;
$args->page = 1;
// 검색 옵션 정리
$search_target = (!$division->no_search)? $division->search_target:'';
$search_keyword = (!$division->no_search)? $division->search_keyword:'';
$query_id = "document.getDivisionDocument";
if($search_target && $search_keyword) {
switch($search_target) {
case 'title' :
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
$args->{"s_".$search_target} = $search_keyword;
case 'content' :
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
$args->{"s_".$search_target} = $search_keyword;
break;
case 'title_content' :
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
$args->s_title = $search_keyword;
$args->s_content = $search_keyword;
break;
case 'user_id' :
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
$args->s_user_id = $search_keyword;
$args->sort_index = 'documents.'.$args->sort_index;
break;
case 'user_name' :
case 'nick_name' :
case 'email_address' :
case 'homepage' :
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
$args->{"s_".$search_target} = $search_keyword;
break;
case 'is_notice' :
case 'is_secret' :
if($search_keyword=='Y') $args->{"s_".$search_target} = 'Y';
else $args->{"s_".$search_target} = '';
break;
case 'member_srl' :
case 'readed_count' :
case 'voted_count' :
case 'comment_count' :
case 'trackback_count' :
case 'uploaded_count' :
$args->{"s_".$search_target} = (int)$search_keyword;
break;
case 'regdate' :
case 'last_update' :
case 'ipaddress' :
$args->{"s_".$search_target} = $search_keyword;
break;
case 'comment' :
$args->s_comment = $search_keyword;
$args->sort_index = 'documents.'.$args->sort_index;
$query_id = 'document.getDivisionComment';
break;
case 'tag' :
$args->s_tags = str_replace(' ','%',$search_keyword);
$args->sort_index = 'documents.'.$args->sort_index;
$query_id = 'document.getDivisionTag';
break;
default :
preg_match('/^extra_vars([0-9]+)$/',$search_target,$matches);
if($matches[1]) {
$args->{"s_extra_vars".$matches[1]} = $search_keyword;
}
break;
}
}
$output = executeQuery($query_id, $args);
if($output->data) {
if($type == 'next'){
$division_count = $division->list_count;
foreach($output->data as $division_no2){
$division_next[$division_count--] = $division_no2;
}
for($i=($division_count+1);$i<($division->list_count+1);$i++){
$division_document[$i] = $division_next[$i];
}
}elseif($type == 'prev'){
$division_document = $output->data;
}
return $division_document;
}
}
추가설명
/**
* @brief 문서 설정 정보를 구함
**/
function getDocumentConfig() {
if(!$GLOBLAS['__document_config__']) {
$oModuleModel = &getModel('module');
$config = $oModuleModel->getModuleConfig('document');
if(!$config->thumbnail_type) $config->thumbnail_type = 'crop';
$GLOBLAS['__document_config__'] = $config;
}
return $GLOBLAS['__document_config__'];
}
-- 여기다가 추가해주세요 --
}
modules/document/queries/getDivisionDocument.xml
파일경로명으로 저장하셔서 해당경로에 추가해주세요
<query id="getDivisionDocument" action="select">
<tables>
<table name="documents" />
</tables>
<columns>
<column name="*" />
</columns>
<conditions>
<condition operation="in" column="module_srl" var="module_srl" filter="number" />
<condition operation="in" column="category_srl" var="category_srl" pipe="and" />
<condition operation="equal" column="is_notice" var="s_is_notice" pipe="and" />
<condition operation="equal" column="member_srl" var="member_srl" filter="number" pipe="and" />
<group pipe="and">
<condition operation="below" column="list_order" var="first_list_order" filter="number" pipe="and" />
<condition operation="excess" column="list_order" var="last_list_order" filter="number" pipe="and" />
</group>
<group pipe="and">
<condition operation="like" column="title" var="s_title" />
<condition operation="like" column="content" var="s_content" pipe="or" />
<condition operation="like" column="user_name" var="s_user_name" pipe="or" />
<condition operation="like" column="user_id" var="s_user_id" pipe="or" />
<condition operation="like" column="nick_name" var="s_nick_name" pipe="or" />
<condition operation="like" column="email_address" var="s_email_addres" pipe="or" />
<condition operation="like" column="homepage" var="s_homepage" pipe="or" />
<condition operation="like" column="tags" var="s_tags" pipe="or" />
<condition operation="equal" column="is_secret" var="s_is_secret" pipe="or" />
<condition operation="equal" column="member_srl" var="s_member_srl" pipe="or" />
<condition operation="more" column="readed_count" var="s_readed_count" pipe="or" />
<condition operation="more" column="voted_count" var="s_voted_count" pipe="or" />
<condition operation="more" column="comment_count" var="s_comment_count" pipe="or" />
<condition operation="more" column="trackback_count" var="s_trackback_count" pipe="or" />
<condition operation="more" column="uploaded_count" var="s_uploaded_count" pipe="or" />
<condition operation="like_prefix" column="regdate" var="s_regdate" pipe="or" />
<condition operation="like_prefix" column="last_update" var="s_last_update" pipe="or" />
<condition operation="like_prefix" column="ipaddress" var="s_ipaddress" pipe="or" />
<condition operation="like" column="extra_vars1" var="s_extra_vars1" pipe="or" />
<condition operation="like" column="extra_vars2" var="s_extra_vars2" pipe="or" />
<condition operation="like" column="extra_vars3" var="s_extra_vars3" pipe="or" />
<condition operation="like" column="extra_vars4" var="s_extra_vars4" pipe="or" />
<condition operation="like" column="extra_vars5" var="s_extra_vars5" pipe="or" />
<condition operation="like" column="extra_vars6" var="s_extra_vars6" pipe="or" />
<condition operation="like" column="extra_vars7" var="s_extra_vars7" pipe="or" />
<condition operation="like" column="extra_vars8" var="s_extra_vars8" pipe="or" />
<condition operation="like" column="extra_vars9" var="s_extra_vars9" pipe="or" />
<condition operation="like" column="extra_vars10" var="s_extra_vars10" pipe="or" />
<condition operation="like" column="extra_vars11" var="s_extra_vars11" pipe="or" />
<condition operation="like" column="extra_vars12" var="s_extra_vars12" pipe="or" />
<condition operation="like" column="extra_vars13" var="s_extra_vars13" pipe="or" />
<condition operation="like" column="extra_vars14" var="s_extra_vars14" pipe="or" />
<condition operation="like" column="extra_vars15" var="s_extra_vars15" pipe="or" />
<condition operation="like" column="extra_vars16" var="s_extra_vars16" pipe="or" />
<condition operation="like" column="extra_vars17" var="s_extra_vars17" pipe="or" />
<condition operation="like" column="extra_vars18" var="s_extra_vars18" pipe="or" />
<condition operation="like" column="extra_vars19" var="s_extra_vars19" pipe="or" />
<condition operation="like" column="extra_vars20" var="s_extra_vars20" pipe="or" />
</group>
<group pipe="and">
<condition operation="below" column="update_order" var="first_update_order" filter="number" pipe="and" />
<condition operation="excess" column="update_order" var="last_update_order" filter="number" pipe="and" />
</group>
</conditions>
<navigation>
<index var="sort_index" default="list_order" order="order_type" />
<list_count var="list_count" default="1" />
<page_count var="page_count" default="1" />
<page var="page" default="1" />
</navigation>
</query>
<tables>
<table name="documents" />
</tables>
<columns>
<column name="*" />
</columns>
<conditions>
<condition operation="in" column="module_srl" var="module_srl" filter="number" />
<condition operation="in" column="category_srl" var="category_srl" pipe="and" />
<condition operation="equal" column="is_notice" var="s_is_notice" pipe="and" />
<condition operation="equal" column="member_srl" var="member_srl" filter="number" pipe="and" />
<group pipe="and">
<condition operation="below" column="list_order" var="first_list_order" filter="number" pipe="and" />
<condition operation="excess" column="list_order" var="last_list_order" filter="number" pipe="and" />
</group>
<group pipe="and">
<condition operation="like" column="title" var="s_title" />
<condition operation="like" column="content" var="s_content" pipe="or" />
<condition operation="like" column="user_name" var="s_user_name" pipe="or" />
<condition operation="like" column="user_id" var="s_user_id" pipe="or" />
<condition operation="like" column="nick_name" var="s_nick_name" pipe="or" />
<condition operation="like" column="email_address" var="s_email_addres" pipe="or" />
<condition operation="like" column="homepage" var="s_homepage" pipe="or" />
<condition operation="like" column="tags" var="s_tags" pipe="or" />
<condition operation="equal" column="is_secret" var="s_is_secret" pipe="or" />
<condition operation="equal" column="member_srl" var="s_member_srl" pipe="or" />
<condition operation="more" column="readed_count" var="s_readed_count" pipe="or" />
<condition operation="more" column="voted_count" var="s_voted_count" pipe="or" />
<condition operation="more" column="comment_count" var="s_comment_count" pipe="or" />
<condition operation="more" column="trackback_count" var="s_trackback_count" pipe="or" />
<condition operation="more" column="uploaded_count" var="s_uploaded_count" pipe="or" />
<condition operation="like_prefix" column="regdate" var="s_regdate" pipe="or" />
<condition operation="like_prefix" column="last_update" var="s_last_update" pipe="or" />
<condition operation="like_prefix" column="ipaddress" var="s_ipaddress" pipe="or" />
<condition operation="like" column="extra_vars1" var="s_extra_vars1" pipe="or" />
<condition operation="like" column="extra_vars2" var="s_extra_vars2" pipe="or" />
<condition operation="like" column="extra_vars3" var="s_extra_vars3" pipe="or" />
<condition operation="like" column="extra_vars4" var="s_extra_vars4" pipe="or" />
<condition operation="like" column="extra_vars5" var="s_extra_vars5" pipe="or" />
<condition operation="like" column="extra_vars6" var="s_extra_vars6" pipe="or" />
<condition operation="like" column="extra_vars7" var="s_extra_vars7" pipe="or" />
<condition operation="like" column="extra_vars8" var="s_extra_vars8" pipe="or" />
<condition operation="like" column="extra_vars9" var="s_extra_vars9" pipe="or" />
<condition operation="like" column="extra_vars10" var="s_extra_vars10" pipe="or" />
<condition operation="like" column="extra_vars11" var="s_extra_vars11" pipe="or" />
<condition operation="like" column="extra_vars12" var="s_extra_vars12" pipe="or" />
<condition operation="like" column="extra_vars13" var="s_extra_vars13" pipe="or" />
<condition operation="like" column="extra_vars14" var="s_extra_vars14" pipe="or" />
<condition operation="like" column="extra_vars15" var="s_extra_vars15" pipe="or" />
<condition operation="like" column="extra_vars16" var="s_extra_vars16" pipe="or" />
<condition operation="like" column="extra_vars17" var="s_extra_vars17" pipe="or" />
<condition operation="like" column="extra_vars18" var="s_extra_vars18" pipe="or" />
<condition operation="like" column="extra_vars19" var="s_extra_vars19" pipe="or" />
<condition operation="like" column="extra_vars20" var="s_extra_vars20" pipe="or" />
</group>
<group pipe="and">
<condition operation="below" column="update_order" var="first_update_order" filter="number" pipe="and" />
<condition operation="excess" column="update_order" var="last_update_order" filter="number" pipe="and" />
</group>
</conditions>
<navigation>
<index var="sort_index" default="list_order" order="order_type" />
<list_count var="list_count" default="1" />
<page_count var="page_count" default="1" />
<page var="page" default="1" />
</navigation>
</query>
modules/document/queries/getDivisionComment.xml
파일경로명으로 저장하셔서 해당경로에 추가해주세요
<query id="getDivisionComment" action="select">
<tables>
<table name="documents" alias="documents" />
<table name="comments" alias="comments"/>
</tables>
<columns>
<column name="documents.*" />
</columns>
<conditions>
<condition operation="in" column="documents.module_srl" var="module_srl" filter="number" />
<condition operation="equal" column="documents.category_srl" var="category_srl" pipe="and" />
<condition operation="equal" column="documents.document_srl" default="comments.document_srl" notnull="notnull" pipe="and" />
<condition operation="equal" column="documents.member_srl" var="member_srl" filter="number" pipe="and" />
<group pipe="and">
<condition operation="below" column="documents.list_order" var="first_list_order" filter="number" pipe="and" />
<condition operation="excess" column="documents.list_order" var="last_list_order" filter="number" pipe="and" />
</group>
<group pipe="and">
<condition operation="below" column="documents.update_order" var="first_update_order" filter="number" pipe="and" />
<condition operation="excess" column="documents.update_order" var="last_update_order" filter="number" pipe="and" />
</group>
<condition operation="like" column="comments.content" var="s_comment" notnull="notnull" pipe="and" />
</conditions>
<navigation>
<index var="sort_index" default="document.list_order" order="order_type" />
<list_count var="list_count" default="20" />
<page_count var="page_count" default="10" />
<page var="page" default="1" />
</navigation>
</query>
<tables>
<table name="documents" alias="documents" />
<table name="comments" alias="comments"/>
</tables>
<columns>
<column name="documents.*" />
</columns>
<conditions>
<condition operation="in" column="documents.module_srl" var="module_srl" filter="number" />
<condition operation="equal" column="documents.category_srl" var="category_srl" pipe="and" />
<condition operation="equal" column="documents.document_srl" default="comments.document_srl" notnull="notnull" pipe="and" />
<condition operation="equal" column="documents.member_srl" var="member_srl" filter="number" pipe="and" />
<group pipe="and">
<condition operation="below" column="documents.list_order" var="first_list_order" filter="number" pipe="and" />
<condition operation="excess" column="documents.list_order" var="last_list_order" filter="number" pipe="and" />
</group>
<group pipe="and">
<condition operation="below" column="documents.update_order" var="first_update_order" filter="number" pipe="and" />
<condition operation="excess" column="documents.update_order" var="last_update_order" filter="number" pipe="and" />
</group>
<condition operation="like" column="comments.content" var="s_comment" notnull="notnull" pipe="and" />
</conditions>
<navigation>
<index var="sort_index" default="document.list_order" order="order_type" />
<list_count var="list_count" default="20" />
<page_count var="page_count" default="10" />
<page var="page" default="1" />
</navigation>
</query>
modules/document/queries/getDivisionTag.xml
파일경로명으로 저장하셔서 해당경로에 추가해주세요
<query id="getDivisionTag" action="select">
<tables>
<table name="documents" alias="documents" />
<table name="tags" alias="tags"/>
</tables>
<columns>
<column name="documents.*" />
</columns>
<conditions>
<condition operation="in" column="documents.module_srl" var="module_srl" filter="number" />
<condition operation="equal" column="documents.document_srl" default="tags.document_srl" notnull="notnull" pipe="and" />
<condition operation="equal" column="documents.member_srl" var="member_srl" filter="number" pipe="and" />
<condition operation="like" column="tags.tag" var="s_tags" notnull="notnull" pipe="and" />
<group pipe="and">
<condition operation="below" column="documents.list_order" var="first_list_order" filter="number" pipe="and" />
<condition operation="excess" column="documents.list_order" var="last_list_order" filter="number" pipe="and" />
</group>
<group pipe="and">
<condition operation="below" column="documents.update_order" var="first_update_order" filter="number" pipe="and" />
<condition operation="excess" column="documents.update_order" var="last_update_order" filter="number" pipe="and" />
</group>
</conditions>
<navigation>
<index var="sort_index" default="documents.list_order" order="order_type" />
<list_count var="list_count" default="20" />
<page_count var="page_count" default="10" />
<page var="page" default="1" />
</navigation>
</query>
<tables>
<table name="documents" alias="documents" />
<table name="tags" alias="tags"/>
</tables>
<columns>
<column name="documents.*" />
</columns>
<conditions>
<condition operation="in" column="documents.module_srl" var="module_srl" filter="number" />
<condition operation="equal" column="documents.document_srl" default="tags.document_srl" notnull="notnull" pipe="and" />
<condition operation="equal" column="documents.member_srl" var="member_srl" filter="number" pipe="and" />
<condition operation="like" column="tags.tag" var="s_tags" notnull="notnull" pipe="and" />
<group pipe="and">
<condition operation="below" column="documents.list_order" var="first_list_order" filter="number" pipe="and" />
<condition operation="excess" column="documents.list_order" var="last_list_order" filter="number" pipe="and" />
</group>
<group pipe="and">
<condition operation="below" column="documents.update_order" var="first_update_order" filter="number" pipe="and" />
<condition operation="excess" column="documents.update_order" var="last_update_order" filter="number" pipe="and" />
</group>
</conditions>
<navigation>
<index var="sort_index" default="documents.list_order" order="order_type" />
<list_count var="list_count" default="20" />
<page_count var="page_count" default="10" />
<page var="page" default="1" />
</navigation>
</query>
출력하기(스킨파일 등에 추가해주세요)
설명
getDivision_next(),getDivision_prev() <- 기본 값입니다. list_order정렬, 문서번호,검색내용을 자동 입력합니다.
옵션(next 함수 기준으로 설명)
getDivision_next('update_order') <- 정렬 기준을 update 순으로 합니다.
{@$divi->list_count = 3}
getDivision_next('',$divi) <- 리스트 출력 카운터 수를 추가 합니다.
getDivision_next('update_order',$divi) <- update 순으로 리스트 출력 카운터 수를 추가 합니다.
{@$divi->document_srl = $oDocument->document_srl} <- 특정 게시물 부터 구하기
(위젯이나 게시물 리스트 등에는 document_srl 변수가 없기 때문에 임의의 게시물 번호를 입력해 줍니다.
변수의 경우는 각 위젯, 게시물 리스트에서 표기하는 document_srl 변수명으로 대체해주세요)
{@$divi->search_target = context::get('search_target')} <- 특정 검색 대상
{@$divi->search_keyword = context::get('search_keyword')} <- 특정 검색어로 부터 구하기
{@$divi->no_search = 'Y'} <- 검색된 상태라도 이를 무시, 전체 게시물에서 구합니다.
{@$divi->list_count = 3} <- 리스트 출력 카운터 수
최대 5가지 항목으로 원하는 결과물을 출력합니다.
검색어의 경우 search_target,search_keyword가 동시에 선언 되어야 합니다.
스킨에 입력 형태
{@$divi->no_search = 'Y'}
{@$oDivision = &getModel('document')}
{@$divi_next = $oDivision->getDivision_next('',$divi)}
<!--@foreach($divi_next as $division_no)-->
<h4><a href="{getUrl('document_srl',$division_no->document_srl, 'listStyle', $listStyle, 'cpage','')}">다음글 {$division_no->document_srl} {$division_no->title}</a></h4><br />
<!--@end-->
{@$divi_prev = $oDivision->getDivision_prev('',$divi)}
<!--@foreach($divi_prev as $division_no)-->
<h4><a href="{getUrl('document_srl',$division_no->document_srl, 'listStyle', $listStyle, 'cpage','')}">이전글 {$division_no->document_srl} {$division_no->title}</a></h4><br />
<!--@end-->
{@$oDivision = &getModel('document')}
{@$divi_next = $oDivision->getDivision_next('',$divi)}
<!--@foreach($divi_next as $division_no)-->
<h4><a href="{getUrl('document_srl',$division_no->document_srl, 'listStyle', $listStyle, 'cpage','')}">다음글 {$division_no->document_srl} {$division_no->title}</a></h4><br />
<!--@end-->
{@$divi_prev = $oDivision->getDivision_prev('',$divi)}
<!--@foreach($divi_prev as $division_no)-->
<h4><a href="{getUrl('document_srl',$division_no->document_srl, 'listStyle', $listStyle, 'cpage','')}">이전글 {$division_no->document_srl} {$division_no->title}</a></h4><br />
<!--@end-->
foreach안에서의 $division_no->document_srl 와같은 결과물을 xe_documents 테이블의 컬럼 내용 전체를 뽑아낼 수 있습니다.
ps1 : 저는 document 모듈에 안넣고 애드온으로 해서 쓰기 때문에 위 내용 적용 시 오류가 발생할 가능성이 있습니다.
(하지만 테스트는 해보았기에 될거로 봅니다.)
ps2 : 왠만하면 이 이상 요구하는건 좀... -_-;;
- 카테고리 :
- 팁
- 조회 수 :
- 3144
- 등록일 :
- 2008.08.07
- 16:59:53 (*.234.236.247)
- 게시글 주소 :
- http://animeclub.net/57367