Gossamer Forum
Home : Products : DBMan : Customization :

Who's Online Enhancement ?

Quote Reply
Who's Online Enhancement ?
Could somebody or anybody help me out,

I would like to make the $username to be able linking or displaying an invitation ( online ) to chat.

Examples :
When somebody clicks on the $username hypertext link then he/she is currently online, pop up a display :
" <Someone> is asking you to chat " or,
" <Someone> is waiting you at the chat page "

It will be nice, if on the Who's online page displaying alternatives such as,

Check this person to chat
Check All person to chat
or
Selective check on the person who's currently online.

Anyway, thanks if somebody could help me out on this one.






Regards,
Tommy
Quote Reply
Re: Who's Online Enhancement ? In reply to
Sending the invitation would be difficult, but not impossible and it wouldn't be instant either. You would need to store the request somewhere and check for it each time you load a page.

So really, someone will only receive an invitation if they visit another DBMan generated page after the request has been sent.

Bear in mind also, that the "Who's online" MOD displays people based on their activity in the last 10-20 minutes, so the person you invite may not necessarily be online at all.

Taking all this into account, you then need somewhere/something to host the chat...

It sounds like a cool idea though.

- Mark


Astro-Boy!!
http://www.zip.com.au/~astroboy/
Quote Reply
Re: Who's Online Enhancement ? In reply to
Thanks Astroboy,

Actually, what's in my mind is a very simple mod. Also, I don't really mastered the Perl program so I couldn't have done it.

I'm not talking about the chat pages or server, it's like a hyperlink text to another URL, perhaps it doesn't have to be a chat page.

Just logical thinking, the mod uses the auth.pl as the remark or whatever you call it for anyone who's logging, right ?

For instance, the "Who's Online" in this forum, it can trace the viewers on what pages is he/she right now.

With those feature, why don't we add a simple javascript pop up.
That say :

"Someone want to chat with you right now at this page [or] go to this page".

What I couldn't figure it out, is how and where to embedded the javascript, so when someone click the hypertext link on the "Who's Online" page, it will pop up the javascript to the target person.

I know it's easy to say, but perhaps you do have another idea, or someone in this forum could also share the idea.

What I see..is more the usefull of the "Who's Online mod", eq. from the user point of view, they see that right now there are thousands people hanging on this forum, and one of them is their friend, how can they tell him/her that he is also online too ?

Thanks anyway for your reply.

Regards,
Tommy
Quote Reply
Re: Who's Online Enhancement ? In reply to
I like the idea, I was just a little unsure as to how to go about implementing it. But I got to thinking about it and may have come up with something...

In Reply To:
For instance, the "Who's Online" in this forum, it can trace the viewers on what pages is he/she right now.
Yes, but it traces quote "Users that have been active within the last 10 minutes". So if a user leaves this forum and goes to another page (without logging out), they will still appear on the "Who's Online" for a few minutes.

In Reply To:
so when someone click the hypertext link on the "Who's Online" page, it will pop up the javascript to the target person.
Again, this cannot happen instantly without the help of some 3rd party software (like ICQ for example). What would have to happen is to store the request, then wait for that user to access DBMan again. Which in reality may only be a few seconds away when they click another DBMan link - unless they've left - so it won't be instant, but it will be close enough. Smile

- Mark


Astro-Boy!!
http://www.zip.com.au/~astroboy/
Quote Reply
Re: Who's Online Enhancement ? In reply to
Hey Tommy, me again Smile

Ok, believe it or not I think I have a solution. It's quite extensive so I'll put it all together as a text file with instructions and upload it to my website later tonight (I'm at work at the moment).

I'll let you know when it's up, and you can try it out. If everything runs smoothly, I might even submit it to the resources centre.

Cheers,

- Mark


Astro-Boy!!
http://www.zip.com.au/~astroboy/
Quote Reply
Re: Who's Online Enhancement ? In reply to
I don't know if this would help you but if you go to http://cgi-resources.com and then go to there perl script section they have a IM script which maybe you could intergrate in someway

Also could I view this Mod when ready it sounds great!

Thanks

Davidd

Quote Reply
Re: Who's Online Enhancement ? In reply to
Hey Astro, BTW do you have try the "No Duplicates Username" from JPD, so if the $username Logg Off, automatically in the "Who's Online" page won't appear the name anymore.

Regards,
Tommy
Quote Reply
Re: Who's Online Enhancement ? In reply to
http://www.zipworld.com.au/...whos_online_chat.txt

Everything you need to know should be there. The "chat icon" I borrowed from 321clipart.com, you may want to use your own.

I've tested it only briefly and wasn't using the "Who's Online" MOD at the time, so I may have overlooked something.

Let me know how it goes.

- Mark


Astro-Boy!!
http://www.zip.com.au/~astroboy/
Quote Reply
Re: Who's Online Enhancement ? In reply to
Thanks numerique,

Yes, i'll will look at the cgi-resources, but let me try the mod from Astro first, if it's working then I'll let you know.

Regards,
Tommy
Quote Reply
Re: Who's Online Enhancement ? In reply to
thats cool

thanks mate look forward to hearing from you

Quote Reply
Re: Who's Online Enhancement ? In reply to
Hi astro !, Good news !!!

Your mod works, with a few correction, but there still a problem when I check the "Ignore" the pop up didn't show up anymore.

Perhaps you don't set the cookie function to auto delete itself. Otherwise if you log on again with another username, the cookie will still set you as the previous logon username, and...maybe this cause the popup never show again. If you click on the name it will redirect you to the home URL (default.cfg)

A little correction of the mod, add this to the line:
|;
&check_chat_requests;
print qq|
AND :
print qq|<a href="$db_script_link_url&chat_request=send&invite=$username">$username</a><BR>|;

Also,
I don't know where else to insert the "&check_chat_requests;" in the html.pl or the userfriendy_html.pl.
I used sub html_page_top for all my pages, so I just insert only once.

So, how it will be, Astro ?

Thanks


Regards,
Tommy
Quote Reply
Re: Who's Online Enhancement ? In reply to
Hey Tommy,

Glad to hear it (mostly) works Smile

Yep, putting it in html_page_top is perfect.

As for the cookies, I thought I had set the cookie to expire in 5 minutes. I must admit I'm not terribly familiar with cookies, but it seemed to work when I tested it.

The way it works (in theory), is it sets a cookie named after whoever just paged you. So if you log in as a different person, and are paged by the same person, then yes, it won't work.

You can always take out the ignore function, it's just one line:

h += '<br><input type="checkbox" onClick="self.opener.ignore(this.checked);"> Ignore User';

I'll have to look into the cookies a bit more I think.

In any case I'm glad it works. Is it what you were after? It was a fairly rush job, so if you'd like anything changed/added, let me know Smile

- Mark


Astro-Boy!!
http://www.zip.com.au/~astroboy/
Quote Reply
Re: Who's Online Enhancement ? In reply to
Your idea about the "Ignore" part, is a great idea, however i check about your javascript, it seems that the looping have to do with it. Here your javascript :

function ignore(checked) {
if (checked) {
var expire = new Date();
fixDate(expire);
expire.setTime(expire.getTime() + 5 * 60 * 1000);
setCookie(user,'ignore',expire);
} else {
deleteCookie(user);
}
w.focus();
}

Well, Ive thinking about changing the code to set the cookies not to be auto deleted by a certain of time. Maybe, eq. with three option "Accept, Decline, Ignore".
And whenever the User click on the Ignore, yes the popup will never show...
Until..
They go again to the "Who's Online" page, and there is an additional hyperlink text "Invite you for Chatting" besides the $username.

Actually it doesn't seems to need the cookies afterall, and about the cookies function, I have another idea about that.

Astro, could you figure it out ?

BTW, if we've finished, don't forget to insert also my name in your MOD ( ha,ha,ha) otherwise I'm going to be Mad ( just kidding).

Waiting for your reply,


Regards,
Tommy