- Desde
- 30 Sep 2004
- Mensajes
- 453
No es un hack mío auque lo he tenido que modificar para que funcione.
Ventajas
-Se integra con los permisos del foro
-No está alojado en tu servidor
*Tiempo de inegración: 30 minutos
1- Vete a esta dirección web https://www.userplane.com/buy/
Elije las siguientes opciones "Plugin"->Selecciona vBulletin->Presiona Choose
Elije Free (Gratis) y sigue el resto de opciones es un proceso de registro normal
Una vez tengas todo funcionando, ya estás listo para integrarlo.
Crea este archivo PHP y llámalo chat.php
Panel de Admin->Administrador de Estilos[tu estilo]->Editar plantillas->Navbar
Busca:
Reemplaza con:
Resultado de la integración en los adjuntos:
Ventajas
-Se integra con los permisos del foro
-No está alojado en tu servidor
*Tiempo de inegración: 30 minutos
1- Vete a esta dirección web https://www.userplane.com/buy/
Elije las siguientes opciones "Plugin"->Selecciona vBulletin->Presiona Choose
Elije Free (Gratis) y sigue el resto de opciones es un proceso de registro normal
Una vez tengas todo funcionando, ya estás listo para integrarlo.
Crea este archivo PHP y llámalo chat.php
PHP:
<?php
############################################################### VBULLETIN CONFIG
define('THIS_SCRIPT','webchat_instant');
$globaltemplates = array('GENERIC_SHELL');
$phrasegroups = array();
$specialtemplates = array();
$actiontemplates = array();
require_once('./global.php');
# Userplane Instant Webchat Addon version 1.2.0 for vBulletin 3.0.x + 3.5.x
# All associated content copyright 2005, by the author
# Added: 2005-08-04 - http://www.vbulletin.org/forum/member.php?u=56130
# once edited, this file have to be installed in your vBulletin directory.
################################################################ SETUP USERPLANE
# edit this line and enter the domainID you received to setup your installation
$wcii['domainID'] = 'el dominio con el que te registras (normalmente tu nombre de usuario)';
# edit this line by listing the usergroups you want to give access to.
# the defaults are Admins(6), Moderators(7) and Registered users(2).
# you have to enter the usergroup IDs, seperated with a comma.
# nota: to give access to ALL users, just keep the settings empty like this:
# $wcii['usergroups'] = '';
# remember, Guests are usergroup == 1;
$wcii['usergroups'] = '2,6,7';
# edit this setting (TRUE/FALSE) if you want to use Login Form from userplane(TRUE),
# with no possibility of using the real username of the members.
# this feature is slower, may bring some timeouts, but will load more features in the future.
$wcii['serverside'] = FALSE;
# edit this setting (TRUE/FALSE) if you want the members
# to be forced to use their own username to access the Chat.
# Guests will be forced to choose a username anyway - if you enable guests to access the chat!
# this feature is not activated if you use the serverside option.
$wcii['force_username'] = TRUE;
# edit this line to change the title of your webchat page.
$wcii['text_title'] = 'The Chatroom';
# edit these lines if you want to change the texts displayed in the page itself.
$wcii['text_launch'] = 'Launch the Chatroom';
$wcii['text_noaccess'] = 'Sorry, you don\'t have the permission to access the Webchat at this moment. You have to register and subscribe to one of our plans or request to join a usergroup to be able to chat.';
$wcii['text_welcome'] = 'Welcome to our Chatroom. This place is your access to our webchat. Please enter your username, or a nick you wish to use online - The administrators may have forced the system to use your real username, so you may not be able to edit yours. Click to "'.$wcii['text_launch'].'" will open a popup window that will give you access to our chatroom.';
################################################################## NO MORE EDITS
# codes in next 3 lines makes the script compatible with vBulletin 3.0 AND 3.5
$sessionid = isset($vbulletin) ? $vbulletin->session->vars['sessionurl'] : $session['sessionurl'];
$userinfo = isset($vbulletin) ? $vbulletin->userinfo : $bbuserinfo;
$isadmin = isset($vbulletin) ? ($vbulletin->userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel']) : ($bbuserinfo['permissions']['adminpermissions'] & CANCONTROLPANEL);
$adminlink = ($isadmin) ? ' » <a href="http://www.userplane.com/chatlite/" target="_userplane" title="http://www.userplane.com/chatlite/"> Userplane Admin </a>' : '';
$canaccess = ($wcii['usergroups'] == '' OR userplane_can_x_access_wc($wcii['usergroups'], $userinfo)) ? TRUE : FALSE;
if(!$canaccess AND !$isadmin)
{
eval(standard_error($wcii['text_noaccess'], FALSE, FALSE));
}
$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'].'" />
<table class="tborder" cellpadding="'.$stylevar['cellpadding'].'" cellspacing="'.$stylevar['cellspacing'].'" border="0" width="100%" align="center">
<tr>
<td class="tcat" colspan="2">
'.$wcii['text_title'].$adminlink.'
</td>
</tr>
<tr>
<td class="panelsurround" align="center">
<div class="panel">
<div style="width:480px" align="left">
<fieldset class="fieldset">
<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($userinfo['userid'])
{
$readonly = ($wcii['force_username']) ? 'readonly="readonly" style="background: #fffff1;color:gray;"' : '';
$HTML .= '<input class="bginput" name="username" type="text" value="'.$userinfo['username'].'" '.$readonly.' />';
}
else
{
$HTML .= '<input class="bginput" name="username" type="text" value=" Your name..." onfocus="eraseValue(this)" />';
}
$HTML .= ' <input name="submit" type="submit" class="button" value="'.$wcii['text_launch'].'" /></form>';
}
$HTML .='</td>
</tr>
</table>
</fieldset>
</div>
</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>
</td>
</tr>
</table>
<!-- / main page contents -->
';
# Build the Navbar and Display the Page
$navbits = construct_navbits(array('webchat_instant.php?'.$sessionid => $wcii['text_title']));
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('GENERIC_SHELL') . '");');
####################################################################### FUNCTION
# will verify if the actual user is enabled the access to the Webchat(wc)
function userplane_can_x_access_wc(&$usergroups, &$userinfo) {
$allowed = explode(",", $usergroups);
foreach ($allowed as $allow)
{
if (is_member_of($userinfo, $allow))
{
return TRUE;
}
}
return FALSE;
}
?>
Panel de Admin->Administrador de Estilos[tu estilo]->Editar plantillas->Navbar
Busca:
Insertar CODE, HTML o PHP:
<td class="vbmenu_control"><a href="calendar.php?$session[sessionurl_q]">$vbphrase[calendar]</a></td>
Reemplaza con:
Insertar CODE, HTML o PHP:
<td class="vbmenu_control"><a href="chat.php?$session[sessionurl_q]">Chat</a></td>
Resultado de la integración en los adjuntos: