Members Online addon?

i4get75
i4get75's picture

Joined: 2002-10-24
Posts: 5
Posted: Sat, 2002-10-26 03:04

I like the idea of others being able to see how many people are browsing the site. I think it brings a sense of community to the website and would promote return visitors. Is there a way I can add this to my site.

Please keep in mind, I'm new to PHP so I'll need good instructions.

Thanks,
Greg :wink:

 
BorgKing
BorgKing's picture

Joined: 2002-09-12
Posts: 314
Posted: Sat, 2002-10-26 15:36

There's no add-on like this for Gallery and I think chances of it being created are very slim.

If you want a community, why not install *nuke or a similar cms? They have this option available.

 
Gaile

Joined: 2002-07-20
Posts: 1301
Posted: Sat, 2002-10-26 22:05

Could you not just use one of the many "who's online" scripts that are freely available and adapt it into say...the index page? Or your header? Would probably work.

Went googling and found a bunch at <!-- BBCode Start --><A HREF="http://www.hotscripts.com/Perl/Scripts_and_Programs/Counters/Real-Time/" TARGET="_blank">HotScripts.com</A><!-- BBCode End -->.

There is one at <!-- BBCode Start --><A HREF="http://www.devarticles.com/content.php?articleId=122&amp;page=1" TARGET="_blank">devArticles.com</A><!-- BBCode End --> that does it with PHP.

 
[Syntax]

Joined: 2002-10-26
Posts: 20
Posted: Sat, 2002-10-26 23:45

I even located a users online script that runs without need of a SQL database,
in perl and php... it basically writes a visitor to a text file.. compares the time of the next visitor to the last, if its less than a set number of minutes it assumes there are 2 people online, if another comes it write to the text file, and if any of the entries are older than the set time limit, it removes them recounts the entry and disaplays the count..

You can say the adverage visitor stays 10 minutes, if the script is included on all the pages, it will not duplicate the user in the count, it will just update thier status, and reset the minute count each time they load a page..

its not completely accurate but it beats setting up SQL database, and if the server wont allow session counts this is another option..

 
diomark
diomark's picture

Joined: 2003-03-14
Posts: 90
Posted: Wed, 2004-10-13 06:43

I've been researching this.. can't get it to work.. seems like whenever one of these scripts is used within gallery (say, by embedding as a php include in one of the gallery/html_wrap files), it looses the IP address of the client and hince never works right...

has anyone had luck with this?
-mark

[Syntax wrote:
"]I even located a users online script that runs without need of a SQL database,
in perl and php... it basically writes a visitor to a text file.. compares the time of the next visitor to the last, if its less than a set number of minutes it assumes there are 2 people online, if another comes it write to the text file, and if any of the entries are older than the set time limit, it removes them recounts the entry and disaplays the count..

You can say the adverage visitor stays 10 minutes, if the script is included on all the pages, it will not duplicate the user in the count, it will just update thier status, and reset the minute count each time they load a page..

its not completely accurate but it beats setting up SQL database, and if the server wont allow session counts this is another option..

 
diomark
diomark's picture

Joined: 2003-03-14
Posts: 90
Posted: Wed, 2004-10-13 07:00

found the solution..
replace the lines in the codes (useronline/online visitors php scripts) for
$ip = $REMOTE_ADDR;

to
$ip = $HTTP_SERVER_VARS['REMOTE_ADDR'];

-mark