Files
cm-web-legacy/application/views/m/news/main.php
2020-06-10 06:19:03 +09:00

124 lines
3.0 KiB
PHP
Executable File

<?
$a = array(
"search_type" => "",
"search_keyword" => "",
"search_theme_type" => "5",
"search_category_code" => "",
"sort_column" => "a.reg_date",
"content_type" => 1,
"search_click1" => "",
"search_click2" => "",
"offset" => 0,
"limit" => "30"
);
$ci->load->model('admin/news/m_theme_news');
$result = $ci->m_theme_news->theme_join_news_list($a);
?>
<div class="news_cont2">
<div class="cont_top">
<div class="cont_top_img">
<span class="shadow"></span>
<a href="/m/news/news_view/<?=$result[0]['content_idx']?>">
<img src="<?= $result[0]['main_img'] ?>">
</a>
</div>
<p class="cont_top_title">
<a href="/m/news/news_view/<?=$result[0]['content_idx']?>"><?= $result[0]['title'] ?></a>
</p>
<p class="chn_bar">
<img src="/img/mobile/bg_bar.gif">
</p>
<p class="cont_top_txt"><?
$a = time();
$b = strtotime($result[0]['reg_date']);
echo floor(($a - $b) / 3600);
?>시간 전</p>
</div>
<div class="news_lists">
<div id="news_box">
<?
$ci->db->from("news");
$ci->db->select("*, `news`.idx as content_idx");
$ci->db->join('press', 'press.idx = news.press_idx');
$ci->db->where("news.is_del", "N");
$ci->db->where("news.is_display", "Y");
$ci->db->where("news.is_display", "Y");
$ci->db->order_by("news.reg_date","desc");
$ci->db->limit(11, 0);
$res = $ci->db->get();
$result = $res->result_array();
// echo $ci->db->last_query();
foreach ($result as $data):
?>
<div class="news_list_cont" >
<div class="art-img2<?=($data['video_url']) ? " plays_b" : ""; ?>">
<a href="/m/news/news_view/<?=$data['content_idx']?>">
<img src="<?= thumb($data['main_img']) ?>">
</a>
</div>
<div class="art-info2">
<h2 class="art-title">
<a href="/m/news/news_view/<?=$data['content_idx']?>"><?= $data['title'] ?></a>
</h2>
<p class="art-info"><?
$a = time();
$b = strtotime($data['update_date']);
echo floor(($a - $b) / 3600);
?>시간 전 <? if($arr_news_setting['etc_char1']=='Y') {?> |
<a target="_blank" href="<?= $data['homepage'] ?>"><?= $data['press_name'] ?> </a>
<?}?>
<span class="feedback fr">
<img src="/img/mobile/img_comments.gif"> <?= $data['comment_count'] ?>+</span>
</p>
</div>
</div>
<? endforeach; ?>
</div>
<p style="text-align:center;">
<button type="button" class="btn btn-default br20" style="padding:8px 40px; font-size:16px;" onclick="more();">더보기
<img src="/img/mobile/arr_down.gif" style="vertical-align:middle;"></button>
</p>
</div>
</div>
<script>
var $page = 1;
function more(){
$.ajax({
url: "/m/news/ajax_news_more?page=" + $page,
complete: function (data) {
$("#news_box").append(data.responseText);
$page++;
setTimeout(function(){
swiper1.update();
},500);
}
});
}
</script>