웹마스터 팁

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

최근문서위젯인 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 -]

 

제목 글쓴이 날짜
외부 이미지 저장 애드온 [7] file samsara 2013.03.26
XE 1.5.X , 1.7.X 용 nginx rewrite [4] Root 2013.03.24
nginx에서 짧은 주소가 동작하지 않는 경우 해결 [3] Gunmania 2013.03.24
재미있는 조건문 팁 두 가지. [2] 엘카 2013.03.23
팝업모듈에서 jQuery 충돌 해결 - 팝업창이 안뜰때. [5] file 똑디 2013.03.22
요약 책갈피 경량판 sns 링크 버튼 디자인 보완 [1] file 웹플러스7 2013.03.21
팝업모듈 사용시 슬라이드js와 충돌문제 [2] 꿈틀잉 2013.03.21
Sketchbook5 레이아웃과 관리자메뉴 충돌 해결 [2] file YJSoft 2013.03.20
회원가입 확장 모듈 1.7.X 및 모바일에서 사용가능하도록 [10] file hhgyu 2013.03.18
외부이미지 저장 애드온을 본문을 읽으면 작동하도록 하자!! 1.7.3적용 [18] 하얀마법 2013.03.16
1.7 버전의 새로워진 사이트맵(메뉴편집)에 적응해보자! [8] file EnuX 2013.03.15
팝업 모듈에서, 사이트 전체에 팝업 띄우는 방법 모르시는 분들을 위해 ^^; [2] sejin7940 2013.03.13
xe 속도 엄청 빨라집니다. [4] 투투투쓰리 2013.03.12
지식인 모듈 기본스킨에서 카테고리 선택 안 해도 질문이 등록되는 버그 수정법 sejin7940 2013.03.12
데이타베이스 복제를 하면 속도가 8%정도 빨라짐 가을풍경 2013.03.03
회원가입시 유저가 비공개 설정하기 [1] file 모앱 2013.03.03
XE 루트로 접속하기 (이동 필요없음) [12] 모앱 2013.03.03
제로보드 4 -> xe 신버전으로 마이그레이션 경험담 [4] file 윤안젤로 2013.02.28
XE 루트로 옮기기 완벽 가이드 [/xe/ 로부터 벗어나자!] ver 1.1 [107] file LI-NA 2013.02.26
RSS 게시판 업데이터 모듈이 SSL 부분적용시 동작하지 않는 문제 해결하기 [25] Gunmania 2013.02.25