Å×½ºÆ®¸¦ Á÷Á¢ Çغ¸Áú¾Ê¾Æ¼ ¿¡·¯°¡ ³¯ ¼öµµ ÀÖ½À´Ï´Ù.
function friends_birthday($year)
{
$f[2002] = array(
112 => 'È«±æ¼ø', /*** 1¿ù12ÀÏÀÌ È«±æ¼ø »ýÀÏ ***/
123 => 'È«±æµ¿',
501 => '¾Æ¹«°³', /*** 5¿ù 01ÀÏ ***/
1010=> '¾Æ¹«°³2' /*** 10¿ù 10ÀÏ ***/
...
);
$f[2003] = array(
111 => 'È«±æ¼ø', /*** 1¿ù11ÀÏÀÌ È«±æ¼ø »ýÀÏ ***/
124 => 'È«±æµ¿',
501 => '¾Æ¹«°³', /*** 5¿ù 01ÀÏ ***/
1010=> '¾Æ¹«°³2' /*** 10¿ù 10ÀÏ ***/
...
);
return $f[$year];
}
function today_birthday($time=0, $img='/images/birthday.gif', $border=1)
{
global $_SERVER; // for PHP/4.0.x
if(!$time) $time = time();
$key = date('nd', $time); // moon + day
$f = friends_birthday(date('Y',$time));
if($f[$key]) {
$birthday = "¿À´ÃÀº $f[$key]´ÔÀÇ »ýÀÏÀÔ´Ï´Ù.";
$imgsize = preg_match(';^/;',$img) ?
@GetImageSize($_SERVER[DOCUMENT_ROOT].$img) : @GetImageSize($img);
$birthday = "\n
\n$birthday";
$BR = "\n
\n";
}
if($f[++$key])
{ $birthday .= "$BR³»ÀÏÀº $f[$key]´ÔÀÇ »ýÀÏÀÔ´Ï´Ù."; }
return $today;
}
## ±âÁ¸ÀÇ public_hday() ÇÔ¼ö¸¦ ¼öÁ¤ÇÒ °æ¿ì
##
function public_hday($time=0, $img=array('/images/taegkgi.gif','/images/birthday.gif'), $border=1)
{
global $_SERVER; // for PHP/4.0.x
if(!$img[0]) $img[0] = '/images/taegkgi.gif';
if(!$img[1]) $img[1] = '/images/birthday.gif';
if(!$time) $time = time();
$key = date('nd', $time); // moon + day
$year = date('Y', $time);
$flag = array(301=>1, 606=>1, 717=>1, 815=>1, 1003 =>1); // bad in_array()
$p = public_calender($year);
$f = friends_birthday($year);
if($p[$key]) {
$public = "¿À´ÃÀº $p[$key]ÀÔ´Ï´Ù.";
if($flag[$key]) {
$imgsize = preg_match(';^/;',$img[0]) ?
@GetImageSize($_SERVER[DOCUMENT_ROOT].$img[0]) : @GetImageSize($img[0]);
$public = "\n
\n$public";
}
$BR[0] = "\n
\n";
}
if($f[$key]) {
$birthday = "¿À´ÃÀº $f[$key]´ÔÀÇ »ýÀÏÀÔ´Ï´Ù.";
$imgsize = preg_match(';^/;',$img[1]) ?
@GetImageSize($_SERVER[DOCUMENT_ROOT].$img[1]) : @GetImageSize($img[1]);
$birthday = "\n
\n$birthday";
$BR[1] = "\n
\n";
}
if($p[++$key]) $public .= "$BR[0]³»ÀÏÀº $p[$key]ÀÔ´Ï´Ù.";
if($f[$key]) $birthday .= "$BR[1]³»ÀÏÀº $f[$key]´ÔÀÇ »ýÀÏÀÔ´Ï´Ù."; // $f[++$key]°¡ ¾Æ´Ô
## or
## return array('public'=>$public, 'birthday'=>$birthday);
##
return $today . $BR[0] . $birthday;
}