Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Who's Online Enhancement 1.4


Guest

Recommended Posts

WOL is trying to reach another site to get IP's, and that site is not responding for now..

//Function to get IP address geolocation data from IPInfoDB and update whos_online table

http://ipinfodb.com/

 

Quick fix:

in catalog/admin/whos_online.php find:

 

//Use backup server if cannot make a connection

if (!$d){

//$backup = file_get_contents("http://backup.ipinfo...ry2.php?ip=$ips");

$ch = curl_init();

$URL = ("http://ipinfodb.com/...ry2.php?ip=$ips");

 

Change the last line to:

 

$URL = ("http://backup.ipinfo...ry2.php?ip=$ips");

 

This is working fine here..

Link to comment
Share on other sites

Quick fix:

in catalog/admin/whos_online.php find:

 

//Use backup server if cannot make a connection

if (!$d){

//$backup = file_get_contents("http://backup.ipinfo...ry2.php?ip=$ips");

$ch = curl_init();

$URL = ("http://ipinfodb.com/...ry2.php?ip=$ips");

 

Change the last line to:

 

$URL = ("http://backup.ipinfo...ry2.php?ip=$ips");

 

This is working fine here..

Perfect!! It works!!

 

Thanks!!

Link to comment
Share on other sites

Quick fix:

in catalog/admin/whos_online.php find:

 

//Use backup server if cannot make a connection

if (!$d){

//$backup = file_get_contents("http://backup.ipinfo...ry2.php?ip=$ips");

$ch = curl_init();

$URL = ("http://ipinfodb.com/...ry2.php?ip=$ips");

 

Change the last line to:

 

$URL = ("http://backup.ipinfo...ry2.php?ip=$ips");

 

This is working fine here..

Ok.. thanks.. I have this error (Fatal error: Call to undefined function get_isp_icon() in /home/xxx/public_html/xxx/whos_online.php on line 717) .

 

you help me?

 

Thanks.. :)

Link to comment
Share on other sites

Ok.. thanks.. I have this error (Fatal error: Call to undefined function get_isp_icon() in /home/xxx/public_html/xxx/whos_online.php on line 717) .

 

At top of your file /home/xxx/public_html/xxx/whos_online.php you should have this line:

require(DIR_WS_FUNCTIONS . 'whos_online.php');

 

That's call to the file admin/includes/functions/whos_online.php where the function (get_isp_icon) is located.

Link to comment
Share on other sites

At top of your file /home/xxx/public_html/xxx/whos_online.php you should have this line:

require(DIR_WS_FUNCTIONS . 'whos_online.php');

 

That's call to the file admin/includes/functions/whos_online.php where the function (get_isp_icon) is located.

Thanks.. I have this require(DIR_WS_FUNCTIONS . 'whos_online.php') in admin/whos_online.php.. where I can find the problem '?

Link to comment
Share on other sites

Thanks.. I have this require(DIR_WS_FUNCTIONS . 'whos_online.php') in admin/whos_online.php.. where I can find the problem '?

 

 

Look in the (online) file admin/includes/functions/whos_online.php to see that the file is the right one and that the function is there..(around line 151)

Link to comment
Share on other sites

Look in the (online) file admin/includes/functions/whos_online.php to see that the file is the right one and that the function is there..(around line 151)

Yes I have in line 151 this function function get_isp_icon($hostname) { etc.. :(

 

 

EDIT::

Ok.. Ok.. I check the file and now work..

 

Thanks.. :)

Edited by romand700
Link to comment
Share on other sites

Quick fix:

in catalog/admin/whos_online.php find:

 

//Use backup server if cannot make a connection

if (!$d){

//$backup = file_get_contents("http://backup.ipinfo...ry2.php?ip=$ips");

$ch = curl_init();

$URL = ("http://ipinfodb.com/...ry2.php?ip=$ips");

 

Change the last line to:

 

$URL = ("http://backup.ipinfo...ry2.php?ip=$ips");

 

This is working fine here..

 

 

Thank you very much!

 

Solved my problem.

Link to comment
Share on other sites

  • 2 months later...

Hi everyone,

 

I'm using Who's Online 3.6.6 and I've noticed an intermittent problem that has popped up every few weeks or so over the past 4 months.

 

[09-Nov-2010 18:55:24] PHP Warning: gethostbyaddr() [<a href='function.gethostbyaddr'>function.gethostbyaddr</a>]: Address is not a valid IPv4 or IPv6 address in /home/user/public_html/includes/functions/whos_online.php on line 45

[09-Nov-2010 19:01:05] PHP Warning: gethostbyaddr() [<a href='function.gethostbyaddr'>function.gethostbyaddr</a>]: Address is not a valid IPv4 or IPv6 address in /home/user/public_html/includes/functions/whos_online.php on line 45

 

lines 35-49 of includes/functions/whos_online.php:

function wo_get_host_from_addr($ip_address) {
 //Get hostname from IP address
 if (strstr($ip_address, ',')) {
   //if multiple responses, use first one
   $ips = explode(',', $ip_address);
   $ip_address = $ips[0];
 }
 if ($ip_address == 'unknown') {
   $hostname = $ip_address;
 } else {
   $hostname = gethostbyaddr($ip_address);
 }
 return $hostname;			

}

 

Is this some coding error or could it be some problem with my hosting service? I'm using a shared server for a few more weeks.

 

Thanks

Link to comment
Share on other sites

I am running whos online 3.6.6 everythings works except that it is not storing any of the Geo data into the database (country_code country_name region_name city latitude longitude). When I go into whos online in the the admin panel everthing seems to be ok but of course the Geo data fields are blank.

 

If I use PHPMyAdmin to manually enter data into the Geo data fields, they are correctly displayed in the admin whos online panel.

 

Can anyone tell me where the code to store the Geo data is located or why it is not being stored?

Link to comment
Share on other sites

I am running whos online 3.6.6 everythings works except that it is not storing any of the Geo data into the database (country_code country_name region_name city latitude longitude). When I go into whos online in the the admin panel everthing seems to be ok but of course the Geo data fields are blank.

 

If I use PHPMyAdmin to manually enter data into the Geo data fields, they are correctly displayed in the admin whos online panel.

 

Can anyone tell me where the code to store the Geo data is located or why it is not being stored?

 

That's because ipinfodb.com just discontinued their old API and started a new one that requires free registration and API key...

http://ipinfodb.com/

Link to comment
Share on other sites

That's because ipinfodb.com just discontinued their old API and started a new one that requires free registration and API key...

http://ipinfodb.com/

 

 

THANKS!!! I registered with them and got the new API key. Now where do I put it? I did a quick search throught the files but it is not obvious where the key goes.

Link to comment
Share on other sites

hmm, bad news it seems...ipinfodb.com wrote "To streamline our maintenance, ipinfodb.com regrets to announce the removal of the Multiple Query APIs" which means (if I read it right) that we are no longer able to use this service with any script that requires multiple queries, like "Who's online"...any alternatives or any way to make it work?

Edited by dr_lucas
Link to comment
Share on other sites

Ok, the new update fixed the problem and everything is up and working again - except one thing - the pins on the map.

 

At one time, many months ago, the pins were displayed on the map correctly. Now the map comes up and no pins. Is this a function that is permently gone? Is there a fix for this? Have I done something wrong? Does anyone still have this function working? If it is permantly gone, why still have the option of showing a map of the world?

Link to comment
Share on other sites

Have I said something to upset everybody? All other posts seem to get replies but mine don't seem to appear on anybody else's radar! I've asked twice about these problems but not a single comment!

 

save yourself the time and aggravation and stop whatever your trying to do with this contribution, work backwards to get it completely out of your store and move on. This contribution cause more problems than it's worth. the SQL queries are all screwed up, the Google API field where you enter the key doesn't show up in the admin...I hag it working for a little bit then it completely failed. Tried to install again and it's screwing up the SQL saying there's a "country_name" somewhere in the field and the store goes blank.....

who cares where the customers are from as long as they're on your site....just my opinion tho....:angry:

Link to comment
Share on other sites

  • 2 weeks later...

Hello,

 

I've already installed Who's Online Enhancement 3.7 "successfully".

I have also included my GoogleMaps and IPinfodb API keys.

I have changed admin/images CHMOD to 777.

 

But there are a couple of things that doesn't work:

 

1) It doesn't shows any information about IP addresses (neither Country nor city nor flag).

 

2) GoogleMap doesn't show locations. I suppose it's due to the first problem.

 

Any help, please?

Link to comment
Share on other sites

Hello,

 

I've already installed Who's Online Enhancement 3.7 "successfully".

I have also included my GoogleMaps and IPinfodb API keys.

I have changed admin/images CHMOD to 777.

 

But there are a couple of things that doesn't work:

 

1) It doesn't shows any information about IP addresses (neither Country nor city nor flag).

 

2) GoogleMap doesn't show locations. I suppose it's due to the first problem.

 

Any help, please?

Link to comment
Share on other sites

I addes the 3.7 changes as well. Everything works except the flags do not appear on the map. So the two problems may not be related.

 

I had to tweak the a few files to add in the location of my files on the website (visitors_georss.php).

Link to comment
Share on other sites

I addes the 3.7 changes as well. Everything works except the flags do not appear on the map. So the two problems may not be related.

 

I had to tweak the a few files to add in the location of my files on the website (visitors_georss.php).

 

What did you do to adjust it? Can you give me some information about those tweaks please?

 

Thank you in advance

Link to comment
Share on other sites

I'm still looking for the bug which makes this addon work unproperly at my osCommerce 2.2-MS2 (neither flags nor user's geographic information is showed).

 

I've done some code changes in order to isolate the problem. At admin/whos_online.php I have included some data informations manually (IP address to be sure that there is an entry at whos_online table with that IP -that data information is showed because is included by other different function-, and Town)...

 

function updateIps($ips){

//Old,incesure method

//$d = file_get_contents("http://ipinfodb.com/ip_query2.php?ip=$ips");

 

//Load the class

$ipinfodb = new ipinfodb;

$ipinfodb->setKey('My API Key from IPinfodb);

 

//Explode the IP list

$ipsArr = explode(",",$ips);

 

if (sizeof($ipsArr) > 0){

$nb_results = sizeof($ipsArr);

for ($i=0;$i<$nb_results;$i++){

$answer = $ipinfodb->getGeoLocation($ipsArr[$i]);

 

$ip = "95.XX.XX.XX";

//$ip = mysql_real_escape_string($ipsArr[$i]);

$country_code = mysql_real_escape_string($answer['CountryCode']);

$country_name = mysql_real_escape_string($answer['CountryName']);

$region_name = mysql_real_escape_string($answer['RegionName']);

$city = "Pamplona";

//$city = mysql_real_escape_string($answer['City']);

$latitude = mysql_real_escape_string($answer['Latitude']);

$longitude = mysql_real_escape_string($answer['Longitude']);

$ip_update_sql = "UPDATE `" . TABLE_WHOS_ONLINE . "` SET `country_code` = '$country_code',`country_name` = '$country_name', `region_name` = '$region_name', `city` = '$city', `latitude` = '$latitude', `longitude` = '$longitude' WHERE `ip_address` = '$ip'";

tep_db_query($ip_update_sql);

}

}

}

 

Result: my active user (as I have accessed store) now shows properly value "Pamplona" at City field.

If I change to "$ip = mysql_real_escape_string($ipsArr[$i]);" it continues working...so initial string arrives and is able to read IP address. In my opinion there are 2 possible causes for the bug:

 

1) $answer = $ipinfodb->getGeoLocation($ipsArr[$i]); doesn't work properly and doesn't pass information to variable $answer

 

2) mysql_real_escape_string($answer[XXXXXXXXXX']); commands aren't working so, information is not properly passed to variables despite arriving properly to string.

 

But my programming knowledge is extremely reduced so I can't find a solution...anybody can help me, please?

Thank you in advance.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...