What is it?: An add on to add Jpilot chat to your Threads install.
Why would I care?: This mod uses a template, and only allows registered users to chat.
Who gets the props?: Dave_L for the code to convert spaces to underscores. JoshPet for letting me use his popup script and omegatron for allowing me to see his chat script.
How do I install it?:
1) Copy jchat.php and chatpopup.php script to your ubbthreads directory.
2) Edit the jchat.tmpl file and change "dachat" to the name of the chat channel you want to use.
<param name="Channel1" value="dachat" />
3) Copy the jchat.tmpl file to your ubbthreads/templates/default/ directory.
4) Add
Code
$ubbt_lang['jchat'] = "In the Chat Room";
to the online.php file in all of your language directories.
5) Download a copy of Jpilot and copy it to a directory named chat under your ubbthreads directory (mine is in ubbthreads/chat).
I could have easily named this add on "How to add something to Threads using a "Threads like" template file". My challenge to all future mods for Threads is that if you create a new php script that you also make that script use a template file. It's a lot easier for most people to edit a template than it is for them to edit a php script. Plus we might just start seeing some of these add ons in the addons folder of a future Threads release.
Just something i want to run by you guys before I install this. My site uses Jpilot, and IIRC, it logs you onto irc.webchat.org? (correct me if i'm wrong). The only problem I forsee myself having is with usernames. Because I have a channel registered on irc.webchat.org, if someone from my site comes into the room and someone else on the server is using that name, and has it protected (aggresively or not) they get renamed as guest in the chatroom. how would this affect threads? I'm a bit confused as to how this works at the monent tbh!
No effect at all on Threads. The user name is passed to Jpilot as the user's nickname for the chat session, but that's all. It just makes it easy for the IRC newbies on your site to log into the IRC server.
Look at the comments in my script and you'll understand what it's doing a lot better.
I'm trying to find info on admin commands for the chatroom stuff...I've never really gotten into it, but figured now would be a good time to start. I have it all set up on my board, and it works very well. However, before I let people know about it, I figured I should make the other admins admins of the chat too (is it possible?) I'm looking for administrator commands for the chatroom on jpilot.com but their forums are down and the command section doesn't deal with it...
I think people show up as "private" even though the chat script is in the Threads directory, and I'm not realy sure how to make them show up as being in the chat. Can anyone point me in the right direction for making it work?
Perfect! Thank you muchly! Do you know if it's possible or how to now add how many people are in the chatroom? Almost like another WOL completely, for the chat?
The way that you are tracked by Threads is when you click on a link (to load a list of posts in a forum, for example). Because the chat page is static, and Who's Online updates every 10 minutes, people have a tendancy to "fall off" of who's online when they are in the chat.
JoshPet solved this problem by creating a java script that updates your online status every 9 minutes, but I don't use it in my hack.
The odd thing that I've noticed is that sometimes I'll show up on a different page in the who's online display, even though the only page I have open is the chat. Unfortunately I don't know enough about how the who's online script works and I haven't had time to sit down and figure it out.
There is a section of code in the jchat.php script that's unnecessary. After reviewing the main.inc.php file (and the ubbt.inc.php file) the table wrappers are defined when you call the library, so you can remove:
and the chat script will work just fine. I actually wrote that section incorrectly anyway (I should have put [:"purple"] $html = new html;[/] on the line above the list statement). Live and learn...
I'll update the zip file later
Update: I should either drink more coffee or get more sleep. The script is OK as is. I'll update the original zip file, but you do need to grab the table wrapper otherwisw tbopen and tbclose are empty.
[:"red"] <script language="javascript" type="text/javascript"> window.blur();</script> <meta http-equiv="refresh" content="500"> <div align="center"><b><font size="2">Please leave this window open while you are in the Chat Room.</font></b></div>[/]
I also added the language [:"red"]$ubbt_lang['jchat'] = "In Chat Room"; [/] to online.php.
The popup opens and refreshes but Who's Online doesn't update my status every 9 minutes.
<div align="center"><b><font face="ariel" size="2"> Please leave this window open while you are in the Chat Room.</b> </font></b></div>"; ?> [/]
My "jchat.tpl" inludes this line, to call-up the "chatpopup.php": [:"blue"] <script language="javascript" type="text/javascript"> window.open('http://www.mysite.com/threads/chatpopup.php?Cat=&Username=$Username&Usernumber=$Usernumber', 'chatpopup','width=800,height=300,top=000,left=000, screenX=1,screenY=1,scrollbars=yes,resizable=yes'); </script> [/]
The one snaglette is my chatpopup.php brings up my header, which is an unecessary bandwidth-user, especially given that it refreshes every (nearly) 10 minutes. And of course it also makes the chatpopup window unecessarily wide. So I'd love to find a way around THAT.
Dal, I've finally gotten this working perfectly, and am really enjoying it. It's all ready to be opened on my board, but I have a weird question. I feel super stupid, so forgive me! lol
Is there a way for me to register the channel I make and have me always an admin? I've looked through the info but am having a hard time....
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.