Version: , by (Guest)
Developer Last Online: Jan 1970
Version: Unknown
Rating:
Released: 06-23-2000
Last Update: Never
Installs: 0
No support by the author.
First of all, let me thank all who have worked on the various hacks already. The work you all do is tremendous. Here is my suggestion for a hack that I think would be quite useful.
It's a real time chat hack. Now I know there are plenty of scripts out there that let you set up chat rooms, but I'm talking about one integrated into vBulletin. I envision a chat system where the room is always open to registered users. The column of users would be listed somewhere on the page, and double clicking a user would bring up their profile. I have no idea how difficult this would be to create, or what kind of strain would be put on the server, but if it could be done I think it would be a tremendous addition.
What do you guys think,
Cameron
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
I'm glad to see others are interested as well. Skimming through the boards, I noticed a similar thread: http://www.vbulletin.com/forum/showt...?threadid=1150 , however it really hasn't been worked on much. I know those skilled in PHP are wrapped up in the Private Messaging and Avatar hacks right now, but if there is enough interest, maybe someone could put it on a furure to do list.
I have sort of integrated phpMyChat into my forums - you can check it out below. I have not worked on integrating the logins as of yet but I hope too soon..
Integrating phpMyChat into vBulletin is actually pretty easy. There are a couple of tricks to do with phpMyChat. You don't want to allow anyone to register (they are going to get in through vBulletin) and you want them to return to vBulletin when they exit phpMyChat.
Here's the vBulletin hack for index.php:
Quote:
//BEGIN CHAT HACK
if ($bbusername) {
$chatbulb = 'images/off.gif';
$numchattersa = $DB_site->query_first("SELECT count(username) AS username FROM c_users");
$numchatters = $numchattersa[username];
if ($numchatters == 0)
{
$chatbulb = 'images/off.gif';
$chatmessage = 'Chat room is currently empty';
} else {
$chatbulb = 'images/on.gif';
$chatmessage = "There are $numchatters people in the chat room";
}
eval("\$chatinfo .= \"".gettemplate("chatloggedin")."\";");
} else {
eval("\$chatinfo .= \"".gettemplate("chatloggedout")."\";");
}
//END CHAT HACK
You have to create two new templates (chatloggedin and chatloggedout) that are used just like the personal message hack templates. You will notice that the c_users table in the select statement is actually a phpMyChat table. The on light will display whenever anyone is in the chat room. If they are not logged on to vBulletin, they won't be permitted into the chat room.
Notice that we are linking into phpMyChat with the vBulletin username and no password. This makes them a non-registered user of phpMyChat. This works but it isn't great security wise. When I get a chance I will clean this up to secure it better.
Here is the chatloggedout template:
Quote:
<tr bgcolor="#C3C3EB">
<td colspan=6>
<smallfont>You must login to join the chat!</smallfont></td>
</tr>
Here's the hack for index.php3 of phpMyChat. At the very end, replace the login screen html with a redirection back to the vBulletin board. This will also prevent anyone from logging into phpMyChat any way except through the vBulletin board.
Quote:
<html>
<head>
<title>vBulletin Redirect</title>
<meta http-equiv="Refresh" content="0; URL=/forum/index.php">
</head>
<body bgcolor="#ffffff" text="#000000" id=all>
<p>Thank you for participating in our chat. You are are now being returned to the <a href="/forum/index.php">VBulletin forum</a>.</p>
</body>
</html>
This works, it was easy to code, but I'm sure it isn't the best way to do it. It certainly isn't the most secure.