You are here: Re: [PHP] online/offline...but on a list of users « PHP « IT news, forums, messages
Re: [PHP] online/offline...but on a list of users

Posted by Edward Vermillion on 09/05/05 16:16

Ryan A wrote:
> <clip>
>
>>I want to add this same functionality to a forum on the same site (the
>
> forum
>
>>was custom programmed
>>from scratch and not any of the popular ones), but since in a single
>
> thread
>
>>there can be a lot of different
>>people/usernames that answer I would prefer _not_ to do a select lookup
>
> for
>
>>each username...
>>any ideas on how else it can be done?
>
> </clip>
>
> I'd say start with a query that pulls the online users into an array,
> then do an array_key_exists() or in_array() against that.
>
> --------------------------------------------
>
> Thanks! Thats a really good idea and one that i didnt think of.
>
> For now it should be okay as there are just a few hundred users, but
> if it gets really big then it might be a bit of a problem...
> if you any other ideas please feel free to reply till then I'll try your
> idea out.
>
> Thanks,
> Ryan
>
>
>
>

One of the things to think about with this is, although you may have a
few hundred users signed up how many are "online" at once. I've got a
forum with a few thousand members, but at any one time there's only
about 15 average that are "online". It peaks at about 45 sometimes, but
that's rare. So the array in this case is relativly small. Plus it lets
you do other things with the infomation like "There are X users online",
showing who is reading what and stuff like that.

If your running a site like MySpace or DA then it could be a problem.
They tend to break things down though into smaller groups like showing
your "friends", or whatever they call them, that are "online".

Another idea that goes with what Chris had said is to use a join on your
"online" table. I'm assuming that your having to do a lookup for each
post in the forum anyway, just join the "online" table here against the
members id or name or whatever your using to track who makes the
individual posts. How you do it exactly really depends on how you're
building up the forums page.

That would probably be a better situation all around if you're doing a
query for each post anyway.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация