<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"	xmlns:fb="http://ogp.me/ns/fb#" lang="ko">
<head>
<?php $this->load->view('partial/head')?>
<link rel="stylesheet" href="/ART/grace/css/default.css">
</head>
<body data-graceview-bg="<?php echo imgSrc($post->editorMainImg)?>">
    <style>
    .channel_header2 {
        background: none;
    }
    </style>
    <?php $this->load->view('partial/sidemenu')?>

    <main>
        <section id="channel_header">
            <div class="channel_header2">
                <h1>
                    <a href="#" class="nav-toggle"> <i class="fa fa-bars" aria-hidden="true"></i></a>
                    <a href="/grace"><img src="/ART/grace/img/logo_white.png" alt=""><span class="ir_pm">크로스맵</span></a>
                </h1>
                <div class="cover_cell">
                    <h2><?php echo $post->title?></h2>
                </div>
                <div class="ArticleInfo">
                    <strong><?php echo $post->editorName?></strong>
                    <p><?php echo $post->editorIntro?></p>
                </div>

            </div>
        </section>
        <!-- //channel_header -->

        <section id="article_contents">
            <div class="container2">
                <div class="row">
                    <div class="article_contents" id="<?php echo $post->idx?>">
                        <?php echo $post->sub_title ? '<h3>'.convertEmoji($post->sub_title, 'DECODE').'</h3>' : ''?>
                        <?php if ($post->video_url) {?><div style="text-align:center; display: block;"><iframe
                                type="text/html" src="<?php echo $post->video_url ?>" allowfullscreen="true"
                                style="border: 0px; display: block; margin: 0px; width: 730px; height: 410px;"
                                data-ratio="0.5625" data-width="730" data-height="410"></iframe></div><?php }?>

                        <?php echo contentImgSrc(convertEmoji($post->content, 'DECODE')) ?>
                    </div>
                    <!-- //article_contents -->

                    <div class="article_footer">
                        <ul class="article_keyword">
                            <?php foreach(explode(' ', $post->tag) as $t) echo '<li><a href="#"><span>#</span>'.$t.'</a></li>';?>

                        </ul>

                        <ul class="comment_btn">
                            <li class="clicked"><a href="#" class="cm-comment-btn"><i class="fa fa-commenting"
                                        aria-hidden="true"></i><span><?php echo $post->comments?></span></a></li>
                            <li <?php echo $iLike ? 'class="clicked"': ''?>><a href="#" class="cm-like-btn"><i
                                        class="fa fa-heart"
                                        aria-hidden="true"></i><span><?php echo $post->likes?></span></a></li>
                                <li><a href="#" class="cm-share-btn"><i class="fa fa-share-alt"
                                            aria-hidden="true"></i><span><?php echo $post->share_count?></span></a></li>
                        </ul>
                        <?php require_once(APPPATH . "views/grace/socialshare.php"); ?>
                    </div>
                    <!-- //article_footer -->

                    <!-- commentbox -->
                    
                    <?php require_once(APPPATH . "views/grace/comment.php"); ?>
                    
                    
                    <!-- //commentbox -->
                </div>
            </div>
        </section>
        <!-- //article_contents -->

        <section id="writer_related_article">
            <div class="container">
                <div class="row">
                    <div class="writer_related_article">
                        <div class="author_box">
                            <div class="img"><img src="<?php echo imgSrc($post->editorImg)?>" alt=""></div>
                            <strong><?php echo $post->editorName?></strong>
                            <p><?php echo $post->editorIntro?></p>
                        </div>
                        <!-- post_listbox -->
                        <section id="post_listbox">
                            <div class="container">
                                <div class="row">
                                    <div class="post_listbox">
                                        <ul>
                                            <?php foreach($editorPosts as $p) { ?>
                                            <li>
                                                <div class="box"><a
                                                        href="/grace/<?php echo $p->titleUrl?>/<?php echo $p->idx?>"><img
                                                            src="<?php echo imgSrc($p->mainImg)?>" alt=""></a></div>
                                                <div class="txtbox">
                                                    <span class="editor_img"><a
                                                            href="/grace/editor/<?php echo $p->editorNameUrl?>/<?php echo $p->editorId?>"><img
                                                                src="<?php echo imgSrc($p->editorImg)?>"
                                                                alt=""></a></span>
                                                    <dl>
                                                        <dd class="editor_txt"><a
                                                                href="/grace/editor/<?php echo $p->editorNameUrl?>/<?php echo $p->editorId?>"><?php echo $p->editorName?></a>
                                                        </dd>
                                                        <dt><a
                                                                href="/grace/<?php echo $p->titleUrl?>/<?php echo $p->idx?>"><?php echo $p->title?></a>
                                                        </dt>

                                                    </dl>
                                                    <span class="info">
                                                        <span class="hit">조회수 <?php echo $p->views?>회</span>
                                                        <span class="reple">댓글 <?php echo $p->comments?>회</span>
                                                    </span>
                                                </div>
                                            </li>
                                            <?php } ?>
                                        </ul>
                                    </div>
                                </div>
                            </div>

                        </section>
                        <!-- //post_listbox -->
                    </div>
                </div>
            </div>
        </section>
        <!-- //writer_related_article -->

        <!-- post_listbox -->
        <section id="post_listbox" class="pb50">
            <div class="container">
                <div class="row">
                    <div class="post_listbox">
                        <div class="tit">
                            <h2>추천 은혜충전</h2>
                            <!--<span class="more"><a href="#">더보기</a></span>-->
                        </div>
                        <ul>
                            <?php foreach($recentPosts as $p) { ?>
                            <li>
                                <div class="box"><a href="/grace/<?php echo $p->titleUrl?>/<?php echo $p->idx?>"><img
                                            src="<?php echo imgSrc($p->mainImg)?>" alt=""></a></div>
                                <div class="txtbox">
                                    <span class="editor_img"><a
                                            href="/grace/editor/<?php echo $p->editorNameUrl?>/<?php echo $p->editorId?>"><img
                                                src="<?php echo imgSrc($p->editorImg)?>" alt=""></a></span>
                                    <dl>
                                        <dd class="editor_txt"><a
                                                href="/grace/editor/<?php echo $p->editorNameUrl?>/<?php echo $p->editorId?>"><?php echo $p->editorName?></a>
                                        </dd>
                                        <dt><a
                                                href="/grace/<?php echo $p->titleUrl?>/<?php echo $p->idx?>"><?php echo $p->title?></a>
                                        </dt>

                                    </dl>
                                    <span class="info">
                                        <span class="hit">조회수 <?php echo $p->views?>회</span>
                                        <span class="reple">댓글 <?php echo $p->comments?>회</span>
                                    </span>
                                </div>
                            </li>
                            <?php } ?>
                        </ul>
                    </div>
                </div>
            </div>

        </section>
        <!-- //post_listbox -->

    </main>
    <!-- footer -->
    <?php $this->load->view('partial/footer')?>
</body>

</html>