묻고답하기

    class top_tag_list extends WidgetHandler {

        /**
         * @brief 위젯의 실행 부분
         *
         * ./widgets/위젯/conf/info.xml 에 선언한 extra_vars를 args로 받는다
         * 결과를 만든후 print가 아니라 return 해주어야 한다
         **/
        function proc($args) {
            // 제목
            $title = $args->title;

            // 출력된 목록 수
            $list_count = (int)$args->list_count;
            if(!$list_count) $list_count = 20;
            $list_count ++;

            $oDB = &DB::getInstance();
            $query = $oDB->_query('select tag from xe_tags group by tag order by cnt desc limit '.$list_count);
            $result = $oDB->_fetch($query);

            $widget_info->top_tag_list = $result->tag;



            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 = 'tags';

            // 템플릿 컴파일
            $oTemplate = &TemplateHandler::getInstance();
            return $oTemplate->compile($tpl_path, $tpl_file);
        }
    }

이것은 제가 기존에 있는 태그불러오는 위젯을 수정한 위젯파일 내용인데요.


xe_tags 테이블의 tag 들중에 중복되는값이 가장 많은 태그 순으로 $list_count(값예: 10) 갯수만큼 불러오는 소스입니다.


물론 XE 시스템을 잘모르는 상태에서 문의게시판 검색해가며 만든건데...


위젯으로 아무런 값이 안나오네요 ㅜㅜ;;


뭐가 틀린걸까요?