달력스킨 적용

달력스킨 적용

QA

달력스킨 적용

본문

if(eregi('%', $width)) {
  $col_width = "14%"; //표의 가로 폭이 100보다 크면 픽셀값입력
} else{
  $col_width = round($width/7); //표의 가로 폭이 100보다 작거나 같으면 백분율 값을 입력
}
 
달력스킨을 다운받아 쓰는데
list.skin.php 에서
위 부분을 지우면 달력이 출력되고 삽입되면 백지로 나타나는데 무슨 이유인가요??ㅠ
 
 
 
아래는 코드 전문입니다.
고수님들의 도움요청합니다.
 
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
 
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);
 
if(eregi('%', $width)) {
  $col_width = "14%"; //표의 가로 폭이 100보다 크면 픽셀값입력
} else{
  $col_width = round($width/7); //표의 가로 폭이 100보다 작거나 같으면 백분율 값을 입력
}
$col_height= 80 ;//내용 들어갈 사각공간의 세로길이를 가로 폭과 같도록
$today = getdate();
$b_mon = $today['mon'];
$b_day = $today['mday'];
$b_year = $today['year'];
if($year < 1) { // 오늘의 달력 일때
  $month = $b_mon;
  $mday = $b_day;
  $year = $b_year;
}
 
$lastday=array(0,31,28,31,30,31,30,31,31,30,31,30,31);
if($year%4 == 0) $lastday[2] = 29;
$dayoftheweek = date("w", mktime (0,0,0,$month,1,$year));
?>
<style type="text/css">
.zp_schedule { border-collapse:collapse; border-spacing: 0 ; width:100%;}
.zp_schedule th,
.zp_schedule td { border:1px solid #DDDDDD; padding:5px 0px }
.zp_schedule th  { text-align:center; font-weight:bold; background:#F9F9F9; }    
</style>
 
<h2 id="container_title"><?php echo $board['bo_subject'] ?><span class="sound_only"> 목록</span></h2>
 
<!-- 게시판 목록 시작 { -->
<div id="bo_list" style="width:<?php echo $width; ?>">
 
    <!-- 게시판 페이지 정보 및 버튼 시작 { -->
    <div class="bo_fx">
        <div id="bo_list_total">
    <a href="<?php echo $_SERVER[PHP_SELF]."?bo_table=".$bo_table."&"?><?php if($month == 1) { $year_pre=$year-1; $month_pre=12; } else {$year_pre=$year; $month_pre=$month-1;} echo ("year=$year_pre&month=$month_pre");?>" target="_self" onfocus="this.blur()"> << </a>
    <a href="<?php echo $_SERVER[PHP_SELF]."?bo_table=".$bo_table."&"?>" onfocus="this.blur()"><strong><?php echo ("$year".년); ?></strong> <strong><?php echo ("$month".월); ?></strong></a>
    <a href="<?php echo $_SERVER[PHP_SELF]."?bo_table=".$bo_table."&"?><?php if($month == 12) { $year_pre=$year+1; $month_pre=1; } else {$year_pre=$year; $month_pre=$month+1;} echo ("year=$year_pre&month=$month_pre");?>" target="_self" onfocus="this.blur()"> >> </a>
 
        </div>
 
        <?php if ($rss_href || $write_href) { ?>
        <ul class="btn_bo_user">
            <?php if ($rss_href) { ?><li><a href="<?php echo $rss_href ?>" class="btn_b01">RSS</a></li><?php } ?>
            <?php if ($admin_href) { ?><li><a href="<?php echo $admin_href ?>" class="btn_admin">관리자</a></li><?php } ?>
            <?php if ($write_href) { ?><li><a href="<?php echo $write_href ?>" class="btn_b02">글쓰기</a></li><?php } ?>
        </ul>
        <?php } ?>
    </div>
    <!-- } 게시판 페이지 정보 및 버튼 끝 -->
 
<table class="zp_schedule">
<tr>
  <th><span style="color:#FF0000">일요일</span></th>
  <th>월요일</th>
  <th>화요일</th>
  <th>수요일</th>
  <th>목요일</th>
  <th>금요일</th>
  <th><span style="color:#0000FF">토요일</span></th>
</tr>
<?php
$cday = 1;
$sel_mon = sprintf("%02d",$month);
$query = "select * from $write_table where left(wr_1,6) <= '".$year.$sel_mon."'  and left(wr_2,6) >= '".$year.$sel_mon."'  order by wr_id asc";
$result = sql_query($query);
$j=0; // layer id
 
while ($row = sql_fetch_array($result)) {
  if( substr($row['wr_1'],0,6) <  $year.$sel_mon ) {
   $start_day =1;
   $start_day= (int)$start_day;
  } else {
   $start_day = substr($row['wr_1'],6,2);
     $start_day= (int)$start_day;
  }
 
  if( substr($row['wr_2'],0,6) >  $year.$sel_mon ) {
   $end_day = $lastday[$month];
   $end_day= (int)$end_day;
  } else {
   $end_day = substr($row['wr_2'],6,2);
   $end_day= (int)$end_day;
  }
 
  $imgown = 'icon';
 
  for ($i = $start_day ; $i <= $end_day;  $i++) {
 
    $j++; // layer ID
 
    $list['comment_cnt'] = "(".$row['wr_comment'].")";
    if($row['wr_comment'] == 0) {
      $list['comment_cnt'] = null ;
    } else {
 
      if($row['wr_last'] >= date("Y-m-d H:i:s", $g4['server_time'] - (24 * 3600))) {
        $list['comment_cnt'] = " (".$row['wr_comment'].")";
        if($list['comment_cnt']!=null) $list['comment_cnt'] = "<span class='small'>".$list['comment_cnt']."</span>";
      } else {
        $list['comment_cnt'] = "<span class='small'>".$list[$i]['comment_cnt']."</span>" ;
      }
    }
 
    $list['icon_new'] = null;
 
    
 
    $row['wr_subject'] = cut_str(get_text($row['wr_subject']),$board['bo_subject_len'],"..."); // subject length cut
 
    if($row['wr_datetime'

이 질문에 댓글 쓰기 :

답변 1

PHP 7.0 이상이면

eregi 함수가 제거되어 그런 것 같습니다

https://www.php.net/manual/en/function.eregi.php

preg_match() 나 strstr() 혹은 strpos() 같은 함수로 바꿔보세요

https://www.php.net/manual/en/function.preg-match.php

https://www.php.net/manual/en/function.strstr.php

 

if(strstr($width, '%')) {
  $col_width = "14%"; //표의 가로 폭이 100보다 크면 픽셀값입력
} else{
  $col_width = round($width/7); //표의 가로 폭이 100보다 작거나 같으면 백분율 값을 입력
}

 

답변을 작성하시기 전에 로그인 해주세요.
전체 1

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT