PDA

View Full Version : User Online Script



Shedevil
November 2nd, 2004, 04:19
Hiya.

I've not been around since May due to work etc. but now I'm back online and trying to work on a little mod. for eFiction as a little community I'm in on the main eFiction forums would love to see this happen, so I've been trying all week to get it work and it won't *sigh*.

I need a "user online" script that does basically 3 things:

1. Welcomes a user who has just logged into their account so it prints out a user online.
2. Welcomes NEW member(s).
3. Displays how many people are online.

So it'd look like:

USER ONLINE: Moonbrat, Bunny, Cataluna
NEWEST USER: Crystal Rose, Lunetta
PEOPLE ONLINE: 5

Though if the last one is too hard, don't worry about that as I found a few scripts that can handle it.
I WOULD like, however to pull the users logged in info. from the user.php file of efiction and the new authors from the author.php file...and incorperate it into a php file that informs visitors to the site of how many people are online.
Though can this be done??? OR Is there a script out there that I can just add into the efiction scipt without too much of a headache because what I need is already done...I've only seen the ones that I have to PAY for...

Efiction already has a user login system and author sign up process so I don't need ANOTHER one just to get the "newest user" part, all I want to do is is call who's online etc. from MySQL and print it to my index page...but I seriously need HELP!

Thanks.
Shedevil

powerline5
November 10th, 2004, 17:38
I was doing a search today myself and found this one
http://www.esselbach.com/thread146-1.html (The 1st link is wrong, the 2nd down, by phillipp "moderator" is the correct one)

Thanks,
Crissy

mjz
November 11th, 2004, 17:07
well, i'm no expert but if you tell me how your user table is set up i could write something like that...

newest user you could get with a query checking for the max(userid) for example...

users online you can make a timestamp in the db whenever your users do anything and simply check for timestamps that are less than 5 or 10 minutes old...

Shedevil
November 18th, 2004, 00:49
Hi again.

Well the forum link didn't work (I downloaded the file but it gave me a header error) so I'll try having one wrote for me.

This is what my authors table looks like:

#
# Table structure for table `fanfiction_authors`
#

CREATE TABLE fanfiction_authors (
uid int(11) NOT NULL auto_increment,
penname varchar(200) NOT NULL default '',
realname varchar(200) NOT NULL default '',
email varchar(200) NOT NULL default '',
website varchar(200) NOT NULL default '',
bio text NOT NULL,
image varchar(200) NOT NULL default '',
date datetime NOT NULL default '0000-00-00 00:00:00',
newreviews int(11) NOT NULL default '0',
admincreated int(11) NOT NULL default '0',
password varchar(40) NOT NULL default '0',
validated int(11) NOT NULL default '0',
userskin varchar(60) NOT NULL default '',
level tinyint(4) NOT NULL default '0',
contact tinyint(4) NOT NULL default '0',
carry tinyint(4) NOT NULL default '0',
categories varchar(200) NOT NULL default '0',
bob int(11) NOT NULL default '0',
PRIMARY KEY (uid),
KEY penname (penname),
KEY validated (validated),
KEY admincreated (admincreated),
KEY level (level),
KEY contact (contact)
) TYPE=MyISAM;
# --------------------------------------------------------

I need to have a script written that grabs the penname, and who just signed up and who's currently online.
So it'll look like this:

WHO'S ONLINE: moonbrat
NEWEST USER: shedevil
CURRENTLY ONLINE: 2

Thanks.
-Shedevil

mjz
November 21st, 2004, 09:30
hey, one more thing, are your users loggin in with sessions or cookies and what is the name of the variable holding the userid?

you can pm me this if you dont want it out in the open...

childgenius
December 2nd, 2004, 17:27
use MusicboxV2 which shows users online he he http://www.MusicboxV2.com