|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /home/queenjbs/yuchun_before_X/pages/ |
Upload File : |
<?php
include "inc_top.php";
if(!$pageCount) $pageCount = 10;
$show_one_page = $pageCount;
$show_view_page = 10;
$page = ( $page ) ? $page : 1;
$offset = ($page-1)*$show_one_page;
$order_by ="order by sortNum,no desc,reg_date desc";
//총 회원;
if($sessionLevel !=15){ //관리자 일떄 다 보이기.
$where .= " and is_secret='N' ";
}
if($MG=="on"){ // member 회원 볼수있게함.
if($sessionLevel < 10){
echo "<script>parent.location.href = './guide.html'</script>";
exit;
}
$where .= "AND general_setting = 'on'";
}
$pcLang = substr($_SERVER[HTTP_ACCEPT_LANGUAGE],0,2);
if($pcLang == "ja" || $sessionLevel == 15){
$langChk .= '1,'; //japan
if($sessionIDX){
$langChk .= '3,'; //japan member
}
}
if($sessionIDX){
$langChk .= '2,'; //all member
}
$langChk .='0'; //all
$where .= " and langChk in($langChk)";
$tableName = "board_news";
$total_count = get_db("SELECT count(*) FROM $tableName where is_delete = 'N' $where");
$query_limit = "limit $offset,$show_one_page";
$QUERY_PAGE = "SELECT * FROM $tableName where is_delete = 'N' $where $order_by $query_limit";
$total_page = ceil( $total_count / $show_one_page);
$more_next_page = $page+1;
$viewMore = ($pageCount >=$total_count) ? "" : "<div class='btn-area' id='btnMore' style='display: block;'><a href='javascript:fnMore();' class='btn' id='$more_next_page'>More</a></div>";
$start_num = $total_count - $offset; //
$result= mysql_query($QUERY_PAGE,$db_con);
if(!$result) {
error("DB_ERROR");
exit;
}
$total = mysql_affected_rows();
if(!$total)
{
$BRD_LIST = "<article class='post' style='text-align:center;'>情報がありません。</article>";
}
else
{
for($i=0; $i<$total; $i++)
{
unset($NUM_IMG,$New_icon);
$Num = ($total_count-$offset) - $i;
$row = mysql_fetch_array($result);
$regdate = substr($row[reg_date],0,10);
if($regdate == $today){$New_icon="<font color=orange><b>NEW</b></font>";}
if($row[is_notice] =='Y') $is_notice_chk="[お知らせ]";
else $is_notice_chk="";
if($row[is_secret] =='Y') $is_secret_chk="<font color=red>[관리자만 보임]</font>";
else $is_secret_chk="";
$RESULT_CONTENT = $row[contents];
$RESULT_CONTENT = stripslashes($RESULT_CONTENT);
//$RESULT_CONTENT=preg_replace("/ style=([^\"\']+) /"," ",$RESULT_CONTENT); // style=border:0... 따옴표가 없을때
//$RESULT_CONTENT=preg_replace("/ style=(\"|\')?([^\"\']+)(\"|\')?/","",$RESULT_CONTENT); // style="border:0..." 따옴표 있을때 style='width:100%;max-width:650px;'
$RESULT_CONTENT = preg_replace("/ height:(\"|\')?([^\"\']+)(\"|\')?;/","",$RESULT_CONTENT);
$RESULT_CONTENT = preg_replace("/ width:(\"|\')?([^\"\']+)(\"|\')?;/","",$RESULT_CONTENT);
$RESULT_CONTENT=preg_replace("/ height=(\"|\')?\d+(\"|\')?/","",$RESULT_CONTENT);
$RESULT_CONTENT=preg_replace("/ width=(\"|\')?\d+(\"|\')?/","",$RESULT_CONTENT);
//더보기 버튼
$BTN_CONTENT_MORE ="<a onclick='chklist($Num);' class='button big' style='cursor:pointer;'>......もっと見る</a>";
//요약글
$RESULT_CONTENT_SUMMARY = utf8_cutstr($RESULT_CONTENT,480,$tail=$BTN_CONTENT_MORE);
//로그인 하면 보이게 하는 구문.
if($sessionLevel == "" && $row[general_setting] == 'on'){
$membersJapansName = "<div style='width:100%;text-align:center; padding-bottom:2.5em;'>".$membersJapansName."</div>";
$RESULT_CONTENT_SUMMARY = $membersJapansName;
$RESULT_CONTENT = $membersJapansName;
}else{
$RESULT_CONTENT_SUMMARY = $RESULT_CONTENT_SUMMARY;
$RESULT_CONTENT = $RESULT_CONTENT;
}
if($row[general_setting] == 'on'){$is_notice_chk .="<font color='#067acc'>member only</font>";}
$BRD_LIST .="
<article class='post'>
<header>
<div class='title'>
<h2>$row[subject] $is_notice_chk</h2>
<p>$regdate $New_icon $is_secret_chk</p>
</div>
</header>
$NUM_IMG
<div id='summary_$Num'>
$RESULT_CONTENT_SUMMARY
</div>
<div id='original_$Num' style='display:none;'>
$RESULT_CONTENT
</div>
</article>
";
}
}
if(!$num) $num = 0;
?>
<style>
.post img {max-width:100%;}
</style>
<script>
function chklist(val){
//alert(val);
$('#summary_'+val).hide();
$('#original_'+val).show();
}
function fnMore(){
var moreSel =$('.btn');
var ID = moreSel.attr("id");
$.ajax({
type: "POST",
url: "news_ajax.php",
data: "page="+ ID+"&MG=<?=$MG?>" ,
cache: false,
success: function(html){
$(".content").append(html);
$(moreSel).attr("id",eval(ID)+1);
}
});
return false;
}
</script>
<div class="visual-area news">
<div class="visual-area-in">
<h2>store</h2>
</div>
</div>
<!-- S container -->
<section>
<article>
<div id="container">
<div class="content">
<!-- Post -->
<?=$BRD_LIST?>
<!-- Post -->
</div>
<?=$viewMore?>
</div>
</article>
</section>
<!-- E : container -->
<?php
include "inc_bottom.php";
?>