Post by fido-x » Thu Dec 30, 2010 11:17 am

Brook wrote:I understand that user_type is a field in the opencart_session table. (customer, guest, bot)
OpenCart doesn't use a "session" table (hasn't for quite some time). Instead, sessions are stored as cookies.
For example:

Code: Select all

$this->session->data['customer_id'] 
holds the customer id of the person visiting your site. If the customer id is equal to "0", the visitor is either a guest or a bot. If the customer id is greater than 0, then the customer has logged in to their account. It should also be noted that session data is unique to the current visitor and has its own unique session id.

The whos_online table counts these unique session id's. It is also "self-cleaning". Every time a page is loaded, a function checks the timestamps on the entries in the whos_online table, and anything that is older than the time set in the admin is deleted (minimum is 5 minutes).

It is my intention to include a means of differentiating bots from guests. When I've got it sorted, anybody who has purchased this module will be entitled to a free update.

The only way (at the moment) to reset the counter is via phpMyAdmin (or something similar) and delete the entries in the counter and counter_history tables. This is also something I will look at for an update.
i2Paq wrote:I want to copy the total of visitors in my current osCommerce counter to your counter so I won't lose this total.
You say I have to divide them over 2 tables?
Both osCommerce and ZenCart use a 2 table setup for their counters (counter and counter_history). The table structure that I have used for the "Earthball" counter table is very similar to that used in osCommerce and ZenCart. I think the only differences are the date format and the start date field name. Both osCommerce and ZenCart have a "startdate" field that holds the date as "Ymd", while the "Earthball" module uses "start_date" as the field name and the date is formatted as "Y-m-d" (the same as elsewhere in OpenCart).

The counter_history is structured a bit differently to that in osCommerce and ZenCart. The "Earthball" module keeps a daily record, while both osCommerce and ZenCart keep a monthly record.

It might be possible to convert the counter tables from osCommerce or ZenCart to those for the "Earthball". If you could send me a "dump" of your counter and counter_history tables from your osC setup, I might be able to convert them for you.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by i2Paq » Fri Jan 07, 2011 12:50 am

Fido,

I find some Who's Online related errors in my OpenCart error.txt:
2011-01-04 18:40:26 - PHP Notice: Undefined index: HTTP_USER_AGENT in /var/www/html/catalog/controller/module/earthball.php on line 31

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by Brook » Fri Jan 07, 2011 12:56 am

i2Paq,

There is a fix posted earlier in this same thread for your HTTP_USER_AGENT error.

There is a simple change that needs to be made to In catalog/controller/module/earthball.php

Just read the post earlier in this thread for the fix.

Active Member

Posts

Joined
Wed Feb 24, 2010 12:15 am

Post by i2Paq » Fri Jan 07, 2011 1:43 am

Brook wrote:i2Paq,

There is a fix posted earlier in this same thread for your HTTP_USER_AGENT error.

There is a simple change that needs to be made to In catalog/controller/module/earthball.php

Just read the post earlier in this thread for the fix.

Thanks!

I completely overlooked that browsing this topic :drunk:

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by i2Paq » Fri Jan 07, 2011 1:44 am

Fido,

FEATURE REQUEST

I think it would be great if you could add your own IP-address into this module so it would not show you as a visitor when looking on you own storefront.

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by FFJim » Fri Feb 11, 2011 4:21 am

Very nice MOD. I added it last night. Definitely needs to filter out bots.

User avatar
New member

Posts

Joined
Wed Jul 21, 2010 6:44 am

Post by fido-x » Fri Feb 11, 2011 10:34 am

FFJim wrote:Very nice MOD. I added it last night. Definitely needs to filter out bots.
Thanks for the comments.

I agree, it does need to filter out the bots, and I am looking into it. I've been looking at some kind of "automatic" detection of bots, based on domain name or user agent, without having to use some "list" of bots like ZenCart and osCommerce do. Not having much luck with this, so I may have to end up using a "list", which will then need to be updated as new bots appear.

It has also been (rightly) suggested by i2Paq that the admin IP address should be excluded from the who's online and visitor count. I've got this done in my development "rebuild", which also excludes the localhost IP from being counted.

I'll be releasing an update when I've got the bots issue sorted. The update will include a vQmod file to add menu entries and the dashboard "stuff".

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by FFJim » Fri Feb 11, 2011 11:02 am

Fido, I made changes this evening to filter out the bots (yeah, with a dumb old list), and it seems to work well. Will forward my changes to you.

User avatar
New member

Posts

Joined
Wed Jul 21, 2010 6:44 am

Post by fido-x » Fri Feb 11, 2011 11:09 am

FFJim wrote:Fido, I made changes this evening to filter out the bots (yeah, with a dumb old list), and it seems to work well. Will forward my changes to you.
Cool. Muchly appreciated.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by fido-x » Sat Feb 12, 2011 11:43 am

Module has been updated and now excludes "bots" and logged in admin users from the counters. Bots are still included in the "who's online" component, but are not included in the display on the front-end. They will, however, show up in the "who's online" component in the back-end.

I'd also like to thank FFJim for his assistance with some ideas about excluding bots.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by wifi-online » Sat Feb 12, 2011 10:38 pm

Hello I have a problem when I'm trying open my admin.
the error is:

Code: Select all

Notice: Undefined index: token in /home/xxxx/public_html/xxxx/xxxx/controller/common/header.php on line 145Notice: Undefined index: token in /home/xxxx/public_html/xxxx/xxxx/controller/common/header.php on line 146
Help me please!

New member

Posts

Joined
Wed Oct 20, 2010 8:49 am
Location - Spain

Post by Brook » Sun Feb 13, 2011 12:29 am

Thank you for updating the "Earthball Who's Online" Module to exclude bots in the counts. That is a great enhancement!

I need some help. I just downloaded and installed the updated code since the update and can't seem to figure out how to exclude the "bots" from displaying as visitors. Currently both my Admin Dashboard and on the "Earthball Who's Online" Page that shows visitors "bots" show as visitors", the ID column for a bot visitor has a value of "-1" and the Name column has a value of "Bot".

What changes do I need to make to not show that "bots" on neither the Dashboard or the "Earthball Who's Online Page". I only want to show guests that are people or customers who are logged in. I am sure that I am missing something in my setup, not sure what to do?

Thank you.

Active Member

Posts

Joined
Wed Feb 24, 2010 12:15 am

Post by FFJim » Sun Feb 13, 2011 12:45 am

wifi-online wrote:Hello I have a problem when I'm trying open my admin.
the error is:

Code: Select all

Notice: Undefined index: token in /home/xxxx/public_html/xxxx/xxxx/controller/common/header.php on line 145Notice: Undefined index: token in /home/xxxx/public_html/xxxx/xxxx/controller/common/header.php on line 146
Help me please!
I had that too. I believe your edits are in the wrong place in admin\controller\common\header.php

Put them right after this line (or at least in the same grouping of lines):

Code: Select all

            $this->data['zone'] = HTTPS_SERVER . 'index.php?route=localisation/zone&token=' . $this->session->data['token']; 

User avatar
New member

Posts

Joined
Wed Jul 21, 2010 6:44 am

Post by fido-x » Sun Feb 13, 2011 1:08 am

I'd say you got it right FFJim.

Brook, to stop the bots from displaying in the admin part of the who's online component (dashboard and page), make the following changes in the model (admin/model/fido/earthball.php)-
In the getOnlineCustomers($limit = 0) function, change the if ($limit) query from:

Code: Select all

$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "whos_online ORDER BY time_last_click DESC LIMIT " . $limit); 
to:

Code: Select all

$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "whos_online WHERE customer_id >= '0' ORDER BY time_last_click DESC LIMIT " . $limit); 
and the else query from:

Code: Select all

$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "whos_online ORDER BY time_entry ASC"); 
to:

Code: Select all

$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "whos_online WHERE customer_id >= '0' ORDER BY time_entry ASC"); 
Then, change the query in the countWhosOnLine() function from:

Code: Select all

$query = $this->db->query("SELECT COUNT(*) AS count FROM " . DB_PREFIX . "whos_online"); 
to:

Code: Select all

$query = $this->db->query("SELECT COUNT(*) AS count FROM " . DB_PREFIX . "whos_online WHERE customer_id >= '0'");
 

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Brook » Sun Feb 13, 2011 1:14 am

Thank you. Thank you. I have to say your Earthball (Who's Online) Module is definitely one of the best if not the best module out there. Definitely a lot of value added to any OpenCart website. I really like your Statements Module too. Keep up the good work. Many thanks for the help and quick reply.

Active Member

Posts

Joined
Wed Feb 24, 2010 12:15 am

Post by fido-x » Sun Feb 13, 2011 1:24 am

That's all right Brook.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Brook » Sun Feb 13, 2011 1:36 am

Sorry for another post, but I am trying to login as a customer and see that I am logged in as a customer by looking at the Admin->Dashboard and Admin->Who's Online

For some reason...
1) if I bring up an browser session looking at my Admin website and
2) open a second browser and login as a customer
3) if I go back to the Admin->Dashboard or Admin->Who's Online
I do not see myself being logged in as a customer

I don't get it, what am I doing wrong?

Active Member

Posts

Joined
Wed Feb 24, 2010 12:15 am

Post by fido-x » Sun Feb 13, 2011 1:52 am

Are finding this on your website or on localhost?

If you're using localhost, it's because the localhost IP address is blocked from being counted. If it's on your website, I'm not sure, but it's mostly likely IP related, since the IP address is passed through to the function that checks for the logged in admin user.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Brook » Sun Feb 13, 2011 1:58 am

I am not using a localhost. I guess that makes sense, since my Admin browser session was using the same IP Address of my Customer browser session (same computer) then I could not see myself logged in when I looked at the Admin-Dashboard, Admin-Who's Online Page

I just logged into my website as a Customer using my iPhone and brought up an Admin session on my Computer and saw that I was successfully logged in as a customer. Thank again for your reply. And thanks again for a great module!

Active Member

Posts

Joined
Wed Feb 24, 2010 12:15 am

Post by Brook » Sun Feb 13, 2011 2:14 am

I hate to post again, but I can't seem to figure out why I can't see any people visiting my website as (guests, visitors not logged in as customers). I can't see any guests visiting my website in the either the Admin->Dashboard or Admin->Who's Online Page...

I can see a visitor once they login as a Customer, I just cannot see the visitor when they are not logged in as a Customer. I am using two different computers. One to view my Admin website and one to view the Customer website (different IP Addresses)

If I bring up a browser session and view my customer website. If I bring up my Admin website I would expect to see that a visitor to my website is a Guest

Any ideas why?

Active Member

Posts

Joined
Wed Feb 24, 2010 12:15 am
Who is online

Users browsing this forum: No registered users and 3 guests