웹마스터 팁

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

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

 

제목 글쓴이 날짜
확장변수 [2] 다케루 2007.08.25
확장변수 이용해서 2차 3차 분류 항목 만들기 [3] VagaBond 2007.09.08
확장변수에서 본문 입력 빼기 [10] file Diver 2007.11.12
게시판 하단 검색 옵션 원하는 것만 넣기 (확장변수 포함) [10] shtjdals 2008.01.02
게시판 확장변수에 라디오버튼 추가해서 사용하기 [6] file 똑디 2008.03.04
확장변수 쉽게 출력하기 [7] lightnsalt 2008.03.04
[3-1차 수정]확장변수 자유롭게 내 마음대로 게시글 리스트에 표현 합시다!![ver1.0.1] [16] file 대암지기 2008.04.09
확장변수(textarea)에 html태그 적용 [6] 오엘 2008.05.08
확장변수 다중선택에서 체크박스의 선택개수를 제한하기 [5] file 우야꼬 2008.05.30
[1원짜리팁] 큰 이미지 썸네일 못생성& 확장변수 원하는 곳에 배치하기 ^^ [2] 파파민 2008.06.23
초보 헤메다가 팁//인쇄영역 확장변수 포함 [8] file 리히토 2008.07.14
확장변수 별로 작성 및 열람 권한 설정하기 [7] 대암지기 2008.10.11
통합검색에서 확장변수 검색하기 [5] StyleD 2008.10.12
전화번호 형식의 확장변수를 목록에 출력하고 싶을 때 serendip 2009.01.06
확장변수전용 권한설정 게시판스킨 미권한자에게 출력 (''깜박''오류?) 보고 file 0su 2009.02.25
Faceoff 버젼에서 확장변수 마음대로 배치하기 ^^ 파파민 2009.03.13
확장변수 출력 방법 초 심플하게 적어봅니다. [15] 라르게덴 2009.03.16
확장변수값 이미지로 대체하여 나타내기 (실시간 응대목적) [12] file sm3 2009.06.10
확장변수 폼 디자인 하기 [14] file Diver 2009.06.21
확장변수에 회원정보를 넣어보자 [10] file 개돌 2009.06.30