Community Forums

[RELEASED] Earthball (Who's Online/Visitor Counter)

Commercial Extensions can be listed here (Modules, payments, shipping, order totals, feeds)

[RELEASED] Earthball (Who's Online/Visitor Counter)

Postby fido-x » Sat Dec 11, 2010 2: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
If you're not living on the edge ... you're taking up too much space!
Multi-Vendor Plugin for OpenCart 1.5.1.x
Have I helped you?
User avatar
fido-x
 
Posts: 1960
Joined: Fri Jun 27, 2008 5:09 pm
Location: Tasmania, Australia

Re: [RELEASED] Earthball (Who's Online/Visitor Counter)

Postby i2Paq » Sun Dec 19, 2010 1: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!.

FREE manuals: ShowMe Guides OpenCart, Opencart Check List and Our Documentation section.

BUGs?: Known BUGS for All OC Versions.

[How to] BTW + Verzend & betaalmethodes.
User avatar
i2Paq
Global Moderator
 
Posts: 9842
Joined: Mon Nov 09, 2009 11:00 am
Location: Winkel - The Netherlands

Re: [RELEASED] Earthball (Who's Online/Visitor Counter)

Postby fido-x » Mon Dec 20, 2010 2: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
If you're not living on the edge ... you're taking up too much space!
Multi-Vendor Plugin for OpenCart 1.5.1.x
Have I helped you?
User avatar
fido-x
 
Posts: 1960
Joined: Fri Jun 27, 2008 5:09 pm
Location: Tasmania, Australia

Re: [RELEASED] Earthball (Who's Online/Visitor Counter)

Postby i2Paq » Mon Dec 20, 2010 11:48 am

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

FREE manuals: ShowMe Guides OpenCart, Opencart Check List and Our Documentation section.

BUGs?: Known BUGS for All OC Versions.

[How to] BTW + Verzend & betaalmethodes.
User avatar
i2Paq
Global Moderator
 
Posts: 9842
Joined: Mon Nov 09, 2009 11:00 am
Location: Winkel - The Netherlands

Re: [RELEASED] Earthball (Who's Online/Visitor Counter)

Postby i2Paq » Mon Dec 20, 2010 6:48 pm

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

FREE manuals: ShowMe Guides OpenCart, Opencart Check List and Our Documentation section.

BUGs?: Known BUGS for All OC Versions.

[How to] BTW + Verzend & betaalmethodes.
User avatar
i2Paq
Global Moderator
 
Posts: 9842
Joined: Mon Nov 09, 2009 11:00 am
Location: Winkel - The Netherlands

Re: [RELEASED] Earthball (Who's Online/Visitor Counter)

Postby Brook » Mon Dec 20, 2010 11:50 pm

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 2:29 am, edited 1 time in total.
Reason: Removed code snippet from commercial module.
Brook
 
Posts: 437
Joined: Tue Feb 23, 2010 4:15 pm

Re: [RELEASED] Earthball (Who's Online/Visitor Counter)

Postby fido-x » Tue Dec 21, 2010 4:08 am

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
If you're not living on the edge ... you're taking up too much space!
Multi-Vendor Plugin for OpenCart 1.5.1.x
Have I helped you?
User avatar
fido-x
 
Posts: 1960
Joined: Fri Jun 27, 2008 5:09 pm
Location: Tasmania, Australia

Re: [RELEASED] Earthball (Who's Online/Visitor Counter)

Postby i2Paq » Tue Dec 21, 2010 7:35 am

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

FREE manuals: ShowMe Guides OpenCart, Opencart Check List and Our Documentation section.

BUGs?: Known BUGS for All OC Versions.

[How to] BTW + Verzend & betaalmethodes.
User avatar
i2Paq
Global Moderator
 
Posts: 9842
Joined: Mon Nov 09, 2009 11:00 am
Location: Winkel - The Netherlands

Re: [RELEASED] Earthball (Who's Online/Visitor Counter)

Postby Brook » Tue Dec 21, 2010 4:13 pm

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.
Brook
 
Posts: 437
Joined: Tue Feb 23, 2010 4:15 pm

Re: [RELEASED] Earthball (Who's Online/Visitor Counter)

Postby i2Paq » Tue Dec 21, 2010 7:50 pm

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

FREE manuals: ShowMe Guides OpenCart, Opencart Check List and Our Documentation section.

BUGs?: Known BUGS for All OC Versions.

[How to] BTW + Verzend & betaalmethodes.
User avatar
i2Paq
Global Moderator
 
Posts: 9842
Joined: Mon Nov 09, 2009 11:00 am
Location: Winkel - The Netherlands

Re: [RELEASED] Earthball (Who's Online/Visitor Counter)

Postby fido-x » Wed Dec 22, 2010 8:13 am

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
If you're not living on the edge ... you're taking up too much space!
Multi-Vendor Plugin for OpenCart 1.5.1.x
Have I helped you?
User avatar
fido-x
 
Posts: 1960
Joined: Fri Jun 27, 2008 5:09 pm
Location: Tasmania, Australia

Re: [RELEASED] Earthball (Who's Online/Visitor Counter)

Postby i2Paq » Wed Dec 22, 2010 8:20 am

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

FREE manuals: ShowMe Guides OpenCart, Opencart Check List and Our Documentation section.

BUGs?: Known BUGS for All OC Versions.

[How to] BTW + Verzend & betaalmethodes.
User avatar
i2Paq
Global Moderator
 
Posts: 9842
Joined: Mon Nov 09, 2009 11:00 am
Location: Winkel - The Netherlands

Re: [RELEASED] Earthball (Who's Online/Visitor Counter)

Postby i2Paq » Wed Dec 22, 2010 2:27 pm

Attached you find the Dutch language Pack :)
Attachments
earthball149vqe-Dutch.zip
This is for the "e" release.
(8.47 KiB) Downloaded 100 times
earthball149b-Dutch.zip
(4.69 KiB) Downloaded 103 times
Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.

FREE manuals: ShowMe Guides OpenCart, Opencart Check List and Our Documentation section.

BUGs?: Known BUGS for All OC Versions.

[How to] BTW + Verzend & betaalmethodes.
User avatar
i2Paq
Global Moderator
 
Posts: 9842
Joined: Mon Nov 09, 2009 11:00 am
Location: Winkel - The Netherlands

Re: [RELEASED] Earthball (Who's Online/Visitor Counter)

Postby i2Paq » Wed Dec 22, 2010 5:49 pm

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

FREE manuals: ShowMe Guides OpenCart, Opencart Check List and Our Documentation section.

BUGs?: Known BUGS for All OC Versions.

[How to] BTW + Verzend & betaalmethodes.
User avatar
i2Paq
Global Moderator
 
Posts: 9842
Joined: Mon Nov 09, 2009 11:00 am
Location: Winkel - The Netherlands

Re: [RELEASED] Earthball (Who's Online/Visitor Counter)

Postby fido-x » Thu Dec 23, 2010 1: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
If you're not living on the edge ... you're taking up too much space!
Multi-Vendor Plugin for OpenCart 1.5.1.x
Have I helped you?
User avatar
fido-x
 
Posts: 1960
Joined: Fri Jun 27, 2008 5:09 pm
Location: Tasmania, Australia

Re: [RELEASED] Earthball (Who's Online/Visitor Counter)

Postby i2Paq » Thu Dec 23, 2010 6:24 am

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

FREE manuals: ShowMe Guides OpenCart, Opencart Check List and Our Documentation section.

BUGs?: Known BUGS for All OC Versions.

[How to] BTW + Verzend & betaalmethodes.
User avatar
i2Paq
Global Moderator
 
Posts: 9842
Joined: Mon Nov 09, 2009 11:00 am
Location: Winkel - The Netherlands

Re: [RELEASED] Earthball (Who's Online/Visitor Counter)

Postby Brook » Thu Dec 23, 2010 5:36 pm

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.
Brook
 
Posts: 437
Joined: Tue Feb 23, 2010 4:15 pm

Re: [RELEASED] Earthball (Who's Online/Visitor Counter)

Postby i2Paq » Thu Dec 23, 2010 10:16 pm

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

FREE manuals: ShowMe Guides OpenCart, Opencart Check List and Our Documentation section.

BUGs?: Known BUGS for All OC Versions.

[How to] BTW + Verzend & betaalmethodes.
User avatar
i2Paq
Global Moderator
 
Posts: 9842
Joined: Mon Nov 09, 2009 11:00 am
Location: Winkel - The Netherlands

Re: [RELEASED] Earthball (Who's Online/Visitor Counter)

Postby Brook » Sun Dec 26, 2010 8:44 pm

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
Brook
 
Posts: 437
Joined: Tue Feb 23, 2010 4:15 pm

Re: [RELEASED] Earthball (Who's Online/Visitor Counter)

Postby Brook » Tue Dec 28, 2010 10:15 pm

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.
Brook
 
Posts: 437
Joined: Tue Feb 23, 2010 4:15 pm

Next

Return to Extensions

Who is online

Users browsing this forum: No registered users and 7 guests

Hosted by Arvixe Web Hosting