myltchat V0.46
myltchat-v0.46
myltchat-v0.46
Características
- Puede establecer el nombre e idioma (español | inglés) del chat.
- No requiere de base de datos.
- El chat puede manejar su propio registro y login de usuarios o utilizar los usuarios del sitio donde se implementa.
- Si el sitio no maneja usuarios y no desea que el chat maneje registro de usuarios se puede generar un nick name aleatorio del tipo Inv + #aleatorio.
- Puede otorgar privilegios de administrador a uno o más usuarios.
- Los usuarios con privilegios de administrador pueden banear a otros usuarios o eliminar comentarios.
- Cada usuario puede elegir su avatar (al iniciar se usa uno genérico )
el cambio puede requerir actualización con F5 según el navegador.
- Cada usuario puede elegir: fuente, color de fuente, estilo negrita, estilo itálica, estilo subrayada; para sus mensajes.
- Al enviar mensaje puede utilizar los iconos incluidos.
- El chat se puede minimizar/maximizar con el botón:
- El chat se puede cambiar a popup con el botón:
Notas de instalación
- Siempre se debe instalar como subcarpeta
tusitio: /index.php (Aquí implementas el chat o en otro archivo php de tu sitio)
tusitio: /myltchat (agregar la carpeta así)
- Hay que dar permisos de escritura a:
Directorio: /myltchat/avatares
Archivos: chattx.txt, banns.txt y rgusr.csv
- Ejempo de implementacion 1 Usuarios anonimos:
<?php
include('myltchat/myltchat.php');
// Instanciar el chat, recibe los parametros:
// nombre de usuario, es administrador del chat,
// nombre del chat, [idioma], [manejo de usuarios propios]
$mltchat=new myltchat('',false,'myltchat','es',false);
// como el manejo de usuarios se indica a false y no se indica
// nombre de usuario se generara un usuario invitado con nombre aleatorio
// establecer preferencias del chat, recibe los parametros:
// altura en pixeles, anchura en pixeles, posicion donde 1=arriba-izquierda;
// 2=izquierda-centro; 3=arriba-derecha; 4=derecha-centro; 5=abajo-izquierda;
// 6=abajo-derecha (2 & 4 no centra verticalmente en IE8)
$mltchat->setPrefs(465,335,6,1);
// escribe el html necesario para crear el chat
$mltchat->escribeChat();
?>
- Ejempo de implementacion 2 utiliza Usuarios propios del sitio:
<?php
...
$mltchat=new myltchat($nombre_usuario_actual,false,'myltchat','es',false);
// notese que $nombre_usuario_actual debe ser el nombre del usuario de la sesion actual
// cambie el segundo parametro a true si el usuario actual es administrador
...
?>
- Ejempo de implementacion 3 el chat maneja su propio sistema de usuarios:
(Cuando use esta opcion por primer vez la cuenta de administrador es 'admin' con password 'admin')
<?php
...
$mltchat=new myltchat('',false,'myltchat','es',true);
// notese que el ultimo parametro es true, con esto internamente se
// realizara la carga de los dos primeros parametros
...
?>
Notas para desarrolladores
- Desarrollado bajo Apache 2.0, PHP Versión 5.2.8 con MySQl 5.0.51a y JQuery
- Probado en:
Google Chrome 8.0.552.237
Firefox 5.0
Internet Explorer 8
Opera 10.62
Safari 5.0.3
- En IE 8 para setPrefs($al,$an,$ps,$tp) donde $ps=2 o 4 no funciona y no se centra verticalmente
- En IE 8 al cambiar a popup puede requerir actualizacion dentro del popup con F5.
- En IE 8 y Opera al cerrar ventana popup (si se cambio a popup) ya no se recarga el chat en la ventana principal
- La altura mínima es de 185px
Si se pone menor se cambiará automáticamente a 185px
- Puede cambiar el estio visual en myltchat_e1.css
- En addmss.php línea 5, si altera la estructura de la etiquetas (en la variable $newcnt) debe actualizar la función cargamsjs() en myltchat.js
- En addmss.php puede controlar el numero de mensajes guardados
Establezca en la variable $maxmsjs el numero máximo permitido (default 165)
Establezca en la variable $prcntctrl el porcentaje de control, cada que el numero de mensaje supere el máximo será
reducido (borrando los mensajes más viejos) al porcentaje de control (default 85%)
Features
- You can set the chat's name and language (spanish | english).
- Does not need a data base.
- The chat can manage its own login/register or use the site existing users.
- If the site does not manage users and you don't want the chat register users it can genarate a random nick name as Inv + #rand_number
- You can set adminitrator privilegies to one or more users.
- The admin users can bann other users or erase comments.
- Every user can choose its avatar (at starting it is used one generic )
changing can need to reload the page with F5 due to browser.
- Every user can choose: font, color font, bold font, italic font, underline font; for its comments.
- There are icons to include in comments.
- The chat can be minimize/maximize with button:
- The chat can be show as popup window with button:
Installing
- Always must be installed as sub-folder
yoursite: /index.php (Here you call the myltchat class or in another file of your site)
yoursite: /myltchat (add the folder directly)
- You must give write permission to:
Folder: /myltchat/avatares
Files: chattx.txt, banns.txt and rgusr.csv
- Example 1 annonymus users:
<?php
include('myltchat/myltchat.php');
// Creates the chat object, receives the parameters:
// user name, is chat administrator,
// chat name, [language], [active the manage users system]
$mltchat=new myltchat('',false,'myltchat','es',false);
// as the manage user system is set to false and does not set a
// user name it will be generate a user with random name
// set chat preferences, receives the parameters:
// height on pixels, width on pixels, position where 1=up-left corner;
// 2=left-center; 3=up-right corner; 4=rigth-center; 5=down-left corner;
// 6=down-right corner (2 & 4 does not center vertically on IE8)
$mltchat->setPrefs(465,335,6,1);
// writes the html code needed to dispaly the chat
$mltchat->escribeChat();
?>
- Example 2 use the site users:
<?php
...
$mltchat=new myltchat($current_user_name,false,'myltchat','es',false);
// the $current_user_name var must be the current user name accord to the session site
// control changes the second parameter to true si the currect user is the admin
...
?>
- Example 3 the chat managing its own users system:
(When usign this option for first time the admin account is 'admin' password 'admin')
<?php
...
$mltchat=new myltchat('',false,'myltchat','es',true);
// the last parameter must be true, with that the chat
// will load/verify the two first parameters
...
?>
For developers
- Developed under Apache 2.0, PHP Versión 5.2.8 con MySQl 5.0.51a and JQuery
- Tested on:
Google Chrome 8.0.552.237
Firefox 5.0
Internet Explorer 8
Opera 10.62
Safari 5.0.3
- On IE 8 for setPrefs($al,$an,$ps,$tp) where $ps=2 or 4 does not works and does not center vertically.
- On IE 8 when changes to popup window it can need reload inside the popup with F5.
- On IE 8 and Opera when closing the popup window (if user changes to it) the chat does not re-appear on the browser
- The minimum height is 185px
If you set a minor one it will change to 185px
- You can change the visua style in myltchat_e1.css
- In addmss.php line 5, if you change the tags structure (in the var $newcnt) you must update the function cargamsjs() in myltchat.js
- In addmss.php you can manage the limit of saved comments
Set in the var $maxmsjs the allowed maximum limit (default 165)
Set in the var $prcntctrl the control percent, any time the comments are more than the maximum limit it will be
reduced (erasing the older comments) to control percent (default 85%)
Proyecto myltchat V0.46
Author: Pedro Cardoso Rodríguez
Mail: cardp_2004@yahoo.com.mx
Copyright © 2011 Pedro Cardoso Rodríguez Bajo LGPL
myltchat V0.46 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
as published by the Free Software Foundation, either version 3 of the License, or any later version.
myltchat V0.46 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with myltchat V0.46 If not, see
http://www.gnu.org/licenses/