View Full Version : Chat Hack
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
I am all for it as I am using phpMyChat but it is not integrated with the board.
I support the idea but lack the knowledge.
I'm glad to see others are interested as well. Skimming through the boards, I noticed a similar thread: http://www.vbulletin.com/forum/showthread.php?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.
Cameron
I support the idea but lack the knowledge,too!
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..
I would love to see this hack.
Sadly, I have no PHP coding skills.
On a side note, would it be possible to integrate with a java-based chatroom? Like this one:
http://asiansinc.com/chat.shtml
Far-fetched, but...
Can someone tell me where to get phpmychat?
Thanks!
http://phpheaven.free.fr//phpmychat.php3
Email Group Support is at http://www.egroups.com/group/phpmychat
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:
//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.
Here is the chatloggedin template:
<tr bgcolor="#C3C3EB">
<td><img src="$chatbulb"></td>
<td colspan=5>
<FONT SIZE="2" FACE="arial, helvetica"><b><a href="/phpMyChat/index.php3?U=$username&PASSWORD=&N=20&D=10">Join The Chat</a></b></font>
<BR><FONT SIZE="1" FACE="verdana,arial,helvetica">$chatmessage</font></td>
</tr>
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:
<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.
<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.
[Edited by Tom on 07-11-2000 at 02:08 AM]
Tom,
Can we see this in action somewhere?
Yes, you can. My forum is located at
http://www.downsyn.com/forum/index.php
Please keep in mind that this is a forum for parents who recently have had a child with Down syndrome so please treat the board and the chat room with respect. You will need to register to use the chat room and to see how the board looks. Please enter into the biography section a note that this registration is for testing purposes so I can delete it later on. Thanks.
I like the idea of being able to page a user. You click on their name and send them a message--is this what people mean by private messaging?
There seems to be so many ways to communicate. I'm wondering which are best.
No... private messaging is sort of like a mailbox system. Paging is available through products like ICQ and AOL Instant Messenger.
Very nicely done my friend. I have some issues with PHP MY Chat but your integration is very nice. Thanks!
Originally posted by Tom
Yes, you can. My forum is located at
http://www.downsyn.com/forum/index.php
Please keep in mind that this is a forum for parents who recently have had a child with Down syndrome so please treat the board and the chat room with respect. You will need to register to use the chat room and to see how the board looks. Please enter into the biography section a note that this registration is for testing purposes so I can delete it later on. Thanks.
I jusst wanted to explain what I meant by that this hack isn't great security-wise. I don't mean this opens up a security hole into your server! What I meant was that you would not have to be particularly clever to figure out how to impersonate someone in the chat room. I need to update phpMyChat so that it uses the same login security as vBulletin. Once that is done then it will be as difficult to impersonate someone in the chat room as it would be to impersonate that same person on the board.
I like all the extras.
I think the Chat is a little slow for a chat program though. And I wonder how slow it would become with several users posting at the same time.
The one benefit is that the chat is always there. But then again, one of the benefits of a Normal Chat program is that when someone leaves the room you can talk behind their back. :) And when they return they don't know anything about it. (I don't do that, but I'm sure others do it about me. I can tell. They're all snickering with their fingers, I can tell. Hey, you talking about me to?) :):D
I'm not crazy about phpMyChat either but the fact that it is written in PHP is what makes it easy to integrate into vBulletin. If I had the source code for a good Java Chat program, I could hack it to use the vBulletin database...
I have hacked phpMyChat into vB also. I have done it a little bit differently as I use the vB cookie to set the username. This makes it much harder to impersonate someone else. You can view it at http://www.linuxquestions.org/questions (you must register to use the chat). If anyone is interested I will post the code.
That's exactly what I was going to do when I had a chance. I would love to see the code since I hate having to re-invent the wheel. ;) Thanks.
[Edited by Tom on 07-12-2000 at 07:31 PM]
OK, I'll post it the day I get back from vacation (probably Sat night/Sun morning).
webhost
05-05-2001, 10:06 PM
Tom your board looks great and works great. thanks for the phpmychat hack. I'll be trying it soon thanks again
Joey
my forum at http://forums.realwebhost.net
amsch
05-10-2001, 02:34 PM
I would like to have the PHPchat with the intergration of the boards. Now I do have a suggestion. I know many sites have a chat schedule all set up. What I was thinking is having a place like the birthdays, have it say todays Chats are.. and list the topic with the time and when they click it , it opens the chat room. One thing it would do is be a reminder to those who want to attend, also those who are not always chatters would see it, then the chats are forced to sign-up on the boards. I hope I made sense?
Am
daivnbe
07-05-2001, 11:49 AM
Hi Tom,
i have tried to integrate your phpmychat Hack in my Board. But it doesnt work.
at witch point i have to insert your hack in the index.php?
daivnbe :confused:
daivnbe
07-05-2001, 12:24 PM
Thanks TOM.
I got it by myself :D
daivnbe
GraphicW
07-05-2001, 04:37 PM
Per the instructions of a previous chat hack on here, I have hacked a jIRC into my forums. I have already tried PHPMyChat and unfortunately, it can get painfully slow once you have about 10 people in the chat. You can also still talk behind members' or admins' back without them seeing, you simple set MyPHPChat to delete the messages sooner rather than leaving it for the default time. You can view the jIRC hack in place on my board. No registration is required, URL is in the Sig.
Iliana
07-06-2001, 11:34 AM
I have been trying to integrate phpmychat with vb and not having any luck. I have been asking for help, hoping that someone could give me step by step instructions to accomplish this. Can someone PLEASE :( help me?
nickut
07-07-2001, 04:53 AM
GraphicW...I really like how you have your chat application integrated into your VB forums. I was wondering if you could post your hack so that we may take a look at how you did it with jIRC.
GraphicW
07-08-2001, 09:45 PM
Actually, the "hack" I used for my chat is not really a hack. It's nothing more than a template. It is already documented here on Vbulletin. I don't remember the URL to the thread, but it is easy to find by typing JIRC into the search function here at VB.
bitbender
08-12-2001, 05:39 PM
OK, I read thru all this, and followed the procedures carefully.
From some reason, the chat option doesnt appear on my index.php in vbulletin.
Was I supposed to define the templates (chatloggedin, chatloggedout) in a specific template, or create them as custom templates?
It appears that index.php chat code hack is attempting to call these chatlogged.. methods, so obviously the placement of the code snippet in the vbulletin index.php is important.
Can some help me out and tell me where ??
Im still learning this, so please be gentle with me....:rolleyes:
bitbender
08-12-2001, 09:06 PM
Ok, after reading many more threads on this subject, and some more homework, I now have a chat button added to my header template, but I have been quite unable to locate the chat.php template that is being discussed in several threads as the link that the button relates to.
I tried to follow the developers advice on how to locate it, and used search, and as of yet, I have not found the source for chat.php. I did see one example, but I'm not sure if that is the version I should use....
<?
$opentopublic = 0;
chdir("/prod");
include("./global.php");
if ($opentopublic=="0") {
if (!$bbuserinfo[userid]) {
show_nopermission();
exit;
}
}
eval("dooutput(\"".gettemplate("chat")."\");");
?>
Any ideas folks ??
Lordmusic
08-13-2001, 01:33 AM
PPN and myself (WITH MUCH THANKS TO FREDDIE) will be releasing an integrated chat hack very soon. The demo I am about to show you is not working 100% (updating people on the front) however it is integrated fully.
This hack uses webmaster's java chat.
However the only down to this hack is that it requires a user to run an irc script and be in that channel. What it does is every 2-5 mins (you may change as you see fit) it updates the site (very little bandwidth used) and posts who's currently in the chat room.
There is then a chat button that brings you into the chat. In order to get into the chat you must be a registered member and you see the page just as you would if you were an unregistered user. Once you are logged in you enter chat with your current name...
Now our hack is going to take the _'s out of names. Let me explain... In standard irc all spaces are converted to _'s. Since there are some users with _'s, for the display of the front page our script will take out those _'s so it looks like the original name.
That's about the entirety of the hack. It is nearing completion.
A little thanks to freddie for the inspiration, thanks to the owner of Iguana land.com for helping me get Freddie's version. Thanks of course for PPN for making the hack per my instruction.
This should be released within the week. We are getting all the bugs worked out and the template colors working so it will be a global hack.
To view a semi working demo check here:
http://216.12.212.125/
Look forward to that hack and thank you everyone. Go ahead and ask me questions and give me suggestions.
bitbender
08-13-2001, 11:18 AM
I updated my status with this problem, but I put it in the wrong thread, and did not mean to cross post.
Please read: http://www.vbulletin.com/forum/showthread.php?s=&postid=153637#post153637
Apologies for the x-posting.
I spent the last 8 weeks fighting with a java based forum product. I learned more about dynamic stack traces than I ever cared to know. Turned out to be a package issue, which is still open to Sun for a fix. While I LOVE programming, I HATE debugging code I can't unjar, or get a peek at the source for.
At this time I am not interested in using JAVA until Sun stabilizes the JDK a bit more.
Lordmusic
08-13-2001, 06:40 PM
However with this java it is not run off your server. You simply link from another, just a little tidbit of info.
bitbender
08-13-2001, 07:13 PM
I probably ought not be so critical of Java. I mean I program in it, along with several other languages, but I think it's still got problems. But to be truthful, assembler language sort of 'taints' one's perspective towards 'newer' languages (frame of ref: Age - Assembler 20+ years, Java 6 years).
New Hack links to the IRC servr, eh? That might be a good thing since I've seen that myphpcat is a hog on resources. I have the luxury of a subnet Internet presence, and additional servers here I can offload the chat to, if necessary, but I'll stay posted for your upcoming hack...
But for now, I'm continuing my quest for the chat "fix" my VB needs....I wanted to keep the chat localized to my server for privacy reasons, and I don't like depending on other machines over which I have no control. It's probably a residual effect of 25 years in mainframes where the motto has always been Availability, Availability, Availability.
thanks again, for replying..
Lordmusic
08-13-2001, 07:43 PM
Understood, i feel the same way, yet I would rather not have to deal with all the bandwidth within my own server, hence the reason I chose IRC. I found a good network that not many people use.
I also find PHPMYCHat to be very lame looking and annoying.
It will be released soon and everyone should be happy.
AlpineFX
01-11-2002, 11:59 AM
I installed the hack listed in this forum, but it left some holes in the chat app, so I found another hack for phpmychat and this one focused on the chat app, so I combined the two and volia I came up with a pretty good combo that works well.
Please I only took two existing hacks one from this topic, and one that was done by the guy who did phpMyChat integration Hack topic, I'll try and find his name later and add it. I think the guy who did it here on this topic was John, anyway I think that these two hacks can get you started, but there is still more work to be done. So we can either wait for humble and see what he has come up with, or we can try and exapnd on these two hacks.
Hope this helps, remember this is not really my work, I did some more explaining and combined the two into one file, since this seemed to work for me, in making it more seamless :)
URL: (note must be registered - please if you want to test it, notify me in the registration by saying test)
Chat Hacks (http://www.loweredvisions.com/board/index.php?referrerid=iceman42)
Anfield
01-12-2002, 03:05 PM
?
BrAinZ
01-23-2002, 10:09 PM
This is strange.. I've tried the hack as listed earlier in this thread, but NOTHING seems to happen :(
How do I get the option to "chat" to appear under the PM section of the Forum Home Page ?
Admin
01-24-2002, 01:07 PM
BrAinZ, please go to this (http://www.vbulletin.com/members/vbulletin.org.php) page and enter your username, to show you are licensed. (you will need to use your customer number and password to access that page)
Thank you.
alzeer.net
01-26-2002, 01:11 AM
This hack Gamil Watmna to they spoke him
freedancer
01-29-2002, 07:00 PM
Cool man !!!!
Gholsie
01-30-2002, 06:38 PM
testing quick reply, this is cool
Waterski
02-04-2002, 06:32 PM
I'm having trouble with the EXIT. It integrated fine but now when you click Exit it basically reloads phpmychat and doesn't take me back to my forum.
I have $exiturl setup right too. Can anyone help?
waterski
BrAinZ
02-05-2002, 08:06 PM
This is strange.. I've tried the hack as listed earlier in this thread, but NOTHING seems to happen
How do I get the option to "chat" to appear under the PM section of the Forum Home Page ?
saab340
02-07-2002, 06:55 PM
Where do I put exactly this piece of code?
// CHAT HACK
// Cleanup Old Users First!
// 240 = Wait 4 mins before deleteing inactive users
$DB_site->query("DELETE from c_users where u_time < ".(time() - 120)." and u_time > 0");
.......
....
..
.
// END CHAT HACK
forums index.php I assume?
But where? after what?
How do I get the chat users to show in after currently active users?
ie currently chatting?
FlyBoy73
02-07-2002, 09:40 PM
Anyone interested in installing a chat hack into my site? mypHpChat will be fine as long as they have to be registered to enter..
Please email me if interested and have experience.
Thanks,
David
Gazer
06-05-2002, 11:19 AM
Could someone please help me install a chat hack onto my board
If interested please e-mail me here: Gazer1@talk21.com
Regards Gazer.
Xetox
10-30-2002, 01:38 AM
ok I have done all that...but how do I add the link to the forums? or maybe I did something wrong, I am new to all this and I think I got everything right but who knows.......but I have no link from the forums to the chat? is there something else I need to do?
after readin more I think I am having the same problem as brainz....any help would be much apreciated!
dv6cougar
05-08-2003, 01:54 AM
hello
the
//chat hack stuff goes right abvoe
eval("dooutput(\"".gettemplate('forumhome')."\");");;
now i'm having a bigger problem wiht this one...
it works right, but it doesnt' catch the users who are logged in using
if($bbusername) {
it always displays the fact that you must log in to chat
any ideas? i tried using this code as well
if ($bbuserinfo['userid']==0) {
only reversing the order fo the if and else since the above means your not logged in :)
no luck, that actually threw me a database error!
Dean C
05-08-2003, 05:38 PM
Look at the date of this thread :) ^^
- miSt
dv6cougar
05-08-2003, 09:36 PM
haha, i knew that but still :) i'm gonna use
$bbuserinfo[username] != null
that should work :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.