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
Entire Thread
Subject Posted By Posted
Integrated DigiChat with UBBT 6.2 dimopoulos 01/13/2003 2:42 PM
Re: Integrated DigiChat with UBBT 6.2 JustDave 01/13/2003 2:43 PM
Re: Integrated DigiChat with UBBT 6.2 Dalantech 01/13/2003 3:38 PM
Re: Integrated DigiChat with UBBT 6.2 dimopoulos 01/13/2003 5:31 PM
Re: Integrated DigiChat with UBBT 6.2 JoshPet 01/16/2003 5:24 AM
Re: Integrated DigiChat with UBBT 6.2 gblue 01/16/2003 6:45 AM
Re: Integrated DigiChat with UBBT 6.2 JoshPet 01/16/2003 6:48 AM
Re: Integrated DigiChat with UBBT 6.2 rufnex 01/16/2003 10:57 AM
Re: Integrated DigiChat with UBBT 6.2 Dalantech 01/16/2003 11:23 AM
Re: Integrated DigiChat with UBBT 6.2 dimopoulos 01/16/2003 12:54 PM
Re: Integrated DigiChat with UBBT 6.2 JoshPet 01/16/2003 5:24 PM
Re: Integrated DigiChat with UBBT 6.2 dimopoulos 01/16/2003 5:35 PM
Re: Integrated DigiChat with UBBT 6.2 gblue 01/16/2003 7:17 PM
Re: Integrated DigiChat with UBBT 6.2 rufnex 01/16/2003 7:54 PM
Re: Integrated DigiChat with UBBT 6.2 gblue 01/17/2003 3:46 AM
Re: Integrated DigiChat with UBBT 6.2 JoshPet 01/17/2003 9:18 AM
Re: Integrated DigiChat with UBBT 6.2 dimopoulos 01/17/2003 3:13 PM
Re: Integrated DigiChat with UBBT 6.2 gblue 01/17/2003 4:47 PM
Re: Integrated DigiChat with UBBT 6.2 Pasqualist 03/08/2003 2:59 AM
Re: Integrated DigiChat with UBBT 6.2 dimopoulos 03/10/2003 8:53 PM
Re: Integrated DigiChat with UBBT 6.2 Gregori 08/18/2003 9:54 PM

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)