Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

View Counter


Recommended Posts

@@Jack_mcs

Hi Jack (I ran out of time in my previous post so here again, updated)

 

Just downloaded a dif version of the DB form IP2Location, and problem appears to be solved.

Now have to sort out problem as per post #246.

What I have noticed is that if I "delete" view_counterDB.BIN from the directory view_counter, nothing changes, which tells me (I think) Ive done something wrong with the BIN file. I downloaded, extracted, changed the file name, and uploaded. So Im not sure what to try next to ensure that I have in fact extracted the zip file.

Many thanks


Kind regards

Grandp

Link to comment
Share on other sites

@@Jack_mcs

Hi Jack

 

Apologies should have referred to post 346.

@@Jack_mcs

Hi Jack

 

Love this.

I nearly got 100% correct, just one question.

When I go to admin>View Count> Reports>IP Counts, then hover over the IP address; country code, country name,region name and  city name, are all blank, so I must have uploded something to the incorrect place. I suspect it may have something to do with

" rename it to view_counterDB.BIN and upload it into the view_counter directory in the root of the shop.I really was unsure where to load it, but currently have it under IP2Location.php as view_counterDB.BIN The code for my downloa

Warning: Illegal string offset 'Country Code' in /home/XXXX/public_html/BS234FINAL/adnin/includes/modules/view_counter/view_counter_report_ip_count.php on line 42

d from IP2Loacation web site was DB3LITEBIN  (at the moment the shop is in a sub directory)

Any thoughts, or is this what I should expect.

 

Many thanks

Grandp

I have just found another problem when I click on IP Counts I get

Warning: unpack(): Type V: not enough input, need 4, have 0 in /home/XXXXX/public_html/BS234FINAL/view_counter/IP2Location.php on line 376

and at the bottom of the page

Warning: Illegal string offset 'Country Code' in /home/XXXXX/public_html/BS234FINAL/admin/includes/modules/view_counter/view_counter_report_ip_count.php on line 42

Maybe I should delete everything and do a complete reinstall.

 

Cheers

 

Grandp

Edited by grandpaj
Link to comment
Share on other sites

For the unpack problem, there was a similar problem before and it was due to changes by the company providing the databases. Try going here,  download the zip package, extract the ip2location-php and upload it to the view_counter directory. For the other offset warnings, they can safely be ignored. 

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

@@Jack_mcs

Hi Jack

 

Getting closer, did as you sugested and now get only this in IP Count

Fatal error: Class 'IP2Location' not found in /home/XXXXX/public_html/BS234FINAL/XXXXX/includes/functions/view_counter.php on line 315

I think I'm about to give up.

 

Any thoughts on this one.

 

Cheers

 

Grandp

Link to comment
Share on other sites

@@Jack_mcs

Hi Jack

 

Well seem to have pretty much everything working. Sooooo many thanks for your help.

Not sure about the hacking report.

 

Ive really no idea what I did.

 

Cheers

 

Grandpa

Link to comment
Share on other sites

@@Jack_mcs

Hi Jack

As I suspected, Hacker Report shows dozens of the following:

Warning: Illegal string offset 'file_name' in /home/XXXX/public_html/BS234FINAL/admin/includes/functions/view_counter.php on line 97

Warning: Illegal string offset 'arg' in /home/XXXX/public_html/BS234FINAL/admin/includes/functions/view_counter.php on line 97

line 97 is as follows

 if (preg_match('/' . $test . '/', $view['file_name']) || preg_match('/' . $test . '/', $view['arg'])) {

And in IP Tracker get this message.

Fatal error: Class 'IP2Location' not found in /home/XXXXX/public_html/BS234FINAL/XXXXX/includes/functions/view_counter.php on line 315

line 315 is

$vcCountry = new IP2Location('../view_counter/view_counterDB.BIN', IP2Location::FILE_IO); //fastest

Any thoughts.

 

Many thanks

 

Grandpa

Edited by grandpaj
Link to comment
Share on other sites

As mentioned previously, the Illegal string offset warnings can be ignored. I posted the fix for some of them in earlier posts that may apply to those. The fata error of Class 'IP2Location' not found can't be ignored. Do you have a directory named view_counter in the root of your shop? Is there a file in it named Class IP2Location.php? If so, assuming the xxxxx in what you posted is your admin, then the code may not be able to find the shop. Is the root of the shop in a different directory than your admin directory is in?

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

@@Jack_mcs

 

Hi Jack

 

the "shop" which is one I use to try things out b4 going to the live shop is at; home/XXX/public_html/BS345FINAL. I wonder if this could be causing the problem. Maybe should I backup the live site and then install View counter there.

I do have a directory called  view_counter and a file in called IP2Location.php

 

Cheers

Grandp

Link to comment
Share on other sites

@@Jack_mcs

 

Hi Jack

 

Here's the latest and final I hope.

Have had a look back throught the thread and found all the answers as you mentioned (Many thanks).

 

All I have left is this

Fatal error: Class 'IP2Location' not found in /home/XXXX/public_html/BS234FINAL/admin/includes/functions/view_counter.php on line 322

Line 22 as follows

$vcCountry = new IP2Location('../view_counter/view_counterDB.BIN', IP2Location::FILE_IO); //fastest

Can't seem to find the answer to this.

 

Cheers

Grandp

Link to comment
Share on other sites

A few lines above the one you show is this line

require_once('../view_counter/IP2Location.php');

That is trying to load that file from the shop side. If the file isn't there or If the path isn't correct, you will get the failure you are seeing.

 

If your admin directory is loaded in a different directory than the shop, then the paths in the above two commands have to be changed.

 

The structure has to be like this for most shops.

 

home/XXX/public_html/BS345FINAL

  has directory named admin

  has directory named view_counter

     has file named IP2Location.php

     has file named view_counterDB.BIN'

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

@@Jack_mcs

 

Hi Jack

 

Me again

 

What does ...Class 'IP2Location' not found in...mean. I know a file is being looked for, but which one I have no idea

Every thing in the addon seems to be in its right place, with the exception of this problem. I have a directory called view_counter which has theses 2 files in it IP2Location.php and  view_counterDB.BIN. This directory is immediatley below includes,pub etc.

I did install this addon in the live shop but had the same problem/Warning so uninstalled it.

(I do have a renamed admin)

 

Cheers

Grandp

Edited by grandpaj
Link to comment
Share on other sites

@@Jack_mcs

 

Hi Jack

 

Hopefully last time.

 

FINALLY Managed to get things sorted on the test shop now for the live shop

 

Although when I use View Counter monitor and check vistitors no details show although I have been on the site and clicked in various places, and when I check Whos Online in admin it shows me being online.

 

Any thoughts

 

Cheers

Grandp

Edited by grandpaj
Link to comment
Share on other sites

Are you sure it is enabled in the settings?  What was the problem you found that got it to work? Others may run into the same problem so it would be useful to post the fix.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

@@Jack_mcs

Hi Jack

 

This will be my last post here, if I can't sort this Im giving up Ive spent about 4 days trying to get this going.

I have View counter set to true in config.

All the files are in public/XXXX/public_html/BS234FINAL and where appropriate public/XXXX/public_html/BS234FINAL/renamed admin

For some reason the following has returned,

Fatal error: Class 'IP2Location' not found in /home/XXXX/public_html/BS234FINAL/admin/includes/functions/view_counter.php on line 322

How to fix I have no idea now

require_once('../view_counter/IP2Location.php'); so

 changed to
require_once('..BS2324FINAL/view_counter/IP2Location.php'); That didn't work

Line 322 as foll

$vcCountry = new IP2Location('../view_counter/view_counterDB.BIN', IP2Location::FILE_IO); //fastest

Any other thoughts

 

Many thanks for your help and patience.

 

Cheers

Grandp

Link to comment
Share on other sites

The way the code works is that it loads in the IP2Location.php file and then tries to access it. If you look in that file you will see "class IP2Location". That is what the code uses and the error is saying it can't be found. The error is showing the name of the admin as admin but since you say that is not the case it would appear your admins configure file is not setup correctly.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

@@Jack_mcs

 

Hi Jack

 

Thanks for your reply. Now I follow (I think)

 

I have no idea about the admin area and when set up was more or less by good luck. Can you tell me please what I need to change.

define('HTTP_SERVER', 'http://grandpas.co.nz');
  define('HTTPS_SERVER', 'http://grandpas.co.nz');
  define('ENABLE_SSL', false);
  define('HTTP_COOKIE_DOMAIN', '');
define('HTTPS_COOKIE_DOMAIN', '');
  define('HTTP_COOKIE_PATH', '/BS234FINAL/Admin');
  define('HTTPS_COOKIE_PATH', '/BS234FINAL/Admin');
  define('HTTP_CATALOG_SERVER', 'http://grandpas.co.nz');
  define('HTTPS_CATALOG_SERVER', 'http://grandpas.co.nz');
  define('ENABLE_SSL_CATALOG', 'false');
  define('DIR_FS_DOCUMENT_ROOT', '/home/XXXXX/public_html/BS234FINAL/');
  define('DIR_WS_ADMIN', '/BS234FINAL/MAdmin/');
  define('DIR_WS_HTTPS_ADMIN', '/BS234FINAL/Admin/');
  define('DIR_FS_ADMIN', '/home/grandp/public_html/BS234FINAL/Admin/');
  define('DIR_WS_CATALOG', '/BS234FINAL/');
  define('DIR_WS_HTTPS_CATALOG', '/BS234FINAL/');
  define('DIR_FS_CATALOG', '/home/XXXXX/public_html/BS234FINAL/');
  define('DIR_WS_IMAGES', 'images/');
  define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
  define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . 'images/');
  define('DIR_WS_INCLUDES', 'includes/');
  define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
  define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
  define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
  define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
  define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
  define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG . 'includes/languages/');
  define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');
  define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');
  define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');
  
  define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');
  define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
  define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');
  

Hopefully now wer'e making progress.

 

Many thanks

 

Grandp

Edited by grandpaj
Link to comment
Share on other sites

The following all except one say the name of the admin is Admin. The exception says it is named MAdmin. They all need to use the correct name.

  define('HTTP_COOKIE_PATH', '/BS234FINAL/Admin');
  define('HTTPS_COOKIE_PATH', '/BS234FINAL/Admin');

  define('DIR_WS_ADMIN', '/BS234FINAL/MAdmin/');
  define('DIR_WS_HTTPS_ADMIN', '/BS234FINAL/Admin/');
  define('DIR_FS_ADMIN', '/home/grandp/public_html/BS234FINAL/Admin/');

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

@@Jack_mcs

 

Hi Jack

The MAdmin was a typo (apologies) as the admin is named something else, I just went thru the original config file and changed the name to admin so as the real name didn't become public knowledge.

So I guess the admin area looks correct.

The IP2Location.php file is in /home/XXXX/public_html/BS234FINAL/view_counter

 

If I use IP2Location.php as included in the download I get

Warning: unpack(): Type V: not enough input, need 4, have 0 in /home/XXXX/public_html/BS234FINAL/view_counter/IP2Location.php on line 376

Warning: Illegal string offset 'Country Code' in /home/XXXXX/public_html/BS234FINAL/renamed admin/includes/modules/view_counter/view_counter_report_ip_count.php on line 42

if I download latest from IP2 web site (hopefully the correct download) IPSLocation-PHP-MODULE-master then extract the IP2Location.php file,extract  and then upload I then get the error

Fatal error: Class 'IP2Location' not found in /home/XXXX/public_html/BS234FINAL/admin/includes/functions/view_counter.php on line 323

Which I guess doesn't work with the addon unless something is changed in the code, or maybe there is another download for IP2Location.php.This download doesn't appear to have Class.IP2Location in it, so maybe hence the problem

 

Cheers

Grandp

 

PS here's a link http://lite.ip2location.com/database/ip-country-region-city-latitude-longitude   or

http://lite.ip2location.com/database/ip-country

Edited by grandpaj
Link to comment
Share on other sites

For the database, please be sure you are downloading the IPV4 BIN version.

 

I download the IP2Location package from here and it is quite different than the one included in the addon. You may want to try downloading a database from that page instead of the one you mentioned. Once you have that database file uploaded, test it with both of the IP2Location files to see if either works.

 

For what it's worth, I just install this the other day and it worked fine with the files from the addon and a database from the site you mention. So it seems like it is something with your installation but that new file on their site confuses things.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

@@Jack_mcs

 

Hi Jack

 

That got rid of the errors.

Im still running the original IP2Location.php file and downloaded the DB file as you suggested.

 

However the Country code,is blank, country name  ?8:?A , city etc are all still blank  or should I keep trying various DB downloads

 

Any thoughts on View Monitor. I click around the shop site 3 - 5 times but nothing appears on the View Monitor when the visitors radio button is clicked. I have the view monitor set to True in the config with everything else set as downloaded (default) maybe there is something else or perhaps I have stuffef up a file somewhere.

 

Cheers and many thanks

Grandpa

Edited by grandpaj
Link to comment
Share on other sites

@@Jack_mcs

 

Hi Jack.

 

Well all seems to be working but I get this when in SHOW either Visitors or All

Fatal error: Uncaught exception 'Exception' with message 'invalid data, remaining: 7lZCet3-ygqX2Rpx1RNNeJImENsnbOARnvbG1dbW3wew0LEayBKS3QZzx4xq_S1LfzI3eph1Vb-_YCqfcmHlBcj1BEO8Tgbu1nS9jm_EtPw_FSPClAzA7F3XCN4izXMvrnAuzR2OKt3A8uHrcXTIsuy0g3qcXzppkKWsxUVmqiGCLZ8sjvhykcUpfcc4JbgriLJBrS-LnJBKttPSIjfQEKiJnM5lIjGKlHrnd1gMAxHWT_cRPI9mwcXox9f3TCTNgEPlBa7oP-VmA49VCeupnUuFymY7WBg4BOmLbKnxbgmz-04__voAYivIFv-plq2WTJfj8P66M0GMAj0dvRkPZpCJ0O44DigsgMVm9cdDvc5KTXU0WNhQQ1MKyeE3xvWFzmVzlw9dlj7lsrAsIq318UBM9yN0VjaU1orfgbJ4BZ1t8bXmP_8UeWMZeJwSR4yle4A2hkBWREnLgMeLX28SqIyYw0sL4aYizRH6XZY6jqkNrKdXo0JOd4Y_3Mq9F8t3GTELja-jItqQS9UMWKCkrW4GtwDV_kvteOiCjwaI3HHjgClTmhztK5GK-Nm0k_--7BAMW9KrhRy4ERUooCdLgV3ycBCmmcgZTr2kM6Fj97OtW2xoxJp_vhmA9aVAsIM_' in /home/xxxxxx/public_html/renamed admin/includes/functions/view_counter.php:1721 Stack trace: #0 /home/xxxx/public_html/renamed admin/includes/functions/view_counter.php(1318): UnserializeSession('7lZCet3-ygqX2Rp...') #1 /home/xxxx/public_html/renamed admin/view_counter.php(679): ShowCart('02c99f8e99c2 in /home/xxxx/public_html/renamed admin/includes/functions/view_counter.php on line 1721

Ive tried googling and searching thru this forum but haven't found a satisfactory answer. I have uninstalled and reinstalled the DB. In the addon package there is anupdate DB does this need to be executed.

 

Cheers

 

Grabdpa

Link to comment
Share on other sites

It seems your shops configure file is not correct. The failure is showing the shop is in the root but you said it was in the BS234FINAL directory.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

@@Jack_mcs

 

Hi Jack

 

My sincere apologies. I should have told you that I have now installed the addon into the live shop and this is where the error FATAL error happens I have included the config file from the admin of the shop, just in case. (its not to say that the error was not also in the test site, as I couldn't really "test" it as I had no visitors of any kind except me when clicking around the test site shop)

The admin has been renamed from what it actually is to admin for security purpose.I did see that there was a very similar question a few pages back in the forum. I tried the suggested fix but that didn't fix. below is the error again ( to save you searching plus the admin config.) What I have noticed is that if I uninstall and reinstall the DB all works absolutely fine,until  I the go the View Counter and look at any Report, then go back to View Counter Monitor . > Visitors, the error as described shows up.

Fatal error: Uncaught exception 'Exception' with message 'invalid data, remaining: 7lZCet3-ygqX2Rpx1RNNeJImENsnbOARnvbG1dbW3wew0LEayBKS3QZzx4xq_S1LfzI3eph1Vb-_YCqfcmHlBcj1BEO8Tgbu1nS9jm_EtPw_FSPClAzA7F3XCN4izXMvrnAuzR2OKt3A8uHrcXTIsuy0g3qcXzppkKWsxUVmqiGCLZ8sjvhykcUpfcc4JbgriLJBrS-LnJBKttPSIjfQEKiJnM5lIjGKlHrnd1gMAxHWT_cRPI9mwcXox9f3TCTNgEPlBa7oP-VmA49VCeupnUuFymY7WBg4BOmLbKnxbgmz-04__voAYivIFv-plq2WTJfj8P66M0GMAj0dvRkPZpCJ0O44DigsgMVm9cdDvc5KTXU0WNhQQ1MKyeE3xvWFzmVzlw9dlj7lsrAsIq318UBM9yN0VjaU1orfgbJ4BZ1t8bXmP_8UeWMZeJwSR4yle4A2hkBWREnLgMeLX28SqIyYw0sL4aYizRH6XZY6jqkNrKdXo0JOd4Y_3Mq9F8t3GTELja-jItqQS9UMWKCkrW4GtwDV_kvteOiCjwaI3HHjgClTmhztK5GK-Nm0k_--7BAMW9KrhRy4ERUooCdLgV3ycBCmmcgZTr2kM6Fj97OtW2xoxJp_vhmA9aVAsIM_' in /home/xxxxxx/public_html/renamed admin/includes/functions/view_counter.php:1721 Stack trace: #0 /home/xxxx/public_html/renamed admin/includes/functions/view_counter.php(1318): UnserializeSession('7lZCet3-ygqX2Rp...') #1 /home/xxxx/public_html/renamed admin/view_counter.php(679): ShowCart('02c99f8e99c2 in /home/xxxx/public_html/renamed admin/includes/functions/view_counter.php on line 1721

The above error only seems to happen when in View Counter > SHOW> All or Visitors

define('HTTP_SERVER', 'https://www.grandpas.co.nz');
  define('HTTPS_SERVER', 'https://www.grandpas.co.nz');
  define('ENABLE_SSL', true);
  define('HTTP_COOKIE_DOMAIN', '');
  define('HTTPS_COOKIE_DOMAIN', '');
  define('HTTP_COOKIE_PATH', '');
  define('HTTPS_COOKIE_PATH', '');
  define('HTTP_CATALOG_SERVER', 'https://www.grandpas.co.nz');
  define('HTTPS_CATALOG_SERVER', 'https://www.grandpas.co.nz');
  define('ENABLE_SSL_CATALOG', 'true');  
  define('DIR_FS_DOCUMENT_ROOT', '/home/XXXXX/public_html/');
  define('DIR_WS_ADMIN', 'ADMIN/');
  define('DIR_WS_HTTPS_ADMIN', '/ADDMIN/');
  define('DIR_FS_ADMIN', '/home/XXXX/public_html/AMIN/');
  define('DIR_WS_CATALOG', '/');
  define('DIR_WS_HTTPS_CATALOG', '/');
  define('DIR_FS_CATALOG', '/home/XXXXX/public_html/');
  define('DIR_WS_IMAGES', 'images/');
  define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
  define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . 'images/');
  define('DIR_WS_INCLUDES', 'includes/');
  define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
  define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
  define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
  define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
  define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
  define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG . 'includes/languages/');
  define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');
  define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');
  define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');
  define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');
  define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
  define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

So many thanks for your help and addons.

 

Cheers

Grandp

Edited by grandpaj
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...