관리자님 일정관리 스킨에서 질문 정보
관리자님 일정관리 스킨에서 질문
본문
안녕하세요. 새해 복 많이 받으세요.
아래 소스는 관리자님의 일정관리 스킨중 schedule.php 입니다.
아래 소스중 echo $row[wr_subject]; 옆에 wr_2 와 wr_3 여분필드를 출력하려면 어떻게 하는지요?
----------------------------------------------------------------------------------
<?
include_once("_common.php");
// 일정(스케쥴) 스킨
// 게시판의 wr_1 필드에 날짜 형식 20081216 일과 같은 yyyymmdd 형식으로 저장
if (!function_exists("get_first_day")) {
// mktime() 함수는 1970 ~ 2038년까지만 계산되므로 사용하지 않음
// 참고 : http://phpschool.com/bbs2/inc_view.html?id=3924&code=tnt2&start=0&mode=search&s_que=mktime&field=title&operator=and&period=all
function get_first_day($year, $month)
{
$day = 1;
$spacer = array(0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4);
$year = $year - ($month < 3);
$result = ($year + (int) ($year/4) - (int) ($year/100) + (int) ($year/400) + $spacer[$month-1] + $day) % 7;
return $result;
}
}
include_once("$g4[bbs_path]/board_head.php");
?>
<style>
#schedule_list .sc_ym { font: bold 25px "Trebuchet MS"; text-align:center; height:20px; }
#schedule_list .sc_tit { font: bold 17px Dotum; text-align:center; height:100px; }
#schedule_list .sc_sun { color:#ff0000; }
#schedule_list .sc_sat { color:#0000ff; }
#schedule_list .sc_day { font: normal 17px "Helvetica Neue"; height:100px; vertical-align:top; text-align:left; border:1px solid #ccc; padding:10px; }
#schedule_list .sc_day a { font: bold 17px "Helvetica Neue"; color:#009900; }
#schedule_list .sc_day .subject a { font: normal 12px Gulim; letter-spacing:-1px; color:#222222; height:14px; text-decoration:none; height:14px; width:70px; overflow:hidden; display:block; }
#schedule_list .sc_day .subject a:hover { text-decoration:underline; }
#schedule_list .sc_today { text-decoration: underline; }
</style>
<table width='100%' border='0' id='schedule_list'>
<?
// 오늘
$today = getdate($g4[server_time]);
$year = (int)substr($schedule_ym, 0, 4);
$month = (int)substr($schedule_ym, 4, 2);
if ($year < 1) $year = $today[year];
if ($month < 1 || $month > 12) $month = $today[mon];
$current_ym = sprintf("%04d%02d", $year, $month);
$end_day = array(1=>31, 28, 31, 30 , 31, 30, 31, 31, 30 ,31 ,30, 31);
// 윤년 계산 부분이다. 4년에 한번꼴로 2월이 28일이 아닌 29일이 있다.
if( $year%4 == 0 && $year%100 != 0 || $year%400 == 0 )
$end_day[2] = 29; // 조건에 적합할 경우 28을 29로 변경
// 해당월의 1일을 mktime으로 변경
$mktime = mktime(0,0,0,$month,1,$year);
$mkdate = getdate(strtotime(date("Y-m-1", $mktime)));
// 1일의 첫번째 요일 (0:일, 1:월 ... 6:토)
$first_day = get_first_day($year, $month);
// 해당월의 마지막 날짜,
$last_day = $end_day[$month];
if ($month - 1 < 1) {
$before_ym = sprintf("%04d%02d", ($year-1), 12);
} else {
$before_ym = sprintf("%04d%02d", $year, ($month-1));
}
if ($month + 1 > 12) {
$after_ym = sprintf("%04d%02d", ($year+1), 1);
} else {
$after_ym = sprintf("%04d%02d", $year, ($month+1));
}
echo "<tr>";
echo "<td colspan='2' align='right'><a href='$_SERVER[PHP_SELF]?bo_table=$bo_table&schedule_ym=$before_ym'><img src='img/month_prev.gif' border='0'></a></td>";
echo "<td colspan='3' align='center' class='sc_ym'>";
echo " $year / $month ";
echo "</td>";
echo "<td colspan='2' align='left'><a href='$_SERVER[PHP_SELF]?bo_table=$bo_table&schedule_ym=$after_ym'><img src='img/month_next.gif' border='0'></a></td>";
echo "</tr>";
// 요일
$yoil = array ("일", "월", "화", "수", "목", "금", "토");
echo "<tr>";
for ($i=0; $i<7; $i++) {
$width = '13%';
$class = array();
$class[] = "sc_tit";
if ($i == 0)
$class[] = "sc_sun";
else if ($i == 6) {
$class[] = "sc_sat";
$width = '12%';
}
$class_list = implode(" ", $class);
echo "<td class='$class_list' width='$width'>$yoil[$i]</td>";
}
echo "</tr>";
$cnt = $day = 0;
for ($i=0; $i<6; $i++) {
echo "<tr>";
for ($k=0; $k<7; $k++) {
$cnt++;
echo "<td class='sc_day'>";
if ($cnt > $first_day) {
$day++;
if ($day <= $last_day) {
$class = array();
// 오늘이라면
if ($today[year] == $year && $today[mon] == $month && $today[mday] == $day) {
$class[] = "sc_today";
}
$current_ymd = $current_ym . sprintf("%02d", $day);
if ($k == 0)
$class[] = "sc_sun";
else if ($k == 6)
$class[] = "sc_sat";
$class_list = implode(" ", $class);
echo "<div class='$class_list'>";
$sql = " select wr_subject, wr_id from $g4[write_prefix]$bo_table where wr_1 = '$current_ymd' and wr_is_comment = 0 order by wr_num ";
$result = sql_query($sql);
$num = @mysql_num_rows($result);
if ($num) {
echo "<a href='$g4[bbs_path]/board.php?bo_table=$bo_table&sfl=wr_1&stx=$current_ymd');\" title='일정건수 : {$row[cnt]}건'>";
echo $day;
echo "</a>";
while ($row=sql_fetch_array($result)) {
echo "<div class='subject'>";
echo "<a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id=$row[wr_id]'>";
echo $row[wr_subject];
echo "</a>";
echo "</div>";
}
} else {
echo $day;
}
echo "</div>";
} else {
echo " ";
}
} else {
echo " ";
}
echo "</td>";
}
echo "</tr>\n";
if ($day >= $last_day)
break;
}
?>
</table>
<div style="float:right;">
<a href="<?="$g4[bbs_path]/board.php?bo_table=$bo_table";?>"><img src="<?=$board_skin_path?>/img/btn_list.gif" border='0'></a>
<a href="<?="$g4[bbs_path]/write.php?bo_table=$bo_table";?>"><img src="<?=$board_skin_path?>/img/btn_write.gif" border='0'></a>
</div>
<?
include_once("$g4[bbs_path]/board_tail.php");
?>
아래 소스는 관리자님의 일정관리 스킨중 schedule.php 입니다.
아래 소스중 echo $row[wr_subject]; 옆에 wr_2 와 wr_3 여분필드를 출력하려면 어떻게 하는지요?
----------------------------------------------------------------------------------
<?
include_once("_common.php");
// 일정(스케쥴) 스킨
// 게시판의 wr_1 필드에 날짜 형식 20081216 일과 같은 yyyymmdd 형식으로 저장
if (!function_exists("get_first_day")) {
// mktime() 함수는 1970 ~ 2038년까지만 계산되므로 사용하지 않음
// 참고 : http://phpschool.com/bbs2/inc_view.html?id=3924&code=tnt2&start=0&mode=search&s_que=mktime&field=title&operator=and&period=all
function get_first_day($year, $month)
{
$day = 1;
$spacer = array(0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4);
$year = $year - ($month < 3);
$result = ($year + (int) ($year/4) - (int) ($year/100) + (int) ($year/400) + $spacer[$month-1] + $day) % 7;
return $result;
}
}
include_once("$g4[bbs_path]/board_head.php");
?>
<style>
#schedule_list .sc_ym { font: bold 25px "Trebuchet MS"; text-align:center; height:20px; }
#schedule_list .sc_tit { font: bold 17px Dotum; text-align:center; height:100px; }
#schedule_list .sc_sun { color:#ff0000; }
#schedule_list .sc_sat { color:#0000ff; }
#schedule_list .sc_day { font: normal 17px "Helvetica Neue"; height:100px; vertical-align:top; text-align:left; border:1px solid #ccc; padding:10px; }
#schedule_list .sc_day a { font: bold 17px "Helvetica Neue"; color:#009900; }
#schedule_list .sc_day .subject a { font: normal 12px Gulim; letter-spacing:-1px; color:#222222; height:14px; text-decoration:none; height:14px; width:70px; overflow:hidden; display:block; }
#schedule_list .sc_day .subject a:hover { text-decoration:underline; }
#schedule_list .sc_today { text-decoration: underline; }
</style>
<table width='100%' border='0' id='schedule_list'>
<?
// 오늘
$today = getdate($g4[server_time]);
$year = (int)substr($schedule_ym, 0, 4);
$month = (int)substr($schedule_ym, 4, 2);
if ($year < 1) $year = $today[year];
if ($month < 1 || $month > 12) $month = $today[mon];
$current_ym = sprintf("%04d%02d", $year, $month);
$end_day = array(1=>31, 28, 31, 30 , 31, 30, 31, 31, 30 ,31 ,30, 31);
// 윤년 계산 부분이다. 4년에 한번꼴로 2월이 28일이 아닌 29일이 있다.
if( $year%4 == 0 && $year%100 != 0 || $year%400 == 0 )
$end_day[2] = 29; // 조건에 적합할 경우 28을 29로 변경
// 해당월의 1일을 mktime으로 변경
$mktime = mktime(0,0,0,$month,1,$year);
$mkdate = getdate(strtotime(date("Y-m-1", $mktime)));
// 1일의 첫번째 요일 (0:일, 1:월 ... 6:토)
$first_day = get_first_day($year, $month);
// 해당월의 마지막 날짜,
$last_day = $end_day[$month];
if ($month - 1 < 1) {
$before_ym = sprintf("%04d%02d", ($year-1), 12);
} else {
$before_ym = sprintf("%04d%02d", $year, ($month-1));
}
if ($month + 1 > 12) {
$after_ym = sprintf("%04d%02d", ($year+1), 1);
} else {
$after_ym = sprintf("%04d%02d", $year, ($month+1));
}
echo "<tr>";
echo "<td colspan='2' align='right'><a href='$_SERVER[PHP_SELF]?bo_table=$bo_table&schedule_ym=$before_ym'><img src='img/month_prev.gif' border='0'></a></td>";
echo "<td colspan='3' align='center' class='sc_ym'>";
echo " $year / $month ";
echo "</td>";
echo "<td colspan='2' align='left'><a href='$_SERVER[PHP_SELF]?bo_table=$bo_table&schedule_ym=$after_ym'><img src='img/month_next.gif' border='0'></a></td>";
echo "</tr>";
// 요일
$yoil = array ("일", "월", "화", "수", "목", "금", "토");
echo "<tr>";
for ($i=0; $i<7; $i++) {
$width = '13%';
$class = array();
$class[] = "sc_tit";
if ($i == 0)
$class[] = "sc_sun";
else if ($i == 6) {
$class[] = "sc_sat";
$width = '12%';
}
$class_list = implode(" ", $class);
echo "<td class='$class_list' width='$width'>$yoil[$i]</td>";
}
echo "</tr>";
$cnt = $day = 0;
for ($i=0; $i<6; $i++) {
echo "<tr>";
for ($k=0; $k<7; $k++) {
$cnt++;
echo "<td class='sc_day'>";
if ($cnt > $first_day) {
$day++;
if ($day <= $last_day) {
$class = array();
// 오늘이라면
if ($today[year] == $year && $today[mon] == $month && $today[mday] == $day) {
$class[] = "sc_today";
}
$current_ymd = $current_ym . sprintf("%02d", $day);
if ($k == 0)
$class[] = "sc_sun";
else if ($k == 6)
$class[] = "sc_sat";
$class_list = implode(" ", $class);
echo "<div class='$class_list'>";
$sql = " select wr_subject, wr_id from $g4[write_prefix]$bo_table where wr_1 = '$current_ymd' and wr_is_comment = 0 order by wr_num ";
$result = sql_query($sql);
$num = @mysql_num_rows($result);
if ($num) {
echo "<a href='$g4[bbs_path]/board.php?bo_table=$bo_table&sfl=wr_1&stx=$current_ymd');\" title='일정건수 : {$row[cnt]}건'>";
echo $day;
echo "</a>";
while ($row=sql_fetch_array($result)) {
echo "<div class='subject'>";
echo "<a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id=$row[wr_id]'>";
echo $row[wr_subject];
echo "</a>";
echo "</div>";
}
} else {
echo $day;
}
echo "</div>";
} else {
echo " ";
}
} else {
echo " ";
}
echo "</td>";
}
echo "</tr>\n";
if ($day >= $last_day)
break;
}
?>
</table>
<div style="float:right;">
<a href="<?="$g4[bbs_path]/board.php?bo_table=$bo_table";?>"><img src="<?=$board_skin_path?>/img/btn_list.gif" border='0'></a>
<a href="<?="$g4[bbs_path]/write.php?bo_table=$bo_table";?>"><img src="<?=$board_skin_path?>/img/btn_write.gif" border='0'></a>
</div>
<?
include_once("$g4[bbs_path]/board_tail.php");
?>
댓글 전체
echo $row[wr_subject].$row[wr_2].$row[wr_3];
답변 감사합니다.^^;
근데 그렇게 하면 안나옵니다.ㅜㅜ
근데 그렇게 하면 안나옵니다.ㅜㅜ
리스트페이지라면 ..
오늘 아래
$wr_2=nl2br($list[$i][wr_2]);
$wr_3=nl2br($list[$i][wr_3]);
실제 출력할 부분에
echo "{$wr_2}{$wr_3}";
를 넣어 주면 될거 같긴 한데 .. 저도 안해봤음 무슨 스킨인지 모르니깐 그냥 상식적으로는 이렇게 하면
되긴 할거 같긴 한데 말이죠 ..
오늘 아래
$wr_2=nl2br($list[$i][wr_2]);
$wr_3=nl2br($list[$i][wr_3]);
실제 출력할 부분에
echo "{$wr_2}{$wr_3}";
를 넣어 주면 될거 같긴 한데 .. 저도 안해봤음 무슨 스킨인지 모르니깐 그냥 상식적으로는 이렇게 하면
되긴 할거 같긴 한데 말이죠 ..
답변 감사합니다.
역시 안되네요 ㅡㅡ
역시 안되네요 ㅡㅡ