일정달력입니다. > 그누4 스킨

그누4 스킨

스킨의 저작권은 해당 스킨 제작자님께 있으며, 그누보드의 저작권과 다를 수 있습니다.
스킨 다운로드시 좋아요와 감사의 코멘트를 남기시면 제작자에게 큰 힘이됩니다. ^^y
그누보드와 관련이 있지만 스킨과 빌더가 아니면 플러그인 게시판에 올려주세요.

일정달력입니다. 정보

달력 일정달력입니다.

첨부파일

달력.zip (73.7K) 899회 다운로드 2007-01-05 17:05:43

본문

먼저 웹디님께서 만드신 달력을 조금 수정하였습니다.

달력에 일정이 들어가있으면 일정이 들어가있는 부분이 bg색상으로

나타납니다. 그리고 일정을 클릭하면 새창으로 일정의 내용을 보여줍니다.

허접하지만 잘 필요하신분들은 사용하세요
추천
1

댓글 전체

압축을 풀면

pop_schedule.php 파일은 그누폴더에 넣으시고요

calendars이 폴더는 최근게시물 스킨 폴더에 넣으시면 됩니다.

그리고 달력호출을

<? echo latest_schedule("폴더명","테이블명"); ?>

이렇게 하시면 됩니다.
설치를 해봤는데요..
다른건 다 잘되는데, 일정을 등록하고 나서 확인해보면 다음달에도 같을 날짜로
색상이 등록되어져있습니다. 그다음달도 계속요..~
저만 그런건가요...다른분들은 안그런가요?
혹시 확인되시면 업그레이드 된 파일 좀 올려주세요^^
수고하세요..
다음달에도 같은 날짜로 일정이 등록되는것을 수정하였습니다.

아래 소스를 덮어쓰세요

latest.skin.php파일을 수정하였여습니다.

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
global $is_admin;

// 글자 색상

$weekday_color = "#000000"; // 평일

$saturday_color = "#000000"; // 토요일

$sunday_color = "#FF3300"; // 일요일 (공휴일)

// 배경 색상

$title_bgcolor = "#F6F6F6";

$today_bgcolor = "yellow"; // 오늘

$select_bgcolor = "#BAFFF6"; // 선택일
$dlfwjd = "#99CCFF";//일정배경색



// 요일

$yoil = array ("일", "월", "화", "수", "목", "금", "토");



// 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 spacer($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;

}



$yyyy = $_REQUEST[yyyy];

$mm = $_REQUEST[mm];



// 오늘

$today = getdate($g4[server_time]);

$mon  = substr("0".$today[mon],-2);

$mday = substr("0".$today[mday],-2);



if (!$yyyy) $yyyy = $today['year'];

if (!$mm) $mm = $today['mon'];



$yyyy = (int)$yyyy;

$mm = (int)$mm;



$f = @file("$g4[path]/bbs/calendar/$yyyy.txt");

if ($f) {

    while ($line = each($f)) {

        $tmp = explode("|", $line[value]);

        $nal[$tmp[0]] = $tmp;

        //print_r2($nal);

    }

}



$spacer = spacer($yyyy, $mm);



$endday = array(1=>31, 28, 31, 30 , 31, 30, 31, 31, 30 ,31 ,30, 31);

// 윤년 계산 부분이다. 4년에 한번꼴로 2월이 28일이 아닌 29일이 있다.

if( $yyyy%4 == 0 && $yyyy%100 != 0 || $yyyy%400 == 0 )

    $endday[2] = 29; // 조건에 적합할 경우 28을 29로 변경



// 해당월의 1일

$mktime = mktime(0,0,0,$mm,1,$yyyy);

$dt = getdate(strtotime(date("Y-m-1", $mktime)));



$dt[wday] = $spacer;



// 해당월의 마지막 날짜,

//$last_day = date("t", $mktime);

$last_day = $endday[$mm];



$yyyy_before = $yyyy;

$mm_before = $mm - 1;

if ($mm_before < 1)

{

    $yyyy_before--;

    $mm_before = 12;

}



$yyyy_after = $yyyy;

$mm_after = $mm + 1;

if ($mm_after > 12)

{

    $yyyy_after++;

    $mm_after = 1;

}



$yyyy_before_href = "$_SERVER[PHP_SELF]?yyyy=".($yyyy-1)."&mm={$mm}";

$yyyy_after_href = "$_SERVER[PHP_SELF]?yyyy=".($yyyy+1)."&mm={$mm}";

$mm_after_href = "$_SERVER[PHP_SELF]?yyyy={$yyyy_after}&mm={$mm_after}";

$mm_before_href = "$_SERVER[PHP_SELF]?&yyyy={$yyyy_before}&mm={$mm_before}";



?>



<!-- Line top start -->

<table width="232" cellpadding="0" cellspacing="0" border="0" align="center">

<tr>

<td><img src="<?=$latest_skin_path?>/img/out_bco01.gif" width="7"></td>

<td background="<?=$latest_skin_path?>/img/out_bbg01.gif"></td>

<td><img src="<?=$latest_skin_path?>/img/out_bco02.gif" width="6"></td>

</tr>

<tr>

<td background="<?=$latest_skin_path?>/img/out_bbg02.gif"></td>

<td>

<!-- Line top end -->

<!-- Title start -->

<table width="100%" cellpadding="0" cellspacing="0" border="0">

<tr height="28">
<td width='5'></td>

<td height="20" class='cookie'><a href="<?=$g4['path']?>/bbs/board.php?bo_table=<?=$bo_table?>" onfocus=this.blur()><img src="<?=$latest_skin_path?>/img/title.jpg" border="0"></a></td>

<td><a href='<?=$mm_before_href?>'><img src="<?=$latest_skin_path?>/img/icon_prev01.gif" width="8" height="9" border="0" align="absmiddle"></a><b><font style='font-family:쿠키; font-size:9pt; color:#FB6900;'>&nbsp;<?=$yyyy?>/<?=$mm?></font></b>

<a href='<?=$mm_after_href?>'><img src="<?=$latest_skin_path?>/img/icon_next01.gif" width="8" height="9" border="0" align="absmiddle"></a><? if ($is_admin == "super") { ?><a href='<?=$g4[path]?>/bbs/board.php?bo_table=calendar'>admin
</a><?}?>
</td>

</tr>

</table>

<table width="100%" cellpadding="0" cellspacing="0" border="0">

<tr><td height="1" bgcolor="#E9E9E9"></td></tr>

<tr><td height="5"></td></tr>

</table>

<!-- Title end -->

<table width="210" cellpadding="0" cellspacing="0" border="0" align="center" >

<tr>

<td valign="top">

<table width=100% cellpadding=0 cellspacing=1 border=0 bgcolor="#E9E9E9">

<tr height="15" bgcolor="<?=$title_bgcolor?>" align="center">

<td width=14% style="color:<?=$sunday_color?>"><img src="<?=$latest_skin_path?>/img/sun.jpg"></td>

<td width=14% style="color:<?=$weekday_color?>"><img src="<?=$latest_skin_path?>/img/mon.jpg"></td>

<td width=14% style="color:<?=$weekday_color?>"><img src="<?=$latest_skin_path?>/img/tue.jpg"></td>

<td width=14% style="color:<?=$weekday_color?>"><img src="<?=$latest_skin_path?>/img/wed.jpg"></td>

<td width=14% style="color:<?=$weekday_color?>"><img src="<?=$latest_skin_path?>/img/thu.jpg"></td>

<td width=14% style="color:<?=$weekday_color?>"><img src="<?=$latest_skin_path?>/img/fri.jpg"></td>

<td width=14% style="color:<?=$saturday_color?>"><img src="<?=$latest_skin_path?>/img/sat.jpg"></td>

</tr>

<?

$cnt = $day = 0;

// 해당일에 글이 올라와 있는지 확인
$cday = 1;
$sel_mon = sprintf("%02d",$mon);
$today_sql = "SELECT * FROM $write_table WHERE left(wr_link1,6) <= '$yyyy$sel_mon'  and left(wr_link2,6) >= '$yyyy$sel_mon'  ORDER BY wr_id ASC";
$result=sql_query($today_sql);

// 포문 돌면서 해당일자 배열에 저장

for ($d=0; $row=sql_fetch_array($result); $d++){
$arry_day=substr($row[wr_link1],6,2);
$arry_name[$arry_day]=substr($row[wr_link1],0,8);
$arry_day=substr($row[wr_link2],6,2);
$arry_name[$arry_day]=substr($row[wr_link2],0,8);
$titals[$arry_day]=$row[wr_subject];

}

for ($i=0; $i<6; $i++)

{

echo "<tr>";

for ($k=0; $k<7; $k++)

{

$cnt++;

echo "<td style='background:#FFFFFF;' align=center>";

if ($cnt > $dt[wday])

{

$day++;

if ($day <= $last_day)

{

// 1같은경우 01로 변경

$mm2 = substr("0".$mm,-2);

$day2 =  substr("0".$day,-2);
if($arry_name[$day2]){

echo "<table width=100% height=100% cellpadding=0 cellspacing=0><tr><td class='cookie' style='padding:1px;font-size:8pt;' id='id$i$k' align=center style='cursor:hand;' title='{$titals[$day2]}' onclick=\"javascript:win_open('$g4[path]/pop_schedule.php?bo_table=$bo_table&year=$yyyy&month=$mm2&day=$day2', 'schedule', 'left=50, top=50, width=300, height=400, scrollbars=1');\">";
}else{
echo "<table width=100% height=100% cellpadding=0 cellspacing=0><tr><td class='cookie' style='padding:1px;font-size:8pt;' id='id$i$k' align=center title='{$titals[$day2]}'>";
}

// 배열의 값이 있는지 비교하여 글자색 변경

if ($arry_name[$day2]==$yyyy.sprintf("%02d",$mm).$day2){
echo "<script language='JavaScript'>document.getElementById('id$i$k').style.backgroundColor='$dlfwjd';</script>";

}

echo $day;

if ($arry_name[$day2]){

echo "";

}

echo "</td></tr></table>";

if ($k==0)

echo "<script language='JavaScript'>document.getElementById('id$i$k').style.color='$sunday_color';</script>";

else if ($k==6)

echo "<script language='JavaScript'>document.getElementById('id$i$k').style.color='$saturday_color';</script>";

else

echo "<script language='JavaScript'>document.getElementById('id$i$k').style.color='$weekday_color';</script>";

$tmp_date = $yyyy.substr("0".$mm,-2).substr("0".$day,-2);

$tmp = $mm2."-".$day2;

if ($nal[$tmp])

{

$title = trim($nal[$tmp][1]);

//echo $title;

echo "<script language='JavaScript'>document.getElementById('id$i$k').title='{$title}';</script>";

if (trim($nal[$tmp][2]) == "*")

echo "<script language='JavaScript'>document.getElementById('id$i$k').style.color='$sunday_color';</script>";

}

// 오늘이라면

if ($today[year] == $yyyy && $today[mon] == $mm && $today[mday] == $day)

{

echo "<script language='JavaScript'>document.getElementById('id$i$k').style.backgroundColor='$today_bgcolor';</script>";

echo "<script language='JavaScript'>document.getElementById('id$i$k').title+='[오늘]';</script>";

}

// 선택일(넘어온 값) 이라면

else if ($tmp_date == $cur_date)

{

echo "<script language='JavaScript'>document.getElementById('id$i$k').style.backgroundColor='$select_bgcolor';</script>";

echo "<script language='JavaScript'>document.getElementById('id$i$k').title+='[선택일]';</script>";

}

} else

echo "&nbsp;";

} else

echo "&nbsp;";

echo "</td>";

}

echo "</tr>\n";

if ($day >= $last_day)

break;

}

?>

</table>

</td>

</tr>

<tr><td height="5"></td></tr>

</table>



<!-- Line bottom start -->

</td>

<td background="<?=$latest_skin_path?>/img/out_bbg03.gif"></td>

</tr>

<tr>

<td><img src="<?=$latest_skin_path?>/img/out_bco03.gif" width="7" height="6"></td>

<td background="<?=$latest_skin_path?>/img/out_bbg04.gif"></td>

<td><img src="<?=$latest_skin_path?>/img/out_bco04.gif" width="6" height="6"></td>

</tr>

</table>
<!-- Line bottom end -->
압축을 풀면

pop_schedule.php 파일은 그누폴더에 넣으시고요

calendars이 폴더는 최근게시물 스킨 폴더에 넣으시면 됩니다.

그리고 달력호출을

<? echo latest_schedule("폴더명","테이블명"); ?>

이렇게 하시면 됩니다. 압축을 풀면

pop_schedule.php 파일은 그누폴더에 넣으시고요

calendars이 폴더는 최근게시물 스킨 폴더에 넣으시면 됩니다.

그리고 달력호출을

<? echo latest_schedule("폴더명","테이블명"); ?>

이렇게 하시면 됩니다.


>> 이렇게 하면...

<? echo latest_schedule("calendars","calendar"); ?>

Fatal error: Call to undefined function: latest_schedule()  이렇게 나와요.

파일(/bbs에 위치), 폴더(/bbs/lastes/calendars에 위치) 위치 맞구요...

펑션을 호출을 못하는걸 보면...
저 펑션이 기본적으로 포함 안하는것 같은데요, 어디가가 저 펑션 있는 부분을 호출해야 할거 같은...
저두  NEON 님과 같은 증상인데요
<? echo latest_schedule("calendars","calendar"); ?>
latest 폴더 안에 calendars 폴더 넣구 게시판calendar 테이블 만들구 했는데요
아래와같은 문구 뜨네요
Fatal error: Call to undefined function: latest_schedule()
도움점 주세요^^;
이틀 걸려서 찾았네요  안찾아질때는 정말 안찾아져요 ㅠ 감사합니다.

해당 함수를 호출하지 못해서 발생하는 에러 입니다.

1. ./lib/latest.lib.php 파일을 열어서 맨아래에 다음을 추가한다.
//=============================================================
function latest_schedule($skin_dir='', $bo_table)
{
    global $config;
    global $g4;
global $year, $month;

    // 스킨디렉토리값이 넘어왔다면
    if ($skin_dir) {
        $latest_skin_path = "./$g4[path]/skin/latest/$skin_dir";
    }

    $write_table = $g4[write_prefix] . $bo_table;
 
    ob_start();
    include "$latest_skin_path/latest.skin.php";
    $content = ob_get_contents();
    ob_end_clean();

    return $content;
}
//==============================================================
에고 죄송합니다.

제가 바뿐써 이제서야 게시물을 보았네요..

해결방법을 올리려고 하니 별이아빠님께서 해결해주셔네요 감사합니다.
감사합니다. 잘 사용하고 있습니다. 
사용중 괜찮은 아이디어가 생각나 몇자 적어봅니다.
금일 일정이 팝업스타일이 아니라, 일정달력옆(우측)에 오늘일정이 일정달력의 높이절반 정도로 간략히 보이고, 하단에 주간일정이 보이는 형식으로는 리스트화되는 스타일도 멋질 거 같습니다.
그러게되면 일정달력이 약간 커져서 우측의 오늘/주간일정 레이아웃으로 구성이 되는 방식이되면 어떨까하는 생각입니다.
전 다음달 일정이 자꾸 이번달 일정과 똑같아요,
latest.skin.php를 조 위에 있는걸루 바꾸면 오류가 나구요.
잘 되시는 분들 좀 알려 주세요~
전체 74 |RSS
그누4 스킨 내용 검색 달력에서

회원로그인

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