|
 |
asp_discuss thread: on the fly chat rooms in asp
Message #1 by "santosh" <santoshsap@y...> on Fri, 20 Apr 2001 08:17:07
|
|
i have developed a chat software in asp. i wish to add the facility of
having private conversation. please help me out.
Message #2 by y.pedersen@g... on Mon, 23 Apr 2001 21:31:50
|
|
I have been in exactly the same situation as you, I made the chat room for
one of the Danish personal contact forums.
I solved the problem by making the chat room object oriented. I made two
objects, User and Message.
User had properties such as UserName and UserID. The UserID was assigned
when the user went through the login procedure. The Message object had a
RecipientID and SenderID property to decide whether the current user was
allowed to see the message or not, simply by comparing the current user's
ID with the RecipientID and SenderID properties.
Let me know if you have further questions regarding to the chat room.
Sincerely,
Yoel Pedersen
Message #3 by santosh sapke <santoshsap@y...> on Mon, 23 Apr 2001 21:34:39 -0700 (PDT)
|
|
--0-1225115784-988086879=:5996
Content-Type: text/plain; charset=us-ascii
hi Yoel
Thanx for your support. i have developed the chat in asp and i suppose the thing u r talking about is being implemented as private
messages. i have right now done the same thing as u said, but for the private message.
i wish to develop the on he fly chat rooms when one user clicks on other user's name in the user list. i don't know how can i open a
window on the other user's computer if i try to sent messages from my m/c if i am one of the users. its is very similar to that of
yahoo chat or the messenger but they r through java.
regards
santosh
y.pedersen@g... wrote:
I have been in exactly the same situation as you, I made the chat room for
one of the Danish personal contact forums.
I solved the problem by making the chat room object oriented. I made two
objects, User and Message.
User had properties such as UserName and UserID. The UserID was assigned
when the user went through the login procedure. The Message object had a
RecipientID and SenderID property to decide whether the current user was
allowed to see the message or not, simply by comparing the current user's
ID with the RecipientID and SenderID properties.
Let me know if you have further questions regarding to the chat room.
Sincerely,
Yoel Pedersen
---------------------------------
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
Message #4 by y.pedersen@g... on Tue, 24 Apr 2001 20:34:06
|
|
Hi Santos,
I did it this way:
I have a collection of message objects stored in the Application object of
ASP. To make all the valid messages appear on a message board each time
the message board was updated (every 9th second) I made a For Each...Next
loop to write all the output html to the user's browser. To determine
whether it should write the current message in the loop or not I used the
RecipientID property of the message and compared it with the user's UserID
property. I made it check the recipient name, and if it was equal
to "Everybody" I made it send yellow text on a black background, and if it
was anything but "Everybody" (which would mean that it was a private
message, if there was a recipient name assigned) I made it send red text
instead of yellow. This way the user of the chat room doesn't have to be
bothered by popup-windows, he/she can just look at the colour of the text
to see whether it was private or not.
If you want to make a popup-window anyways, you can make it with
javascript, you just send it as a part of the html output (I have made my
chat room send a javascript to update the frame of the window containing
the user list each time a message such as "... left the room" or "...
entered the room" appeared as a newly added message).
It says that we are not allowed to discuss code on this list, but if you
want to get some code to open a popup-window with a specified url, you can
send me an e-mail at y.pedersen@g... or you can ask someone at the
javascript list.
Regards, Yoel
|
|
 |