Exemplo n.º 1
0
                                    <?php 
foreach ($orders as $order) {
    ?>
                                    <tr>
                                        <td><a href="<?php 
    echo base_url();
    ?>
shop/order/<?php 
    echo $order->order_id;
    ?>
"><?php 
    echo $order->order_id;
    ?>
</a></td>
                                        <td class="td-width"><?php 
    echo display_datetime($order->order_datetime);
    ?>
</td>
                                        <td><?php 
    echo display_money($order->order_price);
    ?>
 บาท</td>
                                        <td><?php 
    echo display_money($order->order_oprice - $order->order_price);
    ?>
 บาท</td>
                                        <?php 
    if ($order->order_status_id == 1) {
        ?>
                                        <td>
                                             <a class="btn-u btn-u2 btn-u-red btn-block btn-u-xs">
Exemplo n.º 2
0
 /**
  * 댓글 목록을 ajax 로 가져옵니다
  */
 public function lists($post_id = 0)
 {
     // 이벤트 라이브러리를 로딩합니다
     $eventname = 'event_comment_list_lists';
     $this->load->event($eventname);
     $post_id = (int) $post_id;
     if (empty($post_id) or $post_id < 1) {
         show_404();
     }
     $view = array();
     $view['view'] = array();
     // 이벤트가 존재하면 실행합니다
     $view['view']['event']['before'] = Events::trigger('before', $eventname);
     $post = $this->Post_model->get_one($post_id);
     if (!element('post_id', $post)) {
         show_404();
     }
     $board = $this->board->item_all(element('brd_id', $post));
     $mem_id = (int) $this->member->item('mem_id');
     $alertmessage = $this->member->is_member() ? '회원님은 이 댓글 목록을 볼 수 있는 권한이 없습니다' : '비회원은 이 댓글 접근할 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오';
     $check = array('group_id' => element('bgr_id', $board), 'board_id' => element('brd_id', $board));
     $this->accesslevel->check(element('access_view', $board), element('access_view_level', $board), element('access_view_group', $board), $alertmessage, $check);
     $is_admin = $this->member->is_admin(array('board_id' => element('brd_id', $board), 'group_id' => element('bgr_id', $board)));
     $check = array('group_id' => element('bgr_id', $board), 'board_id' => element('brd_id', $board));
     $can_comment_write = $this->accesslevel->is_accessable(element('access_comment', $board), element('access_comment_level', $board), element('access_comment_group', $board), $check);
     /**
      * 페이지에 숫자가 아닌 문자가 입력되거나 1보다 작은 숫자가 입력되면 에러 페이지를 보여줍니다.
      */
     $param =& $this->querystring;
     $findex = strtolower(element('comment_order', $board)) === 'desc' ? 'cmt_num, cmt_reply' : 'cmt_num desc, cmt_reply';
     if ($this->cbconfig->get_device_view_type() === 'mobile') {
         $per_page = element('mobile_comment_count', $board) ? (int) element('mobile_comment_count', $board) : 0;
     } else {
         $per_page = element('comment_count', $board) ? (int) element('comment_count', $board) : 0;
     }
     $page = (int) $this->input->get('page');
     if (empty($page)) {
         if (strtolower(element('comment_order', $board)) === 'desc') {
             $page = 1;
         } else {
             $page = $per_page ? ceil(element('post_comment_count', $post) / $per_page) : 1;
             if ($page === 0) {
                 $page = 1;
             }
         }
     }
     if ($page < 1) {
         show_404();
     }
     $offset = ($page - 1) * $per_page;
     $this->Comment_model->allow_search_field = array('cmt_id', 'post_id', 'cmt_content', 'cmt_userid', 'cmt_nickname');
     // 검색이 가능한 필드
     $this->Comment_model->search_field_equal = array('cmt_id', 'cmt_userid', 'cmt_nickname');
     // 검색중 like 가 아닌 = 검색을 하는 필드
     $image_width = $this->cbconfig->get_device_view_type() === 'mobile' ? element('post_mobile_image_width', $board) : element('post_image_width', $board);
     $use_sideview = $this->cbconfig->get_device_view_type() === 'mobile' ? element('use_mobile_sideview', $board) : element('use_sideview', $board);
     $comment_date_style = $this->cbconfig->get_device_view_type() === 'mobile' ? element('mobile_comment_date_style', $board) : element('comment_date_style', $board);
     $comment_date_style_manual = $this->cbconfig->get_device_view_type() === 'mobile' ? element('mobile_comment_date_style_manual', $board) : element('comment_date_style_manual', $board);
     // 이벤트가 존재하면 실행합니다
     $view['view']['event']['step1'] = Events::trigger('step1', $eventname);
     /**
      * 게시판 목록에 필요한 정보를 가져옵니다.
      */
     $where = array('post_id' => $post_id, 'cmt_del <>' => 2);
     $result = $this->Comment_model->get_comment_list($per_page, $offset, $where, '', $findex, $sfield = '', $skeyword = '');
     $list_num = $result['total_rows'] - ($page - 1) * $per_page;
     if (element('list', $result)) {
         foreach (element('list', $result) as $key => $val) {
             $result['list'][$key]['meta'] = $meta = $this->Comment_meta_model->get_all_meta(element('cmt_id', $val));
             $result['list'][$key]['content'] = '';
             $is_blind = element('comment_blame_blind_count', $board) > 0 && element('cmt_blame', $val) >= element('comment_blame_blind_count', $board) ? true : false;
             if ($is_blind === true) {
                 $result['list'][$key]['content'] .= '<div class="alert alert-danger">신고가 접수된 게시글입니다. 본인과 관리자만 확인이 가능합니다</div>';
             }
             if (element('cmt_secret', $val)) {
                 $result['list'][$key]['content'] .= '<span class="label label-warning">비밀글입니다</span>';
             }
             if ($is_blind === false && !element('cmt_secret', $val) or $is_admin !== false or element('mem_id', $val) && (int) element('mem_id', $val) === $mem_id or element('mem_id', $post) && (int) element('mem_id', $post) === $mem_id) {
                 $result['list'][$key]['content'] .= display_html_content(element('cmt_content', $val), element('cmt_html', $val), $image_width, $autolink = true, $popup = true);
                 if (element('comment_syntax_highlighter', $board)) {
                     $result['list'][$key]['content'] = preg_replace_callback("/(\\[code\\]|\\[code=(.*)\\])(.*)\\[\\/code\\]/iUs", "content_syntaxhighlighter", $result['list'][$key]['content']);
                     // SyntaxHighlighter
                 }
             }
             if (element('cmt_del', $val)) {
                 $result['list'][$key]['content'] = '<div class="alert alert-danger">이 게시물은 ' . html_escape(element('delete_mem_nickname', $meta)) . '님에 의해 ' . html_escape(element('delete_datetime', $meta)) . ' 에 삭제 되었습니다</div>';
             }
             $result['list'][$key]['display_name'] = display_username(element('cmt_userid', $val), element('cmt_nickname', $val), element('mem_icon', $val), $use_sideview ? 'Y' : 'N');
             $result['list'][$key]['display_datetime'] = display_datetime(element('cmt_datetime', $val), $comment_date_style, $comment_date_style_manual);
             $result['list'][$key]['is_mobile'] = element('cmt_device', $val) === 'mobile' ? true : false;
             $result['list'][$key]['display_ip'] = '';
             if ($this->member->is_admin() === 'super' or element('show_comment_ip', $board) === '2') {
                 $result['list'][$key]['display_ip'] = display_ipaddress(element('cmt_ip', $val), '1111');
             } elseif (element('show_comment_ip', $board) === '1') {
                 $result['list'][$key]['display_ip'] = display_ipaddress(element('cmt_ip', $val), $this->cbconfig->item('ip_display_style'));
             }
             $result['list'][$key]['member_photo_url'] = member_photo_url(element('mem_photo', $val), 64, 64) ? member_photo_url(element('mem_photo', $val), 64, 64) : site_url('assets/images/member_default.gif');
             $result['list'][$key]['cmt_depth'] = strlen($result['list'][$key]['cmt_reply']) * 30;
             $result['list'][$key]['can_update'] = false;
             $result['list'][$key]['can_delete'] = false;
             $result['list'][$key]['can_reply'] = false;
             if (!element('post_del', $post) && !element('cmt_del', $val)) {
                 if (!element('mem_id', $val)) {
                     $result['list'][$key]['can_delete'] = true;
                 }
                 if ($is_admin !== false or element('mem_id', $val) && $mem_id === (int) element('mem_id', $val)) {
                     $result['list'][$key]['can_update'] = true;
                     $result['list'][$key]['can_delete'] = true;
                 }
                 if ($key > 0 && $is_admin === false) {
                     if (element('cmt_reply', $val)) {
                         $prev_reply = substr(element('cmt_reply', $val), 0, strlen(element('cmt_reply', $val)) - 1);
                         if ($prev_reply === $result['list'][$key - 1]['cmt_reply']) {
                             $result['list'][$key - 1]['can_update'] = false;
                             $result['list'][$key - 1]['can_delete'] = false;
                         }
                     }
                 }
                 if (strlen(element('cmt_reply', $val)) < 5 && $can_comment_write === true) {
                     $result['list'][$key]['can_reply'] = true;
                 }
             }
         }
     }
     $view['view']['data'] = $result;
     $view['view']['board'] = $board;
     $view['view']['post'] = $post;
     $view['view']['is_admin'] = $is_admin;
     /**
      * primary key 정보를 저장합니다
      */
     $view['view']['primary_key'] = $this->Post_model->primary_key;
     /**
      * 페이지네이션을 생성합니다
      */
     $config['base_url'] = site_url('comment_list/lists/' . $post_id) . '?' . $param->replace('page');
     $config['total_rows'] = $result['total_rows'];
     $config['per_page'] = $per_page;
     if (!$this->input->get('page')) {
         $_GET['page'] = (string) $page;
     }
     $config['_attributes'] = 'onClick="comment_page(\'' . $post_id . '\', $(this).attr(\'data-ci-pagination-page\'));return false;"';
     if ($this->cbconfig->get_device_view_type() === 'mobile') {
         $config['num_links'] = element('mobile_comment_page_count', $board) ? element('mobile_comment_page_count', $board) : 3;
     } else {
         $config['num_links'] = element('comment_page_count', $board) ? element('comment_page_count', $board) : 5;
     }
     $this->pagination->initialize($config);
     $view['view']['paging'] = $this->pagination->create_links();
     $view['view']['page'] = $page;
     // 이벤트가 존재하면 실행합니다
     $view['view']['event']['before_layout'] = Events::trigger('before_layout', $eventname);
     /**
      * 레이아웃을 정의합니다
      */
     $skindir = $this->cbconfig->get_device_view_type() === 'mobile' ? element('board_mobile_skin', $board) : element('board_skin', $board);
     if (empty($skindir)) {
         $skindir = $this->cbconfig->get_device_view_type() === 'mobile' ? $this->cbconfig->item('mobile_skin_board') : $this->cbconfig->item('skin_board');
     }
     if (empty($skindir)) {
         $skindir = $this->cbconfig->get_device_view_type() === 'mobile' ? $this->cbconfig->item('mobile_skin_default') : $this->cbconfig->item('skin_default');
     }
     if (empty($skindir)) {
         $skindir = 'basic';
     }
     $skin = 'board/' . $skindir . '/comment_list';
     $this->data = $view;
     $this->view = $skin;
 }
Exemplo n.º 3
0
 /**
  * 검색 페이지 함수입니다
  */
 public function index()
 {
     // 이벤트 라이브러리를 로딩합니다
     $eventname = 'event_search_index';
     $this->load->event($eventname);
     $view = array();
     $view['view'] = array();
     // 이벤트가 존재하면 실행합니다
     $view['view']['event']['before'] = Events::trigger('before', $eventname);
     /**
      * 페이지에 숫자가 아닌 문자가 입력되거나 1보다 작은 숫자가 입력되면 에러 페이지를 보여줍니다.
      */
     $param =& $this->querystring;
     $page = (int) $this->input->get('page') > 0 ? (int) $this->input->get('page') : 1;
     $findex = 'post_num, post_reply';
     $sfield = $sfield2 = $this->input->get('sfield', null, '');
     $sop = $this->input->get('sop', null, '');
     if ($sfield === 'post_both') {
         $sfield = array('post_title', 'post_content');
     }
     $mem_id = (int) $this->member->item('mem_id');
     $skeyword = $this->input->get('skeyword', null, '');
     if (empty($skeyword)) {
         // 이벤트가 존재하면 실행합니다
         $view['view']['event']['before_nokeyword_layout'] = Events::trigger('before_nokeyword_layout', $eventname);
         /**
          * 레이아웃을 정의합니다
          */
         $page_title = $this->cbconfig->item('site_meta_title_search');
         $meta_description = $this->cbconfig->item('site_meta_description_search');
         $meta_keywords = $this->cbconfig->item('site_meta_keywords_search');
         $meta_author = $this->cbconfig->item('site_meta_author_search');
         $page_name = $this->cbconfig->item('site_page_name_search');
         $layoutconfig = array('path' => 'search', 'layout' => 'layout', 'skin' => 'search', 'layout_dir' => $this->cbconfig->item('layout_search'), 'mobile_layout_dir' => $this->cbconfig->item('mobile_layout_search'), 'use_sidebar' => $this->cbconfig->item('sidebar_search'), 'use_mobile_sidebar' => $this->cbconfig->item('mobile_sidebar_search'), 'skin_dir' => $this->cbconfig->item('skin_search'), 'mobile_skin_dir' => $this->cbconfig->item('mobile_skin_search'), 'page_title' => $page_title, 'meta_description' => $meta_description, 'meta_keywords' => $meta_keywords, 'meta_author' => $meta_author, 'page_name' => $page_name);
         $view['layout'] = $this->managelayout->front($layoutconfig, $this->cbconfig->get_device_view_type());
         $this->data = $view;
         $this->layout = element('layout_skin_file', element('layout', $view));
         $this->view = element('view_skin_file', element('layout', $view));
         return false;
     }
     /**
      * 게시판 목록에 필요한 정보를 가져옵니다.
      */
     $this->Post_model->allow_search_field = array('post_title', 'post_content', 'post_userid', 'post_nickname');
     // 검색이 가능한 필드
     $this->Post_model->search_field_equal = array('post_userid');
     // 검색중 like 가 아닌 = 검색을 하는 필드
     $per_page = 15;
     $offset = ($page - 1) * $per_page;
     $group_id = (int) $this->input->get('group_id') ? (int) $this->input->get('group_id') : '';
     $board_id = (int) $this->input->get('board_id') ? (int) $this->input->get('board_id') : '';
     $where = array();
     $boardwhere = array('brd_search' => 1);
     if ($group_id) {
         $where['board.bgr_id'] = $group_id;
         $boardwhere['board.bgr_id'] = $group_id;
     }
     $boardlisttmp = $this->Board_model->get_board_list($boardwhere);
     $boardlist = array();
     if (is_array($boardlisttmp)) {
         foreach ($boardlisttmp as $key => $value) {
             $boardlist[$value['brd_id']] = $value;
         }
     }
     $grouplisttmp = $this->Board_group_model->get('', '', '', '', 0, 'bgr_order', 'ASC');
     if (is_array($grouplisttmp)) {
         foreach ($grouplisttmp as $key => $value) {
             $grouplist[$value['bgr_id']] = $value;
         }
     }
     $where['post.post_secret'] = 0;
     $where['post.post_del'] = 0;
     $like = '';
     $result = $this->Post_model->get_search_list($per_page, $offset, $where, $like, $board_id, $findex, $sfield, $skeyword, $sop);
     $list_num = $result['total_rows'] - ($page - 1) * $per_page;
     if (element('list', $result)) {
         foreach (element('list', $result) as $key => $val) {
             $images = '';
             if (element('post_image', $val)) {
                 $imagewhere = array('post_id' => element('post_id', $val), 'pfi_is_image' => 1);
                 $images = $this->Post_file_model->get_one('', '', $imagewhere, '', '', 'pfi_id', 'ASC');
             }
             $result['list'][$key]['images'] = $images;
             $result['list'][$key]['post_url'] = post_url(element('brd_key', $val), element('post_id', $val));
             $result['list'][$key]['display_name'] = display_username(element('post_userid', $val), element('post_nickname', $val), element('mem_icon', $val), 'Y');
             $result['list'][$key]['display_datetime'] = display_datetime(element('post_datetime', $val), 'user', 'Y-m-d H:i');
             $result['list'][$key]['content'] = cut_str(strip_tags(element('post_content', $val)), 200);
             $result['list'][$key]['is_mobile'] = element('post_device', $val) === 'mobile' ? true : false;
         }
     }
     $view['view']['data'] = $result;
     $view['view']['boardlist'] = $boardlist;
     $view['view']['grouplist'] = $grouplist;
     if (!$this->session->userdata('skeyword_' . urlencode($skeyword))) {
         $sfieldarray = array('post_title', 'post_content', 'post_both');
         if (in_array($sfield2, $sfieldarray)) {
             $searchinsert = array('sek_keyword' => $skeyword, 'sek_datetime' => cdate('Y-m-d H:i:s'), 'sek_ip' => $this->input->ip_address(), 'mem_id' => $mem_id);
             $this->Search_keyword_model->insert($searchinsert);
             $this->session->set_userdata('skeyword_' . urlencode($skeyword), 1);
         }
     }
     $highlight_keyword = '';
     if ($skeyword) {
         $key_explode = explode(' ', $skeyword);
         if ($key_explode) {
             foreach ($key_explode as $seval) {
                 if ($highlight_keyword) {
                     $highlight_keyword .= ',';
                 }
                 $highlight_keyword .= '\'' . html_escape($seval) . '\'';
             }
         }
     }
     $view['view']['highlight_keyword'] = $highlight_keyword;
     /**
      * primary key 정보를 저장합니다
      */
     $view['view']['primary_key'] = $this->Post_model->primary_key;
     /**
      * 페이지네이션을 생성합니다
      */
     $config['base_url'] = site_url('search/') . '?' . $param->replace('page');
     $view['view']['tab_url'] = site_url('search/') . '?' . $param->replace('page, board_id');
     $config['total_rows'] = $result['total_rows'];
     $config['per_page'] = $per_page;
     if ($this->cbconfig->get_device_view_type() === 'mobile') {
         $config['num_links'] = 3;
     } else {
         $config['num_links'] = 5;
     }
     $this->pagination->initialize($config);
     $view['view']['paging'] = $this->pagination->create_links();
     $view['view']['page'] = $page;
     // 이벤트가 존재하면 실행합니다
     $view['view']['event']['before_layout'] = Events::trigger('before_layout', $eventname);
     /**
      * 레이아웃을 정의합니다
      */
     $page_title = $this->cbconfig->item('site_meta_title_search');
     $meta_description = $this->cbconfig->item('site_meta_description_search');
     $meta_keywords = $this->cbconfig->item('site_meta_keywords_search');
     $meta_author = $this->cbconfig->item('site_meta_author_search');
     $page_name = $this->cbconfig->item('site_page_name_search');
     $searchconfig = array('{검색어}');
     $replaceconfig = array($skeyword);
     $page_title = str_replace($searchconfig, $replaceconfig, $page_title);
     $meta_description = str_replace($searchconfig, $replaceconfig, $meta_description);
     $meta_keywords = str_replace($searchconfig, $replaceconfig, $meta_keywords);
     $meta_author = str_replace($searchconfig, $replaceconfig, $meta_author);
     $page_name = str_replace($searchconfig, $replaceconfig, $page_name);
     $layoutconfig = array('path' => 'search', 'layout' => 'layout', 'skin' => 'search', 'layout_dir' => $this->cbconfig->item('layout_search'), 'mobile_layout_dir' => $this->cbconfig->item('mobile_layout_search'), 'use_sidebar' => $this->cbconfig->item('sidebar_search'), 'use_mobile_sidebar' => $this->cbconfig->item('mobile_sidebar_search'), 'skin_dir' => $this->cbconfig->item('skin_search'), 'mobile_skin_dir' => $this->cbconfig->item('mobile_skin_search'), 'page_title' => $page_title, 'meta_description' => $meta_description, 'meta_keywords' => $meta_keywords, 'meta_author' => $meta_author, 'page_name' => $page_name);
     $view['layout'] = $this->managelayout->front($layoutconfig, $this->cbconfig->get_device_view_type());
     $this->data = $view;
     $this->layout = element('layout_skin_file', element('layout', $view));
     $this->view = element('view_skin_file', element('layout', $view));
 }
Exemplo n.º 4
0
                <?php 
    if (element('file_download_count', $view) > 0) {
        foreach (element('file_download', $view) as $key => $value) {
            ?>
                    <tr>
                        <td><i class="fa fa-download"></i> <a href="javascript:file_download('<?php 
            echo element('download_link', $value);
            ?>
')"><?php 
            echo html_escape(element('pfi_originname', $value));
            ?>
(<?php 
            echo byte_format(element('pfi_filesize', $value));
            ?>
)</a> <span class="time"><i class="fa fa-clock-o"></i> <?php 
            echo display_datetime(element('pfi_datetime', $value), 'full');
            ?>
</span><span class="badge"><?php 
            echo number_format(element('pfi_download', $value));
            ?>
</span></td>
                    </tr>
                <?php 
        }
    }
    if (element('link_count', $view) > 0) {
        foreach (element('link', $view) as $key => $value) {
            ?>
                    <tr>
                        <td><i class="fa fa-link"></i> <a href="<?php 
            echo element('link_link', $value);
Exemplo n.º 5
0
            <tbody>
            <?php 
if (element('list', element('latest_comment', $view))) {
    foreach (element('list', element('latest_comment', $view)) as $key => $value) {
        ?>
                <tr>
                    <td><a href="<?php 
        echo element('post_url', $value);
        ?>
"><?php 
        echo cut_str(html_escape(strip_tags(element('cmt_content', $value))), 50);
        ?>
</a></td>
                    <td><?php 
        echo element('display_name', $value);
        ?>
</td>
                    <td class="text-right"><?php 
        echo display_datetime(element('cmt_datetime', $value));
        ?>
</td>
                </tr>
            <?php 
    }
}
?>
            </tbody>
        </table>
    </div>
</div>
Exemplo n.º 6
0
        ?>
 <?php 
        if (element('mem_userid', $result)) {
            ?>
 ( <a href="?sfield=document.mem_id&amp;skeyword=<?php 
            echo element('mem_id', $result);
            ?>
"><?php 
            echo html_escape(element('mem_userid', $result));
            ?>
</a> ) <?php 
        }
        ?>
</td>
                            <td><?php 
        echo display_datetime(element('doc_updated_datetime', $result), 'full');
        ?>
</td>
                            <td class="text-right"><?php 
        echo number_format(element('doc_hit', $result));
        ?>
</td>
                            <td><a href="<?php 
        echo admin_url($this->pagedir);
        ?>
/write/<?php 
        echo element(element('primary_key', $view), $result);
        ?>
?<?php 
        echo $this->input->server('QUERY_STRING', null, '');
        ?>
Exemplo n.º 7
0
 /**
  * 최근 댓글을 가져옵니다
  */
 public function latest_comment($config)
 {
     $view = array();
     $view['view'] = array();
     $this->CI->load->model(array('Comment_model'));
     $skin = element('skin', $config);
     $brd_id = element('brd_id', $config);
     $brd_key = element('brd_key', $config);
     $exclude_brd_id = element('exclude_brd_id', $config);
     $exclude_brd_key = element('exclude_brd_key', $config);
     $findex = element('findex', $config) ? element('findex', $config) : 'cmt_id';
     $forder = element('forder', $config) ? element('forder', $config) : 'DESC';
     $limit = element('limit', $config);
     $length = element('length', $config);
     $period_second = element('period_second', $config);
     $cache_minute = element('cache_minute', $config);
     if ($limit <= 0) {
         return false;
     }
     if ($cache_minute > 0) {
         $cache_brd_id = is_array($brd_id) ? implode('-', $brd_id) : $brd_id;
         $cache_brd_key = is_array($brd_key) ? implode('-', $brd_key) : $brd_key;
         $cache_exclude_brd_id = is_array($exclude_brd_id) ? implode('-', $exclude_brd_id) : $exclude_brd_id;
         $cache_exclude_brd_key = is_array($exclude_brd_key) ? implode('-', $exclude_brd_key) : $exclude_brd_key;
         $cachename = 'latest-comment-s-' . $skin . '-i-' . $cache_brd_id . '-k-' . $cache_brd_key . '-l-' . $cache_exclude_brd_id . '-k-' . $cache_exclude_brd_key . '-l-' . $limit . '-t-' . $length . '-p-' . $period_second;
         $html = $this->CI->cache->get($cachename);
         if ($html) {
             return $html;
         }
     }
     if (empty($skin)) {
         $skin = 'basic';
     }
     $view['view']['config'] = $config;
     $view['view']['length'] = $length;
     if ($brd_key) {
         if (is_array($brd_key)) {
             foreach ($brd_key as $v) {
                 $brd_id[] = $this->CI->board->item_key('brd_id', $v);
             }
         } else {
             $brd_id = $this->CI->board->item_key('brd_id', $brd_key);
         }
     }
     if ($exclude_brd_key) {
         if (is_array($exclude_brd_key)) {
             foreach ($exclude_brd_key as $v) {
                 $exclude_brd_id[] = $this->CI->board->item_key('brd_id', $v);
             }
         } else {
             $exclude_brd_id = $this->CI->board->item_key('brd_id', $exclude_brd_key);
         }
     }
     if ($brd_id && !is_array($brd_id)) {
         $view['view']['board'] = $this->CI->board->item_all($brd_id);
     }
     $where = array();
     $where['cmt_del'] = 0;
     $where['cmt_secret'] = 0;
     $where['post_secret'] = 0;
     $where['post_del'] = 0;
     $this->CI->db->from('comment');
     $this->CI->db->join('post', 'post.post_id=comment.post_id', 'inner');
     $this->CI->db->where($where);
     if ($brd_id) {
         if (is_array($brd_id)) {
             $this->CI->db->group_start();
             foreach ($brd_id as $v) {
                 $this->CI->db->or_where('comment.brd_id', $v);
             }
             $this->CI->db->group_end();
         } else {
             $this->CI->db->where('comment.brd_id', $brd_id);
         }
     }
     if ($exclude_brd_id) {
         if (is_array($exclude_brd_id)) {
             foreach ($exclude_brd_id as $v) {
                 $this->CI->db->where('comment.brd_id <>', $v);
             }
         } else {
             $this->CI->db->where('comment.brd_id <>', $exclude_brd_id);
         }
     }
     if ($period_second) {
         $comment_start_datetime = cdate('Y-m-d H:i:s', ctimestamp() - $period_second);
         $this->CI->db->where('cmt_datetime >=', $comment_start_datetime);
     }
     if ($findex && $forder) {
         $forder = strtoupper($forder) === 'ASC' ? 'ASC' : 'DESC';
         $this->CI->db->order_by($findex, $forder);
     }
     if (is_numeric($limit)) {
         $this->CI->db->limit($limit);
     }
     $result = $this->CI->db->get();
     $view['view']['latest'] = $latest = $result->result_array();
     $view['view']['latest_limit'] = $limit;
     if ($latest && is_array($latest)) {
         foreach ($latest as $key => $value) {
             $view['view']['latest'][$key]['name'] = display_username(element('cmt_userid', $value), element('cmt_nickname', $value));
             $brd_key = $this->CI->board->item_id('brd_key', element('brd_id', $value));
             $view['view']['latest'][$key]['url'] = post_url($brd_key, element('post_id', $value)) . '#comment_' . element('cmt_id', $value);
             $view['view']['latest'][$key]['title'] = $length ? cut_str(element('cmt_content', $value), $length) : element('cmt_content', $value);
             $view['view']['latest'][$key]['display_datetime'] = display_datetime(element('cmt_datetime', $value), '');
         }
     }
     $view['view']['skinurl'] = base_url(VIEW_DIR . 'latest/' . $skin);
     $html = $this->CI->load->view('latest/' . $skin . '/latest', $view, true);
     if ($cache_minute > 0) {
         $this->CI->cache->save($cachename, $html, $cache_minute);
     }
     return $html;
 }
Exemplo n.º 8
0
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">가입일</label>
            <div class="col-sm-9">
                <p class="form-control-static"><?php 
echo display_datetime($this->member->item('mem_register_datetime'), 'full');
?>
</p>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">최근 로그인</label>
            <div class="col-sm-9">
                <p class="form-control-static"><?php 
echo display_datetime($this->member->item('mem_lastlogin_datetime'), 'full');
?>
</p>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-9 col-sm-offset-3 mt20">
                <a href="<?php 
echo site_url('membermodify');
?>
" class="btn btn-default btn-sm" title="회원정보 변경">회원정보 변경</a>
            </div>
        </div>
    </div>
</div>
Exemplo n.º 9
0
</th>
                    <td><?php 
        echo nl2br(html_escape(element('value', $value)));
        ?>
 </td>
                </tr>
            <?php 
    }
}
?>
            <tr>
                <th>회원가입일</th>
                <td><?php 
echo display_datetime(element('mem_register_datetime', element('member', $view)), 'full');
?>
</td>
            </tr>
            <tr>
                <th>최종접속일</th>
                <td><?php 
echo display_datetime(element('mem_lastlogin_datetime', element('member', $view)), 'full');
?>
</td>
            </tr>
        </tbody>
    </table>
</div>
<div class="modal-footer">
    <button type="submit" class="btn btn-black btn-sm" onClick="window.close();">닫기</button>
</div>
Exemplo n.º 10
0
        echo html_escape(element('post_title', $result));
        ?>
</td>
                            <td><a href="<?php 
        echo admin_url($this->pagedir . '/view/' . element('cmt_id', $result));
        ?>
"><?php 
        echo element('content', $result);
        ?>
</a></td>
                            <td><?php 
        echo element('display_name', $result);
        ?>
</td>
                            <td><?php 
        echo display_datetime(element('trash_datetime', element('meta', $result)), 'full');
        ?>
</td>
                            <td><a href="?sfield=trash_ip&amp;skeyword=<?php 
        echo display_admin_ip(element('trash_ip', element('meta', $result)));
        ?>
"><?php 
        echo display_admin_ip(element('trash_ip', element('meta', $result)));
        ?>
</a></td>
                            <td><input type="checkbox" name="chk[]" class="list-chkbox" value="<?php 
        echo element(element('primary_key', $view), $result);
        ?>
" /></td>
                        </tr>
                    <?php 
Exemplo n.º 11
0
        ?>
</a></td>
                            <td><?php 
        echo element('display_name', $result);
        ?>
</td>
                            <td><?php 
        echo html_escape(element('mni_nickname', $result));
        ?>
</td>
                            <td><?php 
        echo display_datetime(element('mni_start_datetime', $result), 'full');
        ?>
</td>
                            <td><?php 
        echo element('mni_end_datetime', $result) > '0000-00-00 00:00:00' ? display_datetime(element('mni_end_datetime', $result), 'full') : '현재 사용중';
        ?>
</td>
                        </tr>
                    <?php 
    }
}
if (!element('list', element('data', $view))) {
    ?>
                        <tr>
                            <td colspan="6" class="nopost">자료가 없습니다</td>
                        </tr>
                    <?php 
}
?>
                    </tbody>
Exemplo n.º 12
0
        ?>
</td>
                            <td><?php 
        echo html_escape(element('mem_email', $result));
        ?>
</td>
                            <td class="text-right"><?php 
        echo number_format(element('mem_point', $result));
        ?>
</td>
                            <td><?php 
        echo display_datetime(element('mem_register_datetime', $result), 'full');
        ?>
</td>
                            <td><?php 
        echo display_datetime(element('mem_lastlogin_datetime', $result), 'full');
        ?>
</td>
                            <td class="text-right"><?php 
        echo element('mem_level', $result);
        ?>
</td>
                            <td>
                                <?php 
        echo element('mem_email_cert', $result) ? '<i class="fa fa-check-square-o"></i>' : '<i class="fa fa-square-o"></i>';
        ?>
                                <?php 
        echo element('mem_open_profile', $result) ? '<i class="fa fa-check-square-o"></i>' : '<i class="fa fa-square-o"></i>';
        ?>
                                <?php 
        echo element('mem_receive_email', $result) ? '<i class="fa fa-check-square-o"></i>' : '<i class="fa fa-square-o"></i>';
Exemplo n.º 13
0
 /**
  * 알림 AJAX 리스트 입니다
  */
 public function ajax_list()
 {
     // 이벤트 라이브러리를 로딩합니다
     $eventname = 'event_notification_ajax_list';
     $this->load->event($eventname);
     /**
      * 로그인이 필요한 페이지입니다
      */
     required_user_login();
     // 이벤트가 존재하면 실행합니다
     Events::trigger('before', $eventname);
     /**
      * 페이지에 숫자가 아닌 문자가 입력되거나 1보다 작은 숫자가 입력되면 에러 페이지를 보여줍니다.
      */
     $param =& $this->querystring;
     /**
      * 게시판 목록에 필요한 정보를 가져옵니다.
      */
     $result = $this->Notification_model->get_notification_list(5, 0, $this->member->item('mem_id'), 'N');
     $html = '<div class="notifications-list"><strong id="notification_count">' . $result['total_rows'] . '</strong>개의 읽지 않은 알림이 있습니다.<span><a href="javascript:;" class="pull-right point noti-all-read">모두 읽음으로 표시</a></span></div>';
     if (element('list', $result)) {
         foreach (element('list', $result) as $key => $val) {
             $result['list'][$key]['delete_url'] = site_url('notification/delete/' . element('not_id', $val) . '?' . $param->output());
             $jsevent = '';
             $read_url = site_url('notification/read/' . element('not_id', $val) . '?' . $param->output());
             if (element('not_type', $val) === 'note') {
                 $read_url = 'javascript:;';
                 $jsevent = 'onClick="note_list(' . element('not_content_id', $val) . ');"';
             }
             $html .= '<div class="notifications-list">
                 <a href="' . $read_url . '" ' . $jsevent . ' class="notification_read ' . element('not_type', $val) . '" data-not-id="' . element('not_id', $val) . '">' . html_escape(element('not_message', $val)) . ' <span class="pull-right">' . display_datetime(element('not_datetime', $val), 'sns') . '</span></a></div> ';
         }
     }
     $html .= '<div class="notifications-list">
         <a class="external point" href="' . site_url('notification') . '">
         알림 페이지로 이동</a></div>';
     echo $html;
     exit;
 }
Exemplo n.º 14
0
 /**
  * 게시판 목록페이지입니다.
  */
 public function _get_list($brd_key, $from_view = '')
 {
     // 이벤트 라이브러리를 로딩합니다
     $eventname = 'event_board_post_get_list';
     $this->load->event($eventname);
     $view = array();
     $view['view'] = array();
     // 이벤트가 존재하면 실행합니다
     $view['view']['event']['before'] = Events::trigger('before', $eventname);
     $return = array();
     $board = $this->_get_board($brd_key);
     $mem_id = (int) $this->member->item('mem_id');
     $alertmessage = $this->member->is_member() ? '회원님은 이 게시판 목록을 볼 수 있는 권한이 없습니다' : '비회원은 이 게시판에 접근할 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오';
     $check = array('group_id' => element('bgr_id', $board), 'board_id' => element('brd_id', $board));
     $this->accesslevel->check(element('access_list', $board), element('access_list_level', $board), element('access_list_group', $board), $alertmessage, $check);
     if (element('use_personal', $board) && $this->member->is_member() === false) {
         alert('이 게시판은 1:1 게시판입니다. 비회원은 접근할 수 없습니다');
         return false;
     }
     $skindir = $this->cbconfig->get_device_view_type() === 'mobile' ? element('board_mobile_skin', $board) ? element('board_mobile_skin', $board) : element('board_skin', $board) : element('board_skin', $board);
     $skinurl = base_url(VIEW_DIR . 'board/' . $skindir);
     $view['view']['is_admin'] = $is_admin = $this->member->is_admin(array('board_id' => element('brd_id', $board), 'group_id' => element('bgr_id', $board)));
     /**
      * 페이지에 숫자가 아닌 문자가 입력되거나 1보다 작은 숫자가 입력되면 에러 페이지를 보여줍니다.
      */
     $param =& $this->querystring;
     $page = (int) $this->input->get('page') > 0 ? (int) $this->input->get('page') : 1;
     $order_by_field = element('order_by_field', $board) ? element('order_by_field', $board) : 'post_num, post_reply';
     $findex = $this->input->get('findex', null, $order_by_field);
     $sfield = $sfieldchk = $this->input->get('sfield', null, '');
     if ($sfield === 'post_both') {
         $sfield = array('post_title', 'post_content');
     }
     $skeyword = $this->input->get('skeyword', null, '');
     if ($this->cbconfig->get_device_view_type() === 'mobile') {
         $per_page = element('mobile_list_count', $board) ? (int) element('mobile_list_count', $board) : 10;
     } else {
         $per_page = element('list_count', $board) ? (int) element('list_count', $board) : 20;
     }
     $offset = ($page - 1) * $per_page;
     $this->Post_model->allow_search_field = array('post_id', 'post_title', 'post_content', 'post_both', 'post_category', 'post_userid', 'post_nickname');
     // 검색이 가능한 필드
     $this->Post_model->search_field_equal = array('post_id', 'post_userid', 'post_nickname');
     // 검색중 like 가 아닌 = 검색을 하는 필드
     // 이벤트가 존재하면 실행합니다
     $view['view']['event']['step1'] = Events::trigger('step1', $eventname);
     /**
      * 상단에 공지사항 부분에 필요한 정보를 가져옵니다.
      */
     $except_all_notice = false;
     if (element('except_all_notice', $board) && $this->cbconfig->get_device_view_type() !== 'mobile') {
         $except_all_notice = true;
     }
     if (element('mobile_except_all_notice', $board) && $this->cbconfig->get_device_view_type() === 'mobile') {
         $except_all_notice = true;
     }
     $use_sideview = $this->cbconfig->get_device_view_type() === 'mobile' ? element('use_mobile_sideview', $board) : element('use_sideview', $board);
     $list_date_style = $this->cbconfig->get_device_view_type() === 'mobile' ? element('mobile_list_date_style', $board) : element('list_date_style', $board);
     $list_date_style_manual = $this->cbconfig->get_device_view_type() === 'mobile' ? element('mobile_list_date_style_manual', $board) : element('list_date_style_manual', $board);
     if (element('use_gallery_list', $board)) {
         $this->load->model('Post_file_model');
         $board['gallery_cols'] = $gallery_cols = $this->cbconfig->get_device_view_type() === 'mobile' ? element('mobile_gallery_cols', $board) : element('gallery_cols', $board);
         $board['gallery_image_width'] = $gallery_image_width = $this->cbconfig->get_device_view_type() === 'mobile' ? element('mobile_gallery_image_width', $board) : element('gallery_image_width', $board);
         $board['gallery_image_height'] = $gallery_image_height = $this->cbconfig->get_device_view_type() === 'mobile' ? element('mobile_gallery_image_height', $board) : element('gallery_image_height', $board);
         $board['gallery_percent'] = floor(102 / $board['gallery_cols']) - 2;
     }
     if (element('use_category', $board)) {
         $this->load->model('Board_category_model');
         $board['category'] = $this->Board_category_model->get_all_category(element('brd_id', $board));
     }
     $noticeresult = $this->Post_model->get_notice_list(element('brd_id', $board), $except_all_notice, $sfield, $skeyword);
     if ($noticeresult) {
         foreach ($noticeresult as $key => $val) {
             $notice_brd_key = $this->board->item_id('brd_key', element('brd_id', $val));
             $noticeresult[$key]['post_url'] = post_url($notice_brd_key, element('post_id', $val));
             $noticeresult[$key]['meta'] = $meta = $this->Post_meta_model->get_all_meta(element('post_id', $val));
             if ($this->cbconfig->get_device_view_type() === 'mobile') {
                 $noticeresult[$key]['title'] = element('mobile_subject_length', $board) ? cut_str(element('post_title', $val), element('mobile_subject_length', $board)) : element('post_title', $val);
             } else {
                 $noticeresult[$key]['title'] = element('subject_length', $board) ? cut_str(element('post_title', $val), element('subject_length', $board)) : element('post_title', $val);
             }
             if (element('post_del', $val)) {
                 $noticeresult[$key]['title'] = '게시물이 삭제 되었습니다';
             }
             $noticeresult[$key]['display_name'] = display_username(element('post_userid', $val), element('post_nickname', $val), element('mem_icon', $val), $use_sideview ? 'Y' : 'N');
             $noticeresult[$key]['display_datetime'] = display_datetime(element('post_datetime', $val), $list_date_style, $list_date_style_manual);
             $noticeresult[$key]['category'] = '';
             if (element('use_category', $board) && element('post_category', $val)) {
                 $noticeresult[$key]['category'] = $this->Board_category_model->get_category_info(element('brd_id', $val), element('post_category', $val));
             }
             if ($param->output()) {
                 $noticeresult[$key]['post_url'] .= '?' . $param->output();
             }
             $noticeresult[$key]['is_mobile'] = element('post_device', $val) === 'mobile' ? true : false;
         }
     }
     /**
      * 게시판 목록에 필요한 정보를 가져옵니다.
      */
     $where = array('brd_id' => $this->board->item_key('brd_id', $brd_key));
     $where['post_del <>'] = 2;
     if (element('except_notice', $board) && $this->cbconfig->get_device_view_type() !== 'mobile') {
         $where['post_notice'] = 0;
     }
     if (element('mobile_except_notice', $board) && $this->cbconfig->get_device_view_type() === 'mobile') {
         $where['post_notice'] = 0;
     }
     if (element('use_personal', $board) && $is_admin === false) {
         $where['post.mem_id'] = $mem_id;
     }
     $category_id = (int) $this->input->get('category_id');
     if (empty($category_id) or $category < 1) {
         $category_id = '';
     }
     $result = $this->Post_model->get_post_list($per_page, $offset, $where, $category_id, $findex, $sfield, $skeyword);
     $list_num = $result['total_rows'] - ($page - 1) * $per_page;
     if (element('list', $result)) {
         foreach (element('list', $result) as $key => $val) {
             $result['list'][$key]['post_url'] = post_url(element('brd_key', $board), element('post_id', $val));
             $result['list'][$key]['meta'] = $meta = $this->Post_meta_model->get_all_meta(element('post_id', $val));
             if ($this->cbconfig->get_device_view_type() === 'mobile') {
                 $result['list'][$key]['title'] = element('mobile_subject_length', $board) ? cut_str(element('post_title', $val), element('mobile_subject_length', $board)) : element('post_title', $val);
             } else {
                 $result['list'][$key]['title'] = element('subject_length', $board) ? cut_str(element('post_title', $val), element('subject_length', $board)) : element('post_title', $val);
             }
             if (element('post_del', $val)) {
                 $result['list'][$key]['title'] = '게시물이 삭제 되었습니다';
             }
             $is_blind = element('blame_blind_count', $board) > 0 && element('post_blame', $val) >= element('blame_blind_count', $board) ? true : false;
             if ($is_blind) {
                 $result['list'][$key]['title'] = '신고가 접수된 게시글입니다.';
             }
             $result['list'][$key]['display_name'] = display_username(element('post_userid', $val), element('post_nickname', $val), element('mem_icon', $val), $use_sideview ? 'Y' : 'N');
             $result['list'][$key]['display_datetime'] = display_datetime(element('post_datetime', $val), $list_date_style, $list_date_style_manual);
             $result['list'][$key]['category'] = '';
             if (element('use_category', $board) && element('post_category', $val)) {
                 $result['list'][$key]['category'] = $this->Board_category_model->get_category_info(element('brd_id', $val), element('post_category', $val));
             }
             if ($param->output()) {
                 $result['list'][$key]['post_url'] .= '?' . $param->output();
             }
             $result['list'][$key]['num'] = $list_num--;
             $result['list'][$key]['is_hot'] = false;
             $hot_icon_day = $this->cbconfig->get_device_view_type() === 'mobile' ? element('mobile_hot_icon_day', $board) : element('hot_icon_day', $board);
             $hot_icon_hit = $this->cbconfig->get_device_view_type() === 'mobile' ? element('mobile_hot_icon_hit', $board) : element('hot_icon_hit', $board);
             if ($hot_icon_day && ctimestamp() - strtotime(element('post_datetime', $val)) <= $hot_icon_day * 86400) {
                 if ($hot_icon_hit && $hot_icon_hit <= element('post_hit', $val)) {
                     $result['list'][$key]['is_hot'] = true;
                 }
             }
             $result['list'][$key]['is_new'] = false;
             $new_icon_hour = $this->cbconfig->get_device_view_type() === 'mobile' ? element('mobile_new_icon_hour', $board) : element('new_icon_hour', $board);
             if ($new_icon_hour && ctimestamp() - strtotime(element('post_datetime', $val)) <= $new_icon_hour * 3600) {
                 $result['list'][$key]['is_new'] = true;
             }
             $result['list'][$key]['is_mobile'] = element('post_device', $val) === 'mobile' ? true : false;
             $result['list'][$key]['thumb_url'] = '';
             $result['list'][$key]['origin_image_url'] = '';
             if (element('use_gallery_list', $board)) {
                 if (element('post_image', $val)) {
                     $filewhere = array('post_id' => element('post_id', $val), 'pfi_is_image' => 1);
                     $file = $this->Post_file_model->get_one('', '', $filewhere, '', '', 'pfi_id', 'ASC');
                     $result['list'][$key]['thumb_url'] = thumb_url('post', element('pfi_filename', $file), $gallery_image_width, $gallery_image_height);
                     $result['list'][$key]['origin_image_url'] = thumb_url('post', element('pfi_filename', $file));
                 } else {
                     $thumb_url = get_post_image_url(element('post_content', $val), $gallery_image_width, $gallery_image_height);
                     $result['list'][$key]['thumb_url'] = $thumb_url ? $thumb_url : thumb_url('', '', $gallery_image_width, $gallery_image_height);
                     $result['list'][$key]['origin_image_url'] = $thumb_url;
                 }
             }
         }
     }
     $return['data'] = $result;
     $return['notice_list'] = $noticeresult;
     if (empty($from_view)) {
         $board['headercontent'] = $this->cbconfig->get_device_view_type() === 'mobile' ? element('mobile_header_content', $board) : element('header_content', $board);
     }
     $board['footercontent'] = $this->cbconfig->get_device_view_type() === 'mobile' ? element('mobile_footer_content', $board) : element('footer_content', $board);
     $board['cat_display_style'] = $this->cbconfig->get_device_view_type() === 'mobile' ? element('mobile_category_display_style', $board) : element('category_display_style', $board);
     $return['board'] = $board;
     $return['point_info'] = '';
     if ($this->cbconfig->item('use_point') && element('use_point', $board) && element('use_point_info', $board)) {
         $point_info = '';
         if (element('point_write', $board)) {
             $point_info .= '원글작성 : ' . element('point_write', $board) . '<br />';
         }
         if (element('point_comment', $board)) {
             $point_info .= '댓글작성 : ' . element('point_comment', $board) . '<br />';
         }
         if (element('point_fileupload', $board)) {
             $point_info .= '파일업로드 : ' . element('point_fileupload', $board) . '<br />';
         }
         if (element('point_filedownload', $board)) {
             $point_info .= '파일다운로드 : ' . element('point_filedownload', $board) . '<br />';
         }
         if (element('point_filedownload_uploader', $board)) {
             $point_info .= '파일다운로드시업로더에게 : ' . element('point_filedownload_uploader', $board) . '<br />';
         }
         if (element('point_read', $board)) {
             $point_info .= '게시글조회 : ' . element('point_read', $board) . '<br />';
         }
         if (element('point_post_like', $board)) {
             $point_info .= '원글추천함 : ' . element('point_post_like', $board) . '<br />';
         }
         if (element('point_post_dislike', $board)) {
             $point_info .= '원글비추천함 : ' . element('point_post_dislike', $board) . '<br />';
         }
         if (element('point_post_liked', $board)) {
             $point_info .= '원글추천받음 : ' . element('point_post_liked', $board) . '<br />';
         }
         if (element('point_post_disliked', $board)) {
             $point_info .= '원글비추천받음 : ' . element('point_post_disliked', $board) . '<br />';
         }
         if (element('point_comment_like', $board)) {
             $point_info .= '댓글추천함 : ' . element('point_comment_like', $board) . '<br />';
         }
         if (element('point_comment_dislike', $board)) {
             $point_info .= '댓글비추천함 : ' . element('point_comment_dislike', $board) . '<br />';
         }
         if (element('point_comment_liked', $board)) {
             $point_info .= '댓글추천받음 : ' . element('point_comment_liked', $board) . '<br />';
         }
         if (element('point_comment_disliked', $board)) {
             $point_info .= '댓글비추천받음 : ' . element('point_comment_disliked', $board) . '<br />';
         }
         $return['point_info'] = $point_info;
     }
     // 이벤트가 존재하면 실행합니다
     $view['view']['event']['step2'] = Events::trigger('step2', $eventname);
     /**
      * primary key 정보를 저장합니다
      */
     $return['primary_key'] = $this->Post_model->primary_key;
     $highlight_keyword = '';
     if ($skeyword) {
         if (!$this->session->userdata('skeyword_' . $skeyword)) {
             $sfieldarray = array('post_title', 'post_content', 'post_both');
             if (in_array($sfieldchk, $sfieldarray)) {
                 $this->load->model('Search_keyword_model');
                 $searchinsert = array('sek_keyword' => $skeyword, 'sek_datetime' => cdate('Y-m-d H:i:s'), 'sek_ip' => $this->input->ip_address(), 'mem_id' => $mem_id);
                 $this->Search_keyword_model->insert($searchinsert);
                 $this->session->set_userdata('skeyword_' . $skeyword, 1);
             }
         }
         $key_explode = explode(' ', $skeyword);
         if ($key_explode) {
             foreach ($key_explode as $seval) {
                 if ($highlight_keyword) {
                     $highlight_keyword .= ',';
                 }
                 $highlight_keyword .= '\'' . html_escape($seval) . '\'';
             }
         }
     }
     $return['highlight_keyword'] = $highlight_keyword;
     /**
      * 페이지네이션을 생성합니다
      */
     $config['base_url'] = board_url($brd_key) . '?' . $param->replace('page');
     $config['total_rows'] = $result['total_rows'];
     $config['per_page'] = $per_page;
     if ($this->cbconfig->get_device_view_type() === 'mobile') {
         $config['num_links'] = element('mobile_page_count', $board) ? element('mobile_page_count', $board) : 3;
     } else {
         $config['num_links'] = element('page_count', $board) ? element('page_count', $board) : 5;
     }
     $this->pagination->initialize($config);
     $return['paging'] = $this->pagination->create_links();
     $return['page'] = $page;
     /**
      * 쓰기 주소, 삭제 주소등 필요한 주소를 구합니다
      */
     $search_option = array('post_title' => '제목', 'post_content' => '내용');
     $return['search_option'] = search_option($search_option, $sfield);
     if ($skeyword) {
         $return['list_url'] = board_url(element('brd_key', $board));
         $return['search_list_url'] = board_url(element('brd_key', $board) . '?' . $param->output());
     } else {
         $return['list_url'] = board_url(element('brd_key', $board) . '?' . $param->output());
         $return['search_list_url'] = '';
     }
     $check = array('group_id' => element('bgr_id', $board), 'board_id' => element('brd_id', $board));
     $can_write = $this->accesslevel->is_accessable(element('access_write', $board), element('access_write_level', $board), element('access_write_group', $board), $check);
     $return['write_url'] = '';
     if ($can_write === true) {
         $return['write_url'] = write_url($brd_key);
     } elseif ($this->cbconfig->get_device_view_type() !== 'mobile' && element('always_show_write_button', $board)) {
         $return['write_url'] = 'javascript:alert(\'비회원은 글쓰기 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.\');';
     } elseif ($this->cbconfig->get_device_view_type() === 'mobile' && element('mobile_always_show_write_button', $board)) {
         $return['write_url'] = 'javascript:alert(\'비회원은 글쓰기 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.\');';
     }
     $return['list_delete_url'] = site_url('postact/listdelete/' . $brd_key . '?' . $param->output());
     return $return;
 }
Exemplo n.º 15
0
"><?php 
        echo html_escape(element('nte_title', $result));
        ?>
</a></td>
                <td><a href="<?php 
        echo site_url('note/view/' . element('type', $view) . '/' . element('nte_id', $result));
        ?>
"><?php 
        echo display_datetime(element('nte_datetime', $result), 'full');
        ?>
</a></td>
                <td><a href="<?php 
        echo site_url('note/view/' . element('type', $view) . '/' . element('nte_id', $result));
        ?>
"><?php 
        echo element('nte_read_datetime', $result) > '0000-00-00 00:00:00' ? display_datetime(element('nte_read_datetime', $result), 'full') : '<span style="color:#a94442;">아직 읽지 않음</span>';
        ?>
</a></td>
                <td><button class="btn-link btn-one-delete" data-one-delete-url = "<?php 
        echo element('delete_url', $result);
        ?>
">삭제</button></td>
            </tr>
        <?php 
    }
}
if (!element('list', element('data', $view))) {
    ?>
            <tr>
                <td colspan="5" class="nopost">쪽지가 없습니다</td>
            </tr>
Exemplo n.º 16
0
        <li><a href="<?php 
echo site_url('note/write');
?>
" class="btn btn-default">쪽지 쓰기</a></li>
    </ul>

    <div class="note-view mt20">
        <div class="note-view-title">
            <?php 
echo html_escape(element('nte_title', element('data', $view)));
?>
 <small><?php 
echo element('display_name', element('data', $view));
?>
, <?php 
echo display_datetime(element('nte_datetime', element('data', $view)), 'full');
?>
 </small>
        </div>
        <div class="note-contents">
            <?php 
echo element('content', element('data', $view));
?>
        </div>
    </div>
    <div class="pull-right" aria-label="...">
        <button type="button" class="btn btn-success btn-sm" onClick="history.back();">이전페이지</button>
        <?php 
if (element('userid', element('data', $view))) {
    ?>
<a href="<?php 
Exemplo n.º 17
0
</td>
                    <td class="text-center">
                        <a href="<?php 
        echo element('read_url', $result);
        ?>
" <?php 
        echo element('onClick', $result) ? 'onClick="' . element('onClick', $result) . '";' : '';
        ?>
 class="noti_read <?php 
        echo element('not_type', $result);
        ?>
" data-not-id="<?php 
        echo element('not_id', $result);
        ?>
"><?php 
        echo element('not_read_datetime', $result) > '0000-00-00 00:00:00' ? '<span class="read">' . display_datetime(element('not_read_datetime', $result), 'sns') . '</span>' : '<span class="unread">읽지 않음</span>';
        ?>
</a></td>
                    <td><a href="<?php 
        echo element('read_url', $result);
        ?>
" <?php 
        echo element('onClick', $result) ? 'onClick="' . element('onClick', $result) . '";' : '';
        ?>
 class="noti_read <?php 
        echo element('not_type', $result);
        ?>
" data-not-id="<?php 
        echo element('not_id', $result);
        ?>
"><?php 
Exemplo n.º 18
0
        ?>
                        <tr>
                            <td><?php 
        echo cut_str(html_escape(strip_tags(element('faq_title', $result))), 100);
        ?>
</td>
                            <td><?php 
        echo cut_str(html_escape(strip_tags(element('faq_content', $result))), 100);
        ?>
</td>
                            <td><?php 
        echo number_format(element('faq_order', $result));
        ?>
</td>
                            <td><?php 
        echo display_datetime(element('faq_datetime', $result), 'full');
        ?>
</td>
                            <td><?php 
        echo element('display_name', $result);
        ?>
 <?php 
        if (element('mem_userid', $result)) {
            ?>
 ( <a href="?fgr_id=<?php 
            echo $this->input->get('fgr_id');
            ?>
&amp;sfield=faq.mem_id&amp;skeyword=<?php 
            echo element('mem_id', $result);
            ?>
"><?php 
Exemplo n.º 19
0
"><?php 
        echo html_escape(element('nte_title', $result));
        ?>
</a></td>
                <td><a href="<?php 
        echo site_url('note/view/' . element('type', $view) . '/' . element('nte_id', $result));
        ?>
"><?php 
        echo display_datetime(element('nte_datetime', $result), 'full');
        ?>
</a></td>
                <td><a href="<?php 
        echo site_url('note/view/' . element('type', $view) . '/' . element('nte_id', $result));
        ?>
"><?php 
        echo element('nte_read_datetime', $result) > '0000-00-00 00:00:00' ? display_datetime(element('nte_read_datetime', $result), 'full') : '<span class="text-danger">아직 읽지 않음</span>';
        ?>
</a></td>
                <td><button class="btn-link btn-one-delete" data-one-delete-url = "<?php 
        echo element('delete_url', $result);
        ?>
">삭제</button></td>
            </tr>
        <?php 
    }
}
if (!element('list', element('data', $view))) {
    ?>
            <tr>
                <td colspan="5" class="nopost">쪽지가 없습니다</td>
            </tr>