웹마스터 팁
IP 주소 4자리수 모두 공개하는 방법
2008.09.11 08:41
이 사이트에서 제로님은 물론, 많은 분들의 도움을 많이 받아 저도 사이트에 좀 기여하는 게 있어야 할 것 같아서 올려봅니다.
아이피 주소가 세자리수만 공개되게 되어 있는데 modules/document/document.item.php에 관련 부분이 있습니다. 아래와 같습니다.
function getIpaddress() {
if($this->isGranted()) return $this->get('ipaddress');
return preg_replace('/([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/','*.$2.$3.$4', $this->get('ipaddress'));
}
여기서 맨 아랫줄의 *라고 된 부분을 $1로 변경하면 4자리수가 모두 공개됩니다.
위의 것은 다큐먼트고, 댓글의 경우에는,
modules/comment/comment.item.php에 있는
function getIpaddress() {
if($this->isGranted()) return $this->get('ipaddress');
return preg_replace('/([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/','*.$2.$3.$4', $this->get('ipaddress'));
}
여기서 맨 아랫줄의 *라고 된 부분을 $1로 변경하면 댓글에서도 4자리수가 모두 공개됩니다.