Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

View Counter


Recommended Posts

56 minutes ago, Owl Sauron said:

found a bug in the monitor section:

What version of oscommerce are you using?

What php version are you using?

Did you download a new database file, assuming this is an upgrade?

Does the database name in the settings match the actual name of the file?

Support Links:

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

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

@Jack_mcs

I've been using this addon for many years.  Just installed the latest version into phoenix, installation went well until I started checking the site visits.

Monitor only shows the admin visits, there are no shop visits showing.

using php7.3, phoenix 1.0.7.11

there are no errors in the log file.

Have I missed a setting?

osC CE live - developing osC Phoenix adding modules with no core changes(awesome and easy!)

Link to comment
Share on other sites

20 hours ago, Jack_mcs said:

What version of oscommerce are you using?

Phoenix 1.0.7.11

What php version are you using?

7.0.33 (Zend: 3.0.0)

Did you download a new database file, assuming this is an upgrade?

IP2LOCATION-LITE-DB9.BIN

Does the database name in the settings match the actual name of the file?

yes, ofc... and inside the view_counter dir

 

Link to comment
Share on other sites

9 hours ago, Mikepo said:

Monitor only shows the admin visits, there are no shop visits showing.

There'is testing code in the includes/functions/view_counter.php file that may cause this. Find the following in that file

    //$records = $db->lookup($_SERVER['REMOTE_ADDR'], \IP2Location\Database::ALL);
    $records = $db->lookup('97.70.16.143', \IP2Location\Database::ALL);

and change to

    $records = $db->lookup($_SERVER['REMOTE_ADDR'], \IP2Location\Database::ALL);

 

Support Links:

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

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

3 hours ago, Owl Sauron said:

7.0.33 (Zend: 3.0.0)

Please see my comment on the new version above or in the install docs. A minimum of 7.1 is required.

Support Links:

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

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

5 hours ago, Jack_mcs said:

There'is testing code in the includes/functions/view_counter.php file that may cause this

sorry jack, that didn't correct the issue, though will effect other functionality 😉

Still seeing no shop visitors

osC CE live - developing osC Phoenix adding modules with no core changes(awesome and easy!)

Link to comment
Share on other sites

3 hours ago, Mikepo said:

Still seeing no shop visitors

That's strange. If the admin shows links, so should the shop side. Do you have the Show option set to Visitors or All? If you have the country blocking option set, please try turning that off. If you clear the view_counter database table and then click around the shop side, does the table now have entries? 

Support Links:

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

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

1 hour ago, Jack_mcs said:

That's strange. If the admin shows links, so should the shop side. Do you have the Show option set to Visitors or All? If you have the country blocking option set, please try turning that off. If you clear the view_counter database table and then click around the shop side, does the table now have entries?  

shop option is set to all, country blocking is not set, I've cleared the tables and still on shop side entries.

All very strange, removing .htaccess files didn't help, (just in case something was blocking things)

The Who's online function is working ok

Do you have any other suggestions.

I might try installing the addon on a fresh v1.0.7.11

osC CE live - developing osC Phoenix adding modules with no core changes(awesome and easy!)

Link to comment
Share on other sites

jack, I did see this line, in functions/view_counter.php

    require_once(DIR_FS_CATALOG . 'view_counter/IP2Location.php'); //PRE-PHOENIX ONLY


should that be there if we are running phoenix?

osC CE live - developing osC Phoenix adding modules with no core changes(awesome and easy!)

Link to comment
Share on other sites

It is not needed in Phoenix but it shouldn't hurt being there either. But go ahead and delete it just in case.

If that doesn't help, the attached  file goes in the includes/modules/ directory. Upload it and then visit a page with the ?test in the url, like http YOUR DOMAIN/index.php?test It will display the details of the database changes. It is safe to run it on a live shop but should be replaced with the original when not needed any longer.

view_counter.php

Support Links:

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

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

ok, looked at the file you sent, and the output from the print_r functions don't show.

So why doesn't the file get called?

I've just compared the files in the addon to the files in the shop/admin and they are all present

so ??

osC CE live - developing osC Phoenix adding modules with no core changes(awesome and easy!)

Link to comment
Share on other sites

Looks like includes/modules/view_counter.php is only called when running the admin side of the shop.  I see the arrays dumped when new viewcounter records are generated.

Is there a hook call missing on the shop side?

osC CE live - developing osC Phoenix adding modules with no core changes(awesome and easy!)

Link to comment
Share on other sites

@Jack_mcs

Found the issue

file includes\hooks\shop\system\view_counter_app_hook.php

find

      if ('VIEW_COUNTER_ENABLED' == 'true') {

change to

      if (VIEW_COUNTER_ENABLED == 'true') {

 

osC CE live - developing osC Phoenix adding modules with no core changes(awesome and easy!)

Link to comment
Share on other sites

Yes, that would cause it. But I wonder where it came from? I searched my files here as well as the last uploaded zip file and it isn't in them that I can see. 

Support Links:

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

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

well, that is strange.  I know I didn't change any file in the download of the addon, but stranger things happen. I least I've solved it and the Addon is working and very useful.  Anyway thanks for looking at the problem. I'm one step further now to getting my new site up!

osC CE live - developing osC Phoenix adding modules with no core changes(awesome and easy!)

Link to comment
Share on other sites

@Jack_mcs

This addon is now running live.

When using reports->referrers I get this error

Fatal error: Uncaught Error: Class 'IP2Location\Database' not found in xxxx/xxxx/includes/functions/view_counter.php:351 Stack trace: #0 xxxx/xxxx/includes/functions/view_counter.php(443): GetIPDetails('81.143.xxx.xxx') #1 xxxx/xxxx/includes/modules/view_counter/view_counter_report_referers.php(63): GetDomainLocation('81.143.xxx.xxx') #2 xxxx/xxxx/view_counter_reports.php(272): include('/xxxx...') #3 {main} thrown in xxxx/xxxx/includes/functions/view_counter.php on line 351

osC CE live - developing osC Phoenix adding modules with no core changes(awesome and easy!)

Link to comment
Share on other sites

On 12/5/2020 at 9:28 AM, Mikepo said:

require_once(DIR_FS_CATALOG . 'view_counter/IP2Location.php'); //PRE-PHOENIX ONLY

If you removed this line, try adding it back in.

Support Links:

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

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

18 minutes ago, Jack_mcs said:

If you removed this line, try adding it back in

thanks jack, that worked ☺️

osC CE live - developing osC Phoenix adding modules with no core changes(awesome and easy!)

Link to comment
Share on other sites

I apologize for the problem it caused. I must have changed the code after adding that statement that the code wasn't needed. I have removed the comment in the next version.

Support Links:

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

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites


@Jack_mcs

Hi jack, sorry another notice

PHP Notice:  Undefined variable: user_agent in xxxx/xxxxx/includes/modules/view_counter.php on line 149

$user_agent isn't defined in the file, and google finds the error, initially I didn't see it.

osC CE live - developing osC Phoenix adding modules with no core changes(awesome and easy!)

Link to comment
Share on other sites

Thanks. I appreciate the report since I am not seeing the warnings here for some reason. To fix this, in that file, replace the four (4) instances of $user_agent with $ua.

Support Links:

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

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 5 weeks later...

Hello Jack.

I installed the latest version of your app and everything seems to run smoothly, except one function in the "reports" area.

When I click on reports/page counts I get this:


1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ggorderggbyggargggggascgg' at line 1

select count(file_name) as cnt, isbot, file_name, arg, inet_ntoa(ip_number) as ip from `view_counter` where isbot = 0 group by file_name, arg ggorderggbyggargggggascgg

[TEP STOP]

everything else is apparently working just fine.

Any idea about what is actually causing the issue?

Thank you
 

Link to comment
Share on other sites

2 hours ago, mendoh said:

everything else is apparently working just fine.

Well, it seems I spoke too soon.

After installing the contribution and testing it according to the install.txt file, I could actually see myself (i.e.: my own IP) being reported on the monitor page along with a skimming IP. I have placed a ban on the skimmer and I got a positive response message in green about the ban. After that, this is all I get no matter if I click on "Show: Admin/Bot/Visitors" and regardless of whether I choose either "active or related" under "Type:"

Displaying 0 to 0 (of 0 links)

Should I select "Show: all" and "Type: related", I can see my test IP captures, however, that view is definitely NOT being updated, while Tools/Who's online gives me plenty of (new) IPs.

Anybody has any clue about what might be wrong with my installation?

Thank you in advance

Link to comment
Share on other sites

9 minutes ago, mendoh said:

Well, it seems I spoke too soon.

After installing the contribution and testing it according to the install.txt file, I could actually see myself (i.e.: my own IP) being reported on the monitor page along with a skimming IP. I have placed a ban on the skimmer and I got a positive response message in green about the ban. After that, this is all I get no matter if I click on "Show: Admin/Bot/Visitors" and regardless of whether I choose either "active or related" under "Type:"

Displaying 0 to 0 (of 0 links)

Should I select "Show: all" and "Type: related", I can see my test IP captures, however, that view is definitely NOT being updated, while Tools/Who's online gives me plenty of (new) IPs.

Anybody has any clue about what might be wrong with my installation?

After double-checking on the various settings I realized I had inadvertently turned off the contribution! 🤪

Now, the only one that stays is the SQL error...

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...