You cannot see this page without javascript.

이 부분은 약간의 코어 소스 수정과 변수 선언을 해주셔야 합니다.

보통 개인 DB 건드리고 출력할 용도가 게시판, 위젯, 애드온 등이 되겠는데요.

이  팁에서는 게시판을 기준으로 설명하겠습니다.

준비물 : 팁, xml파일, func_include 애드온, class.php
사전지식 : func_include 애드온을 이용한 함수 사용법

class.php

class 클래스명 {
    function init(){
        Context::set('getTable',array('테이블명1','테이블명2'));
    }
   function getTable(){
        $output = executeQueryArray('board/skins/스킨명.테이블명', $obj);
        // 오류가 생기면 그냥 무시
        if(!$output->toBool()) return;
        return $output->data;
    }
}


테이블명.xml

<query id="테이블명" action="select">
    <tables>
        <table name="테이블명" /> <- 이곳 본인의 테이블명 적으시면 됩니다.
    </tables>
    <columns>
        <column name="*" />
    </columns>
</query>

게시판스킨 임의의 html 파일에 아래를 선언

<!--@if($func_check)-->
{@ func_include('modules/board/skins/스킨명/php/class.php') }
{@ 클래스명::init() }
{@ $tables = 클래스명::getTable() }
<!--@end-->

    <!--@foreach($tables as $key => $val)-->
         내용
    <!--@endforeach-->

core 파일 수정
classes/db/DBMysql_innodb.class.php <- 이것은 각 DB 종류에 따라 그 파일을 수정해야합니다.
      /**
         * @brief insertAct 처리
         **/
        function _executeInsertAct($output) {
            // 테이블 정리
            foreach($output->tables as $key => $val) {
                $prefix = (!@in_array($key, Context::get('getTable')))? $this->prefix:false;
                $table_list[] = '`'.$prefix.$val.'`';
            }
.... 중략

        /**
         * @brief updateAct 처리
         **/
        function _executeUpdateAct($output) {
            // 테이블 정리
            foreach($output->tables as $key => $val) {
                $prefix = (!@in_array($key, Context::get('getTable')))? $this->prefix:false;
                $table_list[] = '`'.$prefix.$val.'` as '.$key;
            }
....중략
        /**
         * @brief deleteAct 처리
         **/
        function _executeDeleteAct($output) {
            // 테이블 정리
            foreach($output->tables as $key => $val) {
                $prefix = (!@in_array($key, Context::get('getTable')))? $this->prefix:false;
                $table_list[] = '`'.$prefix.$val.'`';
            }
....중략
        /**
         * @brief selectAct 처리
         *
         * select의 경우 특정 페이지의 목록을 가져오는 것을 편하게 하기 위해n
         * navigation이라는 method를 제공
         **/
        function _executeSelectAct($output) {
            // 테이블 정리
            foreach($output->tables as $key => $val) {
                $prefix = (!@in_array($key, Context::get('getTable')))? $this->prefix:false;
                $table_list[] = '`'.$prefix.$val.'` as '.$key;
            }
....중략



$prefix 로 시작하는 것 하고 그 밑에 내용 두줄을 위와 같이 교체 해주세요.


원리는 위에 지정한 테이블명과 접근하려는 테이블명이 같을 경우 xe_ 등의 말머리를 출력하지 않게 하는 겁니다.
그렇게 때문에 본인의 DB에 xe_documents 라는 테이블과 documents 라는 테이블이 있을 경우 테이블명이 동일하기 때문에
이런 경우를 제외하고는 다 뽑는게 가능하다고 봅니다.
엮인글 :
List of Articles
번호 제목 글쓴이 날짜sort 조회 수
169 Linux LFS/TheEnd - 마무리 LynX 2014-08-06 382
168 Linux LFS/Make Bootable System - LFS 시스템 부팅하기 LynX 2014-08-06 445
167 Linux LFS/Bootscripts - 시스템 부트로더 설정하기 [8] LynX 2014-08-06 570
166 Linux LFS/Building - 빌드하기 [11] LynX 2014-08-06 2614
165 Linux LFS/Preparation - 준비 LynX 2014-08-06 745
164 Linux LFS/Introduction - 소개 [8] LynX 2014-08-06 669
163 Linux LFS/Preface - 서문 [9] LynX 2014-08-06 1072
162 Linux Custom Kernel 컴파일링 & 설치하기 [8] LynX 2014-08-06 457
161 Linux PDO_MYSQL 설치 [8] LynX 2014-08-01 310
160 Linux sendmail, dovecot 설치 및 설정 [20] LynX 2014-08-01 2724
159 Linux rc.local 서비스 등록하기 LynX 2014-07-22 504
158 Linux systemd unit 등록 옵션 LynX 2014-07-22 20455
157 Linux 페도라17(centos7) 새로운 서비스 관리 LynX 2014-07-20 570
156 Linux SSH 컴파일 설치 LynX 2014-07-19 376
155 Xpress Engine XML 쿼리 대신 직접 mysql 사용하기 LynX 2014-07-19 273
154 Xpress Engine XML 쿼리 대신 직접 mysql 사용하기 LynX 2014-07-16 391
153 Linux 리눅스 기본 명령어 LynX 2014-07-16 792
152 Xpress Engine xe 외부 php 파일에서 db 접근하기 executeQuery() LynX 2014-07-14 919
151 Xpress Engine xe 모든 변수값 출력해 보기 LynX 2014-07-14 93715
» Xpress Engine XE용 query xml 방식으로 일반 테이블도 접근 처리 하기 LynX 2014-07-14 459

XE Login