웹마스터 팁

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

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

 

제목 글쓴이 날짜
최근게시물에 움직이는 GIF 불러오기 SuP 2013.04.25
게시판 리스트에서 확장변수를 카테고리처럼 보여주기 [11] file 고진감래 2009.11.05
게시판확장변수를 이미지로 나타내게 게시판스킨 수정법 [3] file 팔공산 2010.03.10
스케치북 게시판 스킨 사용시 확장변수 라인 CSS수정 해피보이 2012.10.17
게시판 확장변수 설명 삭제 안 되는 버그 해결방법 sejin7940 2012.08.30
확장변수 숫자(화폐) 콤마 표시하기 (sketchbook 스킨) file 라싸 2012.08.12
다국어시, 언어코드 찾기 후 검색을 한 뒤 적용 누르면 적용 안 되는 버그 수정 sejin7940 2012.06.08
확장변수 쉽게 출력하기 [7] lightnsalt 2008.03.04
모든 원하는 확장변수를 선택해서 최근게시물 위젯에 나타내기 간단팁 [12] jsuimage 2009.10.17
게시판에 다운로드 횟수 출력하기 (스케치북 게시판 전용) [5] file 숭숭군 2012.04.20
Xe 1.5.1로 사이트 꾸미기 part 1 [25] file 황비 2011.12.04
[초보팁] 최근게시물 위젯에 확장변수 표시하기 [23] 오뎅궁물 2010.01.29
그룹별 회원정보 검색 & 회원의 추가가입폼 복수 검색 팁 (XE 1.5) sejin7940 2012.03.22
게시판 본문에 글쓴이 전화번호 추출하여 보이기 늘푸른이 2012.03.03
첨부파일 보이기 숨기기 옵션추가 [18] ☜ TeRy ☞ 2009.02.10
확장변수 중 전화번호 양식으로 write_form.html 에서 script로 제어시 sejin7940 2012.02.16
확장변수이용시 숫자 일경우 정렬하기 팁 푸하라 2012.02.02
외부 이미지 링크 막기 (초간단) 2%부족 [5] easy14 2008.01.14
확정변수 로 프린트 페이지 꾸미기(/print_page.html) 세상의지배자 2011.12.26
코어 1.5.1에서 회원목록에 성별아이콘 쓰기(수정) 늘푸른이 2011.12.10