웹마스터 팁
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
이전글, 다음글 얻기
2008.05.29 19:17
질문&답변 란에 글이 좀 보이길래 한번 만들어봤습니다. (저도 써야하기 땜시롱)
이걸 애드온으로 해둘까하다가 그냥 입맛에 맞게 하시라고 소스만 드릴게요.
getNextDivision.xml
getPrevDivision.xml
스킨 같은 곳에서 사용 방법
{@$oDivision = &getModel('document')}
다음글 {$oDivision->getDocumentDivision($oDocument->document_srl,'next','list_order')}
이전글 {$oDivision->getDocumentDivision($oDocument->document_srl,'prev','list_order')}
list_order로 정렬 법과 update_order로 정렬 법으로 되게 해봤습니다.
executeQuery("document.getNextDivision", $args);
document 은 xml 파일이 있는 곳으로 바꿔주셔야 합니다.
xml파일을 addons/애드온명/queries/ 폴더에 넣어서 사용하실 경우는 addons.애드온명.getNextDivision 으로 되어야 겠죠.
그리고 만약 addons/애드온명 폴더 안에서 사용할 경우라면
다음글 {getDocumentDivision($oDocument->document_srl,'next','list_order')}
이전글 {getDocumentDivision($oDocument->document_srl,'prev','list_order')}
이런식으로 사용하세요.
---------------------
추가 설명 해드립니다.
제일 위의 소스파일은 제로XE/modules/document/document.model.php 의 제일 하단
/**
* @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__'];
}
---- 요기 붙여넣기 해주세요 ----
}
?>
나머지 xml의 내용은 제목대로(getNextDivision.xml,getPrevDivision.xml) 각각 파일로 만드셔서
제로XE/modules/document/queries/ 폴더에 넣어주세요.
주의1. 꼭 파일 저장하실때(특히 XML) UTF-8로 저장하세요.
주의2. 안되면?? ㄷㄷㄷ;;;; 저는 됐습니다. 안되면 어쩔수 없이 물어보세요 ^^
이걸 애드온으로 해둘까하다가 그냥 입맛에 맞게 하시라고 소스만 드릴게요.
function getDocumentDivision($document_srl,$type,$order){ $oDocumentModel = &getModel('document'); $oDocument = $oDocumentModel->getDocument($document_srl, ''); $args->module_srl = $oDocument->get('module_srl'); if($order == 'list_order') { $args->list_order = $oDocument->get('list_order'); $args->sort_index = 'list_order'; } elseif($order == 'update_order') { $args->update_order = $oDocument->get('update_order'); $args->sort_index = 'update_order'; } if($type == 'next') $args->order_type = 'desc'; elseif($type == 'prev') $args->order_type = 'asc'; $args->list_count = 1; $args->page_count = 1; $args->page = 1; if($type == 'next') $output = executeQuery("document.getNextDivision", $args); elseif($type == 'prev') $output = executeQuery("document.getPrevDivision", $args); if($output->data) { $data = array_pop($output->data); $division_document = $data->document_srl; } return $division_document; }
getNextDivision.xml
<query id="getNextDivision" 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="below" column="list_order" var="list_order" filter="number" pipe="and" /> <condition operation="below" column="update_order" var="update_order" filter="number" pipe="and" /> </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>
getPrevDivision.xml
<query id="getPrevDivision" 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="excess" column="list_order" var="list_order" filter="number" pipe="and" /> <condition operation="excess" column="update_order" var="update_order" filter="number" pipe="and" /> </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>
스킨 같은 곳에서 사용 방법
{@$oDivision = &getModel('document')}
다음글 {$oDivision->getDocumentDivision($oDocument->document_srl,'next','list_order')}
이전글 {$oDivision->getDocumentDivision($oDocument->document_srl,'prev','list_order')}
list_order로 정렬 법과 update_order로 정렬 법으로 되게 해봤습니다.
executeQuery("document.getNextDivision", $args);
document 은 xml 파일이 있는 곳으로 바꿔주셔야 합니다.
xml파일을 addons/애드온명/queries/ 폴더에 넣어서 사용하실 경우는 addons.애드온명.getNextDivision 으로 되어야 겠죠.
그리고 만약 addons/애드온명 폴더 안에서 사용할 경우라면
다음글 {getDocumentDivision($oDocument->document_srl,'next','list_order')}
이전글 {getDocumentDivision($oDocument->document_srl,'prev','list_order')}
이런식으로 사용하세요.
---------------------
추가 설명 해드립니다.
제일 위의 소스파일은 제로XE/modules/document/document.model.php 의 제일 하단
/**
* @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__'];
}
---- 요기 붙여넣기 해주세요 ----
}
?>
나머지 xml의 내용은 제목대로(getNextDivision.xml,getPrevDivision.xml) 각각 파일로 만드셔서
제로XE/modules/document/queries/ 폴더에 넣어주세요.
주의1. 꼭 파일 저장하실때(특히 XML) UTF-8로 저장하세요.
주의2. 안되면?? ㄷㄷㄷ;;;; 저는 됐습니다. 안되면 어쩔수 없이 물어보세요 ^^
태그 연관 글
- [2018/11/07] 묻고답하기 제로보드4, XE 백업 파일을 xml로 추출한 파일에 한글이 안 나옵니다 *2
- [2017/03/05] 묻고답하기 게시판 스킨의 테마 컬러를 skin.xml에 정의해 스타일시트에 전달하는 방법이 궁금합니다.
- [2016/09/29] 묻고답하기 백업용 xml파일 저장후 삭제 문의 *2
- [2011/07/13] 묻고답하기 XE에 기상청 동네날씨예보 XML 위젯 추가하기 *1
- [2011/05/28] 묻고답하기 설치시 문제 (The result is not valid XML) *1
댓글 25
제목 | 글쓴이 | 날짜 |
---|---|---|
이전글, 다음글 얻기 [25] | 라르게덴 | 2008.05.29 |
에디터입력창 배경색상(이미지) 변경해보기 [5] [1] | 팔공산 | 2008.07.13 |
SocialXE 설치후 트위터, 페이스북 접속 안될경우??? [9] | 착한부산남자 | 2012.09.28 |
bodex 추천 & 댓글 버튼 만들기. [1] | meanie | 2012.10.28 |
게시판확장변수를 이미지로 나타내게 게시판스킨 수정법 [3] | 팔공산 | 2010.03.10 |
닉네임 변경시 기존 게시물 연동 팁 (레벨 아이콘 에드온 이용) [9] | 바붕아 | 2012.10.23 |
Zbxe 서버 이전하기 [4] | 팔공산 | 2007.08.22 |
약관 동의 후 가입하기 [2] | findwind | 2008.11.24 |
로그인 안되시는분들 참고 [8] | 화니478 | 2007.08.14 |
[XE 1.4] 모듈 개발 시 유의해야할 템플릿 버그 | 퍼니엑스이 | 2012.10.24 |
XE 1.5.3.1hotfix1에서 Content widget이 정상작동 하지 않을때 [3] | 황비 | 2012.08.29 |
메인화면에 설문조사 위젯(?) 만들기 [3] | 3D매니아 | 2010.12.14 |
팝업관리 모듈(팝업 오프너 ver. 0.0.4 )에 사용되는 addon/pop_up [25] | ForHanbi | 2011.08.21 |
알렉사 순위 가져오는 스크립트;; [30] | zero | 2001.11.06 |
FTP 쉬운설치 에러나시는분들 [4] | 조양각 | 2012.01.05 |
스케치북 게시판 스킨 사용시 확장변수 라인 CSS수정 | 해피보이 | 2012.10.17 |
운영하던 사이트의 도메인 주소를 변경했을때 기존 사이트의 이미지들이 엑박이 뜰때 해결방법 [4] | 졸라맨 | 2012.03.05 |
클립보드로 텍스트 복사하기 [5] | 베니 | 2007.11.24 |
Google Analytics Addon 자료 최신 XE 에서 작동시키는 방법 [4] | sejin7940 | 2012.10.05 |
크롭에 웹폰트 적용하기 css | 꿈틀잉 | 2012.10.07 |