Exemplo n.º 1
0
function page_url()
{
    global $WPGLOBAL, $loop;
    $prismic = $WPGLOBAL['prismic'];
    $doc = $loop->current_post();
    if (!$doc) {
        return;
    }
    $scheme = "http://";
    $serverName = array_key_exists('HTTP_HOST', $_SERVER) ? $_SERVER['HTTP_HOST'] : '';
    return $scheme . $serverName . document_url($doc);
}
Exemplo n.º 2
0
                    </thead>
                    <tbody>
                    <?php 
if (element('list', element('data', $view))) {
    foreach (element('list', element('data', $view)) as $result) {
        ?>
                        <tr>
                            <td><?php 
        echo number_format(element('num', $result));
        ?>
</td>
                            <td><a href="<?php 
        echo goto_url(document_url(html_escape(element('doc_key', $result))));
        ?>
" target="_blank"><?php 
        echo document_url(html_escape(element('doc_key', $result)));
        ?>
</a></td>
                            <td><?php 
        echo html_escape(element('doc_title', $result));
        ?>
</td>
                            <td><?php 
        echo element('doc_layout', $result) ? html_escape(element('doc_layout', $result)) : '기본설정따름';
        ?>
</td>
                            <td><?php 
        echo element('doc_mobile_layout', $result) ? html_escape(element('doc_mobile_layout', $result)) : '기본설정따름';
        ?>
</td>
                            <td><?php 
Exemplo n.º 3
0
 /**
  * 일반문서를 보여주는 함수입니다
  */
 public function index($doc_key = '')
 {
     // 이벤트 라이브러리를 로딩합니다
     $eventname = 'event_document_index';
     $this->load->event($eventname);
     $view = array();
     $view['view'] = array();
     if (empty($doc_key)) {
         show_404();
     }
     // 이벤트가 존재하면 실행합니다
     $view['view']['event']['before'] = Events::trigger('before', $eventname);
     $docinfo = $this->cache->get('document-key-id-info');
     $doc_id = $docinfo && element($doc_key, $docinfo) ? element($doc_key, $docinfo) : '';
     if ($doc_id) {
         $data = $this->Document_model->get_one($doc_id);
     } else {
         $where = array('doc_key' => $doc_key);
         $data = $this->Document_model->get_one('', '', $where);
     }
     if (!element('doc_id', $data)) {
         show_404();
     }
     if (!$this->session->userdata('doc_id_' . element('doc_id', $data))) {
         $this->Document_model->update_hit(element('doc_id', $data));
         $this->session->set_userdata('doc_id_' . element('doc_id', $data), '1');
     }
     $data['content'] = $this->cbconfig->get_device_view_type() === 'mobile' ? element('doc_mobile_content', $data) ? element('doc_mobile_content', $data) : element('doc_content', $data) : element('doc_content', $data);
     $thumb_width = $this->cbconfig->get_device_view_type() === 'mobile' ? $this->cbconfig->item('document_mobile_thumb_width') : $this->cbconfig->item('document_thumb_width');
     $autolink = $this->cbconfig->get_device_view_type() === 'mobile' ? $this->cbconfig->item('use_document_mobile_auto_url') : $this->cbconfig->item('use_document_auto_url');
     $popup = $this->cbconfig->get_device_view_type() === 'mobile' ? $this->cbconfig->item('document_mobile_content_target_blank') : $this->cbconfig->item('document_content_target_blank');
     $data['content'] = display_html_content(element('content', $data), element('doc_content_html_type', $data), $thumb_width, $autolink, $popup, $writer_is_admin = true);
     $view['view']['data'] = $data;
     $view['view']['doc_key'] = $doc_key;
     $view['view']['canonical'] = document_url($doc_key);
     // 이벤트가 존재하면 실행합니다
     $view['view']['event']['before_layout'] = Events::trigger('before_layout', $eventname);
     /**
      * 레이아웃을 정의합니다
      */
     $page_title = $this->cbconfig->item('site_meta_title_document');
     $meta_description = $this->cbconfig->item('site_meta_description_document');
     $meta_keywords = $this->cbconfig->item('site_meta_keywords_document');
     $meta_author = $this->cbconfig->item('site_meta_author_document');
     $page_name = $this->cbconfig->item('site_page_name_document');
     $searchconfig = array('{문서제목}', '{문서아이디}');
     $replaceconfig = array(element('doc_title', $data), $doc_key);
     $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);
     $layout_dir = element('doc_layout', $data) ? element('doc_layout', $data) : $this->cbconfig->item('layout_document');
     $mobile_layout_dir = element('doc_mobile_layout', $data) ? element('doc_mobile_layout', $data) : $this->cbconfig->item('mobile_layout_document');
     $use_sidebar = element('doc_sidebar', $data) ? element('doc_sidebar', $data) : $this->cbconfig->item('sidebar_document');
     $use_mobile_sidebar = element('doc_mobile_sidebar', $data) ? element('doc_mobile_sidebar', $data) : $this->cbconfig->item('mobile_sidebar_document');
     $skin_dir = element('doc_skin', $data) ? element('doc_skin', $data) : $this->cbconfig->item('skin_document');
     $mobile_skin_dir = element('doc_mobile_skin', $data) ? element('doc_mobile_skin', $data) : $this->cbconfig->item('mobile_skin_document');
     $layoutconfig = array('path' => 'document', 'layout' => 'layout', 'skin' => 'document', 'layout_dir' => $layout_dir, 'mobile_layout_dir' => $mobile_layout_dir, 'use_sidebar' => $use_sidebar, 'use_mobile_sidebar' => $use_mobile_sidebar, 'skin_dir' => $skin_dir, 'mobile_skin_dir' => $mobile_skin_dir, '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
$attributes = array('class' => 'form-horizontal', 'name' => 'fadminwrite', 'id' => 'fadminwrite');
echo form_open(current_full_url(), $attributes);
?>
            <input type="hidden" name="<?php 
echo element('primary_key', $view);
?>
"    value="<?php 
echo element(element('primary_key', $view), element('data', $view));
?>
" />
            <div class="form-horizontal">
                <div class="form-group">
                    <label class="col-sm-2 control-label">페이지주소</label>
                    <div class="col-sm-10 form-inline">
                        <?php 
echo document_url();
?>
/ <input type="text" class="form-control" name="doc_key" value="<?php 
echo set_value('doc_key', element('doc_key', element('data', $view)));
?>
" /> 페이지주소를 입력해주세요
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">페이지제목</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" name="doc_title" value="<?php 
echo set_value('doc_title', element('doc_title', element('data', $view)));
?>
" />
                    </div>
Exemplo n.º 5
0
    <!-- footer start -->
    <footer>
        <div class="container">
            <div>
                <ul class="company">
                    <li><a href="<?php 
echo document_url('aboutus');
?>
" title="회사소개">회사소개</a></li>
                    <li><a href="<?php 
echo document_url('provision');
?>
" title="이용약관">이용약관</a></li>
                    <li><a href="<?php 
echo document_url('privacy');
?>
" title="개인정보 취급방침">개인정보 취급방침</a></li>
                </ul>
            </div>
            <div class="copyright">
                <?php 
if ($this->cbconfig->item('company_address')) {
    ?>
                    <span><?php 
    echo $this->cbconfig->item('company_address');
    ?>
                        <?php 
    if ($this->cbconfig->item('company_zipcode')) {
        ?>
(우편 <?php 
Exemplo n.º 6
0
function link_to_post($post)
{
    return '<a href="' . document_url($post) . '">' . post_title($post) . '</a>';
}