웹마스터 팁

원하는 확장변수 번호를 지정해서 최근 게시물 위젯에 적용하기 위한 간단 팁입니다.

최근문서위젯인 newest_document 내용을 약간 수정하셔서 사용하시면 됩니다.

스킨은 default스킨을 이용했습니다.

<적용예제 미리보기>

[스터디하자 - studyhaja.kr -] 

 

1. xe->widegets->newest_document-> newest_document.class.php :

약70번째줄에 보시면 아래와 같은 내용이 나오는데요, 빨간색 부분부터 제가 첨가한 내용입니다.

저는 확장변수 선택범위를 20번까지 했지만 필요에 따라서 줄이거나 늘이거나 하시면 됩니다.

필요에 따라서 복사하기 쉽게 그냥 20번까지 그대로 다 적어 봤습니다.

 

[내용부분]

            // 결과가 있으면 각 문서 객체화를 시킴
            $modules = array();
            if(count($output->data)) {
                foreach($output->data as $key => $attribute) {
                    $modules[$attribute->module_srl]->mid = $attribute->mid;
                    $modules[$attribute->module_srl]->site_srl = $attribute->site_srl;

                    $document_srl = $attribute->document_srl;

                    $oDocument = null;
                    $oDocument = new documentItem();
                    $oDocument->setAttribute($attribute, false);
                    $GLOBALS['XE_DOCUMENT_LIST'+ '+ '][$oDocument->document_srl] = $oDocument;

                    $document_list[$key] = $oDocument;

                    // 확장 변수 1번 출력
                    if($args->extra_var_num_1) {
                        $oDocument->extra_value_1 = $oDocument->getExtraValue($args->extra_var_num_1);
                        $oDocument->extra_var_num_1 = $args->extra_var_num_1;
                    }
                    // 확장 변수 2번 출력
                    if($args->extra_var_num_2) {
                        $oDocument->extra_value_2 = $oDocument->getExtraValue($args->extra_var_num_2);
                        $oDocument->extra_var_num_2 = $args->extra_var_num_2;
                    }
                    // 확장 변수 3번 출력
                    if($args->extra_var_num_3) {
                        $oDocument->extra_value_3 = $oDocument->getExtraValue($args->extra_var_num_3);
                        $oDocument->extra_var_num_3 = $args->extra_var_num_3;
                    }
                    // 확장 변수 4번 출력
                    if($args->extra_var_num_4) {
                        $oDocument->extra_value_4 = $oDocument->getExtraValue($args->extra_var_num_4);
                        $oDocument->extra_var_num_4 = $args->extra_var_num_4;
                    }
                    // 확장 변수 5번 출력
                    if($args->extra_var_num_5) {
                        $oDocument->extra_value_5 = $oDocument->getExtraValue($args->extra_var_num_5);
                        $oDocument->extra_var_num_5 = $args->extra_var_num_5;
                    }
                    // 확장 변수 6번 출력
                    if($args->extra_var_num_6) {
                        $oDocument->extra_value_6 = $oDocument->getExtraValue($args->extra_var_num_6);
                        $oDocument->extra_var_num_6 = $args->extra_var_num_6;
                    }
                    // 확장 변수 7번 출력
                    if($args->extra_var_num_7) {
                        $oDocument->extra_value_7 = $oDocument->getExtraValue($args->extra_var_num_7);
                        $oDocument->extra_var_num_7 = $args->extra_var_num_7;
                    }
                    // 확장 변수 8번 출력
                    if($args->extra_var_num_8) {
                        $oDocument->extra_value_8 = $oDocument->getExtraValue($args->extra_var_num_8);
                        $oDocument->extra_var_num_8 = $args->extra_var_num_8;
                    }
                    // 확장 변수 9번 출력
                    if($args->extra_var_num_9) {
                        $oDocument->extra_value_9 = $oDocument->getExtraValue($args->extra_var_num_9);
                        $oDocument->extra_var_num_9 = $args->extra_var_num_9;
                    }
                    // 확장 변수 10번 출력
                    if($args->extra_var_num_10) {
                        $oDocument->extra_value_10 = $oDocument->getExtraValue($args->extra_var_num_10);
                        $oDocument->extra_var_num_10 = $args->extra_var_num_10;
                    }
                    // 확장 변수 11번 출력
                    if($args->extra_var_num_11) {
                        $oDocument->extra_value_11 = $oDocument->getExtraValue($args->extra_var_num_11);
                        $oDocument->extra_var_num_11 = $args->extra_var_num_11;
                    }
                    // 확장 변수 12번 출력
                    if($args->extra_var_num_12) {
                        $oDocument->extra_value_12 = $oDocument->getExtraValue($args->extra_var_num_12);
                        $oDocument->extra_var_num_12 = $args->extra_var_num_12;
                    }
                    // 확장 변수 13번 출력
                    if($args->extra_var_num_13) {
                        $oDocument->extra_value_13 = $oDocument->getExtraValue($args->extra_var_num_13);
                        $oDocument->extra_var_num_13 = $args->extra_var_num_13;
                    }
                    // 확장 변수 14번 출력
                    if($args->extra_var_num_14) {
                        $oDocument->extra_value_14 = $oDocument->getExtraValue($args->extra_var_num_14);
                        $oDocument->extra_var_num_14 = $args->extra_var_num_14;
                    }
                    // 확장 변수 15번 출력
                    if($args->extra_var_num_15) {
                        $oDocument->extra_value_15 = $oDocument->getExtraValue($args->extra_var_num_15);
                        $oDocument->extra_var_num_15 = $args->extra_var_num_15;
                    }
                    // 확장 변수 16번 출력
                    if($args->extra_var_num_16) {
                        $oDocument->extra_value_16 = $oDocument->getExtraValue($args->extra_var_num_16);
                        $oDocument->extra_var_num_16 = $args->extra_var_num_16;
                    }
                    // 확장 변수 17번 출력
                    if($args->extra_var_num_17) {
                        $oDocument->extra_value_17 = $oDocument->getExtraValue($args->extra_var_num_17);
                        $oDocument->extra_var_num_17 = $args->extra_var_num_17;
                    }
                    // 확장 변수 18번 출력
                    if($args->extra_var_num_18) {
                        $oDocument->extra_value_18 = $oDocument->getExtraValue($args->extra_var_num_18);
                        $oDocument->extra_var_num_18 = $args->extra_var_num_18;
                    }
                    // 확장 변수 19번 출력
                    if($args->extra_var_num_19) {
                        $oDocument->extra_value_19 = $oDocument->getExtraValue($args->extra_var_num_19);
                        $oDocument->extra_var_num_19 = $args->extra_var_num_19;
                    }
                    // 확장 변수 20번 출력
                    if($args->extra_var_num_20) {
                        $oDocument->extra_value_20 = $oDocument->getExtraValue($args->extra_var_num_20);
                        $oDocument->extra_var_num_20 = $args->extra_var_num_20;
                    }

                }
                $oDocumentModel->setToAllDocumentExtraVars();

[내용부분 끝] 

 

2. xe->widegets->newest_document->conf->info.xml

파일의 <extra_vars>내용안의 적당한 곳에 다음을 삽입하시면 됩니다.

 

         <var id="extra_var_num_1">
            <name>확장변수 1</name>
            <type>select</type>
            <description>확장 변수1 출력여부</description>
            <options><name>출력안함</name><value></value></options>
            <options><name>확장변수1출력</name><value>1</value></options>
        </var>
        <var id="extra_var_num_2">
            <name>확장변수 2</name>
            <type>select</type>
            <description>확장 변수2 출력여부</description>
            <options><name>출력안함</name><value></value></options>
            <options><name>확장변수2출력</name><value>2</value></options>
        </var>
        <var id="extra_var_num_3">
            <name>확장변수 3</name>
            <type>select</type>
            <description>확장 변수3 출력여부</description>
            <options><name>출력안함</name><value></value></options>
            <options><name>확장변수3출력</name><value>3</value></options>
        </var>
        <var id="extra_var_num_4">
            <name>확장변수 4</name>
            <type>select</type>
            <description>확장 변수4 출력여부</description>
            <options><name>출력안함</name><value></value></options>
            <options><name>확장변수4출력</name><value>4</value></options>
        </var>
        <var id="extra_var_num_5">
            <name>확장변수 5</name>
            <type>select</type>
            <description>확장 변수5 출력여부</description>
            <options><name>출력안함</name><value></value></options>
            <options><name>확장변수5출력</name><value>5</value></options>
        </var>
        <var id="extra_var_num_6">
            <name>확장변수 6</name>
            <type>select</type>
            <description>확장 변수6 출력여부</description>
            <options><name>출력안함</name><value></value></options>
            <options><name>확장변수6출력</name><value>6</value></options>
        </var>
        <var id="extra_var_num_7">
            <name>확장변수 7</name>
            <type>select</type>
            <description>확장 변수7 출력여부</description>
            <options><name>출력안함</name><value></value></options>
            <options><name>확장변수7출력</name><value>7</value></options>
        </var>
        <var id="extra_var_num_8">
            <name>확장변수 8</name>
            <type>select</type>
            <description>확장 변수8 출력여부</description>
            <options><name>출력안함</name><value></value></options>
            <options><name>확장변수8출력</name><value>8</value></options>
        </var>
        <var id="extra_var_num_9">
            <name>확장변수 9</name>
            <type>select</type>
            <description>확장 변수9 출력여부</description>
            <options><name>출력안함</name><value></value></options>
            <options><name>확장변수9출력</name><value>9</value></options>
        </var>
        <var id="extra_var_num_10">
            <name>확장변수 10</name>
            <type>select</type>
            <description>확장 변수10 출력여부</description>
            <options><name>출력안함</name><value></value></options>
            <options><name>확장변수10출력</name><value>10</value></options>
        </var>
        <var id="extra_var_num_11">
            <name>확장변수 11</name>
            <type>select</type>
            <description>확장 변수11 출력여부</description>
            <options><name>출력안함</name><value></value></options>
            <options><name>확장변수11출력</name><value>11</value></options>
        </var>
        <var id="extra_var_num_12">
            <name>확장변수 12</name>
            <type>select</type>
            <description>확장 변수12 출력여부</description>
            <options><name>출력안함</name><value></value></options>
            <options><name>확장변수12출력</name><value>12</value></options>
        </var>
        <var id="extra_var_num_13">
            <name>확장변수 13</name>
            <type>select</type>
            <description>확장 변수13 출력여부</description>
            <options><name>출력안함</name><value></value></options>
            <options><name>확장변수13출력</name><value>13</value></options>
        </var>
        <var id="extra_var_num_14">
            <name>확장변수 14</name>
            <type>select</type>
            <description>확장 변수14 출력여부</description>
            <options><name>출력안함</name><value></value></options>
            <options><name>확장변수14출력</name><value>14</value></options>
        </var>
        <var id="extra_var_num_15">
            <name>확장변수 15</name>
            <type>select</type>
            <description>확장 변수15 출력여부</description>
            <options><name>출력안함</name><value></value></options>
            <options><name>확장변수15출력</name><value>15</value></options>
        </var>
        <var id="extra_var_num_16">
            <name>확장변수 16</name>
            <type>select</type>
            <description>확장 변수16 출력여부</description>
            <options><name>출력안함</name><value></value></options>
            <options><name>확장변수16출력</name><value>16</value></options>
        </var>
        <var id="extra_var_num_17">
            <name>확장변수 17</name>
            <type>select</type>
            <description>확장 변수17 출력여부</description>
            <options><name>출력안함</name><value></value></options>
            <options><name>확장변수17출력</name><value>17</value></options>
        </var>
        <var id="extra_var_num_18">
            <name>확장변수 18</name>
            <type>select</type>
            <description>확장 변수18 출력여부</description>
            <options><name>출력안함</name><value></value></options>
            <options><name>확장변수18출력</name><value>18</value></options>
        </var>
        <var id="extra_var_num_19">
            <name>확장변수 19</name>
            <type>select</type>
            <description>확장 변수19 출력여부</description>
            <options><name>출력안함</name><value></value></options>
            <options><name>확장변수19출력</name><value>19</value></options>
        </var>
        <var id="extra_var_num_20">
            <name>확장변수 20</name>
            <type>select</type>
            <description>확장 변수20 출력여부</description>
            <options><name>출력안함</name><value></value></options>
            <options><name>확장변수20출력</name><value>20</value></options>
        </var> 

 

3. xe->widegets->newest_document->skins->default->list.html

저는 디폴트 스킨에만 적용해 봤습니다. 빨간색 부분부터 제가 추가한 내용입니다.

확장변수를 둘러싸는 기호나 색깔등은 원하시는대로 바꾸시면 됩니다. 

[내용부분]

<div class="newest_document_default_{$colorset}">
    <div class="newest_document_default_box">
        <!--@foreach($widget_info->document_list as $oDocument)-->
        <div class="document_box">
            <div class="document">

    <!--확장변수 출력-->
    <!--@if($oDocument->extra_value_1)-->
    [<font color="red"><strong>{$oDocument->extra_value_1}</strong></font>]
    <!--@end-->
    
 <!--@if($oDocument->extra_value_2)-->
    <<font color="#2a0287"><strong>{$oDocument->extra_value_2}</strong></font>>
    <!--@end-->

    <!--@if($oDocument->extra_value_3)-->
    [<font color="#6538d7"><strong>{$oDocument->extra_value_3}</strong></font>]
    <!--@end-->

    <!--@if($oDocument->extra_value_4)-->
    [<font color="#007709"><strong>{$oDocument->extra_value_4}</strong></font>]
    <!--@end-->

    <!--@if($oDocument->extra_value_5)-->
    [<font color="blue"><strong>{$oDocument->extra_value_5}</strong></font>]
    <!--@end-->

    <!--@if($oDocument->extra_value_6)-->
    [<font color="#2a0287"><strong>{$oDocument->extra_value_6}</strong></font>]
    <!--@end-->

    <!--@if($oDocument->extra_value_7)-->
    - <font color="#6538d7"><strong>{$oDocument->extra_value_7}</strong></font> -
    <!--@end-->

    <!--@if($oDocument->extra_value_8)-->
    [<font color="#007709"><strong>{$oDocument->extra_value_8}</strong></font>]
    <!--@end-->

    <!--@if($oDocument->extra_value_9)-->
    [<font color="black">{$oDocument->extra_value_9}</font>]
    <!--@end-->

    <!--@if($oDocument->extra_value_10)-->
    [<font color="blue"><strong>{$oDocument->extra_value_10}</strong></font>]
    <!--@end-->

    <!--@if($oDocument->extra_value_11)-->
    [<font color="blue"><strong>{$oDocument->extra_value_11}</strong></font>]
    <!--@end-->

    <!--@if($oDocument->extra_value_12)-->
    [<font color="#2a0287"><strong>{$oDocument->extra_value_12}</strong></font>]
    <!--@end-->

    <!--@if($oDocument->extra_value_13)-->
    [<font color="#6538d7"><strong>{$oDocument->extra_value_13}</strong></font>]
    <!--@end-->

    <!--@if($oDocument->extra_value_14)-->
    [<font color="#330374"><strong>{$oDocument->extra_value_14}</strong></font>]
    <!--@end-->

    <!--@if($oDocument->extra_value_15)-->
    [<font color="blue"><strong>{$oDocument->extra_value_15}</strong></font>]
    <!--@end-->

    <!--@if($oDocument->extra_value_16)-->
    [<font color="#2a0287"><strong>{$oDocument->extra_value_16}</strong></font>]
    <!--@end-->

    <!--@if($oDocument->extra_value_17)-->
    [<font color="#6538d7"><strong>{$oDocument->extra_value_17}</strong></font>]
    <!--@end-->

    <!--@if($oDocument->extra_value_18)-->
    [<font color="#007709"><strong>{$oDocument->extra_value_18}</strong></font>]
    <!--@end-->

    <!--@if($oDocument->extra_value_19)-->
    [<font color="blue"><strong>{$oDocument->extra_value_19}</strong></font>]
    <!--@end-->

    <!--@if($oDocument->extra_value_20)-->
    [<font color="blue"><strong>{$oDocument->extra_value_20}</strong></font>]
    <!--@end-->
    <!--확장변수 출력 끝--> 

[내용부분 끝]  

 

<적용예제 미리보기>

[스터디하자 - studyhaja.kr -]

 

제목 글쓴이 날짜
모든 원하는 확장변수를 선택해서 최근게시물 위젯에 나타내기 간단팁 [12] jsuimage 2009.10.17
1.2.6 버전에서 메뉴추가 안되시는 분들 읽어보세요... [6] Crazyhouse.cn 2009.10.19
댓글 새창으로 보기 (경로수정) [1] file 고진감래 2009.10.20
댓글 삭제/수정/답글 시 팝업창으로 띄우기 [22] file 고진감래 2009.10.21
오늘 게시된 글은 날짜 대신 today 그림으로 대치 (왕초보용 초간단팁) file jsuimage 2009.10.21
Blog API ''not logged'' 오류 해결법 [2] file June Oh 2009.10.23
하나의 게시물을 각각 다르게 보이도록 만드는 방법 [5] 얼터1.0 2009.10.24
제로보드 XE가 갑자기 느려져서 확인해봤더니 [1] jy1664 2009.10.27
게시판 글작성 선택적 메일보내기 - 확장변수 이용 [2] file noirzo 2009.10.28
board.api.php 사용법 [1] file Hide_D 2009.10.29
1.2.6 업데이트 후 애드온 등 css가 적용 안되는 분들~ SeokiE 2009.10.29
카운터위젯 - 오늘 가입한 회원수 전체 회원수 출력 [5] 공수래 2009.11.01
프로필이미지, 이미지마크, 이미지이름 수정, 추가시 포인트 삭감 [1] lattente 2009.11.02
XE로 API 처리 완전 정복하기(1) [6] file 라르게덴 2009.11.02
XE로 API 처리 완전 정복하기(2) [2] file 라르게덴 2009.11.03
게시판 리스트에서 확장변수를 카테고리처럼 보여주기 [11] file 고진감래 2009.11.05
추천인/비추천인 표시하기 [7] file 고진감래 2009.11.05
1.3.0 버전에서 모듈설치 방법과 시작 모듈 설정하기 [21] file 스타호스트 2009.11.11
XE를 처음 접하거나 이제막 사이트개발을 하려는 초보자를 위한 XE 접근방법 [1] DuRi 2009.11.12
"제로보드 XE 기본 개념을 이해하자" 문서화 [3] file amd짱좋아 2009.11.13