달력게시판.. // 자답 > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

달력게시판.. // 자답 정보

달력게시판.. // 자답

본문

현재 사용하는 달력게시판입니다.
현재 출력 순서가 게시판 번호순으로 출력이 되는데
이걸 예약시간 (wr_2) 를 기점으로 출력을 하고 싶습니다.

참고로 wr_1 에는 예약날짜를 wr_2 에는 예약시간을 여분필드로 잡았습니다.

아래는 list.skin.php 코드 입니다. 어떤 부분을 고쳐야지 제가 원하는대로 나올까요?


<?php
include_once($board_skin_path . '/lib/skin.lib.php');
$VAR['today'] = date('Ymd');
$VAR['select'] = date('Ym');
if(preg_match('/^[0-9]{6}$/', $_GET['schedule_ym']) == true && checkdate(substr($_GET['schedule_ym'], 4, 2), 1, substr($_GET['schedule_ym'], 0, 4)) == true) $VAR['select'] = $_GET['schedule_ym'];
$VAR['timestamp'] = strtotime($VAR['select'] . '01');
$VAR['weekday'] = date('w', $VAR['timestamp']);
$VAR['count'] = date('t', $VAR['timestamp']) + $VAR['weekday'] + 1;
$VAR['path'] = "{$g4['bbs_path']}/board.php?bo_table={$bo_table}";
?>
<br>
<link rel="stylesheet" type="text/css" href="<?php echo $board_skin_path; ?>/css/list.skin.css" />
<script type="text/javascript" src="<?php echo $board_skin_path; ?>/js/list.skin.js" charset="<?php echo $g4['charset']; ?>"></script>
<center id="G4_LIST" style="width:<?php echo $width; ?>;">
	<p class="subject">
		<a href="<?php echo phpself('schedule_ym', date('Ym', strtotime('-1 month', $VAR['timestamp']))); ?>"><img src="<?php echo $board_skin_path; ?>/img/b_prev_month.gif" alt="이전달" /></a>
		&nbsp; &nbsp;
		<a href="<?php echo $VAR['path'] . "&schedule_ym={$VAR['select']}"; ?>"><strong><?php echo date('Y년 m월', $VAR['timestamp']); ?></strong></a>
		&nbsp; &nbsp;
		<a href="<?php echo phpself('schedule_ym', date('Ym', strtotime('+1 month', $VAR['timestamp']))); ?>"><img src="<?php echo $board_skin_path; ?>/img/b_next_month.gif" alt="다음달" /></a>
	</p>
	<table>
		<tr>
			<td class="sunday"><strong class="white">일</strong></td>
			<td class="weekday"><strong class="white">월</strong></td>
			<td class="weekday"><strong class="white">화</strong></td>
			<td class="weekday"><strong class="white">수</strong></td>
			<td class="weekday"><strong class="white">목</strong></td>
			<td class="weekday"><strong class="white">금</strong></td>
			<td class="saturday"><strong class="white">토</strong></td>
		</tr>
		<tr>
		<?php
		for($i = $row = 1; $i < $VAR['count']; $i++, $row++)
		{
			$date = $i - $VAR['weekday'];
			if($date < 1) echo '<td class="default">&nbsp;</td>';
			else
			{
				$wr_1 = $VAR['select'] . sprintf('%02d', $date);
				if($VAR['today'] == $wr_1) $date = "<ins>{$date}</ins>";
				$schedule = null;
				$query = sql_query("SELECT wr_id,wr_2,  wr_name FROM {$write_table} WHERE wr_1 = '{$wr_1}' AND wr_is_comment = 0");
				while($result = mysql_fetch_array($query))
				{
					$schedule .= "<div><a href=\"{$VAR['path']}&wr_id={$result['wr_id']}\">{$result['wr_2']}&nbsp;&nbsp;{$result['wr_name']}</a></div>";
				}
				if($schedule) $date = "<strong class=\"red\">{$date}</strong>";
				echo "<td class=\"default\"><div>{$date}</div>{$schedule}</td>";
			}
			if($row > 0 && $row % 7 == 0 && $row < $VAR['count']) echo '</tr><tr height="100">';
		}
		$count = 7 - (($row - 1) % 7);
		if($count != 7)
		{
			for($i = 1; $i <= $count; $i++) echo '<td class="default">&nbsp;</td>';
		}
		?>
		</tr>
	</table>
	<?php if($admin_href || !$member['mb_id'] || $write_href){ ?>
	<p class="button">
		<?php if($admin_href) echo "<input type=\"button\" name=\"write\" value=\"관리자\" class=\"root\" onclick=\"window.document.location.href='{$admin_href}';\" />"; ?>
		<?php if(!$member['mb_id']) echo "<input type=\"button\" name=\"write\" value=\"로그인\" class=\"button\" onclick=\"window.document.location.href='{$g4['bbs_path']}/login.php?url={$urlencode}';\" />"; ?>
		<?php if($write_href) echo "<input type=\"button\" name=\"write\" value=\"예약하기\" class=\"button\" onclick=\"window.document.location.href='{$write_href}';\" />"; ?>
	</p>
	<?php } ?>
</center>



적고보니 오름차순을 넣으면 되는걸 깜박했네요..

선착순 1분 2천 포인트 드립니다 ㅠㅠ

댓글 전체

전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

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