Author Topic: IP adress not showing up as numbers  (Read 6367 times)

0 Members and 1 Guest are viewing this topic.

Offline BartAfterDark

  • Hero Member
  • *****
  • Posts: 520
    • View Profile
IP adress not showing up as numbers
« on: September 09, 2005, 07:18:04 PM »
hello.
When I look at the IP adress from the users who has commented.
They look like this: IP: 503e1197

Anyone knows what is wrong?

 - lars

Offline Xyu BAM

  • Full Member
  • ***
  • Posts: 145
    • View Profile
Re: IP adress not showing up as numbers
« Reply #1 on: September 10, 2005, 06:27:07 AM »
hmmm...this is HEX equivalent...not sure why is that, maybe if u tell us more about your server it could help and a link to phpinfo please ;)

Offline BartAfterDark

  • Hero Member
  • *****
  • Posts: 520
    • View Profile
Re: IP adress not showing up as numbers
« Reply #2 on: September 10, 2005, 10:51:25 AM »
it first started after i changed the userdb to phpbb's

Offline BartAfterDark

  • Hero Member
  • *****
  • Posts: 520
    • View Profile
Re: IP adress not showing up as numbers
« Reply #3 on: September 10, 2005, 03:23:18 PM »
Okay.
I think I found something

phpbb is using encoded hex numbers.

So I need to add this somehow

Code: [Select]
function decode_ip($int_ip)
{
$hexipbang = explode('.', chunk_split($int_ip, 2, '.'));
return hexdec($hexipbang[0]). '.' . hexdec($hexipbang[1]) . '.' . hexdec($hexipbang[2]) . '.' . hexdec($hexipbang[3]);
}

Offline Xyu BAM

  • Full Member
  • ***
  • Posts: 145
    • View Profile
Re: IP adress not showing up as numbers
« Reply #4 on: September 11, 2005, 08:29:40 AM »
first try to replace in details.php
Code: [Select]
        "comment_user_ip" => $comment_user_ip,
with:
Code: [Select]
        "comment_user_ip" => decode_ip($comment_user_ip),if it gives u error, then add that function into include/functions.php

Offline BartAfterDark

  • Hero Member
  • *****
  • Posts: 520
    • View Profile
Re: IP adress not showing up as numbers
« Reply #5 on: September 11, 2005, 12:22:25 PM »
doesn't work when I add it to the details.php file
error:
Code: [Select]
Fatal error: Call to undefined function decode_ip() in W:\www\details.php on line 412And I can't seem to find where in functions I have to add it.

Offline Xyu BAM

  • Full Member
  • ***
  • Posts: 145
    • View Profile
Re: IP adress not showing up as numbers
« Reply #6 on: September 11, 2005, 12:28:56 PM »
just add it to the end

Offline BartAfterDark

  • Hero Member
  • *****
  • Posts: 520
    • View Profile
Re: IP adress not showing up as numbers
« Reply #7 on: September 11, 2005, 09:38:49 PM »
it isn't as easy as that :/