• (12 Pages)
  • +
  • « First
  • 3
  • 4
  • 5
  • 6
  • 7
  • Last »

Simple Text Chat Box Learn how to use a simple idea to make text chat web application Rate Topic: ****- 3 Votes

#61 ahmad_511  Icon User is offline

  • MSX
  • member icon

Reputation: 131
  • View blog
  • Posts: 722
  • Joined: 28-April 07

Posted 23 July 2011 - 05:08 PM

Quote

can i send a file from my PC to my friend to download it like in SKYPE

the current code doesn't have such functionality but it can be added as long as you know what you're doing (but not exactly the way skype is doing it).
anyways, it requires a real web host where you can upload the file to and then your friend will receive a private link so he can click to download it.

Quote

can i change the font color from the form send because i try this code but it didn't work

I'm not getting what you're saying, but if you downloaded the latest code you'll see that all of styling properties can be found in the cb_style.css and you can change whatever property you want from there.

Quote

i typed
<p style="color:red;"> hello</p>
and then click on send but the color didn't changed


you can't change the message color this way simply because we replaced the <,> with their entity equivalents to avoid some of html and javascript injections, besides it's not a good option to let people style the message without some restrictions to what they can do, maybe you want to consider using Bulletin Board Codes instead and allow only the set of BBCodes you want them to use.

Hope it helps.
Was This Post Helpful? 0
  • +
  • -

#62 hatem39  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 23-July 11

Posted 23 July 2011 - 05:30 PM

sorry Ahmed i know i ask a lot



View Postahmad_511, on 23 July 2011 - 05:08 PM, said:

the current code doesn't have such functionality but it can be added as long as you know what you're doing (but not exactly the way skype is doing it).
anyways, it requires a real web host where you can upload the file to and then your friend will receive a private link so he can click to download it.


that's mean it's never send file from my PC to my friend the only way is upload the file in any host and then give him the link (there is no code do this job)?



View Postahmad_511, on 23 July 2011 - 05:08 PM, said:

you can't change the message color this way simply because we replaced the <,> with their entity equivalents to avoid some of html and javascript injections, besides it's not a good option to let people style the message without some restrictions to what they can do, maybe you want to consider using Bulletin Board Codes instead and allow only the set of BBCodes you want them to use.

Hope it helps.


that's mean if i don't allow them they never change the font color(is there a trick? :blush: or code do it without using Bulletin Board Codes)

thank you in advence

This post has been edited by hatem39: 23 July 2011 - 05:31 PM

Was This Post Helpful? 0
  • +
  • -

#63 ahmad_511  Icon User is offline

  • MSX
  • member icon

Reputation: 131
  • View blog
  • Posts: 722
  • Joined: 28-April 07

Posted 23 July 2011 - 06:21 PM

Quote

that's mean it's never send file from my PC to my friend the only way is upload the file in any host and then give him the link (there is no code do this job)?

No, I didn't say that.
what I meant is if you're using the chat box on your localhost your friend will not be able to read your inputs since all contents are saved locally to your hard drive, and the simplest way to let him read them is to put them where he can access them (on the internet).
some people hosts their sites on their own machines but this requires you to have a public IP Address and setup/configure your PC properly and carefully since it will be exposed to the public etc. etc...
besides you'll have to keep your machine turned on so people can connect to.

finding a small webhost to host your application (chatbox) is the best option in my opinion since they take care of a lot of things and they have the experience to to do that,
you can find many of hosting plans at low prices or even for free and have enough features to host this simple code (anyways make sure to read the detailed feature list they provide and some testimonials before you register).

now, if you did that, the chatbox will be available to the public as a regular website (unless you want to integrate it with your login system)

the upload facility (if added) will be embedded to the chatbox and it will handle file uploading process and sends corresponding link to your partner so he can download.

Quote

that's mean if i don't allow them they never change the font color(is there a trick? or code do it without using Bulletin Board Codes)

Using BBCodes was just a suggestion, and you can use any trick you prefer to change the font color, but again the script doesn't have this capability now and you have to tweak it a little bit to achieve desired results.

Note:
I'm not sure whether you're asking me to add these features or you want to add them yourself but you don't know how (if this is the case let us know where you got stuck and we'll try our best to help you).

Regards
Was This Post Helpful? 0
  • +
  • -

#64 hatem39  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 23-July 11

Posted 24 July 2011 - 01:31 PM

thank you very much Ahmed
yes i know to share it with my friends i must put it on the net(host)


View Postahmad_511, on 23 July 2011 - 06:21 PM, said:

the upload facility (if added) will be embedded to the chatbox and it will handle file uploading process and sends corresponding link to your partner so he can download.

ok let's say my friend n I chat with each other using chatbox and i didn't upload the file in the host it is in my PC and i want to send it from my PC to my friend's PC throw chatbox (this option is used in SKYPE we can send files from our PC to who chating with him)

View Postahmad_511, on 23 July 2011 - 06:21 PM, said:

Using BBCodes was just a suggestion, and you can use any trick you prefer to change the font color, but again the script doesn't have this capability now and you have to tweak it a little bit to achieve desired results.


we suppose this chatroom script doesn't have this capability(i programed it with a single color) what i want to ask is can i write a code in the send form witch allow me to change the color i hope you understand what i want to do ,sorry i'm not good in webprogramming
Was This Post Helpful? 0
  • +
  • -

#65 ahmad_511  Icon User is offline

  • MSX
  • member icon

Reputation: 131
  • View blog
  • Posts: 722
  • Joined: 28-April 07

Posted 24 July 2011 - 05:17 PM

Quote

this option is used in SKYPE we can send files from our PC to who chating with him

Skype is peer to peer system, the chat box is Client-Server system.
so if you meant you want it act this way, then No
but, if you want to send the file to your friend whatever the method is, then Yes, as I mentioned before you can add an uploading section to the chat box where you can send files to your friend through the server as following:
1- from within the chat box you click the Browse (or Choose File) button.
2- select the file you want and then click the Send button.
3- the file will be uploaded to the server to a specific directory.
4- the server will send your friend a message containing the corresponding URL to the file download handler
5- your friend will see and click provided link to download it.

above are the very basic steps to send a file through the chat box.

Quote

can i write a code in the send form witch allow me to change the color

again, we disabled the < and > symbols for security/usability reasons, and this is what makes it impossible to use html tags inside the message.
you may say Ok, I'll do it on my risk, and here comes another usage problem,
Imagine you want to send your friend the following message:10<p>5, the browser then will render the number 5 as a paragraph right? and you'll not see the result as it should be.

so, that way I suggested the BBCodes since most of us are familiar with (or any other way you want to use to describe the the style properties for the message)
the concept is simple, instead of using known html tags to colorize your message, try to make your own ones.

for example:
instead of using <span style='color:red;'>Hello</span>, you can use [color=red]Hello[/color] which is shorter, easier to remember and semantic.
the only problem here is that the browser doesn't understand that and you have to tell it what to do as following:

Note: this is not the best way to do that, it just to simplify things to you.
this can be done either on the server (php) or on the client's machine (javascript)
1- search the message for the pattern [color= and replace it with <span style='color:
2- read the characters comes between the = sign and the bracket ] which must be a valid color value and replace them with color_value;'>
3- search for [/color] and replace it with </span>

Quote

sorry i'm not good in webprogramming

you only need a good willing to learn and you'll be good someday, I'm not going to pretend that I'm a good programmer, but I really have fun while coding even if I found some hair on the floor around my chair ( I don't know where they came from :) )

Important: I'm not sure if adding message coloring and file upload features to this tutorial is a good thing since I was trying to keep it as simple as possible, from the other hand I don't mind helping anybody to get what he's trying to achieve (if he really wants to learn not just to have the code)

Regards
Was This Post Helpful? 0
  • +
  • -

#66 hatem39  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 23-July 11

Posted 25 July 2011 - 01:26 AM

Thank you very much for your reply ahmed
Was This Post Helpful? 0
  • +
  • -

#67 Thelasers  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 31-July 11

Posted 03 August 2011 - 12:31 AM

can you help me? I want a sound if a user goes online or write something (different sounds)
Thanks for the Tutorial :)
Was This Post Helpful? 0
  • +
  • -

#68 Akai1831  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 26-September 11

Posted 26 September 2011 - 11:17 PM

Hello there guys especially to sir ahmad_511, can I request in your chatbox about log in system can you separate the log in form of administrators and normal users so others can't choose the Administrators in the combo box, to prevent impersonating of other staff or if they choose the Administrators in combo box they will asked security code that only admin know else if they choose normal they just need to input their name because I really want to include your chatbox on my website and goes the credit to you, you're the great sir ahmad_511. Thanks a lot for your hardwork.
Was This Post Helpful? 0
  • +
  • -

#69 phamtungcnt  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 07-October 11

Posted 07 October 2011 - 10:17 AM

I want have chat private-feature between 2 users but don't know how. Can you help me, ahmad_511? Thank you so much! I'm beginner at PHP :(.
Was This Post Helpful? 0
  • +
  • -

#70 Spliffie  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 03-June 11

Posted 07 October 2011 - 10:44 AM

View Postphamtungcnt, on 07 October 2011 - 10:17 AM, said:

I want have chat private-feature between 2 users but don't know how. Can you help me, ahmad_511? Thank you so much! I'm beginner at PHP :(.


If it's up and running correctly, click on the user or double click on user it will insert into prvt message user field , or type user name into prvt user field and send message


Hope it helps

Regards
Spliffie
Was This Post Helpful? 0
  • +
  • -

#71 phamtungcnt  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 07-October 11

Posted 07 October 2011 - 06:28 PM

View PostSpliffie, on 07 October 2011 - 10:44 AM, said:

View Postphamtungcnt, on 07 October 2011 - 10:17 AM, said:

I want have chat private-feature between 2 users but don't know how. Can you help me, ahmad_511? Thank you so much! I'm beginner at PHP :(.


If it's up and running correctly, click on the user or double click on user it will insert into prvt message user field , or type user name into prvt user field and send message


Hope it helps

Regards
Spliffie

Oh, I didn't see the last update version. But it's only in the same box, the way I want is open new window and appear the private chat, only those 2 users can read. Anyway thanks alot, Spliffie!
Was This Post Helpful? 0
  • +
  • -

#72 Syfer  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 190
  • Joined: 08-October 10

Posted 20 October 2011 - 05:22 AM

thanks

This post has been edited by Syfer: 20 October 2011 - 05:43 AM

Was This Post Helpful? 0
  • +
  • -

#73 Octavio  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 08-November 11

Posted 08 November 2011 - 11:27 AM

hello ...

I have a problem, I installed the chat but I can not log in is always in the same place

can you help me?

thank you
Was This Post Helpful? 0
  • +
  • -

#74 ahmad_511  Icon User is offline

  • MSX
  • member icon

Reputation: 131
  • View blog
  • Posts: 722
  • Joined: 28-April 07

Posted 09 November 2011 - 07:40 AM

hi,
sorry I didn't get what you mean, can you please add more details about the problem you're encountering.
any error messages, a link to your chat can also help

thanks for your interesting
Was This Post Helpful? 0
  • +
  • -

#75 Octavio  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 08-November 11

Posted 09 November 2011 - 03:52 PM

hi

sorry for my bad English...

I installed on my chat server and when I put my nickname and is always on the front page here's the link: http://teste-online.net78.net/chat/


Thank you for everything
Was This Post Helpful? 0
  • +
  • -

  • (12 Pages)
  • +
  • « First
  • 3
  • 4
  • 5
  • 6
  • 7
  • Last »