Chatrooms

Hello everyone, does anyone have any idea on how to incorporate a chatroom into a website? It would have to have usernames and logins.

It’s just an idea thrown at me at the moment and may never come off, but I would like to know if it is possible.

Thanks
Trev


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I’ve seen plenty of these, and the best-executed one I’ve seen is Campfire[1]. I doubt that there’s a way to embed Campfire in another site, but you could easily add a link to your page to send the visitor to Campfire.

If you wanted to build one from scratch, the basic idea is that you have a very lightweight server application which can receive lots and lots of HTTP POST requests (incoming chat messages) and store them in a timeline (probably a database) and then return N number of messages in a structured format (maybe an unordered list, with some CSS classnames to differentiate one user from another). Then on the client side, you use a timed observer pattern (a JavaScript loop that keeps polling the server for updates) to update the contents of a DIV. Prototype.js’s Periodical Observer would be how I would attack this part. The rest is a simple text field and a submit button.

Naturally, if you use Campfire, you would have to pay per user, and if you build it yourself, you would have to figure out how to build it… Not impossible, and well-solved in the wild, which makes your job that much easier.

Walter

  1. http://campfirenow.com

freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

On 20 Oct 2008, 3:34 pm, Trevreav wrote:

Hello everyone, does anyone have any idea on how to incorporate a chatroom into a website? It would have to have usernames and logins.

Checking with Hotscripts is always a good place to start to get an idea what’s available. 404 - Not Found


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Another interesting one would be from SmashingMagazine.com’s 50+ tutorials using AJAX:

http://www.ibm.com/developerworks/web/library/x-ajaxxml8/index.html?ca=drs-

Looks to be an interesting read with the root page here:


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I spend an hour this afternoon making one, just to see if I could:

http://scripty.walterdavisstudio.com/chat

The back-end is ~20 lines of code (plus my usual MyActiveRecord
framework):

<?php
require_once('config.inc.php');
if(isset($_POST['user']) &&
	!empty($_POST['user']) &&
	isset($_POST['message']) &&
	!empty($_POST['message'])){
	$line = clean($_POST['message']);
	$who = clean($_POST['user']);
	$m = ActiveRecord::Create('messages',array('author'=> 

$who,‘message’=>$line));
$m->save();
print($m->h(‘author’) . ': ’ . $m->h(‘message’) . “
n
n”);
exit;
}
if(isAjax()){
header(‘Content-type: text/html; charset=utf-8’);
$thread = ActiveRecord::FindAll(‘messages’,null,‘added_at ASC’);
foreach($thread as $t) print($t->h(‘author’) . ': ’ . $t->h
(‘message’) . “
n
n”);
print ‘’;
}
?>

the front end is all available by dint of “view source”, and uses
Protaculous.

Have a play.

Walter

On Oct 20, 2008, at 6:25 PM, Dan J wrote:

Another interesting one would be from SmashingMagazine.com’s 50+
tutorials using AJAX:

IBM Developer?
ca=drs-

Looks to be an interesting read with the root page here:

http://www.smashingmagazine.com/2008/10/16/50-excellent-ajax-
tutorials/


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I spend an hour this afternoon making one, just to see if I could

Please note that an hour of Walter’s time is worth 24 in the real world.

David


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Please note that an hour of Walter’s time is worth 24 in the real world.

If you prick him, does he not spew code? :smiley:


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Nonsense. I bleed in seven colors!

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

By which, of course, I mean these seven:

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Great stuff, thanks everyone. I’ll look into it today, but I think
it’ll probably be over my head to do it.
I’ve had a look at your chatroom and it looks great, unfortunately I
wouldn’t have a clue on how to use the code, MyActiveRecord
framework, or Protaculous, so that puts me at a bit of a disadvantage!

As I said, it may never happen, and it’s a freebie (or very low paid)
favour for a local rugby team, so I can’t afford to spend the time
learning what to do - unless they can let me fiddle on in my own time
forever more.

Many thanks

Trev
On 21 Oct 2008, at 01:48, waltd wrote:

By which, of course, I mean these seven:

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

If you have a PHP5 server available, I can share a version that uses a text file for its data store. You’d just drop a couple of files in particular places relative to the Freeway page, and it will just work. There will be performance issues to that version which the MySQL one just won’t have, but for low-stress use, it will probably be fine. Let me know if you want to try it, and I’ll bundle it up.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks Walter, I’ll let you know how things progress, but I’ve now
just heard that it could be a blog where users can add their comments
rather than an out-and-out chatroom. Don’t know if this is easier or
harder!
Trev
On 21 Oct 2008, at 12:26, waltd wrote:

If you have a PHP5 server available, I can share a version that
uses a text file for its data store. You’d just drop a couple of
files in particular places relative to the Freeway page, and it
will just work. There will be performance issues to that version
which the MySQL one just won’t have, but for low-stress use, it
will probably be fine. Let me know if you want to try it, and I’ll
bundle it up.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Walter, it looks like it may be going ahead, but instead of a
chatroom or blog, they’re going to want a message board, for which
people will have to log in, and also some sort of voting system for
player of the day, again, for which they’ll have to sign in.

Maybe it ends up having a registration and sign in box on the home
page and once you’re past this then any page is viewable.

Any thoughts from anyone would be greatly appreciated as I’m now
getting out of my depth…

Thanks
Trev

On 21 Oct 2008, at 12:26, waltd wrote:

If you have a PHP5 server available, I can share a version that
uses a text file for its data store. You’d just drop a couple of
files in particular places relative to the Freeway page, and it
will just work. There will be performance issues to that version
which the MySQL one just won’t have, but for low-stress use, it
will probably be fine. Let me know if you want to try it, and I’ll
bundle it up.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Walter, it looks like it may be going ahead, but instead of a chatroom or blog, they’re going to want a message board, for which people will have to log in, and also some sort of voting system for player of the day, again, for which they’ll have to sign in.

Well, the gold standard for message boards is PHPBB. It also has a poll feature (not sure if it’s standard or a plug-in) that lets you post a new thread which simply collects votes rather than replies. I believe it can be set to require login in order to view anything, or at the least, in order to post anything.

One thing to know, however. With great popularity comes a great deal of dedicated hacker effort, since an exploitable weakness can be multiplied by all the thousands of installations out there. PHPBB is one of the more-often-hacked server apps as a result, and you really have to keep up with the latest patches if you want to run it.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Its could be still something that a WordPress blog could do. e.g. to
get users to login and see hidden posts only to subscribed members,
and there are several voting plugins you could use. The way the posts
and replies are styled could give a feel of a message board.

I would install a Wordpress blog, and have a play around with it to
get the feel of how it works, and familiarise yourself with it.
Luckily being widely used, there are lots of plugins for Wordpress
that could be a solution to suit you, and save you lots of time.

On 22 Oct 2008, at 17:33, Trevor Reaveley wrote:

Walter, it looks like it may be going ahead, but instead of a
chatroom or blog, they’re going to want a message board, for which
people will have to log in, and also some sort of voting system for
player of the day, again, for which they’ll have to sign in.

Maybe it ends up having a registration and sign in box on the home
page and once you’re past this then any page is viewable.

Any thoughts from anyone would be greatly appreciated as I’m now
getting out of my depth…

David Owen
Freeway Friendly Web hosting and Domains ::


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks David, I’ve heard of Wordpress but never used it (or even seen
it). Is it a standalone programme that somehow integrates with FW?
Trev
On 23 Oct 2008, at 14:08, David Owen wrote:

Its could be still something that a WordPress blog could do. e.g.
to get users to login and see hidden posts only to subscribed
members, and there are several voting plugins you could use. The
way the posts and replies are styled could give a feel of a message
board.

I would install a Wordpress blog, and have a play around with it to
get the feel of how it works, and familiarise yourself with it.
Luckily being widely used, there are lots of plugins for Wordpress
that could be a solution to suit you, and save you lots of time.

On 22 Oct 2008, at 17:33, Trevor Reaveley wrote:

Walter, it looks like it may be going ahead, but instead of a
chatroom or blog, they’re going to want a message board, for which
people will have to log in, and also some sort of voting system
for player of the day, again, for which they’ll have to sign in.

Maybe it ends up having a registration and sign in box on the home
page and once you’re past this then any page is viewable.

Any thoughts from anyone would be greatly appreciated as I’m now
getting out of my depth…

David Owen
Freeway Friendly Web hosting and Domains ::

http://www.ineedwebhosting.co.uk
I Need Web Hosting Mac friendly web hosting and domain registration
http://www.printlineadvertising.co.uk


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

On 23 Oct 2008, 1:13 pm, Trevreav wrote:

Thanks David, I’ve heard of Wordpress but never used it (or even seen
it). Is it a standalone programme that somehow integrates with FW?
Trev

WordPress is a blogging software you install on your Web server. Visually speaking, it offers themes or skins, which are something you would edit in a text editor/CSS editor to make the site look the way you like. But it’s not at all compatible with Freeway.

That said, it is extremely powerful and extensible, and runs some of the busiest blogs on the Web.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Trev,

Yes its a stand alone program.

Look in your domain hosting control panel under CGI scripts >
Wordpress Blog, and click on that to install in a folder/directory.
Follow the instructions to install, have a play. If it goes wrong the
folder/directory can be easily deleted using an FTP program, and the
MySql database deleted fro the control panel.

You can create a Freeway front end web site that links into this
folder/directory.

If you can get to grips with working and styling a WordPress blog
using CSS, you will certainly aid you in working with Freeway sites,
and appreciate how good Freeway actually is.

On 23 Oct 2008, at 14:13, Trevor Reaveley wrote:

Thanks David, I’ve heard of Wordpress but never used it (or even
seen it). Is it a standalone programme that somehow integrates with
FW?
Trev

David Owen


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks David, as I have the hosting with you it seems to make sense
to have a play. When I get a moment I’ll be on the case.
Trev
On 23 Oct 2008, at 14:54, David Owen wrote:

Hi Trev,

Yes its a stand alone program.

Look in your domain hosting control panel under CGI scripts >
Wordpress Blog, and click on that to install in a folder/
directory. Follow the instructions to install, have a play. If it
goes wrong the folder/directory can be easily deleted using an FTP
program, and the MySql database deleted fro the control panel.

You can create a Freeway front end web site that links into this
folder/directory.

If you can get to grips with working and styling a WordPress blog
using CSS, you will certainly aid you in working with Freeway
sites, and appreciate how good Freeway actually is.

On 23 Oct 2008, at 14:13, Trevor Reaveley wrote:

Thanks David, I’ve heard of Wordpress but never used it (or even
seen it). Is it a standalone programme that somehow integrates
with FW?
Trev

David Owen
http://www.ineedwebhosting.co.uk
I Need Web Hosting Mac friendly web hosting and domain registration


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options