113 lines
3.7 KiB
PHP
Executable File
113 lines
3.7 KiB
PHP
Executable File
<?php
|
|
$partner_idx = $result['idx'];
|
|
$editor_name = $result['partner_name'];
|
|
$editor_main_img = $result['main_img'];
|
|
$editor_intro = $result['partner_intro'];
|
|
$partner_img = $result['partner_img'];
|
|
$category_idx = $result['category_idx'];
|
|
$category_name = $result['category_name'];
|
|
$channel_idx = $result['channel_idx'];
|
|
$channel_name = $result['channel_name'];
|
|
$sns_id1 = $result['sns_id1'];
|
|
$sns_id2 = $result['sns_id2'];
|
|
$sns_id3 = $result['sns_id3'];
|
|
$sns_id4 = $result['sns_id4'];
|
|
$sns_id5 = $result['sns_id5'];
|
|
|
|
|
|
|
|
|
|
$content_type = '3';
|
|
|
|
?>
|
|
|
|
|
|
<? include_once ('life_header_inc.php');?>
|
|
|
|
<div class="channel_contents">
|
|
<div class="wrap" style="margin-top:70px;">
|
|
<div class="channel_top bgb3">
|
|
<span class="fl art_no">전체글 수 <span class="beachblue"><?=number_format($total_count)?></span></span>
|
|
<span class="fr art_bt">
|
|
<button type="button" onclick="location.href='/web/life/editor/<?=$partner_idx?>?search_sort=1'" class="btn <? if($search_sort=='1') { echo 'btn-default_bb'; } else { echo 'btn-default';}?> br20" >최신순</button>
|
|
<button type="button" onclick="location.href='/web/life/editor/<?=$partner_idx?>?search_sort=2'" class="btn <? if($search_sort=='2') { echo 'btn-default_bb'; } else { echo 'btn-default';}?> br20">인기순</button>
|
|
</span>
|
|
</div>
|
|
<div id="life_list">
|
|
<?
|
|
$i = 1;
|
|
$row_count = count($list);
|
|
foreach ($list as $val) {
|
|
$head_title = '';
|
|
if($val['head_title'] != '') $head_title = '<span class="beachblue">['.$val['head_title'].']</span> ';
|
|
$title = $head_title.$val['title'];
|
|
|
|
$title_txt = mb_strimwidth($title, '0', '90', '..', 'utf-8');
|
|
|
|
|
|
if($i%4==1) echo '<div class="channel_boxs" style="margin-bottom: 0 !important;">';
|
|
|
|
?>
|
|
<div class="channel_con">
|
|
<div class="art-img" onclick="location.href='/web/life/life_view/<?=$val['idx']?>'" style="border-top-left-radius: 5px;border-top-right-radius: 5px;cursor:pointer;width:309.39px;height:200.3px;background:url('<?=$val['main_img']?>') no-repeat center; background-size:cover;"></div>
|
|
<p class="chtitle" style="height:56px"><a href="/web/life/life_view/<?=$val['idx']?>"><?=$title_txt?></a></p>
|
|
</div>
|
|
<?
|
|
|
|
if($i%4==0 || $row_count==$i) echo '</div>';
|
|
|
|
$i++;
|
|
}
|
|
|
|
$life_more_btn_style = 'style="display:none;"';
|
|
if($total_count > $row_count) {
|
|
$life_more_btn_style = 'style="display:block;"';
|
|
}
|
|
?>
|
|
</div>
|
|
<div class="channel_bottom">
|
|
<button type="button" class="btn btn-default br20" id="life_more_btn" onclick="editor_list_more();" <?=$life_more_btn_style?>>더보기 </button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<script>
|
|
var life_page = 2;
|
|
function editor_list_more(){
|
|
var form_data = {
|
|
"sort" : "<?=$search_sort?>",
|
|
"page" : life_page,
|
|
"partner_idx" : "<?=$partner_idx?>"
|
|
};
|
|
$.ajax({
|
|
url: '/web/life/life_list_more',
|
|
async: false,
|
|
type: 'POST',
|
|
dataType: 'HTML',
|
|
data: form_data,
|
|
success: function (rtnHtml) {
|
|
if(rtnHtml=='') return false;
|
|
var arrHtml = rtnHtml.split("|||||");
|
|
if(arrHtml[0].trim()=='0000') {
|
|
$("#life_list").append(arrHtml[1]);
|
|
|
|
if (arrHtml[3] == "N") {
|
|
$("#life_more_btn").hide();
|
|
} else {
|
|
$("#life_more_btn").show();
|
|
}
|
|
life_page++;
|
|
|
|
} else {
|
|
alert(arrHtml[1]);
|
|
return false;
|
|
}
|
|
},
|
|
error: function (rtnHtml) {
|
|
alert('저장에 실패했습니다.');
|
|
return false;
|
|
}
|
|
});
|
|
}
|
|
</script>
|