TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,163
  • Total Topics: 21,351
  • Online today: 816
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 218
  • Total: 219
  • @rjen

I want to add chat option to my site

Started by Ibexy, December 26, 2006, 08:05:13 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

knat

I was replying to the first post.. did you highjack the thread  ? ;D

URPG

Hijack? naaaah, wouldn't get any ransom for it anyway i guess...

I was just looking for chat software myself and decided we did not need one chat-thread per user.

SRaven

http://www.x7chat.com

they have several forum intergrations one of them is SMF :) its what I use for my forum.

SoulPleX

Quote from: Tank on January 11, 2007, 10:34:55 AM
There is a new chat for smf.. and it dont run on your server so no heavy server load.. check it out at: http://www.userplane.com/support/downloads/webchat/index.cfm?gclid=CKWYyZSV2IkCFSoMQgodmj69-A

It looks cool  :)

Here is the code Userplane provided if anyone can make it work for TP


<?php
################################################################ CONFIGURE USERPLANE

# Modify the following line with your domainID.  This can be found inside the link generated in the Instant Webchat Admin.
$wcii['domainID']                = 'domainID';

# Edit this line to set whether or not guests will have access to the Webchat.
# if TRUE guests will have access, if FALSE they will receive a message you can customize below.
$wcii['guests_enabled']                = FALSE;

# Edit this setting (TRUE/FALSE) if you want to use Userplane login medallion.
# If TRUE the Userplane login medallion will display rather than the client side login field.
# In the future this medallion will contain more features and options, so we suggest you use our medallion.
$wcii['serverside']                = FALSE;

# This sets whether or not users are required to enter the Webchat with their usernames from the site or
# if they can enter a username in the login field.  
# This feature works only if you set the above value to FALSE thus not using the Userplane login medallion.
$wcii['force_username']        = TRUE;

# This value sets the title of the Webchat page.
$wcii['text_title']                = 'Video_Chat';

# These values set the text used on the Webchat launch page.
$wcii['text_launch']        = 'Launch Video Chat';

$wcii['text_noaccess']        = '<blockquote><b>Sorry, you don\'t have the permission to access the Webchat.  Please contact the site admin.</b></blockquote>';

$wcii['text_welcome']        = 'Welcome.  Please enter a username for the Webchat  - The site may require you to use your account name.  Click the "'.$wcii['text_launch'].'" to enter the Video Chat.';

################################################################## NO MORE EDITS

$forum_version = 'SMF 1.0.5';

// Get everything started up...
define('SMF', 1);
@
set_magic_quotes_runtime(0);
error_reporting(E_ALL);
$time_start = microtime();

// Load the settings...
require_once(dirname(__FILE__) . '/Settings.php');

// Just in case something happens to Settings.php, let's try to at least load an error screen.
if (!isset($sourcedir))
       
$sourcedir = dirname(__FILE__) . '/Sources';

// And important includes.
require_once($sourcedir . '/QueryString.php');
require_once(
$sourcedir . '/Subs.php');
require_once(
$sourcedir . '/Errors.php');
require_once(
$sourcedir . '/Load.php');
require_once(
$sourcedir . '/Security.php');

// If $maintenance is set specifically to 2, then we're upgrading or something.
if ($maintenance == 2)
       
db_fatal_error();

// Connect to the MySQL database.
if (empty($db_persist))
       
$db_connection = @mysql_connect($db_server, $db_user, $db_passwd);
else
       
$db_connection = @mysql_pconnect($db_server, $db_user, $db_passwd);

// Show an error if the connection couldn't be made.
if (!$db_connection || !@mysql_select_db($db_name, $db_connection))
       
db_fatal_error();

// Load the settings from the settings table, and perform operations like optimizing.
reloadSettings();
// Clean the request variables, add slashes, etc.
cleanRequest();
$context = array();

// Determine if this is should be using WAP, WAP2, or imode.
define('WIRELESS', isset($_REQUEST['wap']) || isset($_REQUEST['wap2']) || isset($_REQUEST['imode']));
// Check if compressed output is enabled, supported, and not already being done.
if (!empty($modSettings['enableCompressedOutput']) && !headers_sent() && ob_get_length() == 0)
{
       
// If zlib is being used, turn off output compression.
       
if (@ini_get('zlib.output_compression') == '1' || @ini_get('output_handler') == 'ob_gzhandler')
               
$modSettings['enableCompressedOutput'] = '0';
       else
               
ob_start('ob_gzhandler');
}
// This makes it so headers can be sent!
if (empty($modSettings['enableCompressedOutput']))
       
ob_start();

// Register an error handler.
set_error_handler('error_handler');

// Start the session. (assuming it hasn't already been.)
loadSession();

// There's a strange bug in PHP 4.1.2 which makes $_SESSION not work unless you do this...
if (@version_compare(PHP_VERSION, '4.2.0') == -1)
       
$HTTP_SESSION_VARS['php_412_bugfix'] = true;

// What function shall we execute? (done like this for memory's sake.)
call_user_func(webchat_main());

// Call obExit specially; we're coming from the main area ;).
obExit(null, null, true);

// The main controlling function.
function webchat_main()
{
       global
$wcii, $txt, $context, $modSettings, $settings, $user_info, $board, $topic, $maintenance, $sourcedir;

       
$modSettings['allow_guestAccess'] = $wcii['guests_enabled'];
       
// Load the user's cookie (or set as guest) and load their settings.
       
loadUserSettings();

       
// Load the current board's information.
       
loadBoard();

       
// Load the current theme.  (note that ?theme=1 will also work, may be used for guest theming.)
       
loadTheme();

       
// Check if the user should be disallowed access.
       
is_not_banned();

       
// Load the current user's permissions.
       
loadPermissions();

       
// Do some logging if this is not an attachment/avatar or the setting of an option.
       
if (empty($_REQUEST['action']) || !in_array($_REQUEST['action'], array('dlattach', 'jsoption')))
       {
               
// Log this user as online.
               
writeLog();

               
// Track forum statistics and hits...?
               
if (!empty($modSettings['hitStats']))
                       
trackStats(array('hits' => '+'));
       }

       
// Is the forum in maintenance mode? (doesn't apply to administrators.)
       
if (!empty($maintenance) && !allowedTo('admin_forum'))
       {
               
// You can only login.... otherwise, you're getting the "maintenance mode" display.
               
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'login2')
               {
                       require_once(
$sourcedir . '/LogInOut.php');
                       return
'Login2';
               }
               
// Don't even try it, sonny.
               
else
               {
                       require_once(
$sourcedir . '/Subs-Auth.php');
                       return
'InMaintenance';
               }
       }
       
// If guest access is off, a guest can only do one of the very few following actions.
       
elseif (empty($modSettings['allow_guestAccess'])
               &&
$user_info['is_guest'] && (!isset($_REQUEST['action'])
               || !
in_array($_REQUEST['action'], array('login', 'login2', 'register', 'register2', 'reminder', 'activate', 'help', '.xml'))))
       {
               require_once(
$sourcedir . '/Subs-Auth.php');
               return
'KickGuest';
       }

       
$adminlink = ($user_info['is_admin']) ? ' &raquo; <a href="http://www.userplane.com/chatlite/" target="_userplane" title="http://www.userplane.com/chatlite/">  Userplane Admin </a>' : '';

$HTML .= '<script type="text/javascript">
       function eraseValue( field ){ field.value = \'\'; }

       function openWebchatWindow( myForm )
       {
               uName =  myForm.username.value;
               companyID =  myForm.companyID.value;
               validName = false;
               if ( uName != \'\' && uName != \' Your name...\')
               {
                       validName = true;
               }
               if (validName)
               {
                       var cleanedUpName = cleanupUsername( uName )
                       if( cleanedUpName == \'\' )
                       {
                               alert("You can only enter characters and numbers");
                       }
                       else
                       {
                               var xOffSet = (screen.width - 225) / 2;
                               var yOffSet = (screen.height - 500) / 2;
                               var features = \'width=738,height=550",toolbar=0,directories=0,menubar=0,status=0,location=0,scrollbars=0,resizable=1\';
                               var winName = "Userplane_Chatlite_" + replaceAlpha( companyID );
                               var theURL = \'http://apps.userplane.com/chatlite/chat.cfm?name=\' + cleanedUpName + \'&domainID=\' + companyID;
                               myWin = window.open(theURL,winName,features);
                       }
               }
               else
               {
                       alert("You must enter a username.");
               }
               return false;
       }

       function replaceAlpha( strIn )
       {
               var strOut = "";
               for( var i = 0 ; i < strIn.length ; i++ )
               {
                       var cChar = strIn.charAt(i);
                       if( ( cChar >= \'A\' && cChar <= \'Z\' )
                               || ( cChar >= \'a\' && cChar <= \'z\' )
                               || ( cChar >= \'0\' && cChar <= \'9\' ) )
                       {
                               strOut += cChar;
                       }
                       else
                       {
                               strOut += "_";
                       }
               }
               return strOut;
       }

       function cleanupUsername( strIn )
       {
               var strOut = "";
               for( var i = 0 ; i < strIn.length ; i++ )
               {
                       var cChar = strIn.charAt(i);
                       if( ( cChar >= \'A\' && cChar <= \'Z\' )
                               || ( cChar >= \'a\' && cChar <= \'z\' )
                               || ( cChar >= \'0\' && cChar <= \'9\' )
                               || cChar == \' \' )
                       {
                               strOut += cChar;
                       }
               }
               return strOut;
       }
       </script>
<!-- main page contents -->
<form action="" method="get" name="" target="_blank" onsubmit="return openWebchatWindow(this);">
       <input type="hidden" name="companyID" value="'
.$wcii['domainID'].'" />

                               <div align="center">
                                       <div class="windowbg" style="width:480px" align="left">
                                               <fieldset class="windowbg2">
                                                       <legend>
                                                               '
.$wcii['text_launch'].'
                                                       </legend>
                                                       <table cellpadding="0" cellspacing="3" border="0">
                                                               <tr>
                                                                       <td>
                                                                               '
.$wcii['text_welcome'].'
                                                                       </td>
                                                               </tr>
                                                               <tr><td align="center">
                                                                               <br />'
;

if(
$wcii['serverside'])
{
       
$HTML .= '<script src="http://www.userplane.com/chatlite/userplane/chatlite.cfm?domainID='.$wcii['domainID'].'" type="text/javascript"></script>';
}
else
{
       if (empty(
$user_info['is_guest']))
       {
               
$readonly = ($wcii['force_username']) ? 'readonly="readonly" style="background: #fffff1;color:gray;"' : '';
               
$HTML .= '<input name="username" type="text" value="'.$user_info['username'].'" '.$readonly.' />';
       }
       else
       {
               
$HTML .= '<input name="username" type="text" value=" Your name..." onfocus="eraseValue(this)" />';
       }
       
$HTML .= ' <input name="submit" type="submit" value="'.$wcii['text_launch'].'" /></form>';
}
$HTML .='</td>
</tr>
</table>
</fieldset>
</div>
<div style="font-weight:bold;padding:5px;">
       <a href="http://www.userplane.com/webchat/" target="_blank" style="color: #FF7700;">Webchat</a> by <span style="color:green;">Ã,±</span><a href="http://www.userplane.com/" target="_blank" style="color: #FF7700;">Userplane</a>
</div>
<!-- / main page contents -->
'
;



       
$context['error_message'] = $HTML;

       
$context['error_title'] = $wcii['text_title'].$adminlink;
       
$context['page_title'] = $wcii['text_launch'];

       
loadTemplate('Errors');
       
$context['sub_template'] = 'fatal_error';

       
// We want whatever for the header, and a footer. (footer includes sub template!)
       
obExit(null, true);
}


?>

This website is proudly hosted on Crocweb Cloud Website Hosting.