묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
최근게시물에서 일반게시물이 보여요
2011.06.15 11:17
커스텀되어있는 최근 게시물을 사용하고 있는데요
포인트 투표가 된 게시글만 최근게시물 위젯에 나타나고
일반 게시물은 최근게시물 위젯에 나타나질 않고 있습니다.
원인이 뭘까요?
==== 아래는 메인화면 최근게시물 위젯 내용입니다.
===== 아래는 Popular_document 위젯 내용입니다.
포인트 투표가 된 게시글만 최근게시물 위젯에 나타나고
일반 게시물은 최근게시물 위젯에 나타나질 않고 있습니다.
원인이 뭘까요?
==== 아래는 메인화면 최근게시물 위젯 내용입니다.
<div class="Rdiv"><img class="zbxe_widget_output" widget="popular_document" skin="ysdesign01" colorset="normal" list_type="readed_count" order_type="desc" order_keyword="실시간무료" list_count="7" view_date="30" mid_list="review_apple,review_ann,review_win,review_ipad" subject_cut_size="26" thumbnail_type="crop" display_author="N" display_regdate="N" display_readed_count="Y" display_voted_count="N" /></div></td>
===== 아래는 Popular_document 위젯 내용입니다.
<?php
/**
* @class popular_document
* @author Hwani (donghanee@gmail.com)
* @brief 인기 게시물을 출력하는 위젯
* @version 0.2
**/
class popular_document extends WidgetHandler {
/**
* @brief 위젯의 실행 부분
*
* ./widgets/위젯/conf/info.xml 에 선언한 extra_vars를 args로 받는다
* 결과를 만든후 print가 아니라 return 해주어야 한다
**/
function proc($args) {
// 위젯 자체적으로 설정한 변수들을 체크
$title = $args->title;
$order_target = $args->order_target;
if(!in_array($order_target, array('readed_count','voted_count','point'))) $order_target = 'readed_count';
$order_type = $args->order_type;
if(!in_array($order_type, array('asc','desc'))) $order_type = 'desc';
$order_keyword = $args->order_keyword;
if(!in_array($order_keyword, array('유료','무료','실시간무료')));
$list_count = (int)$args->list_count;
if(!$list_count) $list_count = 5;
$mid_list = explode(",",$args->mid_list);
$subject_cut_size = $args->subject_cut_size;
if(!$subject_cut_size) $subject_cut_size = 0;
//페이징 때문에 추가
$list_count = (int)$args->list_count;
if(!$list_count) $list_count = 5;
// 위젯 외곽 꾸미기 처리..
$design_top = $args->design_top;
$design_middle = $args->design_middle;
$design_bottom = $args->design_bottom;
$design_img = $args->design_img;
// module_srl 대신 mid가 넘어왔을 경우는 직접 module_srl을 구해줌
if($mid_list) {
$oModuleModel = &getModel('module');
$module_srl = $oModuleModel->getModuleSrlByMid($mid_list);
}
// DocumentModel::getDocumentList()를 이용하기 위한 변수 정리
if(is_array($module_srl)) $obj->module_srl = implode(',',$module_srl);
else $obj->module_srl = $module_srl;
$obj->sort_index = $order_target;
$obj->order_type = $order_type=="desc"?"desc":"asc";
$obj->order_keyword = $order_keyword;
$obj->list_count = $list_count;
$obj->s_date=-1;
if($args->view_date)
{
//time -> zdate 변형의 함수 필요
$date=ztime(date('YmdHis')) - 60*60*24*$args->view_date;
$date2=date('YmdHis', $date);
$obj->s_date=$date2;
}
// if($obj->sort_index == 'list_order') $obj->avoid_notice = -2100000000;
//$obj->category_srl = $args->category_srl;
if($args->category_srl && !is_array($args->category_srl)) $args->category_srl = explode(',',$args->category_srl);
//if(is_array($args->category_srl)) $args->category_srl = implode(',',$args->category_srl);
for($i=0; $i < count($args->category_srl); $i++) {
$csrl = $args->category_srl[$i];
$sql = "select category_srl from xe_document_categories where parent_srl=$csrl";
$qry = mysql_query($sql);
while($psrl = mysql_fetch_array($qry)) {
$realsrl .= $psrl[0].",";
}
$realsrl = substr($realsrl,0,-1);
}
$obj->category_srl = $realsrl;
/* 페이지 네비게이션 기능 추가 */
// 페이지 목록 수 (1,2,3,4....)
$page_count = $args->page_count;
if(!$page_count) $page_count = 5;
$obj->page_count = $page_count;
// 페이지 출력 여부
$page_type = $args->page_type;
// 페이지 번호 구하기
if($page_type=='Y') $obj->page = (Context::get('page'))? Context::get('page'): 1;
/* 페이지 네비게이션 기능 추가 끝 */
$output = executeQueryArray('widgets.popular_document.getPopularDocuments', $obj);
/* 페이지 네비게이션 기능 추가 */
$output_count = executeQueryArray('widgets.popular_document.getNewestDocumentsCount', $obj);
/* 페이지 네비게이션 기능 추가 끝 */
// document 모듈의 model 객체를 받아서 결과를 객체화 시킴
$oDocumentModel = &getModel('document');
// 오류가 생기면 그냥 무시
if(!$output->toBool()) return;
// 결과가 있으면 각 문서 객체화를 시킴
if(count($output->data)) {
foreach($output->data as $key => $attribute) {
$document_srl = $attribute->document_srl;
$oDocument = null;
$oDocument = new documentItem();
$oDocument->setAttribute($attribute);
$document_list[] = $oDocument;
}
} else {
$document_list = array();
}
//이미지 위젯 호환
// 글자 제목 길이
$widget_info->title_length = (int)$subject_cut_size;
if(!$widget_info->title_length) $widget_info->title_length = 10;
// 썸네일 생성 방법
$widget_info->thumbnail_type = $args->thumbnail_type;
if(!$widget_info->thumbnail_type) $widget_info->thumbnail_type = 'crop';
// 썸네일 가로 크기
$widget_info->thumbnail_width = (int)$args->thumbnail_width;
if(!$widget_info->thumbnail_width) $widget_info->thumbnail_width = 100;
// 썸네일 세로 크기
$widget_info->thumbnail_height = (int)$args->thumbnail_height;
if(!$widget_info->thumbnail_height) $widget_info->thumbnail_height = 100;
// 가로 이미지 수
$widget_info->rows_list_count = (int)$args->rows_list_count;
if(!$widget_info->rows_list_count) $widget_info->rows_list_count = 5;
// 세로 이미지 수
$widget_info->cols_list_count = (int)$args->cols_list_count;
if(!$widget_info->cols_list_count) $widget_info->cols_list_count = 1;
// 노출 여부 체크
if($args->display_author!='Y') $widget_info->display_author = 'N';
else $widget_info->display_author = 'Y';
if($args->display_regdate!='Y') $widget_info->display_regdate = 'N';
else $widget_info->display_regdate = 'Y';
if($args->display_readed_count!='Y') $widget_info->display_readed_count = 'N'+
';
else $widget_info->display_readed_count = 'Y';
if($args->display_voted_count!='Y') $widget_info->display_voted_count = 'N';
else $widget_info->display_voted_count = 'Y';
// 템플릿 파일에서 사용할 변수들을 세팅
if(count($mid_list)==1) $widget_info->module_name = $mid_list[0];
$widget_info->title = $title;
$widget_info->document_list = $document_list;
$widget_info->subject_cut_size = $subject_cut_size;
/* 페이지 네비게이션 기능 추가 */
$widget_info->page_type = $page_type;
$widget_info->total_count = $output_count->data[0]->count; // 전체 개시물 수
$widget_info->page = (!Context::get('page'))? 1:Context::get('page'); // 현재 페이지
// 총 페이지 수
$total_count = $widget_info->total_count/$list_count;
if($widget_info->total_count%$list_count != 0) $total_count+=1;
$widget_info->total_page = floor($total_count); // 총 페이지 수
$widget_info->page_count = $page_count; // 총 페이지 수
/* 페이지 네비게이션 기능 추가 끝 */
//위젯꾸밈을 위해 사용한 변수 셋팅
$widget_info->design_top = $design_top;
$widget_info->design_middle = $design_middle;
$widget_info->design_bottom = $design_bottom;
$widget_info->design_img = $design_img;
$widget_info->list_count = $list_count;
Context::set('widget_info', $widget_info);
// 템플릿의 스킨 경로를 지정 (skin, colorset에 따른 값을 설정)
$tpl_path = sprintf('%sskins/%s', $this->widget_path, $args->skin);
Context::set('colorset', $args->colorset);
// 템플릿 파일을 지정
$tpl_file = 'list';
// 템플릿 컴파일
$oTemplate = &TemplateHandler::getInstance();
$output = $oTemplate->compile($tpl_path, $tpl_file);
return $output;
}
}
/**
* @brief 다음 페이지 요청
**/
function WD_getNextPage($total_count, $total_page, $cur_page, $page_count = 10) {
$first_page = $cur_page - (int)($page_count/2);
if($first_page<1) $first_page = 1;
$last_page = $total_page;
if($last_page>$total_page) $last_page = $total_page;
if($total_page < $page_count) $page_count = $total_page;
$GLOBALS['wd_total_page'] = $total_page;
$GLOBALS['wd_first_page'] = $first_page;
$GLOBALS['wd_page_count'] = $page_count;
$GLOBALS['wd_last_page'] = $last_page;
$page->first_page = $first_page;
$page->last_page = $last_page;
return $page;
}
function WD_getNextPage2() {
$page = $GLOBALS['wd_first_page']+$GLOBALS['wd_i']++;
if($GLOBALS['wd_i'] > $GLOBALS['wd_page_count'] || $page > $GLOBALS['wd_last_page']) $page = 0;
return $page;
}
function WD_getNextClear() {
$GLOBALS['wd_i'] = 0;
}
?>
글쓴이 | 제목 | 최종 글 |
---|---|---|
XE | 공지 글 쓰기,삭제 운영방식 변경 공지 [16] | 2019.03.05 by 남기남 |
NZ448 | 게시물 이동 권한에 대해서.... | |
청어 | 파일첨부가 안됩니다 ~! [1] | 2009.02.06 by 청어 |
earthhero.me | 마이그레이션 import 가 안됩니다. | |
쿠쿠813 |
게시판 본문 밑에 나오는 글 목록을 없애고 싶습니다.
[9]
![]() | 2009.02.06 by aa |
박세홍659 | 너무 많은 재시도 라고 나옵니다 | |
데미안k | 호스팅 이전은 잘 했는데 로그인이 안되는군요 [1] | 2009.02.06 by 우리아기 |
syj | 용량에 대한 질문 입니다. [1] | 2009.02.06 by 비나무 |
김준영131 | 사진에 사각형으로 링크를 걸어놨는데.. [1] | 2009.02.06 by 비나무 |
짱0유 | 따라했는데... [5] | 2009.02.06 by 짱0유 |
김준영131 | 1.1.4 버전 어디서 받는거에요? [1] | 2009.02.06 by 백성찬 |
궁금이 |
포인트랭킹
![]() | |
미션 임포서블 |
위젯의 최근 문서 출력이 없어졌어요!?
[3]
![]() | 2009.02.06 by 미션 임포서블 |
프랜드 | 플래쉬 로고 링크걸기 [2] | 2009.02.06 by 프랜드 |
xp | xp에서 동시 접속자수? [1] | 2009.02.06 by 비나무 |
앙태 |
관리자 > 메뉴가 깨집니다
[4]
![]() | 2009.02.06 by 비나무 |
김철 | 이미지 복사시 내서버에 저장되게 어떻게 하나요? [1] | 2009.02.06 by 비나무 |
오리74 | 메뉴 문의드립니다.이거때문에 더이상 진행이 안되서...도와주세요. [2] | 2009.02.06 by 오리74 |
ccau |
회원가입폼에서 사진등록은 할 수 없나요?
[2]
![]() | 2009.02.06 by ccau |
구구다스 | 레이아웃의 로고를 *.swf로 사용하는 방법? [4] | 2009.02.06 by 프랜드 |
휀라이언트 |
xe 초보자인데요..상위메뉴바에 대해서 좀 알려주세요..
[6]
![]() | 2009.02.06 by 만쓰별(정만) |
module_srls="50" 이런식으로 해당게시판을 선택 안하셨군요.
예전에는 게시판을 선택하지 않아도 전체 게시판을 상대로 게시물을 뿌렸었는데 코어가 업데이트 되면서 선택한 게시판만 출력하게 바꿨어요. 해당 게시판을 선택해야 됩니다.
소스를 다시보니 글에는 최근 게시물이라고 하고는 소스는 popular document을 올리셨네요..
최근 게시물 위젯을 ./widgets/newest_document/skins 이곳에 넣어야 됩니다.