Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Aug 2002
Posts: 1,191
Kahuna
Kahuna
Joined: Aug 2002
Posts: 1,191
Mod Name / Version - Integrated DigiChat with UBBT 1.1
Description - This modification allows a seamless integration with DigiChat using data from the UBBT database
Working Under - UBB.Threads 6.2
Features
  • Retrieves the data from the database and passes it as parameters in the DigiChat applet
  • Shows on the Who's Online screen on a different section, who is online

Pre-requisites - none
Author - dimopoulos
Credits - Threadsdev
Files Altered - online.php, templates/default/online.tmpl, templates/default/ubbt_registerednav.tmpl
Database Altered - Yes. New table w3t_InChat. New field U_ChatIcon in w3t_Users table
New Files - Yes. chatmain.php, chatcheck.php, chat.php
Other Info - Backup your database and your files before modifying!!!!!

1. DATABASE Changes
1.1 Create a new table called w3t_InChat with two fields: C_UserID INT(9) NOT NULL and C_Last INT(9) UNSIGNED NOT NULL.
Code
 <br />CREATE TABLE w3t_InChat <br />( <br />	C_UserID  int(9)   NOT NULL <br />	C_Last  int(9)  UNSIGNED NOT NULL <br />); <br />

1.2 Add a new field in the w3t_Users table called U_ChatIcon VARCHAR(10) DEFAULT "1000"
Code
 <br />ALTER TABLE w3t_InChat ADD U_ChatIcon VARCHAR(10) DEFAULT '1000'; <br />


The U_ChatIcon field holds the chat icon that the user will have. It defaults to the default icon of DigiChat which is 1000. You can put more items in there

2. Open templates/default/ubbt_registerednav.tmpl
Find
Code
 <br />($template['members_link']) <br />

BELOW it ADD
Code
 <br />UBBTPRINT; <br />// 20030113 - Chat Link - New Start <br />echo <<<UBBTPRINT <br /> | <br /><script langauge="javascript" type="text/javascript"> <br />	function OpenChat(){window.open('$phpurl/chat.php','','left=10,right=10,width=400,height=250');} <br />	</script><a href="javascript: OpenChat()">Chat</a> <br />UBBTPRINT; <br />// 20030113 - Chat Link - New End <br />echo <<<UBBTPRINT <br />

NOTE: The above code is in One line. I present it in three lines for aesthetic purposes



3. Open online.php
Find
Code
 <br />// ------------------------- <br />// Delete the inactive users <br />   $html = new html; <br />   $Outdated = $html -> get_date() - 600; <br />   $query = " <br />      DELETE FROM {$config['tbprefix']}Online <br />      WHERE       O_Last < $Outdated <br />   "; <br />   $dbh -> do_query($query); <br />

Add below it
Code
 <br />// 20030113 In Chat Check New Start <br />   $Outdated = $html -> get_date() - 60; <br />   $query = " <br />      DELETE FROM {$config['tbprefix']}InChat <br />      WHERE       C_Last < $Outdated <br />   "; <br />   $dbh -> do_query($query); <br />// 20030113 In Chat Check New End <br />[code] <br /> <br />Open online.php <br />Find <br />[code] <br />      $color = $html -> switch_colors($color); <br />      $x++; <br /> <br />   } <br />   $regsize = 0; <br />   if (isset($regrow)) { <br />      $regsize = sizeof($regrow); <br />   } <br />   $dbh -> finish_sth($reged); <br />

Add below it
Code
 <br />// 20030113 In Chat Check New Start <br />   $query = " <br />      SELECT t2.U_Username, t1.C_Last,t2.U_Status,t2.U_Visible,t2.U_Extra1, <br />             t2.U_Title,t2.U_Color,t2.U_OnlineFormat,t2.U_Number <br />      FROM   {$config['tbprefix']}InChat AS t1, <br />	     {$config['tbprefix']}Users AS t2 <br />      WHERE  t1.C_UserID = t2.U_Number <br />      ORDER BY t1.C_Last DESC <br />   "; <br />   $regedinchat = $dbh -> do_query($query); <br />   $regrowsinchat = $dbh -> total_rows($regedinchat); <br /> <br />   $color = "lighttable"; <br /> <br />// Array key tracker <br />   $x = 0; <br /> <br />   [:"blue"]while (list($Username,$Last,$Status,$Visible,$ICQ, <br />            $Title,$Color,$OnlineFormat,$Uid) = $dbh -> fetch_array($regedinchat) ) [/] <br />   { <br /> <br />      $Last = $html -> convert_time($Last,$toffset); <br />      $EUsername = $Uid; <br />      $PUsername = $Username; <br />      if ($Color) <br />      { <br />         $PUsername = "<font color=\"$Color\">$Username</font>"; <br />      } <br /> <br />      $regrowinchat[$x]['color'] = $color; <br />      $regrowinchat[$x]['EUsername'] = $EUsername; <br />      $regrowinchat[$x]['PUsername'] = $PUsername; <br /> <br />      if ($Status == "Administrator") <br />      { <br />         $Status = $ubbt_lang['USER_ADMIN']; <br />      } <br />      if ($Status == "Moderator") <br />      { <br />         $Status = $ubbt_lang['USER_MOD']; <br />      } <br />      if ($Status == "User") <br />      { <br />         $Status == $ubbt_lang['USER_USER']; <br />      } <br /> <br />        // Set up the link to send the user a Private Message -  by JoshPet <br />      if ($config['private']) <br />      { <br />         [:"blue"]$privmessage = "<a href=\"{$config['phpurl']}/sendprivate.php?Cat=$Cat&amp;User=$Uid\"> <br />            <img src=\"{$config['images']}/sendprivate.gif\" <br />                  alt=\"{$ubbt_lang['PRIV_HEAD']}\" border=\"0\" /></a>";[/] <br />      } <br /> <br />    // ----------------------------------------------------- <br />    // Here we give more information on what they are doing <br />      if ( ($OnlineFormat == "no") && ($user['U_Status'] != "Administrator") ) <br />      { <br />         $Private = 1; <br />      } <br /> <br /> <br />      if ( $Private ) <br />      { <br />         $Where = "<font class=\"small\"><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;({$ubbt_lang['Private']})"; <br />      } <br />      else <br />      { <br />         $Where = "Chatting..."; <br />      } <br /> <br />      if ( (preg_match('/^\d+$/',$ICQ)) && ($config['ICQ_Status']) ) <br />      { <br />         $icqindicator = "<img src=\"http://online.mirabilis.com/scripts/online.dll?icq=$ICQ&amp;img=5\" alt=\"*\" />"; <br />      } <br />      else <br />      { <br />         $icqindicator = ""; <br />      } <br /> <br />      $regrowinchat[$x]['icqindicator'] = $icqindicator; <br />      $regrowinchat[$x]['Status']       = $Status; <br />      $regrowinchat[$x]['privmessage']  = $privmessage; <br />      $regrowinchat[$x]['Title']        = $Title; <br />      $regrowinchat[$x]['Last']         = $Last; <br />      $regrowinchat[$x]['Where']        = $Where; <br /> <br />      $color = $html -> switch_colors($color); <br />      $x++; <br /> <br />   } <br /> <br />   $regsizeinchat = 0; <br />   if (isset($regrowsinchat)) { <br />      $regsizeinchat = sizeof($regrowsinchat); <br />   } <br />   $dbh -> finish_sth($regedinchat); <br />// 20030113 In Chat Check New End <br />



Open templates/default/online.tmpl
Find
Code
 <br />UBBTPRINT; <br />} <br />echo <<<UBBTPRINT <br /><!-- END OF LOOP --> <br /> <br />$tbclose <br /><br /> <br /><br /> <br />

Add below it
Code
 <br />UBBTPRINT; <br />// 20030113 In Chat link - New Start <br />echo <<<UBBTPRINT <br />$tbopen <br /><tr> <br /><td class="tdheader" colspan="5" align="center"> <br /><font style="text-decoration: underline">$regrowsinchat {$ubbt_lang['REGED_USERS']}</font> <br /></td> <br /></tr> <br /><tr> <br /><td class="tdheader" width="15%"> <br />{$ubbt_lang['USERNAME_TEXT']} <br /></td> <br /><td class="tdheader" width="2%"> <br />PM <br /></td> <br /><td class="tdheader" width="12%"> <br />{$ubbt_lang['USER_TITLE']} <br /></td> <br /><td class="tdheader" width="16%"> <br />{$ubbt_lang['LAST_ACTIVE']} <br /></td> <br /><td class="tdheader" width="30%"> <br />{$ubbt_lang['ONLINE_LOC']} <br /></td> <br /></tr> <br /> <br /><!-- BEGIN ONLINE LOOP, DO NO REMOVE COMMENT --> <br />UBBTPRINT; <br />for ($i=0;$i<$regsizeinchat;$i++) { //UBBTREMARK <br />echo <<<UBBTPRINT <br /> <br /><tr> <br /><td valign="top" class="{$regrowinchat[$i]['color']}"> <br />{$regrowinchat[$i]['icqindicator']} <br />[:"blue"]<a href="{$config['phpurl']}/showprofile.php?Cat=$Cat&amp; <br />User={$regrowinchat[$i]['EUsername']}&amp;what=online">{$regrowinchat[$i]['PUsername']}</a>[/] <br /></td> <br /><td valign="top" class="{$regrowinchat[$i]['color']}"> <br />{$regrowinchat[$i]['privmessage']} <br /></td> <br /><td valign="top" class="{$regrowinchat[$i]['color']}"> <br />{$regrowinchat[$i]['Title']} <br /></td> <br /><td valign="top" class="{$regrowinchat[$i]['color']}"> <br />{$regrowinchat[$i]['Last']} <br /></td> <br /><td valign="top" class="{$regrowinchat[$i]['color']}"> <br />{$regrowinchat[$i]['Where']} <br /></td> <br /></tr> <br /> <br />UBBTPRINT; <br />} <br />echo <<<UBBTPRINT <br /><!-- END OF LOOP --> <br /> <br />$tbclose <br /><br /> <br /><br /> <br />UBBTPRINT; <br />// 20030113 In Chat link - New End <br />echo <<<UBBTPRINT <br />


NOTE: The code in [:"blue"]blue[/] should be in ONE line. It has been split in two for aesthetic purposes

Last step is to open the chatmain.php and put in the codebase directive your domain name.

Warm regards

Nikos
Attachments
64750-DChatwUBBT6.2.zip (0 Bytes, 25 downloads)


Nikos
Sponsored Links
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Thanks Nikos!

Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
What licensing did you go with at DigiChat? From what I saw the price list was pretty steep!

Joined: Aug 2002
Posts: 1,191
Kahuna
Kahuna
Joined: Aug 2002
Posts: 1,191
Yes it was DaLan. I got the license one which enables me to install the software on my server and use it.

It was really expensive, but I managed to get it for only 400 GBP.

DigiChat has many modules which are sold separately, one of them being the commander which allows you to check who is online in the DigiChat at any time, plus some other stuff. Also you can get the moderation module, which is kind of good if you have chats with important people and users ask them questions - this way you filter out the junk.

The license that I got was for 100 concurrent users.

Warm regards

Nikos


Nikos
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Thanks Nikos -
I just installed this for someone and it worked great.

One correction to your instructions.

You say:
1.2 Add a new field in the w3t_Users table called U_ChatIcon VARCHAR(10) DEFAULT "1000"
Code
 <br />ALTER TABLE [:"red"]w3t_InChat[/] ADD U_ChatIcon VARCHAR(10) DEFAULT '1000'; <br />



Should be:

1.2 Add a new field in the w3t_Users table called U_ChatIcon VARCHAR(10) DEFAULT "1000"
Code
 <br />ALTER TABLE [:"red"]w3t_Users[/] ADD U_ChatIcon VARCHAR(10) DEFAULT '1000'; <br />




Last edited by JoshPet; 01/16/2003 10:22 AM.
Sponsored Links
Joined: Oct 2002
Posts: 108
Journeyman
Journeyman
Offline
Joined: Oct 2002
Posts: 108
Nikos,

Thanks very much for this, Josh just installed it for me and it works great, now I have Chat, UBBT and Photo Gallery (photopost) working great with one login.

Thanks to Dave for IIP and PhotoPost my users dont have to login three seperate times to access all the features on my site.

Thanks to Josh for his hard work and help to get my site working perfect.



Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
You are welcome.

Thank you.

Joined: Aug 2001
Posts: 19
Junior Member
Junior Member
Offline
Joined: Aug 2001
Posts: 19
is there a existing site with a eg. for this chat integration?

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

Joined: Aug 2002
Posts: 1,191
Kahuna
Kahuna
Joined: Aug 2002
Posts: 1,191
Josh, thanks for the suggestion but you posted the same thing twice

I agree it should be
Code
ALTER TABLE `w3t_Users` ADD `U_ChatIcon` VARCHAR( 10 ) DEFAULT '1000'

but I can't edit my original post - time expired, so if you can please do.

Gill, nice to hear that you have everything sorted out.
Rufnex, sorry but I don't have a test site enabled, but when I do, I will either post it here or PM you.

Warm regards

Nikos


Nikos
Sponsored Links
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Ah I highlighted my changes in Red. I can't edit your posts in here....

-- nudge nudge - JustDave

Rufnex - I bet Gill wouldn't mind if you went to www.itsajeep.org and checked out his site. He's got it up and running.

Joined: Aug 2002
Posts: 1,191
Kahuna
Kahuna
Joined: Aug 2002
Posts: 1,191
Thanks Josh.

Warm regards

Nikos


Nikos
Joined: Oct 2002
Posts: 108
Journeyman
Journeyman
Offline
Joined: Oct 2002
Posts: 108
you are welcome to check out my site, its working great

the link is http://itsajeep.org



Joined: Aug 2001
Posts: 19
Junior Member
Junior Member
Offline
Joined: Aug 2001
Posts: 19
[]I bet Gill wouldn't mind if you went to www.itsajeep.org and checked out his site. He's got it up and running. [/]

thx for the link .. so i can test it

Joined: Oct 2002
Posts: 108
Journeyman
Journeyman
Offline
Joined: Oct 2002
Posts: 108
Nikos,

I ran into a slight problem, the mod is working great but most of my users have dial up, including myself. I just disconnected from the internet (it happens a lot here bad phone lines) well DigiChat still thinks I am logged in since I did not log off. Of course when I get re-connected and try to get back into chat it wont let me because I am actually still logged into chat from the previous login. I wonder if you have run into this problem and what you did to work around it. I have not found a way to allow more than one login with the same name.

This has nothing to do with you mod, just curious if you had problems with this before.



Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Ah, now I understand.

I've disabled the "chat" link for you in ubbt_registerednav.tmpl
So if you resolve this, we can turn it back on by modifying that file.

Joined: Aug 2002
Posts: 1,191
Kahuna
Kahuna
Joined: Aug 2002
Posts: 1,191
Gill,

I did find myself in this situation and yes it is a bit of a pain.

The only way to get around it is to close all your internet explorer windows and then login again. It appears that even if you have one IE window open, DChat's java classes use that and think you are connected still. I have been meaning to ask the support people of DChat but never got around it.

I will do though and let you know shortly.

Warm regards

Nikos


Nikos
Joined: Oct 2002
Posts: 108
Journeyman
Journeyman
Offline
Joined: Oct 2002
Posts: 108
Nilkos

Here is my email to Josh (saves typing again)

(cut and paste)

Last night what happened was that I got disconnected from the internet (dialup) When that happens You are still in digichat with the first login name, then when you get re-connected and try to login the new way, DigiChat say's "Hey you are allready logged in" so it wont let you back in.

I thought well ok, I will just go back to the other link at the top of the page and login the old way. WRONG.. that wont work, it keeps telling me (no matter what name I use) that I am typing in the wrong name and password.

before the mod, you could allways go back and login as gblue ii or gblue iii or whatever, For whaterver reason it wont work this way now.

What I did to get by it was I had to go into DigiChat and 'delete' the room, restart the chat server and then create the room again. Once I did that it seem to work ok
the new and the old way, but I wonder what will happen when someone gets disconnected "mid chat" and tries to get back in.

BTW I did delete my cookies but that did not help,

I did talk to digichat and they basically told me because of the client / server type of chat that the ghost login's remain, they said to login as chatmaster and "kick" the ghost out (which I tried) still did not work.

Thanks

Gill Blue




Joined: Jan 2003
Posts: 263
Member
Member
Joined: Jan 2003
Posts: 263
Hi Nikos!

I'm very thankfull for writing the digichat integration mod. It's working almost perfect now...

What is wrong:

When I look at the "who's online" page when 2 or more people are chatting, then there is only one person listed! The name in the list does change change sometimes, but I always see only one name/row....

Any idea ?

Regards,

Pasquale

Joined: Aug 2002
Posts: 1,191
Kahuna
Kahuna
Joined: Aug 2002
Posts: 1,191
I have seen that happening Pasquale on my test board. It must be a typo somewhere. Let me have a look at it and I will get back at you.


Nikos
Joined: Sep 2002
Posts: 151
Member
Member
Offline
Joined: Sep 2002
Posts: 151
It would be cool if there was a custombox for IIP, with info on who´s online in the chat!


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
Nettomo
Nettomo
Germany, Bremen
Posts: 417
Joined: November 2001
Forum Statistics
Forums63
Topics37,575
Posts293,932
Members13,824
Most Online6,139
Sep 21st, 2024
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,835
Greg Hard 4,625
Top Posters(30 Days)
Gizmo 2
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2025 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.1
(Snapshot build 20240918)