Forum

Forum - DatingScript

Online dating software

You are not logged in.

#1 2019-01-07 09:36:24

rdog
Member

search by IP address in CP

I was reading this thread https://www.datingscript.com/forum/view … hp?id=2663 and did the change in the search.php file but never seen any change in the CP to search for IP addresses, so not sure, what was suppose to change. anyone have a screen shot

vlad wrote:

This feature was already in place but actually stopped working after ip related changes in the database. You can get it working again by editing 'application/models/system/search.php' file. Around line 180 replace this code

$str = "HEX(`" . $prefix. "`.`ip_address`)=" . $this->db->escape(bin2hex(inet_pton($value)));
with this one

if ( substr($value, -1) == '*' )
{
    $str = "`" . $prefix. "`.`ip_address` BETWEEN UNHEX(" . $this->db->escape(bin2hex(inet_pton(substr($value, 0, -1) . '1'))) . ") AND UNHEX(" . $this->db->escape(bin2hex(inet_pton(substr($value, 0, -1) . '255'))) . ")";
}
else
{
    $str = "HEX(`" . $prefix. "`.`ip_address`)=" . $this->db->escape(bin2hex(inet_pton($value)));
}

Last edited by rdog (2019-01-07 09:37:11)

Offline

#2 2019-02-04 19:15:51

rdog
Member

Re: search by IP address in CP

Ok, I figured it out just put the IP address in the search text window, thought there would be a separate area to input the IP, but it's not.  so all is good

Offline

Board footer