Post by fido-x » Sat Dec 11, 2010 10:02 pm

This is a combined Who's Online/Visitor Counter for OpenCart.

The Who's Online component displays the number of visitors currently online, including the separation of guests and registered customers. The Visitor Counter component shows the total number of visitors and page views from the date the counter is started.

Integrates with RevolverMaps to give a visual display of where your customers come from.

The administration includes a dashboard component displaying a few statistics of the number of visitors and who's online with links to pages containing more detailed information.

Simple "plug'n'play" installation, with nothing overwritten.

Full installation instructions included.

Compatible with OpenCart versions 1.4.8, 1.4.8b, 1.4.9, 1.4.9.1 and 1.4.9.2.

Demo: http://demo.fido-x.net. You can login to the administration with username/password of "demo/demo" to view the administration.

You'll find the Earthball module under "Extensions->Modules". You'll also find direct links to the Who's Online and Counter Statistics pages under the "Reports" entry in the header menu.

Available from: Fido-X IT or from Extensions.

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 » Sun Dec 19, 2010 9:55 pm

I've just bought your great extension and I'm wondering if it would be possible to get the output in the Footer of my template?

I'm already having a few modules in the left and right column and I personally think the output of your module looks "better" there ;)

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 fido-x » Mon Dec 20, 2010 10:20 am

Yeah, it can be put in the footer if you wish. You'll need to modify a couple of files.

General Instructions for Placing Module in Footer
For the front-end, by making the following changes to the footer controller and template files, you can add any module to the footer:-
catalog/controller/common/footer.php
Insert the following:-

Code: Select all

$module_data = array();

$this->load->model('checkout/extension');

$results = $this->model_checkout_extension->getExtensions('module');

foreach ($results as $result) {
    if ($this->config->get($result['key'] . '_status') && ($this->config->get($result['key'] . '_position') == 'footer')) {
        $module_data[] = array(
            'code'       => $result['key'],
            'sort_order' => $this->config->get($result['key'] . '_sort_order')
        );

        $this->children[] = 'module/' . $result['key'];        
    }
}

$sort_order = array(); 

foreach ($module_data as $key => $value) {
    $sort_order[$key] = $value['sort_order'];
}

array_multisort($sort_order, SORT_ASC, $module_data);            

$this->data['modules'] = $module_data; 
before:

Code: Select all

$this->id = 'footer'; 
In the template file:
catalog/view/theme/YOUR_TEMPLATE/template/common/footer.tpl
Insert the following at line 2:-

Code: Select all

<div class="modules">
  <?php foreach ($modules as $module) { ?>
  <?php echo ${$module['code']}; ?>
  <?php } ?>
</div>
And in the stylesheet (catalog/view/theme/YOUR_TEMPLATE/stylesheet/stylesheet.css), add the following:-

Code: Select all

#footer .modules {
    display: block;
    text-align: left;
} 
Specific to the Earthball (Who's Online/Visitor Counter) Module
In the administration:
admin/controller/module/earthball.php
Insert the following at line 94:-

Code: Select all

$this->data['positions'][] = array(
    'position' => 'footer',
    'title'    => $this->language->get('text_footer'),
); 
admin/language/english/module/earthball.php
Insert the following at line 17:-

Code: Select all

$_['text_footer']             = 'Footer'; 

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 » Mon Dec 20, 2010 7:48 pm

Great! I will test it tonight.

Thanks!

After my testing I will put up the Dutch translation for download in this topic.

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 » Tue Dec 21, 2010 2:48 am

I'm not getting it to work in my footer.

I have double checked everything but the module does not show up.

I also see that when logged on as a customer I'm still a visitor in the statistics.

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 » Tue Dec 21, 2010 7:50 am

I have OpenCart 1.4.9.2 installed. I just bought and installed this module.

I am getting the following error written to my Admin-System->Error Log

Code: Select all

2010-12-20 23:25:53 - PHP Notice:  Undefined index:  HTTP_USER_AGENT in /homepages/15/d244334450/htdocs/websites/prod_region/retail/oc149_shopcelebrity/catalog/controller/module/earthball.php on line 31
Any ideas what might be causing this error?
Last edited by fido-x on Tue Dec 21, 2010 10:29 am, edited 1 time in total.
Reason: Removed code snippet from commercial module.

Active Member

Posts

Joined
Wed Feb 24, 2010 12:15 am

Post by fido-x » Tue Dec 21, 2010 12:08 pm

Brook wrote:I have OpenCart 1.4.9.2 installed. I just bought and installed this module.

I am getting the following error written to my Admin-System->Error Log

Code: Select all

2010-12-20 23:25:53 - PHP Notice:  Undefined index:  HTTP_USER_AGENT in /homepages/15/d244334450/htdocs/websites/prod_region/retail/oc149_shopcelebrity/catalog/controller/module/earthball.php on line 31
Any ideas what might be causing this error?
The "HTTP_USER_AGENT" provides information about the browser being used and is normally accessible with the following code:

Code: Select all

$_SERVER['HTTP_USER_AGENT'] 
or (to comply with OC structure):

Code: Select all

$this->request->server['HTTP_USER_AGENT'] 
I use the second method in the earthball module.

The "user agent" information (as you would have seen) is being displayed in the "Who's Online" list in the admin, as to why it's flagging an error, I have no answer.

I don't get this error on my localhost test environment, or on my demo site, but I do get the same error showing up in the logs for my own site, as well as a few other errors relating to environment variables (HTTP_HOST, HTTP_REFERER). I suspect it is related to server settings.
i2Paq wrote:I'm not getting it to work in my footer.

I have double checked everything but the module does not show up.

I also see that when logged on as a customer I'm still a visitor in the statistics.
Had a look at your demo setup and (from viewing the page source), it would appear that you haven't put the following code in the footer as suggested:

Code: Select all

<div class="modules">
  <?php foreach ($modules as $module) { ?>
  <?php echo ${$module['code']}; ?>
  <?php } ?>
</div>
At least, I didn't see a <div class="modules">. I did notice that you've put your information module into your footer, although you have separated the "dynamic" links from the "static" links and put them to the left and right. I suspect they've been "hard-coded" rather than dynamically loaded.

The code I provided earlier in this post for the footer controller and template files, will allow the inclusion of any module in the footer that has a position of "Footer".

As to why you're still showing as a "Guest" when you've logged in, I have no answer, as I haven't been able to re-create this scenario, either on my localhost test environment or on my demo site.

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 » Tue Dec 21, 2010 3:35 pm

I'm testing on another test-setup, the one your are looking at is the one with past/finished changes from that site ;)
So that is why you do not see the code in the footer :)

I will try and set up your code again and PM you the link tonight.

Thanks for you prompt reply.

As I only want certain links in a certain way in my footer I've only used "static" links to the information pages etc.

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 » Wed Dec 22, 2010 12:13 am

I think I found a fix for the following error that I was getting written to my Error Log

Code: Select all

2010-12-20 23:25:53 - PHP Notice:  Undefined index:  HTTP_USER_AGENT in /homepages/15/d244334450/htdocs/websites/prod_region/retail/oc149_shopcelebrity/catalog/controller/module/earthball.php on line 31
In catalog/controller/module/earthball.php

find line 31

Code: Select all

$user_agent = $this->request->server['HTTP_USER_AGENT'];
change

Code: Select all

$user_agent = (isset($_SERVER['HTTP_USER_AGENT'])) ? $_SERVER['HTTP_USER_AGENT'] : '';
I no longer get the above error written to my Error Log.

Active Member

Posts

Joined
Wed Feb 24, 2010 12:15 am

Post by i2Paq » Wed Dec 22, 2010 3:50 am

I have got it to work.
Turned out that I had not set the module to: active ::)

The output is now visible in my footer, it still needs some work to get it in-line with the rest. See here.

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 fido-x » Wed Dec 22, 2010 4:13 pm

Thanks Brook. Should have thought of that myself.

@i2Paq
Looks like a style issue. Maybe you should give it a width, text-align to the left and auto margins left and right.

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 » Wed Dec 22, 2010 4:20 pm

fido-x wrote:Thanks Brook. Should have thought of that myself.

@i2Paq
Looks like a style issue. Maybe you should give it a width, text-align to the left and auto margins left and right.
Yep, I know.

I'm working on this today ;)

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 » Wed Dec 22, 2010 10:27 pm

Attached you find the Dutch language Pack :)

Attachments

This is for the "e" release.


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 » Thu Dec 23, 2010 1:49 am

In which table is the total visitors number stored?

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 fido-x » Thu Dec 23, 2010 9:04 am

There are 2 tables for the counter: counter and counter_history.
The "counter" table contains the overall total (page views), while the "counter_history" table contains the daily count of visitors, and records whether they are guests or registered customers (same method as used by ZenCart and osCommerce).

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 » Thu Dec 23, 2010 2:24 pm

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?

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 Dec 24, 2010 1:36 am

I would like for this module to only show me really people who are visiting my website... What I am trying to say is that I am not that interested in seeing that there are 10 Google Bot sessions currently on my website.

Is there any SQL change that I can make with this module to show all sessions that are not Bot or Google Bot Sessions. There is a user_type field I think in the opencart_session table if I am not mistaken?

Thank you.

Active Member

Posts

Joined
Wed Feb 24, 2010 12:15 am

Post by i2Paq » Fri Dec 24, 2010 6:16 am

Maybe there should be a check-box that you need to check if you want to see the Bots.
I know that my osCommerce Who's Online has this.

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 » Mon Dec 27, 2010 4:44 am

If I wanted to reset the "Counter Statistics", what do I need to do?

Example, say that I wanted to reset the counter to reset visitor counters to 0 and start counting on 12/27/2010

Active Member

Posts

Joined
Wed Feb 24, 2010 12:15 am

Post by Brook » Wed Dec 29, 2010 6:15 am

I understand that user_type is a field in the opencart_session table. (customer, guest, bot)

I understand that the Earthball Module uses a new table opencart_whos_online table. I cannot figure out how the opencart_whos_online table gets populated with data from the opencart_session table. Can someone help me understand? I looked in admin\model\\fido\earthball.php and could not figure it out?

I really only want the Earthball Module to not show user_type sessions that are "bots", only show guests and customers.

What changes do I need to make to the Earthball Module to add a user_type column to the who's online page?

Any help would be appreciated.

Active Member

Posts

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

Users browsing this forum: No registered users and 11 guests