$instPath = explode("/counter/counter.html", __FILE__);
$noSession = "yes";
include $instPath[0]."/lib/link";
if($counterApply != "done") {
/// ÆäÀÌÁöº° Hit ¼ö ///////////////
$counter_q1 = mysqlQuery(" select count(code) from n_counterPage where pageUrl = '$PHP_SELF' ");
$counter_c1 = mysqlFetch($counter_q1);
if($counter_c1[0] == 0) { $counter_q2 = mysqlQuery(" insert into n_counterPage(code, pageName, pageUrl, count) values('', '', '$PHP_SELF', 1) ");
} else { $counter_q2 = mysqlQuery(" update n_counterPage set count = count + 1 where pageUrl = '$PHP_SELF' ");
}
///////////////////////////////////
/// Á¢¼Ó¼¼ºÎÇöȲ //////////////////
$counter_q1 = mysqlQuery(" select count(code) from n_counter where ip = '$REMOTE_ADDR' and browser = '$HTTP_USER_AGENT' and visited > date_sub(now(), interval 60 minute) ");
$counter_c1 = mysqlFetch($counter_q1);
if($counter_c1[0] == 0) {
if(!$HTTP_REFERER) { $HTTP_REFERER = "µµ¸ÞÀÎÁÖ¼Ò ÀÔ·Â(¶Ç´Â Áñ°Üã±â)"; }
$counter_q2 = mysqlQuery(" insert into n_counter(code, visited, ip, browser, path, visit) values('', now(), '$REMOTE_ADDR', '$HTTP_USER_AGENT', '$HTTP_REFERER', '$PHP_SELF') ");
}
///////////////////////////////////
$counterApply = "done";
}
if($counterDate == 't') {
$counter_q1 = mysqlQuery(" select count(code) from n_counter ");
$counter_c1 = mysqlFetch($counter_q1);
$counterTotal = sprintf('%07d', $counter_c1[0]);
for($i=0;$i<7;$i++) { echo "
"; }
} else if($counterDate == 'h') {
$counter_q1 = mysqlQuery(" select count from n_counterPage where pageUrl = '$PHP_SELF' ");
$counter_c1 = mysqlFetch($counter_q1);
$counterHit = sprintf('%07d', $counter_c1[0]);
for($i=0;$i<7;$i++) { echo "
"; }
} else if($counterDate == '') {
// do not display
} else if($counterDate == '0') {
$counter_q1 = mysqlQuery(" select now() ");
$counter_c1 = mysqlFetch($counter_q1);
$countComp = dateFormat($counter_c1[0]);
$counter_q2 = mysqlQuery(" select count(code) from n_counter where visited like '$countComp[0]-$countComp[1]-$countComp[2] %' ");
$counter_c2 = mysqlFetch($counter_q2);
$counterToday = sprintf('%07d', $counter_c2[0]);
for($i=0;$i<7;$i++) { echo "
"; }
} else {
$counterDate = abs($counterDate);
if($counterDate != 0) {
$counter_q1 = mysqlQuery(" select date_sub(now(), INTERVAL $counterDate DAY) ");
$counter_c1 = mysqlFetch($counter_q1);
$countComp = dateFormat($counter_c1[0]);
$counter_q2 = mysqlQuery(" select count(code) from n_counter where visited like '$countComp[0]-$countComp[1]-$countComp[2] %' ");
$counter_c2 = mysqlFetch($counter_q2);
$counterBefore = sprintf('%07d', $counter_c2[0]);
for($i=0;$i<7;$i++) { echo "
"; }
}
}
?>
/*----------------------------------------------------------------
ÆÄ ÀÏ ¸í : counter.html
------------------------------------------------------------------
»ç ¿ë ¿ä ¾à : [ÀϹÝ] Ä«¿îÅÍ Àû¿ë ¹× Ç¥½Ã
------------------------------------------------------------------
°³ ¹ß ÀÚ : ±è¿ìÇö
------------------------------------------------------------------
µð ÀÚ ÀÎ : ±è¹Î¾Æ
------------------------------------------------------------------
Á¦ÀÛ ½ÃÀÛÀÏ : 2003/05/02
------------------------------------------------------------------
¼ö Á¤ ³» ¿ë : ¼öÁ¤ÀÏ :
¼öÁ¤ÀÚ :
³» ¿ë :
------------------------------------------------------------------*/
?>