Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 4 1 2 3 4
#232706 01/11/2003 10:46 AM
Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
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).

For more info on configuring Jpilot see their web site.

<Da_Soap_Box>

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.

</Da_Soap_Box>

Enjoy <img src="/threads/php/images/graemlins/smile.gif" alt="" />

Version 1.1 now includes a popup window to update the who's online display.
Attachments
64465-Jchat.zip (0 Bytes, 120 downloads)

Last edited by Dalantech; 05/25/2003 2:26 AM.
Sponsored Links
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I know there are a bunch of users that will get a lot of use out of this. Thanks!

Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268


There are a couple variations of this one floating around, but I figured I'd write one that uses a template

It's all your fault JustDave...

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
Thanks Dalantech I was actuall thinking of this a few weeks ago. Your right there are quite a few chat mods around here. Good to be updated.

Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
Thank you for letting me see your chat script!

Sponsored Links
Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
thats why its posted here so everyone can have a chat.

Now if I can ever get instant messaging done again like I had in UBB I will be a happy camper. Shout box is close but not exactly what I want.

Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
Thanks Dlanatech - keep meaning to re-install the chatroom - maybe this will prompt me to do it LOL

Ian


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Great Job!

Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
Thanks for your help on it

Joined: Jun 2001
Posts: 356
Junior Member
Junior Member
Offline
Joined: Jun 2001
Posts: 356
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!

Sponsored Links
Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
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.

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
nice job


- Allen wavey
- What Drives You?
Joined: Jun 2001
Posts: 356
Junior Member
Junior Member
Offline
Joined: Jun 2001
Posts: 356
aha! Thanks, I understand now.

Joined: May 2002
Posts: 362
Junior Member
Junior Member
Offline
Joined: May 2002
Posts: 362
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...

Any other places to look?

-peter

Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
Thanks

Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268

Joined: May 2002
Posts: 362
Junior Member
Junior Member
Offline
Joined: May 2002
Posts: 362
Thanks a bunch! Is there any chance I can have the chatroom info like who's in the chat show in the WOL?

Thanks again for everything!

-peter

Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
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?

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
If the page is called "chat.php"

In the languages/english/online.php language file, add this:


$ubbt_lang['chat'] = "In the Chat Room";

Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
Proving, yet again, that you rule!

Thanks!

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
You are doing quite nicely here yourself lately... all sorts of cool stuff that you've been posting.

Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
Thanks

Just trying to give something back...

Joined: May 2002
Posts: 362
Junior Member
Junior Member
Offline
Joined: May 2002
Posts: 362
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?

Thank you!

-peter

Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
No idea, unless you are in the chat with them

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.

Last edited by Dalantech; 01/19/2003 1:15 PM.
Joined: Aug 2002
Posts: 32
User
User
Offline
Joined: Aug 2002
Posts: 32
Has anyone done this, so I can view it on action???


Organizer
Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
[]Has anyone done this, so I can view it on action??? [/]

I've got it at measurection.

Username: testing
password: testing

Then click the chat button at the top.

The little popup will update the Who's online information every 9 minutes. The top of every page in my threads tells how many users are in Chat.


Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
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:

Code
 <br />// --------------------- <br />// Grab the tablewrapper <br />   list($tbopen,$tbclose) = $html -> table_wrapper(); <br />


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.

Last edited by Dalantech; 01/25/2003 2:25 PM.
Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
Zip file updated

Joined: Sep 2000
Posts: 49
Power User
Power User
Offline
Joined: Sep 2000
Posts: 49
[]The little popup will update the Who's online information every 9 minutes...[/]

Josh, I was trying to go for this, but couldn't get it. If you can spare the time, could you review this with me?

I added this code to my jchat.tmpl:

[:"red"] <script language="javascript" type="text/javascript"> window.open
('http://www.mysite.com/threads/chatpopup.php?
Cat=&Username=$Username&Usernumber=$Usernumber',
'chatpopup','width=300,height=250,top=100,left=150,screenX=1,screenY=1,
scrollbars=yes,resizable=yes');</script>[/]

...and just put this in my new "chatpopup.php":

[:"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.

Thanks in advance for your tips!

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
I haven't looked at the way Dalantech set this up... I know some of it was based on what I had created (like the pop up thing).

The only way I could get it to work at the time was by passing the Usernumber variable to the popup in the URL.

Is $Usernumber being defined in the chat php file?

The popup should update the info, if it has the usernumber.

Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
I didn't set it up to use your java applet Josh, but I think that variable should be available after authentication.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Yeah, in whatever script you call this:


('http://www.mysite.com/threads/chatpopup.php?
Cat=&Username=$Username&Usernumber=$Usernumber',
'chatpopup','width=300,height=250,top=100,left=150,screenX=1,screenY=1,
scrollbars=yes,resizable=yes');</script>


Make sure $Username & $Usernumber has been defined before it. You may need to do

$Username = $user['U_Username'];
$Usernumber = $user['U_Number'];

or something similar to set that up.

Try adding :

echo "Name = $Username <br />";
echo "Number = $Usernumber <br />";

near the top of chat popup to debug it.... see if it has a name and number... if not, that's the problem.

Joined: Sep 2000
Posts: 49
Power User
Power User
Offline
Joined: Sep 2000
Posts: 49
I don't have a clue what I'm doing but I got it to work! Don't you love it when that happens?

Here's what I did. I borrowed some code from the top of the faq_english.php file, since the "Who's Online" updates when users go to THAT file......

So, my new "chatpopup.php" looks like this:
[:"blue"]
<?
// Require the library
require ("./main.inc.php");

$html = new html;
$html -> send_header("Updater",$Cat,0,0,0,0,"");


echo "
<script language="javascript" type="text/javascript">
window.blur();</script>
<meta http-equiv="refresh" content="550">

<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.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
I wonder if this works for me but not for you because Register Globals might be off?

Hmmmm.... you shouldn't need to send the header.


Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
Attachment corrected and uploaded to the first post

Joined: May 2002
Posts: 362
Junior Member
Junior Member
Offline
Joined: May 2002
Posts: 362
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....

Thanks,
peter

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
your on dalnet or xnet?

The command will be on xnet for example this

/msg nickserv register yourname your password

/msg chanserv register roomname password description

then when you log into the room you can type this

/msg nickserv identify password

/msg chanserv identify roomname password

You will be autooped and recognized as founder

Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
Excellent post Chuck

We'll turn this place into a tech support site like mine in no time

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Hey - try this.

You shouldnt' need to send the header, but add this near the top of your chat popup file. (After the "require" to main.inc.php).

Code
<br />	$Username = get_input("Username","get");<br />	$Usernumber = get_input("Usernumber","get");<br />


I think this has to do with Register Globals being off (or on)

But this has been fixing alot of issues with variables not getting passed. It's a standard function.

Let me know if that helps.

Page 1 of 4 1 2 3 4

Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
AllenAyres
AllenAyres
Texas
Posts: 21,079
Joined: March 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)