|
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/ |
Upload File : |
<?
require $_SERVER['DOCUMENT_ROOT']."/conf/conf_dir.php";
$tableName = "board_news";
//$order_by ="order by sortNum desc,no desc,reg_date desc";
//$order_by = ' ORDER BY is_notice asc,no desc';
$order_by = ' ORDER BY is_notice asc, sortNum asc,no desc';
include "include_where.php";
if ($page && $num) $page = ceil($page / 2); //페이지 수 알기. left 페이지와 본문 페이징이 달라 맞춰주는 계산
if($pageTmp) $page= $pageTmp;
if(!$pageCount) $pageCount = 10;
$show_one_page = $pageCount;
$show_view_page = 7;
$page = ( $page ) ? $page : 1;
$offset = ($page-1)*$show_one_page;
//$order_by ="order by sortNum,no desc,reg_date desc";
$total_count = get_db("SELECT count(*) FROM $tableName where is_delete = 'N' $where");
$query_limit = "limit $offset,$show_one_page";
$QUERY_PAGE = "SELECT *,(select no from board_chuchun where module_no=a.no and module_name='$tableName' and uid_fk='$sessionIDX') as voted_chk FROM $tableName as a where is_delete = 'N' $where $order_by $query_limit";
$total_page = ceil( $total_count / $show_one_page);
$more_next_page = $page+1;
$viewlist = ( !$total_count ) ? "" : Get_viewpage5($page,$total_count,$show_one_page,$show_view_page,$url_tail);
$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,$MEM_ICON);
//$Num = ($total_count-$offset) - $i;
$row = mysql_fetch_array($result);
$Num = $row[no];
$regdate = substr($row[reg_date],0,10);
$regdateArr = explode("-",$regdate);
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);
if($row[general_setting] == 'on'){
$MEM_ICON = "<div style='position:relative; left:0; top:-20px; z-index:5; margin-right:30px;'><img src='/images/sub/icon_member.png' width='30' /></div>
<div style='position:relative; left:0; top:-60px; z-index:5; margin-right:0px;'><a href='javascript:chklist($Num);'><img id='listBtn".$Num."' src='../images/sub/icon_arr_more.jpg' /></a></div>";
}else{
$MEM_ICON ="<a href='javascript:chklist($Num);'><img id='listBtn".$Num."' src='../images/sub/icon_arr_more.jpg' /></a>";
}
//로그인 하면 보이게 하는 구문.
if(($sessionLevel == "" || $sessionLevel == 3) && $row[general_setting] == 'on'){
$membersJapansName = "<div style='width:100%;text-align:center; padding-bottom:2.5em;'>".$membersJapansName."</div>";
$RESULT_CONTENT = $membersJapansName;
}else{
$RESULT_CONTENT = $RESULT_CONTENT;
}
if($row[voted_chk]){
$voted_img_tail = "on";
$voted_count_color = "#FF4D06";
}else{
$voted_img_tail = "off";
$voted_count_color = "#838383";
}
$BRD_LIST .="
<div class='post padding_s1' id='post".$Num."'>
<div class='btn_top'>
$MEM_ICON
</div>
<div class='post_date'>
<div class='date_tit_le'>$regdateArr[0].$regdateArr[1]</div>
<div class='date_tit_mi'>$regdateArr[2]</div>
<div class='date_tit_ri'> <h2>$is_notice_chk $row[subject] $is_secret_chk</h2></div>
</div>
<div id='list".$Num."' class='post_del'>
<div class='line_h23px padding_b_40 imgSize' style='word-break:break-all;'>$RESULT_CONTENT</div>
</div>
<div id='area".$Num."' class='post_social_area'>
<div class='le' id='voted_color_".$Num."' style='color:".$voted_count_color.";font-weight:bold;'><a href='javascript: content_like($Num,\"$tableName\",\"$sessionLevel\");'><img id='voted_img".$Num."' src='../images/sub/icon_mv_like_".$voted_img_tail.".png' /></a><span id='voted_number".$Num."' style='color:".$voted_count_color.";'>$row[voted_count]</span> 名</div>
<div class='ri'>
<ul >
<li><a href='javascript: pagePrint($Num);'><IMG src='../images/sub/icon_print.png'></a></li>
<!--<li><a href='javascript: content_like($Num);'><IMG src='../images/sub/icon_like_b.png'></a></li>-->
<li style=' position:relative; top:0; left:0; '>
<div id='tooltip".$Num."' style=' display:none; position:absolute; top:-90px; left:20px; z-index:5; width:50px; '>
<div style='background-color:#FFF; border:1px solid #999; border-bottom:none; text-align:center; line-height:50px;'>
<a href='javascript: sendSns(\"facebook\",\"www.yuchun.jp/news.php?tmp_no=$Num\",\"$row[subject]\");'><img src='../images/sub/sns_fb.png' width='30' height='30' style='margin:5px;' /></a><br>
<a href='javascript: sendSns(\"twitter\",\"www.yuchun.jp/news.php?tmp_no=$Num\",\"$row[subject]\");'><img src='../images/sub/sns_tw.png' width='30' height='30' style='margin:5px;' /></a><br>
</div>
<img src='../images/sub/tooltip_bottom.png' width='50' height='6' />
</div>
<a href='javascript:tooltip_open($Num);'><IMG src='../images/sub/icon_share.png'></a>
</li>
</ul>
</div>
</div>
</div>
";
}
}
?>
<div class="con_right" id="con_ls">
<?=$BRD_LIST?>
<div class="pagination02">
<?=$viewlist?>
</div>
</div>