달력에서 이미지만 뽑아 오고 싶습니다. 정보
달력에서 이미지만 뽑아 오고 싶습니다.관련링크
본문
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 = '14%';
$class = array();
$class[] = "sc_tit";
if ($i == 0)
$class[] = "sc_sun";
else if ($i == 6) {
$class[] = "sc_sat";
$width = '14%';
}
$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_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) {
while ($row=sql_fetch_array($result)) {
echo "<div align='center'>";
echo "<a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id=$row[wr_id]'>";
echo $day;
echo "</a>";
echo "</div>";
}
} else {
echo "<div align='center'>";
echo $day;
echo "</div>";
}
echo "</div>";
} else {
echo " ";
}
} else {
echo " ";
}
echo "</td>";
}
echo "</tr>\n";
if ($day >= $last_day)
break;
}
?>
</table>
</td>
<td width="500">
<?
$sql2 = " select bf_file from $g4[board_file_table] where bo_table='schedule' order by wr_id ";
$result2 = sql_query($sql2);
$num2 = @mysql_num_rows($result2);
if ($num2) {
while ($img=sql_fetch_array($result2)) {
echo $img[bf_file];
echo "<br/>";
}
}
?>
</td>
</tr>
</table>
<div align="center" style="padding-left:340px;padding-top:10px;">
<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");
include_once("$g4[bbs_path]/_tail.php");
?>
---------------------------
빨간색 부분이 글이 있으면 링크로 걸리면서 되는부분이구요.
파란색 부분이 파일명을 뽑아 오는 부분입니다.
제가 하고 싶은것은 달력 부분에 마우스 오버를 했을때
오른쪽에 이미지가 나오게 하고 싶은데요.
도저히 저 두 sql 문을 결부를 못시키겠네요.
머리가 나빠서겠죠..
도움 부탁드립니다 (__)
http://nakedweb.cafe24.com/skin/board/schedule/schedule.php?bo_table=schedule&schedule_ym=
댓글 전체
while ($row=sql_fetch_array($result)) {
$row['file']=get_file( "$g4[write_prefix]$bo_table", $row['wr_id']);
echo "<div align='center'>";
echo "<a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id=$row[wr_id]'>";
echo $day;
echo "</a>";
echo $row['file'][0]['view'];
echo "</div>";
}
첨부 파일이 있는지 부터 확인해 보세요. 그리고,
lib/common.php에 보면 다음 함수가 있습니다. 참고하세요.
// 게시글에 첨부된 파일을 얻는다. (배열로 반환)
function get_file($bo_table, $wr_id)