Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2005-02-17 02:37:19
- kirk
- New Member
- From: LA
- Registered: 2005-01-20
- Posts: 8
Users Currently Online
Does anyone know if there is a plugin that displays the number of users currently visiting your site? I managed to find this script:
http://elouai.com/user-counter.php
I guess there can be a way to work it into the textpattern coding. But I was wondering if there was a plugin that already does that? I thorougly looked through the forum and was not able to find anything related to this.
Kirk
Offline
#2 2005-05-30 03:42:17
- starzabove
- Member

- Registered: 2004-04-13
- Posts: 76
Re: Users Currently Online
In trying to answer a client request, I found this: http://www.spoono.com/php/tutorials/tutorial.php?id=16
Anyone able to convert this into a plugin or show me how?
Thanks!
Last edited by starzabove (2005-05-30 04:27:14)
90+ Textpattern installs and still going…
Offline
Re: Users Currently Online
The spoono method is really easy to implement as a TXP plugin. There is no need to create a table since txp_log could be used. I may do this if you encounter problems, or if I find the time, which is really hard when the weather is so nice!
Offline
#4 2005-05-30 17:44:26
- starzabove
- Member

- Registered: 2004-04-13
- Posts: 76
Re: Users Currently Online
Oy, I did encounter problems. I did it adding a table, and it seems to work, shows 1 user online, but I had several of us hit the site and it ALWAYS says ’1 user online’, – that’s kind of useless.
I don’t blame you about the weather, though, so enjoy! And if you should find a spare bit, of time, I know for one that I would greatly appreciate it, and it’d be another great addition to the package of plugins offered.
Even a quick tip on what to change in the php form to call it out from txp_logs instead of the mysql table it had me make might work better.
Thanks.
Last edited by starzabove (2005-05-30 18:05:49)
90+ Textpattern installs and still going…
Offline
Re: Users Currently Online
Plugin: mem_online_users
Version: 0.1
Author: Michael Manfre
More Info
I found some time and banged out a plugin that will output the number of distinct users who have accessed a portion of the site in the past x seconds. Let me know if you would like it tweaked, or have any questions.
Offline
#6 2005-06-02 06:43:43
- starzabove
- Member

- Registered: 2004-04-13
- Posts: 76
Re: Users Currently Online
Awesome – thank you!
But, am I missing the download link?
Last edited by starzabove (2005-06-02 06:44:00)
90+ Textpattern installs and still going…
Offline
#7 2005-06-02 08:52:18
- davidm
- Member

- From: Paris, France
- Registered: 2004-04-27
- Posts: 719
Re: Users Currently Online
Ok another one that was missing ! That’s very cool…
Guess we’re gonna have some work updating all this new plugins @textpattern.org !
Thx !!
.: Retired :.
Offline
Re: Users Currently Online
Sorry guys. I forgot to add the download link to the post. It’s up there now.
Offline
Re: Users Currently Online
Sorry to bother you with my problems but I don´t whats wrong here? (I use RC3)
Fatal error: Call to undefined function doTag() in ….\textpattern\lib\txplib_misc.php(304) : eval()’d code on line 1165
Edit: The page with the txp:mem_online_users / -tag shows nothing but the Fatal error…
Last edited by skoggy (2005-06-02 13:41:02)
Offline
Re: Users Currently Online
skoggy, the doTag function was added a short time ago by zem. I don’t think it is in the packaged download found on textpattern.com, but it is in SVN. To get around this error, edit the plugin and add this to the end.
<blockquote>
<code>
// ——————————————————————————————-
if (!function_exists(‘doTag’)) {
function doTag($content, $tag, $class=’‘, $atts=’‘)
{
$atts = ($class ? $atts.’ class=”’.$class.’”’ : $atts);
if (!$tag) return $content;
return ($content) ? tag($content, $tag, $atts) : “<$tag $atts />”;
}
}
</code>
</blockquote>
Offline
Re: Users Currently Online
Hmmm… That helped! The tag still produces a 0, Kinda strange or?
Last edited by skoggy (2005-06-02 14:22:16)
Offline
Re: Users Currently Online
In Admin—>Prefs, make sure logging is set to “All hits”. This plugin uses the textpattern logging data, so if logging is off, or set to refers only, then it will not work properly.
Offline
Offline
Re: Users Currently Online
Very elegant solution. I look forward to finding out just how many visitors some of my sites get with a ten minute period.
Update:
The first site I tried it on worked great. The second one with the DoTag error above. I decided it was as good a time as any to upgrade, so I fired up my svn client and got a new install and then sftped it to the site. At that point, path_to_site got wiped out. I fixed that with phpMyAdmin. Switched the plugin back on and still got the doTag error. I pasted in the replacement code and now the plugin returns absolutely nothing.
It works great when it works, though.
Updated again:
I figured out what I was doing wrong. It works now. But I am still at a loss why I have had to apply a patch to the bleeding edge version.
Last edited by michaelkpate (2005-06-03 02:46:00)
Offline
#15 2005-06-02 22:08:40
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Users Currently Online
<code><txp:mem_online_users timeout=“3600” /></code> gives me this output:
<br />
< class=“mem_online_users”>3
Offline