Not Solved IP addresses wrong format
#1
Not Solved
I am trying to call members' IP addresses in their member, but the IP addresses in the database return weird configurations, for example 2Y??.  How do I fix this?

IP's show up correctly in the post ip.
Reply
#2
Not Solved
IP addresses are stored in a binary format: http://php.net/manual/en/function.inet-ntop.php
[Image: banner.png]
Reply
#3
Not Solved
That link is way over my brain function. How do handle that information? The IP search function doesn't work because of the different format.
Reply
#4
Not Solved
Use in a plugin:
$somevar = my_inet_ntop($db->unescape_binary($memprofile['lastip']));
Or with Template Conditionals:
<?=my_inet_ntop($db->unescape_binary($memprofile['lastip']))?>
But you'll have to add my_inet_ntop and unescape_binary to inc/plugins/phptpl_allowed_funcs.txt
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)