Example #1
0
<?php

if (!defined("__MAGIC__")) {
    exit;
}
$rows = $this->Config('rows');
$cols = $this->Config('cols');
$tot = $rows * $cols;
$bo_no = $this->Config('bo_no');
$tbn = $this->TBN();
$tbn_board = Board::Inst()->TBN();
$tbn_file = File::Inst()->TBN();
$sql = "\n\tSELECT\n\t\tA.wr_no,\n\t\tA.wr_subject,\n\t\tB.file_no\n\tFROM `{$tbn}` A\n\tINNER JOIN {$tbn_file} B ON B.wr_no=A.wr_no\n\tWHERE A.bo_no='{$bo_no}' AND A.wr_parent_no=0 AND A.wr_is_secret=0\n\tORDER BY A.wr_datetime\n\tLIMIT {$tot}\n";
$sql_result = DB::Get()->sql_query_list($sql);
Example #2
0
<?php

if (!defined("__MAGIC__")) {
    exit;
}
// 스펨  차단코드 검사
Captcha::Inst()->Check();
$m = $this->Action('login_info');
$passwd = $this->Sql('password', $_POST['mb_passwd']);
if ($passwd != $m['mb_passwd']) {
    Dialog::alert("기존 비밀번호가 맞지 않습니다.\n다시한번 확인하세요.");
}
// 파일을 업로드 했을 때 이전 파일들은 지움
$f = File::Inst();
$files = array();
foreach ($f->mb_no($m['mb_no'])->Action('files') as $v) {
    $files[] = $v['file_no'];
}
// 삭제해야할 파일들 삭제
foreach ($files as $v) {
    $f->Action('delete', $v);
}
$this->Sql('unregist', $m['mb_no'], GV::String('mb_memo'));
$this->Action('logout');
Dialog::alert("정상적으로 회원탈퇴 되었습니다.\n그동안 이용해 주셔서 감사합니다.", Path::Group());
exit;
Example #3
0
<?php

if (!defined('__MAGIC__')) {
    exit;
}
$m = $this;
$file = File::Inst()->mb_no($m->mb_no);
$picture = $m->Action('picture');
?>

<div class="sub_title"><h2>회원페이지</h2></div>

<div id="member_view">

  <div id="mypage_box">
    <p class="welcom">Welcom to <?php 
echo Config::Inst()->hp_title;
?>
</p>
    <p class="title">MY PAGE</p>
    <p class="ment"><span><?php 
echo $m->mb_nick;
?>
님의 <b>마이페이지</b> 입니다.</span> 오늘도 <?php 
echo Config::Inst()->hp_title;
?>
와 함께 좋은 하루되세요!</p>
  </div>

  <h3><strong><?php 
echo $m->mb_nick;
<?php if(!defined("__MAGIC__")) exit; 


if(is_array($_POST['chk'])) {
  foreach($_POST['chk'] as $k=>$v) {
    // 게시글 하나 삭제
    $this->Sql('delete', $v);

    // 게시글에 포함된 파일 모두 삭제
    foreach(File::Inst()->wr_no($v)->Action('files') as $vv) {
      File::Inst()->Action('delete', $vv);
    }
  }
}

exit;


Example #5
0
// 로그인한 회원정보
$m = $this->Action('login_info');
// 수정하지 않을 변수
unset($clear['mb_id']);
unset($clear['mb_passwd']);
if (!$clear['mb_nick']) {
    Dialog::alert("별명을 입력하세요.");
}
// 파일을 업로드 했을 때 이전 파일들은 지움
$f = File::Inst();
$files = array();
if ($_FILES[$f->Config('form_name', 'file')]['name']) {
    foreach ($f->mb_no($m['mb_no'])->Action('files') as $k => $v) {
        $files[] = $v['file_no'];
    }
}
// 삭제파일
$del_files = $_POST[File::Inst()->Config('form_name', 'del')];
if (!$del_files) {
    $del_files = array();
}
// 삭제해야할 파일들 삭제
foreach (array_merge($files, $del_files) as $v) {
    $f->Action('delete', $v);
}
// 파일 업로드
$f->Action('upload', 0);
// 회원정보 업데이트
$this->Sql('update', $m['mb_no'], $clear);
Dialog::alertNReplace("회원정보가 수정되었습니다.", $this->Link('list'));
exit;
Example #6
0
<?php if(!defined('__MAGIC__')) exit;

$key = GV::Number($this->KN());
$board = Board::Inst($this->bo_id);
$v = $this->Sql('fetch', $key);
$comments = Comment::Inst(
	)->wr_no($key
	)->bo_no($board->bo_no
	)->html(
);

// 파일 정보를 가져옴
$file = File::Inst()->wr_no($key)->Protection();
?>

<div id="write_view">
<div class="title">
  <div class="title_bg_left">
  <div class="title_bg_right">
  <h2>
    <?php if($v['wr_category']) {?>
    <span class="category"><?php echo array_pop(explode('|',$v['wr_category']))?> | </span>
    <?php }?>
    <?php echo $v['wr_subject']?>
    <span class="hit">조회: <?php echo $v['wr_hit']?></span>
  </h2>
  <p class="writer">
    <span class="datetime"><?php echo $v['wr_datetime']?></span>
    <?php echo $v['wr_writer']?>
  </p>
  </div>
Example #7
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 #8
0
<?php

if (!defined("__MAGIC__")) {
    exit;
}
/*
 * action파일
 * action.*.php 파일은 Alert을 호출하지 않고 단순한 하나의 행동을하고
 * 결과 값을 알려준다.
 * $result에 결과값을 저장해 줌
 * --------------------------
 * 회원 이미지 경로
 */
$pic_width = Config::Inst()->mb_pic_width;
$pic_height = Config::Inst()->mb_pic_height;
$list = File::Inst()->mb_no($this->mb_no)->Action('images', $pic_width, $pic_height);
if (is_array($list) && sizeof($list) != 0) {
    $result['is'] = true;
    $result['file_no'] = $list[0]['file_no'];
    $result['link'] = $list[0]['link'];
} else {
    $result['is'] = false;
    $result['link'] = $this->path_img('noimg.gif');
}
Example #9
0
<?php

if (!defined("__MAGIC__")) {
    exit;
}
/*
 * action파일
 * action.*.php 파일은 Alert을 호출하지 않고 단순한 하나의 행동을하고
 * 결과 값을 알려준다.
 * $result에 결과값을 저장해 줌
 * --------------------------
 * 회원 이미지 경로
 */
$list = File::Inst()->mb_no($this->mb_no)->Action('files');
if (is_array($list) && sizeof($list) != 0) {
    $result = File::Inst()->Link('thumb', $list[0]['file_no'], 50, 50);
} else {
    $result = $this->path_img('noimg.gif');
}
Example #10
0
<?php if(!defined("__MAGIC__")) exit; 

// 게시글 조회수 업데이트
$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;

/*
 * 파일의 Protection 함수를 호출함으로써 핫링크를 방지함
 * 세션에 임의의 값을 저장해두고 비교하는 루틴으로 핫링크를 검사한다.
 * 게시글을 볼때마다 갱신한다.
 */
File::Inst()->Protection();
Example #11
0
<?php if(!defined('__MAGIC__')) exit;

// 타이틀
$this->title = '글쓰기';
// 게시판 설정
$this->config = Board::Inst()->bo_no($this->bo_no);
// 현재위치 출력 모듈
$this->breadcrumb = PageElement::Inst('breadcrumb')->html();
// 에디터
$this->editor = Editor::Inst('wr_content', $this->config->bo_editor)->html();
// 파일관련 모듈 
$this->file = File::Inst();
// 업데이트 주소
$this->action = $this->Link('insert');
// 목록으로 가기 주소
$this->link_list = $this->Link('list');


Example #12
0
<?php if(!defined("__MAGIC__")) exit; 

// 키값
$this->key = GV::Number($this->KN());
$this->title = '글수정';
// 게시판 설정
$this->config = Board::Inst()->bo_no($this->bo_no);
// 파일관련 모듈 
$this->file = File::Inst()->wr_no($this->key)->Protection();
// 업데이트 주소
$this->action = $this->Link('update');
// 목록으로 가기 주소
$this->link_list = $this->Link('list');
// 게시글 데이터
$this->data = $this->Sql('fetch', $this->key);
// 에디터
$this->editor = Editor::Inst('wr_content', $this->config->bo_editor)->db_edit($this->data['wr_content'])->html();
// 태그
$tags = array();
foreach(Tag::Inst()->Sql('list', $this->bo_no, $this->key) as $v) {
  $tags[] = $v['tag_name'];
}
$this->tags = implode(',', $tags);

Example #13
0
"/>
        <?php 
if ($pic['is']) {
    ?>
        <p><input type="checkbox" id="fd" name="<?php 
    echo File::Inst()->Config('form_name', 'del');
    ?>
[]" value="<?php 
    echo $pic['file_no'];
    ?>
"/>&nbsp;<label for="fd">삭제 : 체크후 수정하면 회원사진을 삭제합니다.</label></p>
        <?php 
}
?>
        <p><input type="file" size="65" name="<?php 
echo File::Inst()->Config('form_name', 'file');
?>
[]"/></p>
        <br clear="both"/>
        <div class="desc"> - 사진의 적정 크기: 가로 <?php 
echo $pic_width;
?>
pixel/세로 <?php 
echo $pic_height;
?>
pixel</div>
      </td>
    </tr>
    <tr>
      <th class="require">자동등록 방지코드</th>
      <td><?php 
Example #14
0
    ?>
<a href="#" onClick="Slidebox('<?php 
    echo $k + 1;
    ?>
');return false" class="thumb"><?php 
    echo $k + 1;
    ?>
</a>
<?php 
}
?>
</div>
<div class="container">
<?php 
foreach ($list as $k => $v) {
    ?>
<div class="content" style="background-image:url('<?php 
    echo File::Inst()->Link('thumb', $v['file_no'], 149, 150);
    ?>
')">
<div><?php 
    echo $v['wr_subject'];
    ?>
</div>
</div>
<?php 
}
?>
</div>
</div>
Example #15
0
<?php if(!defined('__MAGIC__')) exit;

$key = GV::Number($this->KN());
$board = Board::Inst($this->bo_id);
$v = $this->Sql('fetch', $key);
$comments = Comment::Inst('mbasic'
	)->wr_no($key
	)->bo_no($board->bo_no
	)->html(
);

// 파일 정보를 가져옴
$file = File::Inst()->wr_no($key);
?>
<div data-role="navbar" data-iconpos="top">
<ul><?php include($this->path_view('buttons.php'))?></ul>
</div>

<h2><?php echo $v['wr_subject']?></h2>
<p class="right"><?php echo $v['wr_writer']?> <?php echo $v['wr_datetime']?></p>

<?php if(sizeof($file->Action('images', $this->Config('img_width')))!=0) {?>
<div style="margin-bottom:20px"><?php foreach ($file->Action('images', $this->Config('img_width')) as $vv) {?>
<div style="margin-bottom:5px">
<img src="<?php echo $vv['link']?>" width="<?php echo $vv['width']?>" height="<?php echo $vv['height']?>"/>
</div>
<?php }?></div>
<?php }?>

<div style="line-height:1.6;min-height:200px"><?php echo $v['wr_content']?></div>
Example #16
0
div.list_top ul li a span.cnt {font-family:Tahoma;font-weight:normal;font-size:.8em;color:#EE5A00}
</style>

<div class="list_top" style="margin-left:55px;margin-bottom:10px">
  <h3><a href="#list_style_2">목록 보기</a></h3>
  <ul class="list_style_2" style="display:none">
<?php foreach ($list as $v) {// 심플리스트
	$category = explode('|',$v['wr_category']);
?>
    <li><a href="<?php echo $v['wr_subject']['href']?>"><?php echo implode('&gt;',$category)?> : <?php echo $v['wr_subject']['text']?>&nbsp;<span class="cnt">(<?php echo $v['cmt_count']?>)</span></a></li>
<?php }?>
  </ul>
</div>

<?php foreach ($list as $v) {
	$imgs = File::Inst()->wr_no($v['wr_no'])->Action('images', 120, 120); // 썸네일 불러오기
	$category = explode('|',$v['wr_category']);
	$link_category = Url::Get(array('ca1'=>$category[0], 'ca2'=>$category[1]));
?>
<span class="blog_date"><?php echo date("n", strtotime($v['wr_datetime']))?>월<br /><?php echo date("j", strtotime($v['wr_datetime']))?>일</span>

<!--Start Blog Div-->
<div class="blog_div">

	<div class="blog_heading">
	<h3><a href="<?php echo $v['wr_subject']['href']?>"><?php echo $v['wr_subject']['text']?></a></h3>
	<p>Posted in <a href="<?php echo $link_category?>" class="category_name"><?php echo implode('-',$category)?></a> by <b><?php echo $v['wr_writer']?></b></p>
	</div><!--End Blog Heading-->

	<p class="blog_comments"><?php echo $v['cmt_count']?></p>
	<br clear="all" />
Example #17
0
$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);


Example #18
0
<?php

/*
 * 파일 다운로드를 위한 파일
 * 파일 다운로드만을 위해서 쓰인다.
 * download.php?file_no=
 * 위와 같은 주소에 파일번호만 연결시켜 주면 해당 파일을 다운받는다.
 * 핫링크 방지를 위해 File::Inst()->Protection()이 호출된 페이지에서 누른 링크였을 경우에만 다운로드 가능하다. 
 */
include_once '_path.php';
File::Inst()->init();
Example #19
0

/* 게시글목록 */
$list = array();
foreach ($this->Sql('list') as $v) {

  $_list = array();

  if($this->Config('mb','admin')) {
    $_list['check'] = '<input type="checkbox" name="chk[]" value="'.$v['wr_no'].'"/>';
  }

  $_list['datetime'] = Util::GetDate($v['wr_datetime']);
  if($v['wr_category']) $_list['category'] = '['.array_pop(explode('|',$v['wr_category'])).']';
  $_list['subject'] = $v['wr_subject'];
  $f = File::Inst()->wr_no($v['wr_no'])->Action('images', 156, 94);
  $_list['thumb'] = $f[0]['link'];//$this->path_img('no_image.gif');

  $list[] = $_list;
}

$cols = $this->Config('cols');
$rows = $this->Config('rows');

// 남은 목록에 빈 데이터를 체움
for($i=sizeof($list)+1; $i<=$rows*$cols; $i++) {
  $_list = array(
    'thumb'=>$this->path_img('no_image.gif'),
    'subject'=>array(
      'text'=>'이미지를 등록해 주세요.'
    )
Example #20
0
<?php 
}
?>
</ul>

<div id="board_list">
<?php 
foreach ($list as $k => $board) {
    ?>
  <ul class="list" <?php 
    echo $k == 0 ? '' : 'style="display:none"';
    ?>
>
  <?php 
    foreach ($board as $k => $v) {
        $imgs = File::Inst()->wr_no($v['wr_no'])->Action('images', 94, 71);
        // 썸네일 불러오기
        ?>
    <?php 
        if ($k == 0) {
            ?>
    <li class="first">
      <?php 
            if ($imgs[0]) {
                ?>
      <img src="<?php 
                echo $imgs[0]['link'];
                ?>
" width="94" height="71"/>
      <?php 
            }