Plugin: AJAXed Who’s Online 0.61
Features:
This plugin will show all users currently online, followed by all offline users in italics.
You can click on a user’s name to view all posts by that user.
If you hover the mouse over an offline user’s name it will show you how long ago they were online.
You need javascript enabled for the list to update without refreshing the page.
Changes from version 0.6:
Fixed a “Invalid argument supplied for foreach()” bug
Changes from version 0.5:
1. Opera web browsers will now update the Who’s Online list without a page refresh
2. Version 0.5 required MySql 4.1, I’ve modified the SQL to work on 3.23 on up
3. Database table is created automatically
Download: online_users.zip
To install:
1. unpackage into your Wordpress plugin directory
3. activate the plugin and call tms_online_users(); where ever you want the currently online users displayed
19 Comments
You must be logged in to post a comment.
Hi I am getting the following errors:
WordPress database error: [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 ‘ON DUPLICATE KEY UPDATE lastping=’2006-3-9 23:35:12′’ at line 1]
INSERT INTO tms_online_users VALUES(’2′, ‘2006-3-9 23:35:12′) ON DUPLICATE KEY UPDATE lastping=’2006-3-9 23:35:12′
No registered users are currently logged in.
I am using MySQL 4.0 and I know the Timestamp param is different here, any tips or pointers? I have tried changing the field to datetime and entering a deafult of ‘0000000000000′ to no avail.
Looks like a very cool plugin and I would love to use it please.
Cheers
Mark
Comment :: March 9, 2006 @ 15:36 pm
Oh.. also it did not create the table automatically I had to create the table myself.. no biggie but thought you might like to know!
Cheers Mark
Comment :: March 9, 2006 @ 25:38 pm
I’ve still got the bug and have just upgraded to 0.61
Getting
Warning: Invalid argument supplied for foreach() in ***************/online_users.php on line 106
Comment :: March 9, 2006 @ 38:59 pm
oh im using WP 2.01
Comment :: March 9, 2006 @ 48:59 pm
ok, i made a couple of modifications, can both of you download it and try it again?
Comment :: March 10, 2006 @ 512:11 am
Hi Jim,
thanks for the cool plugin.
it is displaying people who are not logged in - just not the person who is!
any thoughts?
Comment :: March 10, 2006 @ 63:37 pm
Hi,
What to change to show on each page the users currently online at that same page? So on each page you see the users currenty viewing that same page…
Null
Comment :: March 11, 2006 @ 75:25 pm
Hi Tried again following findings:
Table not created in 4.021 as I believe the timstamp option is different in 4.1 so CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP option is not valid… I created the table myself using the defaults for Timestamp (i.e. Null and no default, it won’t accept NOT NULL)
The table is not updated if I manually add a user to the table it does not show active users that are logged in, it will however show users manaully entered that are not online now.
Thanks for you attention on this
Mark
Comment :: March 11, 2006 @ 85:59 pm
I have changed the database field to datetime and put a not null and default of 00000000000000 which seems to fix the user alst online time.. not updating for new users though will keep having a go and let you what the score is..
Cheers
Mark
Comment :: March 14, 2006 @ 99:29 am
I am still facing problem with the DB. I tried already to create the table by myself….but no luck….. it seems that the uder_id is always 1. and the clause “ON DUPLICATE KEY UPDATE” drops always an error regarding the mySQL version….
Should we instead use REPLACE??
Thanks
Marcos
Comment :: March 20, 2006 @ 101:05 pm
Hi, i downloaded your plugin a few days ago and was facing the same trouble with creating Table in MySQL 4.0.17
My hoster won’t change- so the solution i found for that issue to remove
the following:
NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP
and leave just that:
CREATE TABLE `tms_online_users` (
`user_id` int(11) NOT NULL default ‘0′,
`lastping` timestamp,
PRIMARY KEY (`user_id`)
);
it works- the only thing which i do not yet understand is the time which shown as tooltip by username- but that is not really dramatic.
So thx for a great plugin.
br from Vienna, Austria
mike
Comment :: March 20, 2006 @ 115:44 pm
this try was definitely not the best one
i see the users which have been online but not the current ones..
same trouble with Timestamp as others
Are there suggestions about this? MySQL Manual doesn’t give a clue about this
Comment :: March 22, 2006 @ 123:32 pm
when you say to “call tms_online_users();” I’m not sure what you mean. I added this to my sidebar.php file:
Who’s Online?
but I just get the heading with nothing beneath it.
Could you help please? (Newbie to wordpress)
Comment :: April 4, 2006 @ 131:05 pm
I use this:
< ?php tms_online_users(); ?>
Comment :: April 4, 2006 @ 143:08 pm
Great plugin, thanks. Works well but is there a way not to display the Offline users? Thanks
Comment :: May 26, 2006 @ 1511:59 pm
Hi there. What modifications should I make if I don’t want the Offline users to appear (that might make the list too long)
Comment :: May 27, 2006 @ 1612:59 am
On line 111 of online_users.php you will see:
“if($offline_user_ids) {”
right before that type in
“$offline_user_ids = 0;”
Comment :: May 27, 2006 @ 174:24 am
Thanks - that did the trick! Again thank you for the great plugin. I must say though that the Stattraq statistics have really gone crazy since then as I guess it must be handling the “pings” from the Who’s Online plugin as hits?
Comment :: May 27, 2006 @ 183:35 pm
I’ve installed many plugins on WordPress, but I have to admit, you beat me on this one. No matter what I do, it just refuses to work. I’ve spent hours creating tables in every shape, form and flavor imaginable and every single one posted on this site and others. NO LUCK!
I uploaded the online_users folder and it’s contents to the wp-content/plugins/ directory on my server.
I then went to the pluin tab on the Admin console of WP 2.3 and I ACTIVATED the Whos Online .61 plugin
Then I opened the sidebar.php file and slipped in the following code string.
saved the file and proceded to install every version of the table suggested on this site and others… JUST WOULD NOT WORK!
So…
The question seems simple enough, yet there seems to be an issue when it comes to getting this plugin to work.
Cany ANYONE, ANYWHERE at ANYTIME please post the ACTUAL WORKING table script that when querried ill make this plugin work?
It should be simple if indeed this plugin actually works.
One would say….
Post in your sidebar.php
Then post:
CREATE TABLE `tms_online_users` (
`timestamp` int(15) NOT NULL default ‘0′,
`user_id` int(10) NOT NULL default ‘0′,
`username` varchar(20) NOT NULL default ‘’,
`displayname` varchar(255) NOT NULL default ‘’,
`useragent` varchar(255) NOT NULL default ‘’,
`ip` varchar(40) NOT NULL default ‘’,
`location` varchar(255) NOT NULL default ‘’,
`url` varchar(255) NOT NULL default ‘’,
`type` enum(’member’,'guest’,'bot’) NOT NULL default ‘guest’,
UNIQUE KEY `useronline_id` (`timestamp`,`username`,`ip`,`useragent`)
);
or such in the MySql table.
And then this thing should run… YET IT DOES NOT!
Who is going to post enough information which will allow anyone who downloads this script to install it and get it up and running?
SOMEONE?
ANYONE?
NOONE?
when you find a solution, email me lasvegan@cox.net
Comment :: November 7, 2007 @ 199:58 am