Joomla!
http://forum.joomla.org/

Most online module
http://forum.joomla.org/viewtopic.php?f=40&t=10576
Page 1 of 1

Author:  mediawizard [ Wed Oct 05, 2005 9:27 pm ]
Post subject:  Most online module

Just want to know if there already exists a module for 'most ever users online'

something like the one on this forum

but dont want to use smf

any help appreciated

Author:  mediawizard [ Thu Oct 06, 2005 11:29 am ]
Post subject:  Re: Most online module

anybody want to enlighten me please?

Author:  madflow [ Thu Oct 06, 2005 4:15 pm ]
Post subject:  Re: Most online module

I don't think Joomla stores this kind of information -> so what should a module do then?

Author:  mediawizard [ Thu Oct 06, 2005 6:04 pm ]
Post subject:  Re: Most online module

hmm, i wonder why joomla doesnt store this info?

it has pretty much all other statistics like % browsers, page stats, most popular etc

let me look around

Author:  mediawizard [ Thu Oct 13, 2005 2:19 pm ]
Post subject:  Re: Most online module

Havent been able to figure this one out

does anyone know if the most users ever online is stored by joomla

if yes, could you pls tell me where, couldnt find it.

And if it doesnt, any way of storing this?
and showing it with a module?

Author:  t3.6k [ Fri Oct 14, 2005 3:46 am ]
Post subject:  Re: Most online module

I have a hacked module (mod_whosonline.php) that keeps track of and displays the Most Users Online.  You must publish the Who's Online module and it uses the number of guests + the number of members to determine the maximum and stores that in a table.  I have the module and SQL table zipped in a package if you want to try it.  NOTE:  you'll have to edit the SQL file if you use other than the jos_ prefix for your databse.

check out: http://www.seismicos.com/content/view/52/41/

You'll notice the counter on the homepage.

Author:  mediawizard [ Fri Oct 14, 2005 8:49 am ]
Post subject:  Re: Most online module

Wow, thanks t3.6k will give install and test asap.

It is really nice of you to share this hack.

Author:  t3.6k [ Fri Oct 14, 2005 1:44 pm ]
Post subject:  Re: Most online module

media -

let me know how it goes - and if I need to make any changes or if you need any help.

Author:  t3.6k [ Fri Oct 14, 2005 2:04 pm ]
Post subject:  Re: Most online module

media,

just a heads up - 1.0.3 has a new mod_whosonline.php in it - so you may need to reapply the hack once you've done the upgrade - the hacked version already contained the fix that was released in the 1.0.3 mod_whosinline.php anyway.

Author:  alphanostrum [ Fri Oct 14, 2005 5:20 pm ]
Post subject:  Re: Most online module

great idea but your hack do not functioned with joomla 1.0.3.  straight tested :-(. only the guests are indicated, no members

Author:  t3.6k [ Fri Oct 14, 2005 9:26 pm ]
Post subject:  Re: Most online module

I have it working in version 1.0.3 see http://www.seismicos.com/ with the the very same hack that was posted.  Let me know what I can do to help.

Author:  t3.6k [ Fri Oct 14, 2005 11:00 pm ]
Post subject:  Re: Most online module

alphanostrum -

I just encountered the same thing you were saying, however, it is not the module that is the problem, I actually went and looked at my #__session table and I have logged in users with the guest flag set to 1 and 2.  Not sure how that's happening but it is.  The mod_whosonline.php as distributed from Joomla expects all members to have the guest flag = 0.  I will try to track down why this is happening if I can, and report to the core team.

Author:  t3.6k [ Sat Oct 15, 2005 6:12 am ]
Post subject:  Re: Most online module

well I tracked down what was happening - and have a fix for it - although I'm not sure whether it was done by design or not I have reported it to the core team.  Essentially the guest flag was getting set to the gid(group id) which for special users was not 0 or 1 so mod_whosonline.php will not report them in the member count.  If you want to correct this is is any easy hack

edit the file database.php from the includes directory
in the method updateObject change:

if ($k != 'guest') {
  $val = "''";
}

to this:

if ($k != 'guest') {
  $val = "''";
} else {
  $val = $v;
}

that's it, just added the else clause - this will insure that the guest field gets set to the value the code set it to; for members to 0 for guests to 1.  You can download the hacked database.php (this is the Joomla 1.0.3 version) here:

http://seismicos.com/pafiledb/pafiledb. ... =file&id=9

As always make sure to back up this file before overwriting it!

Author:  mediawizard [ Sat Oct 15, 2005 8:32 am ]
Post subject:  Re: Most online module

Hi t3.6k

Am using an upgraded version of mos,
hence i edited the sql table name

currently on J! 1.0.3
[added ur database.php edited file]

however,

am getting an error - screenshot incuded


and since we are storing the date can we show most users online: X 'on xx.xx.xxxx' [date]?


edit : also tried it on a J! 103 which was installed as 102
> added edited whosonline.php
> added database.php
> sql query error

[see it here]

Author:  t3.6k [ Sat Oct 15, 2005 1:51 pm ]
Post subject:  Re: Most online module

m-

nice site, looks like you got it working - is that only one site - the others are getting errors?

CREATE TABLE mos_mostusers (
  count int(11) NOT NULL default '0',
  date date NOT NULL default '0000-00-00'
) TYPE=MyISAM;

you can use this table without a primary key - the key is not necessary, the only reason I used the key was to keep track of the number of times we have exceeded the most users because the ID will keep track for me, but just more a point of interest than a necessary part of it.

Author:  alphanostrum [ Sat Oct 15, 2005 3:14 pm ]
Post subject:  Re: Most online module

for me this fix the prob. now members are also indicated.

Author:  t3.6k [ Sat Oct 15, 2005 3:23 pm ]
Post subject:  Re: Most online module

alpha - i figured they had that commented out in there cause quoted value may have been casuing a problem of some sort somewhere, which is why I went the direction I did with the unquoted value.

Bug Tracker

Author:  t3.6k [ Sat Oct 15, 2005 4:23 pm ]
Post subject:  Re: Most online module

media-

just cause you asked for it, I modifed a configurable version of Most Users hack - now you can choose to display count, count and date, or not display most users using the Joomla! module manager - see:

http://www.seismicos.com/content/view/54/41/

thanks for the suggestion.

Author:  mediawizard [ Sat Oct 15, 2005 6:51 pm ]
Post subject:  Re: Most online module

t3.6k

I cant begin to thank you...

I tried your hack on three sites :

mumbaimart
Jooms
and golfkraft at the link above.

First two are upgrades,
the last one is a fresh install
and yes, am getting errors on all three

Viz 1.1,
intalls and works like a peach
jooms is done, working on the other two right now
should be done in abt 10 mins ;)

Once again a big thank you t3.6k
I owe you one, let me know if I can help with something

maybe this could be included in the std install
am definitely going to use it on all my sites.

update :
installed on all three sites and is working great
have listed a link to this topic on jooms too

I know a lot of people are going to want this t3.6k

Author:  t3.6k [ Sun Oct 16, 2005 1:21 am ]
Post subject:  Re: Most online module

media - awesome news and thanks for the link on Jooms I really appreciate it!

Author:  Pintobean [ Fri Oct 21, 2005 8:10 pm ]
Post subject:  Re: Most online module

I tried using the better version that t3.6k provides. Everything appears to work fine from the backend. On the frontend, when I'm logged out, it will say "1 guest online" as it should, but after I log in, it says "No Users Online". I applied the sql patch, and my table prefixes are all jos_. I've logged in and out several times, and it is consistent--"No Users Online" whevener I'm logged in.

I haven't editted any other files, just copied over the two mod files and applied the sql patch to create the new database table. Have I missed something?

Thanks!

Author:  t3.6k [ Sat Oct 22, 2005 2:54 am ]
Post subject:  Re: Most online module

Hey pinto-

Yeah there is a problem with the database class that doesn't set the guest/non-guest flag correctly in the session table - you can find a fix here and you'll be all set.  The file gets placed in the includes directory of Joomla - this is a 1.0.3 version of the class.

http://www.seismicos.com/pafiledb/pafil ... =file&id=9

There is actually a discussion about the problem ealrier in this thread.  Let me know if you need more assistance.

Author:  Pintobean [ Sat Oct 22, 2005 3:26 am ]
Post subject:  Re: Most online module

Ahh, thank you. Yeah, you did say that earlier, but for some reason it just wasn't clear to me that it applied.  :-[ Thanks for your reply and for the module! It works perfectly now.

Author:  aitter [ Sat Jan 07, 2006 9:23 pm ]
Post subject:  Re: Most online module

This patched version works. Please, since I am not quite aware of the procedure to submit an official patch, do forward this for use of the other users :)

I hope there are no hidden problems :D

Author:  critter183 [ Thu Feb 23, 2006 4:33 am ]
Post subject:  Re: Most online module

I just used your hack and it works great. had minor issue running the MySQL query, but no biggie. Something about duplicate something or other. Fixed itself basically.

I took out the ul and li stuff to shrink space that online users list filled and I am one happy camper. :)

Thanks!

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/