LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 11-19-2004, 01:34 PM   #1
rioguia
Member
 
Registered: Jun 2002
Posts: 411

Rep: Reputation: 30
webserver-based instant messaging service?


I'm not sure how to ask this question. Is there a software that would allow anyone visiting a website to open an instant message window on a webserver? I'm working on doing a class reunion page for my high school class. My web counter shows when more than one person. People visiting the site complain that there is no way to strike up a conversation. I'm not looking for a clone of the commercial instant messengers that require a user to establish an ID, etc. If there is such a software, could someone point me to a website that demonstrates it? Thanks
 
Old 11-19-2004, 01:46 PM   #2
iago
LQ Newbie
 
Registered: Nov 2004
Location: Canada
Distribution: Slackware
Posts: 26

Rep: Reputation: 15
There is at least a couple different Java applets that have this functionality. I once wrote one, but it's long gone. There are also some applets that let you connect to an irc server through a web page instead of using a real irc client (xchat, mirc, etc.). Either of those should give you the functionality you're looking for.
 
Old 11-20-2004, 04:14 AM   #3
rioguia
Member
 
Registered: Jun 2002
Posts: 411

Original Poster
Rep: Reputation: 30
NEED HELP configuring ez chat

thanks iago. i'm tryin ez chat on a stock Fedora Core 2 / Apache 2.50 imbedded in a cmsimple CMS. Does anyone have any experience with it or know enough PHP to help me?

see:
www.dexter1976.com

The shout box doesn't seem to work an I suspect that its the relative paths set in the code. Nothing displays at all until i make an absolute path pointing to the config and index.php files. Unfortunately, anyone tyring to post to the chat gets sent to the banned list.

The script install instructions are a little hard to understand relative to the path in the config file. It says:
Area 1 is for configuring the location of EzChatBox this should be
relative to the file running the application and should not include
trailing slashes.
<?php
include("/var/www/html/vh07/EzChatBox/config.php");
include("/var/www/html/vh07/EzChatBox/index.php");
?>

The config file looks like this.


####################
# ----------- #
# Configuring #
# ----------- #
# ----------- #
####################

#1 Here is a sample of the default config file.


1 // EzChatBox location (no trailing slash)
$EZChat_location = "EzChatBox";

2 // Set the page titles
$EZChat_title = "EZChatBox - Alpha Release";
$EZChat_ban_title = "EZChatBox - Ban List";
$EZChat_up_title = "EZChatBox - Processing Message...";

3 // Chatbox image title
$EZChat_image = "logo.jpg";
$EZChat_inc_tagline = "No";i ///CHANGED THIS BECAUSE ITS IMBEDDED IN A CMS SYSTEM
$EZChat_tagline = "The easy way to chat";

4 // If EzChatBox is on a page of it's own this value
// must be Yes. If it is included then the value should be No.
// This decides whether to add HTML content at the top of
// the page.

5 // Chatbox refresh page settings
$EZChat_refresh = "Yes";
$EZChat_time = "30";

6 // Chatbox upload refresh timings
$EZChat_uptime = "3";

7 // Admin email (for banned users to plead case)
$EZChat_email = "email@yourserver.com";

8 //files
$EZChat_file_ban = "banned.ban";
$EZChat_file_ips = "iplist.html";
$EZChat_file_content = "dsp_chat_content.php";
$EZChat_ban_relocate = "dsp_ban.php";
 
Old 11-20-2004, 04:21 PM   #4
rioguia
Member
 
Registered: Jun 2002
Posts: 411

Original Poster
Rep: Reputation: 30
ended up using oxyshout!

still need to tweak the code but the basics are working.
 
Old 11-23-2004, 08:28 AM   #5
rioguia
Member
 
Registered: Jun 2002
Posts: 411

Original Poster
Rep: Reputation: 30
banning bad words / refress issues

i have some coding questions regarding software i'm testing at www.dexter1976.com


FIRST, my chat software (PHP / oxyshout) doesn't refresh automatically. when a chat user posts a message, the new message doesn't hit the screen of recipients until they referesh there browser. to solve this i used the following code


My current code does this:
PHP:
Code:
<meta http-equiv="refresh" content="60" />;
this causes one problem. when the referesh hits, it sometimes wipes out the input of somebody trying to type in a message. is my refresh approach wrong? Is there away to deal with the issue but getting the software to save the contents of the input screen for the chat user? Any suggestions would be appreciated.

SECOND, I want to ban bad words on my oxyshout instant message. i have the bad words in the database but upper case varients of the words still get through. i'm not a coder so i really don't know what information to provide to ask this question. if anyone could help me ask a better question, i might even figure it out myself with a google search. here's what i have so far.

I'm tryin to replace the current code to get all varients of the word (BADWORD, badword, Badword, etc.). right now the code gets "badword" but not "BADWORD." does the proposed code do what I want (i haven't been able to make it work yet but it may be due to other problems). I just want to know if this is the right approach i guess. thanks for any help.
PHP:
current code:
Code:
 $post = str_replace($w["word"], $w["replacement"], $post);
proposed code:
Code:
 $post = eregi_replace($w["word"], $w["replacement"], $post);

Last edited by rioguia; 11-23-2004 at 08:50 AM.
 
Old 11-23-2004, 10:00 AM   #6
iago
LQ Newbie
 
Registered: Nov 2004
Location: Canada
Distribution: Slackware
Posts: 26

Rep: Reputation: 15
To respond to the first part about automatically refreshing, it's possible to stream http content. I've only seen this done with a plugin or a customized web server, but I'm pretty sure it's possible with perl or php.

The basic idea is that when you send the HTTP headers to the client ("Content-type: text/html" and such), you don't send a content length. Then you continually send content without closing the socket (ie, completing). If you also send "<script>window.scrollto(0, 400000)</script>" after each message, it will keep the window at the bottom and make it look nicer. You can probably Google "Streaming Http Content" for whatever language you want.

I still think your best bet may be a Java applet, though.

<edit> I was talking to a guy last night who needed help with a Perl chat program he's working on. I'm not sure how he got around this, but I'll direct him to this thread if his way is slick.
 
Old 11-23-2004, 11:01 AM   #7
rioguia
Member
 
Registered: Jun 2002
Posts: 411

Original Poster
Rep: Reputation: 30
Question java

thanks for sharing your knowledge. that makes so much sense. can't wait to try it tonight!

i only know a little "C" which is why i am using PHP. Java's pretty different. is there a good tutorial online i could use to see if i could figure it out. i've seem some really cool features that i would love to try but i don't have a handle on what's required. i'm asking for a tutorial that is the equivalent of my first "hello world" script for java.

thanks

Last edited by rioguia; 11-23-2004 at 11:02 AM.
 
Old 11-23-2004, 11:24 AM   #8
iago
LQ Newbie
 
Registered: Nov 2004
Location: Canada
Distribution: Slackware
Posts: 26

Rep: Reputation: 15
I don't know a lot about making Applets, I've only ever used Java for application development (commandline stuff). There are a million books and at least that many tutorials around about it, so it shouldn't be hard to find a good one.

Good luck!
 
Old 11-24-2004, 11:28 AM   #9
rioguia
Member
 
Registered: Jun 2002
Posts: 411

Original Poster
Rep: Reputation: 30
PHP push and pop commands

has anyone had any experience writing PHP push and pop commands to run a chat room?

http://www.htmlite.com/php025a.php
 
Old 11-24-2004, 11:54 AM   #10
iago
LQ Newbie
 
Registered: Nov 2004
Location: Canada
Distribution: Slackware
Posts: 26

Rep: Reputation: 15
Re: banning bad words / refress issues

Quote:
Originally posted by rioguia
[B]i have some coding questions regarding software i'm testing at www.dexter1976.com


FIRST, my chat software (PHP / oxyshout) doesn't refresh automatically. when a chat user posts a message, the new message doesn't hit the screen of recipients until they referesh there browser. to solve this i used the following code


My current code does this:
PHP:
Code:
<meta http-equiv="refresh" content="60" />;
this causes one problem. when the referesh hits, it sometimes wipes out the input of somebody trying to type in a message. is my refresh approach wrong? Is there away to deal with the issue but getting the software to save the contents of the input screen for the chat user? Any suggestions would be appreciated.
A refresh is done differently on different browsers, and can't be considered consistant. I would recommend you have two seperate pages, one for typing in the message and the other for displaying the chat. Have the display page refresh every 5 seconds, and the other page never refresh. Then put them into a frame or iframe so they are both displayed at once.
 
Old 11-24-2004, 01:40 PM   #11
rioguia
Member
 
Registered: Jun 2002
Posts: 411

Original Poster
Rep: Reputation: 30
Content-length: streaming

iago. thanks again.

i totally agree with you on spliting the content and the input screen; i put that on my to-do list at the site this am (great minds think alike)

i've been looking at your suggestion for streaming. it seems that this is not a well-documented approach.

1 is this content-length sepecified by the html page itself (like meta tags) or is it a function of apache?

2. Are you suggesting that I do any of the following:

a. Content-length: 0 (not supported by the standard)
b. Content-length: blank (just leave no data since content-length is not required?
c. just leave out the content-length reference completely

also what about the "Connection: close"?

proposed
Quote:
HTTP/1.1 200 OK
Date: Mon, 06 Dec 1999 20:54:26 GMT
Server: Apache/1.3.6 (Unix)
Last-Modified: Fri, 04 Oct 1996 14:06:11 GMT
ETag: "2f5cd-964-35bd6"
Accept-Ranges: bytes ***
Content-length:772
Connection: close
Content-type: text/html
***According toO'Reilley :
Quote:
(according to O'Rielley: server possesses the ability to return subsections of a document, instead of returning the entire document every time it is requested. This is useful for retrieving records in a document, which may be useful for database and streaming multimedia applications)

Last edited by rioguia; 11-24-2004 at 01:55 PM.
 
Old 11-24-2004, 02:11 PM   #12
iago
LQ Newbie
 
Registered: Nov 2004
Location: Canada
Distribution: Slackware
Posts: 26

Rep: Reputation: 15
This is from some Java code I wrote:

Code:
out.write((status + "\r\n"));
out.write("Connection: close\r\n");
out.write(("Date: " + new Date() + "\r\n"));
out.write("Server: JavaOpServer\r\n");
out.write("Pragma: no-cache\r\n");
out.write("Cache-Control: no-cache\r\n");
out.write("Content-type: text/html\r\n\r\n");
Followed by the streaming content:
Code:
out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">");
out.write("<html>");
out.write("<head>");
out.write("<title>Channel Text</title>");
out.write("<link href=\"bot.css\" rel=\"stylesheet\" type=\"text/css\">");
out.write("</head>");
	    
out.write("<BODY class=\"chatWindowBody\">");
	    
String []backChat = bot.getOutput().getBackChat();

int start = backChat.length > 40 ? backChat.length - 40 : 0;
	    
for(int i = start; i < backChat.length; i++) 
    outputAdded(backChat[i]);

out.write("<hr>");
out.write("<script type=\"text/javascript\">window.scrollTo(0, 400000)</script>");
out.flush();
	    
bot.addListener(this);
If you want a live demonstration of this bot, let me know here and I'll create an account for you to have a look.


To answer your question, the way I'm doing it is with my own customized Http engine. Of course, that likely won't work for your needs. The only way that I know of to do it is with an Apache or IIS extension or plugin. it's possible there is a way to do it in Php or Perl, but I'm unfamiliar with how.

<edit> I'm thinking about it, and I don't think that Perl (unsure about php) buffers the output before it's sent. Which means that there's no way of Perl specifying its own content length automatically. Using an appropriate loop would probably let you send streaming content from Perl, but I'm not sure how you would detect when they close their browser window (in Java, you get a IOException when the socket is closed). There might be a proper way to stream php like this, I couldn't tell you. I'm a Perl guy, not Php.

Last edited by iago; 11-24-2004 at 02:15 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
instant messaging paul62 Slackware 2 06-15-2005 03:47 AM
instant messaging arlothemoo Linux - General 2 08-19-2002 06:43 AM
RH 7.2 Instant messaging for Linux ? RedHat123 Linux - Software 9 07-16-2002 04:17 AM
instant messaging mmls Linux - Newbie 2 06-12-2002 01:39 PM
Instant messaging help Jasutinsama Linux - General 0 02-14-2001 11:51 AM


All times are GMT -5. The time now is 02:05 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration