| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
current users online | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
current users online
I want to add a php script to see how many users are online.
This will be nice when it's showing under the subscribe button from the newsletter. I'm a newby and hope that someone can help me. This is the script that i found. Maybe there's a better one. <? session_start(); /** * Calculate the number of users online by * counting the number of session files. Returns the * number of users on success, or -1 on failure. */ function getUsersOnline() { $count = 0; $handle = opendir(session_save_path()); if ($handle == false) return -1; while (($file = readdir($handle)) != false) { if (ereg("^sess", $file)) $count++; } closedir($handle); return $count; } echo "users online = " . getUsersOnline() . " "; ?> |
|||||||
#2
|
|||||||||
|
|||||||||
Check out our traffic monitor add on for x-cart, it does that but at a much wider level and it's 100% x-cart specific.
It covers - Live customers on site - Customers on site along with the pages they took through the and the total time spent on it. - Highlights any customer currently in the checkout process. - Shop cart revenue generated It also tells you refering sites. And search engine keywords that were used to find your site along with the search engines they eminated from. http://www.firetanksoftware.com/fts/customer/product.php?productid=25 There's also a new add on coming from us for x-cart that tracks exactly where your sales are coming from with $$$$ values allocated to specific incoming links and unique visitor reports. Our traffic monitor works on both your PHP shop and your HTML catalog. Small tip, it's bad practise to put how many people are online on the front of your site unless you have a really busy site. Customers seeing "1 person on site" generally get the impression your site isn't very popular and serves little purpose to the customer.
__________________
Groovico Used by X-carters the world over: Marketing Manager Pro Bundle For X-cart Featured Product Manager for X-cart Feed manager pro for X-cart http://www.firetanksoftware.com Celebrating 7 Years of providing quality X-cart Add ons and X-cart Mods for x-cart 3.X to X-cart 4.4.X |
|||||||||
#3
|
|||||||
|
|||||||
Thanks for the tip
|
|||||||
#4
|
|||||||||
|
|||||||||
As much as I'd love you pay you $45.00, I'm not in need of a package with all this functionality.
I'd just like the Online Visitors total. If you could provide code for this at a small price, I'd likely be willing to go for it. I imagine all the information needed is basically recorded somewhere in the x-cart system with advanced stats, just a matter of figuring out what info to pull. |
|||||||||
#5
|
|||||||||
|
|||||||||
Groovico,
The way I understand his request in that he wants website VISITORS to be able to see who is online like what we have here in the forums (bottom of page). This type of script is used in most forum software, DNN, php-Nuke, etc. Your mod is great for site administration, but not for what he wants. I would suggest to Jon would be to copy the script from phpBB forums or one of the other programs that use it. Read This: http://forums.devshed.com/showthread.php?threadid=21831&forumid=5
__________________
Best Regards, Sam Solace - Pres/CEO Century Performance Center, Inc. http://www.centuryperformance.com (3) sites using X-Cart 5.3.5.5 X-Payments Enterprise 3.1.4 |
|||||||||
#6
|
|||||||||
|
|||||||||
Century you're right about that, ours is entirely for administration and serious marketing purposes. I read the post that shirtshop wanted to see users online from his point of view not the customers, sorry if I misread that.
Jon, if all you want to do is show how many customers are online, there's a number of scripts out there that do that kind of stuff. Bear in mind though if you take the PHP code route, it won't take into account users on your HTML pages. Our add on doesn't actually use the x-cart data for it's online user figures or any of it's tracking data.
__________________
Groovico Used by X-carters the world over: Marketing Manager Pro Bundle For X-cart Featured Product Manager for X-cart Feed manager pro for X-cart http://www.firetanksoftware.com Celebrating 7 Years of providing quality X-cart Add ons and X-cart Mods for x-cart 3.X to X-cart 4.4.X |
|||||||||
#7
|
|||||||||
|
|||||||||
I was reading between the lines a little bit after he balked at your product, taking a "guess" that he was wanting a more simple script.
__________________
Best Regards, Sam Solace - Pres/CEO Century Performance Center, Inc. http://www.centuryperformance.com (3) sites using X-Cart 5.3.5.5 X-Payments Enterprise 3.1.4 |
|||||||||
#8
|
|||||||
|
|||||||
here's one - http://www.faultysanity.com/coding_stuff.php
|
|||||||
#9
|
|||||||||
|
|||||||||
There's lots of scripts out there right that do this, they are generally the same principle of writing an IP address to a database for a given period of time and removing them after a certain period of time.
Nothing difficult to setup. What I'm wondering, is that with all the statistics that x-cart keeps track of, is it not possible to pull from current statistics to form the number? I'm not sure exactly what stats are kept. But with sessions stored in a mysql table, are non logged in users given a session? If they are, you could simply count the number only by counting the number of entries in the sessions table. |
|||||||||
#10
|
|||||||||
|
|||||||||
X-cart uses three different ways of storing user sessions, it can store them in the mysql db, in filesystem, and also has a default option only called "other method", it's down to how you set your config up.
If you rely on x-cart sessions, anyone on your static catalog won't be counted in users online and you'll also be tied into the x-cart session time out too. Only those on the php side of the cart that have actually started a session would be counted. You could have 10 users on the static HTML pages and only 1 user who used the search or added anything to the cart so it would show 1 user online instead of 11. The catalog part would also constantly show "0 users online". It's only an issue though if you rely on the static catalog for search engines traffic. It's actually got me curious now, if we have a bit of time at firetank we'll see if we can code up something that works happily on all pages of the site.
__________________
Groovico Used by X-carters the world over: Marketing Manager Pro Bundle For X-cart Featured Product Manager for X-cart Feed manager pro for X-cart http://www.firetanksoftware.com Celebrating 7 Years of providing quality X-cart Add ons and X-cart Mods for x-cart 3.X to X-cart 4.4.X |
|||||||||
|
|||
X-Cart forums © 2001-2020
|