RadarURL
웹 프로그래밍

제로보드에서 나이의 상중하를 표기해주 방법

by JaeSoo posted Feb 02, 2007
?

단축키

Prev이전 문서

Next다음 문서

ESC닫기

크게 작게 위로 아래로 댓글로 가기 인쇄





음.. 단순하게 나이의 많고 적음을 표시해줍니다. 리디님 팁 보구 다 따라 했습니다..ㅡㅡ;;
자세히 몰라 필요 없는 부분이 많이 들어가 있을 수 있습니다.

해당스킨의 setup.php 를 열고 적당한데에 아래 소스 삽입.

<?
//Birth matching
function birth_matching($member_no) {
global $connect, $member_table;
if($member_no) {
$data=mysql_fetch_array(mysql_query("select birth from $member_table where no='$member_no'"));
$date=timestamp2date($data[birth]);
$target_birth=$date[1];
$birth_month=$date[2];
$birth_date=$date[3];
$member=member_info();

if (8<$member[level]) $bm=" ";
else{
        $date=timestamp2date($member[birth]);
        $my_birth=$date[1];
        if ($my_birth - $target_birth > 0) $bm="<img src=skin/nzeo_ver3/elder.gif border=0 align=absmiddle alt='".$birth_month."월 ".$birth_date."일'>"; // 나이많은 사람 표시용 아이콘
        elseif ($my_birth - $target_birth < 0) $bm="<img src=skin/nzeo_ver3/little.gif border=0 align=absmiddle alt='".$birth_month."월 ".$birth_date."일'>"; // 나이 어린사람 표시용 아이콘
        elseif ($my_birth - $target_birth == 0) $bm="<img src=skin/nzeo_ver3/friend.gif border=0 align=absmiddle alt='".$birth_month."월 ".$birth_date."일'>"; // 동갑 아이콘
}
echo "$bm";
}
}
?>

해당스킨의 view.php에 적당한 곳에 소스 삽입.

<?=birth_matching($data[ismember])?>

해당스킨의 view_comment.php에 적당한 곳에 소스 삽입.

<?=birth_matching($c_data[ismember])?>

하시면 되겠습니다. 남녀를 구분해서 가입 받았다면 나눌수 있겠고..
나이차를 새분화 해서 할부지, 삼춘, 형 등으로 나누어도 좋을꺼 같습니다. (__*)

스샷의 화살표 부분이 적용부분입니다.

-------------------------------------------------------------------
alt 메세지에 생일이 나오도록 수정했습니다. ^^*


출처 : http://www.nzeo.com/bbs/zboard.php?id=cgi_tip&page=3&sn1=&divpage=1&sn=off&ss=on&sc=off&keyword=포인트&select_arrange=headnum&desc=asc&no=5968

Articles

1 2 3 4 5 6 7 8 9 10