$clear['wr_category'] = implode('|',$clear['wr_category']); // 회원이면 자신의 회원번호를 입력함 if($this->Config('mb','login')) $clear['mb_no'] = $this->Config('mb','no'); // 기본 정보들 자동입력 $clear['wr_datetime'] = 'NOW()'; $clear['wr_update'] = 'NOW()'; $clear['wr_ip'] = "INET_ATON('".Util::GetRealIPAddr()."')"; $clear['bo_no'] = $bo_no; $key = DB::Get()->InsertEx($tbn, $clear, array('wr_ip','wr_datetime','wr_update')); if(!$key) Dialog::Alert('정확한 정보를 입력하세요.'); // 태그 입력 $tags = $_POST['tags']; if($tags) { Tag::Inst()->Action('insert', $bo_no, $key, array_unique(array_filter(explode(',', $tags)))); } // 파일 업로드 File::Inst()->Action('upload', $key); $url = $this->Link('view', $key); if($clear['wr_is_secret']) $url = $this->Link('list'); Url::GoReplace($url);
<?php if(!defined("__MAGIC__")) exit; $tags = array(); foreach(Tag::Inst()->Sql('group', $this->bo_no) as $v) { $tags[] = $v['tag_name']; } $this->tags = $tags; // meta keywords PageElement::Inst('head')->SetConfig('keywords', '', implode(',',$this->tags));
<?php if(!defined("__MAGIC__")) exit; $tbn = $this->TBN(); $tbn_tag = Tag::Inst()->TBN(); $bo_no = $this->bo_no; $category = urldecode(GV::Category()); // 개수 카운트 $sql = " SELECT count(wr_no) as cnt FROM `{$tbn}` WHERE bo_no={$bo_no} AND wr_parent_no=0 "; // 월별보기 저장소 쿼리 $archive=trim($_GET['archive']); if($archive) { $archive = explode(' ', $archive); $archive[0] = preg_replace('/[^0-9]/','',$archive[0]); $archive[1] = preg_replace('/[^0-9]/','',$archive[1]); $sql.=" AND DATE_FORMAT(wr_datetime,'%Y%m')=DATE_FORMAT('{$archive[0]}-{$archive[1]}-01','%Y%m') "; } $sql.= Search::Inst()->Sql(array('wr_subject','wr_content')); $ca1 = trim($_GET['ca1']); $ca2 = trim($_GET['ca2']); if($ca1) $sql.= " AND wr_category LIKE '{$ca1}%' "; if($ca2) $sql.= " AND wr_category LIKE '%{$ca2}' ";
// 게시글 조회수 업데이트 $key = GV::Number($this->KN()); $this->wr_no = $key; // 세션이 끊어 졌을때만 다시 업데이트 함 if(!$_SESSION[$this->Config('hit_check').$key]) { $this->Sql('update_hit',$key); $_SESSION[$this->Config('hit_check').$key] = true; } $data = $this->Sql('fetch', $key); $data['wr_content'] = Editor::Inst(Board::Inst()->bo_no($this->bo_no)->bo_editor)->db_out($data['wr_content']); $this->sql['fetch'.$key] = $data; // 태그 가져오기 $tags = array(); foreach(Tag::Inst()->Sql('list', $this->bo_no, $key) as $v) { $tags[] = array( 'name'=>$v['tag_name'], 'link'=>Url::Get(array('tag'=>$v['tag_name']),array('ca1','ca2','wr_no','pg')) ); } $this->tags = $tags; // 홈페이지 타이틀 설정 $title = array_merge( array($data['wr_subject']), array($data['wr_category']), PageElement::Inst('head')->Config('title') ); PageElement::Inst('head')->SetConfig('title', '', $title);
<?php if(!defined("__MAGIC__")) exit; $key = $this->Key(); // 태그삭제 $tags = $_POST['tags']; Tag::Inst()->Action('insert', $this->bo_no, $key, array()); // 게시글 하나 삭제 $this->Sql('delete', $key); // 게시글에 포함된 파일 모두 삭제 foreach(File::Inst()->wr_no($key)->Action('files') as $v) { File::Inst()->Action('delete', $v); } Url::GoReplace($this->Link('list'));
$archive=array(); foreach($this->Sql('list_all') as $v) { if(!isset($archive[$v['wr_datetime_text']])) $archive[$v['wr_datetime_text']]=0; $archive[$v['wr_datetime_text']]++; } krsort($archive); // 공시사항 $notice = $this->Sql('list_notice'); // 최신댓글 $comment = Comment::Inst()->Sql('latest', $this->bo_no, 10); // 최신글 $latest = Latest::Inst('blog_side', $this->bo_no)->html(); // 태그 $tags = Tag::Inst('basic', $this->bo_no)->SetConfig('hide_count','',1)->html(); if(!function_exists('strcut_utf8')) { function strcut_utf8($str, $len, $checkmb=false, $tail='') { /** * UTF-8 Format * 0xxxxxxx = ASCII, 110xxxxx 10xxxxxx or 1110xxxx 10xxxxxx 10xxxxxx * latin, greek, cyrillic, coptic, armenian, hebrew, arab characters consist of 2bytes * BMP(Basic Mulitilingual Plane) including Hangul, Japanese consist of 3bytes **/ preg_match_all('/[\xE0-\xFF][\x80-\xFF]{2}|./', $str, $match); // target for BMP $m = $match[0]; $slen = strlen($str); // length of source string $tlen = strlen($tail); // length of tail string $mlen = count($m); // length of matched characters
* 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