Example #1
0
<?php

if (!defined('__MAGIC__')) {
    exit;
}
$v = $this->view;
if (!$v) {
    $v = Widget::Inst()->Action('data_explode', $this->wg_no);
}
if ($v['bo_no']) {
    echo Write::Inst($v['skin'], $v['bo_no'])->SetConfig('img_width', '', $v['img_width'])->SetConfig('cols', '', $v['cols'])->SetConfig('rows', '', $v['rows'])->SetConfig('list_view', '', $v['list_view'])->SetConfig('use_comment', '', $v['use_comment'])->SetConfig('show_notice', '', $v['show_notice'])->html();
}
Example #2
0
<?php

if (!defined("__MAGIC__")) {
    exit;
}
$tbn = $this->TBN();
$tbn_write = Write::Inst()->TBN();
$sql_result = DB::Get()->Sql_query_list("\n\tSELECT \n\t\tA.*, \n\t\tB.wr_no,\n\t\tcount(A.bo_no) as cnt\n\tFROM `{$tbn}` A\n\tLEFT JOIN `{$tbn_write}` B ON A.bo_no=B.bo_no\n  WHERE A.bo_kind=''\n\tGROUP BY A.bo_no\n");
foreach ($sql_result as $k => $v) {
    if ($v['wr_no'] == null) {
        $sql_result[$k]['cnt'] = 0;
    }
}
Example #3
0
<?php if(!defined("__MAGIC__")) exit; 

$table = array();
$table['write'] = Write::Inst()->Table();


Example #4
0
<?php

if (!defined('__MAGIC__')) {
    exit;
}
$data = Widget::Inst()->Action('data_explode', $this->wg_no);
echo Write::Inst($data['skin'], 0, $data['wr_no'])->SetConfig('editor', 'name', $data['editor'])->SetConfig('editor', 'width', $data['editor_width'])->SetConfig('editor', 'height', $data['editor_height'])->html();
Example #5
0
if (!defined("__MAGIC__")) {
    exit;
}
/*
 * action파일
 * action.*.php 파일은 Alert을 호출하지 않고 단순한 하나의 행동을하고
 * 결과 값을 알려준다.
 * $result에 결과값을 저장해 줌
 * --------------------------
 */
if ($this->list) {
    $result = $this->list;
} else {
    if ($this->wr_no && !$this->mb_no) {
        $this->list = $this->Sql('list_by_write', $this->wr_no);
        // 파일 내용중에 이미지를 검사하여 출력해준다.
        $data = Write::Inst()->Sql('fetch', $this->wr_no);
        preg_match_all("/<img[^>]*src=[\"']?([^>\"']+)[\"']?[^>]*>/i", $data['wr_content'], $imgtags);
        if ($imgtags[1][0]) {
            $subfolder = explode('/', $_SERVER['PHP_SELF']);
            $host = 'http://' . $_SERVER['HTTP_HOST'] . '/' . $subfolder[1];
            $file_path = str_replace(array_shift(explode('?', $host)), '', $imgtags[1][0]);
            if (strpos('http', $file_path) === false) {
                $this->list_content_img = array('file_path' => $file_path);
            }
        }
    } else {
        $this->list = $this->Sql('list_by_member', $this->mb_no);
    }
    $result = $this->list;
}
Example #6
0
    $this->action = $this->Link('update');
}
/*
 * 게시판 목록 : 기존에 생성된 것
 */
$board_list = array();
$board_list[] = array('bo_subject' => '게시판생성');
foreach (Board::Inst()->Sql('list') as $v) {
    if ($data['bo_no'] == $v['bo_no']) {
        $v['selected'] = 'selected';
    }
    $board_list[] = $v;
}
$this->board_list = $board_list;
/*
 * 게시판 스킨 목록
 */
$skin_list = array();
$skin_list[] = array('name' => '게시판스킨 선택');
foreach (Write::Inst()->SkinList() as $v) {
    if ($data['skin'] == $v['skin']) {
        $v['selected'] = 'selected';
    }
    $skin_list[] = $v;
}
$this->skin_list = $skin_list;
/*
 * 하단 버튼 링크생성
 */
$this->btn_ok = Widget::Inst()->path_img('btn_ok.gif');
$this->btn_cancel = Widget::Inst()->path_img('btn_cancel.gif');
Example #7
0
$data['editor_height'] = GV::String('editor_height');
if (!$data['editor_height']) {
    $data['editor_height'] = $view['editor_height'];
}
if (!$data['editor_height']) {
    $data['editor_height'] = $this->Config('editor_height');
}
$this->data = $data;
// 에디터 목록
$this->editor_list = Editor::Inst('')->SkinList();
$this->action = $this->Link('insert');
if ($this->wg_no) {
    $this->action = $this->Link('update', $this->wg_no);
}
/*
 * 페이지 게시판 스킨 목록
 */
$skin_list = array();
$skin_list[] = array('name' => '스킨 선택');
foreach (Write::Inst()->SkinList('page') as $v) {
    if ($data['skin'] == $v['skin']) {
        $v['selected'] = 'selected';
    }
    $skin_list[] = $v;
}
$this->skin_list = $skin_list;
/*
 * 하단 버튼 링크생성
 */
$this->btn_ok = Widget::Inst()->path_img('btn_ok.gif');
$this->btn_cancel = Widget::Inst()->path_img('btn_cancel.gif');
Example #8
0
    $this->action = $this->Link('update');
}
/*
 * 게시판 목록 : 기존에 생성된 것
 */
$board_list = array();
$board_list[] = array('bo_subject' => '블로그게시판 생성');
foreach (Board::Inst()->Sql('list') as $v) {
    if ($data['bo_no'] == $v['bo_no']) {
        $v['selected'] = 'selected';
    }
    $board_list[] = $v;
}
$this->board_list = $board_list;
/*
 * 게시판 스킨 목록
 */
$skin_list = array();
$skin_list[] = array('name' => '블로그스킨 선택');
foreach (Write::Inst()->SkinList('blog') as $v) {
    if ($data['skin'] == $v['skin']) {
        $v['selected'] = 'selected';
    }
    $skin_list[] = $v;
}
$this->skin_list = $skin_list;
/*
 * 하단 버튼 링크생성
 */
$this->btn_ok = Widget::Inst()->path_img('btn_ok.gif');
$this->btn_cancel = Widget::Inst()->path_img('btn_cancel.gif');
Example #9
0
function Insert($data, $key = array())
{
    $ret = array();
    // $data의 마지막에 + 기호가 있다면 앞의 결과($key)와 합쳐서 반환함
    if (strpos($data, '+') !== false) {
        $ret[] = $key[0];
        $data = substr($data, 0, -1);
    }
    $_data = explode(':', $data);
    // 타입에 맞도록 데이터 입력
    switch ($_data[0]) {
        case 'widget':
            // 위젯 입력
            $_clear['wg_skin'] = $_data[1];
            $_clear['wg_width'] = '100';
            $_clear['wg_width_unit'] = '%';
            if ($_data[1] == 'page') {
                $_clear['wg_param'] = 'wr_no=' . $key[0] . '[]editor=cheditor[]editor_width=100%[]editor_height=500px';
            } else {
                if ($_data[1] == 'write') {
                    if ($_data[2] == 'mobile') {
                        $_clear['wg_param'] = 'skin=mbasic[]img_width=500[]rows=20[]columns=wr_datetime|wr_subject|wr_writer|wr_hit[]use_comment=1[]show_notice=1[]bo_no=' . $key[0];
                    } else {
                        $_clear['wg_param'] = 'skin=basic[]img_width=500[]rows=20[]columns=wr_datetime|wr_subject|wr_writer|wr_hit[]use_comment=1[]show_notice=1[]bo_no=' . $key[0];
                    }
                } else {
                    if ($_data[1] == 'webclip') {
                        $_clear['wg_param'] = 'skin=' . $_data[2];
                    }
                }
            }
            $ret[] = DB::Get()->InsertEx(Widget::Inst()->TBN(), $_clear);
            break;
        case 'write':
            // 게시글 입력 파일이 있다면 파일 내용을, 없다면 받은 키 값으로 위젯호출 구문을 적어넣는다
            $_path = __DIR__ . '/page/' . $_data[1];
            if (is_file($_path)) {
                $contents = addslashes(implode('', file($_path)));
            } else {
                $contents = '';
                rsort($key);
                foreach ($key as $v) {
                    $contents .= '[[Widget|' . $v . ']]';
                }
            }
            $_clear['bo_no'] = 0;
            $_clear['wr_subject'] = 'page';
            $_clear['wr_content'] = $contents;
            $ret[] = DB::Get()->InsertEx(Write::Inst()->TBN(), $_clear);
            break;
        case 'board':
            // 게시판 입력
            $_clear['bo_subject'] = $_data[1];
            $_clear['bo_editor'] = 'cheditor';
            $ret[] = DB::Get()->InsertEx(Board::Inst()->TBN(), $_clear);
            break;
    }
    return $ret;
}
Example #10
0
<?php

if (!defined("__MAGIC__")) {
    exit;
}
// 스킨 변경시 업데이트
$_POST['wg_skin'] = GV::String('wgSkin');
$data = Widget::Inst()->Action('data_explode', $this->wg_no);
if (!$data['wr_no']) {
    // wr_no가 없으면 입력
    // 게시글 입력
    $tbn = Write::Inst()->TBN();
    $clear = array();
    $clear['mb_no'] = Member::Inst()->mb_no;
    $clear['bo_no'] = 0;
    $clear['wr_datetime'] = 'NOW()';
    $clear['wr_update'] = 'NOW()';
    $clear['wr_ip'] = "INET_ATON('" . Util::GetRealIPAddr() . "')";
    $clear['wr_content'] = '';
    $clear['wr_subject'] = '페이지(일반형)';
    $key = DB::Get()->InsertEx($tbn, $clear, array('wr_ip', 'wr_datetime', 'wr_update'));
    // 게시글번호 저장
    $_POST['wr_no'] = $key;
} else {
    $_POST['wr_no'] = $data['wr_no'];
}
// POST 데이터 변환
$data = Widget::Inst()->Action('data_implode', $_POST);
// 업데이트
DB::Get()->Update($this->TBN(), $data, "where wg_no='{$this->wg_no}'");
?>
Example #11
0
 * version 1.0
 * 사용자의 구미에 맞도록 초기설치 제어를 수행함
 */
$cfg = array();
// 데이터베이스 정보
$cfg['dbinfo'] = array('host' => 'localhost', 'user' => '', 'password' => '', 'db' => '', 'prefix' => 'm3_');
// 관리자 정보
$cfg['admin_info'] = array('id' => 'admin', 'password' => '', 'password_confirm' => '', 'name' => '최고관리자');
// 홈페이지 기본정보
$cfg['hp_info'] = array('title' => '매직보드');
// data 폴더 목록
// '폴더명'=>'권한값'
$cfg['data_folder'] = array(Path::data() => 0707, Path::data_file() => 0707, Path::data('cache') => 0707, Path::data('zmLog') => 0707, Path::data('zmLogConnect') => 0755, Path::data('cheditor') => 0707, Path::data_member() => 0707);
// 설치 테이블 정보
// '테이블명'=>'설치모듈 인스턴스'
$cfg['tables'] = array('magic' => Magic::Inst(), 'config' => Config::Inst(), 'write' => Write::Inst(), 'board' => Board::Inst(), 'file' => File::Inst(), 'comment' => Comment::Inst(), 'member' => Member::Inst(), 'tag' => Tag::Inst(), 'widget' => Widget::Inst());
/*
* 메뉴구성 및 기본 컨텐츠 설정
$cfg['default_data'] = "
kr:index				=widget:page=write:index.html
+메뉴얼:basic			=widget:page=write=widget:webclip:sub_title+=widget:page
++영문홈페이지:basic	=widget:page=write=widget:webclip:sub_title+=widget:page
++모바일홈페이지:basic	=widget:page=write=widget:webclip:sub_title+=widget:page
+게시판:basic			=widget:page=write=widget:webclip:sub_title+=widget:page
++공지사항:basic		=widget:page=write=widget:webclip:sub_title+=widget:write=board:공지

eng:index				=widget:page=write:index.html
+English Sample:basic	=widget:page=write

member:member
Example #12
0
    $this->action = $this->Link('update');
}
/*
 * 게시판 목록 : 기존에 생성된 것
 */
$board_list = array();
$board_list[] = array('bo_subject' => '게시판생성');
foreach (Board::Inst()->Sql('list') as $v) {
    if ($data['bo_no'] == $v['bo_no']) {
        $v['selected'] = 'selected';
    }
    $board_list[] = $v;
}
$this->board_list = $board_list;
/*
 * 게시판 스킨 목록
 */
$skin_list = array();
$skin_list[] = array('name' => '게시판스킨 선택');
foreach (Write::Inst()->SkinList('gallery') as $v) {
    if ($data['skin'] == $v['skin']) {
        $v['selected'] = 'selected';
    }
    $skin_list[] = $v;
}
$this->skin_list = $skin_list;
/*
 * 하단 버튼 링크생성
 */
$this->btn_ok = Widget::Inst()->path_img('btn_ok.gif');
$this->btn_cancel = Widget::Inst()->path_img('btn_cancel.gif');