Mostrar Mensajes

Esta sección te permite ver todos los posts escritos por este usuario. Ten en cuenta que sólo puedes ver los posts escritos en zonas a las que tienes acceso en este momento.


Temas - callosino

Páginas: [1] 2
1
PHP / Error en un codigo
« en: 20 de Septiembre de 2012, 17:02:41 pm »
Buenas,

Estoy haciendo una pagina web para una asociación y me he atascado en un sitio que no se donde arreglarlo. He probado un monton de cosas y todo da error.

Aquí os dejo la pagina en cuestion que es un buscador

Código: [Seleccionar]
<?php

header
(&#39;Content-Type: text/html; charset=UTF-8&#39;);

include (&#39;config.php&#39;);
include (&#39;functions.php&#39;);

mysql_select_db($db_name,mysql_connect($db_host,$db_user,$db_pass));

validar_hash();

if(isset(
$_SESSION[$sesion_hash])) 
{
echo &
#39;<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Asociación Alicantina de Jugger</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="AAJ, Jugger, Alicante, FEJ" />
<meta name="description" content="Pagina privada para la AAJ" />
<meta name="author" content="Asociacion Alicantina de Jugger" />
<meta name="publisher" content="Asociacion Alicantina de Jugger" />
<meta name="copyright" content="Asociacion Alicantina de Jugger" />
<meta name="audience" content="all" />
<meta name="robots" content="all" />
<link rel="stylesheet" type="text/css" href="css.css" />
</head>
<body>
<
div id="banner"><img src="imagenes/banner.gif" alt="banner" /></div>
<
div id="menuweb"><a href="menu.php">PRINCIPAL</a> - ALTAS BUSCADOR - <a href="logout.php">SALIR</a></div>
<
div id="contenedor">
<div id="contenedor_arriba">PRINCIPAL</div>
<div id="contenedor_medio">
<form name="formulario" method="post" action="buscador.php">
  <
table width="100%" border="0" cellspacing="1" cellpadding="1">
    <
tr>
      <
td width="18%"><strong>NOMBRE</strong></td>
      <
td width="1%">&nbsp;</td>
      <
td width="30%"><input type="text" name="nombre1" /></td>
      <
td width="25%"><strong>APODO</strong></td>
      <
td width="1%">&nbsp;</td>
      <
td width="23%"><input type="text" name="apodo1" /></td>
      <
td width="2%">&nbsp;</td>
    </
tr>
    <
tr>
      <
td><strong>APELLIDO1</strong></td>
      <
td>&nbsp;</td>
      <
td><input type="text" name="apellido11" /></td>
      <
td><strong>APELLIDO2</strong></td>
      <
td>&nbsp;</td>
      <
td><input type="text" name="apellido21" /></td>
      <
td>&nbsp;</td>
    </
tr>
    <
tr>
      <
td><strong>FECHA DE NACIMIENTO</strong></td>
      <
td>&nbsp;</td>
      <
td><input type="text" name="fecha1" /></td>
      <
td><strong>DNI</strong></td>
      <
td>&nbsp;</td>
      <
td><input type="text" name="dni1" /></td>
      <
td>&nbsp;</td>
    </
tr>
    <
tr>
      <
td><strong>EMAIL</strong> </td>
      <
td>&nbsp;</td>
      <
td><input type="text" id="email1" /></td>
      <
td><strong>EQUIPO</strong></td>
      <
td>&nbsp;</td>
      <
td><input type="text" name="equipo11" /></td>
      <
td>&nbsp;</td>
    </
tr>
    <
tr>
      <
td colspan="7"><div align="center"><strong>ORDENAR BUSQUEDA POR:&nbsp;&nbsp
            <
select name="criterio">
            <
option value="nombre_equipo" selected="selected">EQUIPO</option>
            <
option value="nombre">NOMBRE</option>
            <
option value="apellido1">APELLIDO1</option>
            <
option value="apeliido2">APELLIDO2</option>
            <
option value="apodo">APODO</option>
            <
option value="fechanacimiento">FECHA</option>
            <
option value="dni">DNI</option>
<option value="email">EMAIL</option>
            </
select>
      </
strong></div></td>
    </
tr>
<tr>
      <
td colspan="7"><div align="center">
        <
input type="submit" name="busqueda" value="REALIZAR BUSQUEDA" />
      </
div></td>
    </
tr>
  </
table>
</
form>
<
div>&#39;;
if (isset($_POST[&#39;busqueda&#39;])) 
{
$bcriterio $_POST[&#39;criterio&#39;];
$bnombre $_POST[&#39;nombre1&#39;];
$bapodo $_POST[&#39;apodo1&#39;];
$bapellido1 $_POST[&#39;apellido11&#39;];
$bapellido2 $_POST[&#39;apellido21&#39;];
$bfecha $_POST[&#39;fecha1&#39;];
$bdni $_POST[&#39;dni1&#39;];
$bemail $_POST[&#39;email1&#39;];
$bequipo $_POST[&#39;equipo1&#39;];
//$query = mysql_query("SELECT * FROM `socios` WHERE `nombre` LIKE &#39;%$bnombre%&#39;  AND `apodo` LIKE &#39;%$bapodo%&#39; AND `apellido1` LIKE &#39;%$bapellido1%&#39; AND `apellido2` LIKE &#39;%$apellido2%&#39; AND `fechanacimiento` LIKE &#39;%$bfecha%&#39; AND `dni` LIKE &#39;%$bdni%&#39; AND `email` LIKE &#39;%$bemail%&#39; AND `equipo` LIKE &#39;%$bequipo%&#39; ORDER BY &#39;%$bcriterio%&#39;;");
$query mysql_query(&#39;SELECT * FROM `socios` WHERE `nombre` LIKE "%&#39;.$bnombre.&#39;%"  AND `apodo` LIKE "%&#39;.$bapodo.&#39;%" AND `apellido1` LIKE "%&#39;.$bapellido1.&#39;%" AND `apellido2` LIKE "%&#39;.$apellido2.&#39;%" AND `fechanacimiento` LIKE "%&#39;.$bfecha.&#39;%" AND `dni` LIKE "%&#39;.$bdni.&#39;%" AND `email` LIKE "%&#39;.$bemail.&#39;%" AND `equipo` LIKE "%&#39;.$bequipo.&#39;%" ORDER BY "%&#39;.$bcriterio.&#39;%";&#39;);
echo &#39;<table border="1" cellpadding="0" cellspacing="0">
  
<tr>
   <
td bgcolor="#66000D">EDIT</td>
    <
td bgcolor="#66000D">NOMBRE</td>
    <
td bgcolor="#66000D">APELLIDO1</td>
    <
td bgcolor="#66000D">APELLIDO2</td>
    <
td bgcolor="#66000D">APODO</td>
    <
td bgcolor="#66000D">EQUIPO </td>
    <
td bgcolor="#66000D">DNI</td>
    <
td bgcolor="#66000D">FECHA NACIMIENTO</td>
    <
td bgcolor="#66000D">CORREO</td>
<td bgcolor="#66000D">FECHA ALTA </td>
<td bgcolor="#66000D">FECHA BAJA</td>
  </
tr>&#39;;
while ($row mysql_fetch_assoc($query))
{
echo &
#39;<tr> 
    
<td><form method="post" action="editar_clientes2.php"><input name="servicio" type=submit value=&#39;.$row[0].&#39; /></form></td>
<td>&#39;.$row[1].&#39;</td>
    
<td>2</td>
    <
td>3</td>
    <
td>4</td>
    <
td>5</td>
    <
td>6</td>
    <
td>7</td>
    <
td>8</td>
    <
td>9</td>
<td>10</td>
  </
tr>
</
table> &#39;;
}
}
echo &
#39;</div>

    
</div>
<div id="contenedor_bajo">PRINCIPAL</div>
</
div>
</
body>
</
html>&#39;;
}
else
{
header(&#39;Location: index.php&#39;);
}

mysql_close();

?>

Cuando entro en mi pagina y le doy a busqueda me sale esto:

Código: [Seleccionar]
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/u601714229/public_html/buscador.php on line 121
Esa linea en concreto es:

Código: [Seleccionar]
while ($row = mysql_fetch_assoc($query))
pero esta bien que yo vea y también he comprobado el SQL y esta bien.

2
(X)HTML / Problemas con un DIV y FORM
« en: 27 de Marzo de 2012, 13:10:18 pm »
Buenas,

Ahora mismo estoy teniendo unos problemas y no se como solucionarlo. Acabo de crear una pagina y he creado un DIV en el cual dentro tiene 3 DIV's. Dos de ellos funcionan bien pero el otro no. En el que no funciona esta un form y no se si es por eso. La pagina es http://coryu.dnsd.info/pruebas/index.html El problema viene que quiero los 3 en la misma linea. El formulario se queda abajo de la linea y lo quiero subir. He probado muchas cosas y nada va >.<

Gracias.

Edit: Creo que lo he solucionado poniendole float: right;

Pero ahora quiero dejar el segundo div centrado, el de las flechas. Y no me deja.

3
PHP / Sobre libreria GD
« en: 09 de Agosto de 2010, 16:42:53 pm »
Buenas estoy creando una web para realizar carteles de One Piece de se busca aquí la web:

http://coryu.sytes.net/onerol/index.php

Y he logrado poner lo de el nick y el dinero, pero lo de la imagen no. ¿Alguien sabe como podría hacer para que cuando rellenen el campo del formulario de la imagen, pongan la dirección y después por php redimensionarlo a un tamaño especifico y pegarlo encima  de una parte de la imagen?

4
PHP / Ayuda sobre una idea.
« en: 08 de Agosto de 2010, 15:11:08 pm »
Buenas, estoy en un foro de rol de One Piece. Y me gustaría saber si me pueden ayudar (lo haría yo claro xD) a hacer una aplicación en la que en una foto base. Ellos suban una imagen, y pongan un nombre y numeros. Y la imagen que ellos suban se sustituya por un espacio de la imagen base y el nombre y numero en un espacio delimitado también. Haber una imagen vale mas que mil palabras xD.

La web tendrá un formulario como este:

Imagen desde una url o imagen subida al servidor.
Nombre:
Recompensa:

Ejemplo:
Imagen: http://img142.imageshack.us/img142/7471/yoh013.jpg
Nombre: Yoh D. Akaki
Recompensa: 21,000,000

Pues el resultado sería este: http://img293.imageshack.us/img293/7910/wantedyoh1.jpg

¿Alguien me podría orientar? Se como hacer el formulario mas o menos, pero el tratamiento de la imagen ya no.

5
PHP / Problema con un sistema de permisos
« en: 06 de Julio de 2010, 17:10:45 pm »
Buenas, he realizado un sistema de permisos en mi web. Para que así un cierto haga una cosa u otra. Y lo hecho en binario por ejemplo:

00000 = Ningún permiso
00001= Puede Editar Permisos
00011= Puede Editar Permisos y Noticias
00010 = Puede Editar Noticias

Y el problema que tengo es que estoy realizando ahora es el panel de editar permisos. Y lo he puesto para que me salga una lista con los nombres de usuarios y un checkbox para elegir si tienen ese derecho o no. Y mi problema es como hacer para que en la base de datos modifique ese 1 o no. No se si me explico.

El code que tengo es este en el procesar:
Código: [Seleccionar]
<?php
print_r 
($_POST);
$usuario $_POST[&#39;editarusuarios&#39;];
print_r ($usuario);
$permisos $_POST[&#39;permisos&#39;];
$noticias $_POST[&#39;noticias&#39;];
$enciclopedia $_POST[&#39;enciclopedia&#39;];
$perfil $_POST[&#39;perfil&#39;];
$comentarios $_POST[&#39;comentarios&#39;];

$titulocentro = &#39;Editando Permisos&#39;;
if (niveladmin ($_SESSION[$sesion],&#39;0&#39;))
{
if (
$permisos == &#39;on&#39;)
{
mysql_query(&#39;UPDATE `usuarios` SET `Permisos` = &#39;&#39; WHERE `Nombre` = "&#39;.$usuario.&#39;";&#39;);
}

}
else
{
$titulocentro = &#39;Acceso Denegado&#39;;
$contenidocentro = &#39;Acceso Denegado, no tienes permisos.&#39;;
}
?>

El problema lo tengo aquí:
Código: [Seleccionar]
mysql_query('UPDATE `usuarios` SET `Permisos` = '' WHERE `Nombre` = "'.$usuario.'";');
Antes de Where lo he dejado vacio porque no se como hacer hay esa modificación.

6
(X)HTML / [Ayuda] Error de tabla
« en: 26 de Junio de 2010, 12:28:22 pm »
Buenas, saben como podría estrechar las celdas de las tablas? Es que tengo esta web que estoy haciendo (el diseño se que es malo, lo quiero cambiar xD pero es el base)

http://coryu.sytes.net/ajm/

En el menú del medio, la imagen de la parte de arriba es mas pequeña y le he tenido que poner un no repetir por css  pero se me queda vació y quiero hacer esa celda justo lo pequeña que es la imagen.  Y también en la parte de abajo, aunque no se vea también pasa lo mismo y el problema es que el menú de noticias se aleja demasiado por eso.

Edit: Lo estoy medio solucionando, parece que la parte de arriba ya lo he hecho bien, pero la de abajo no... y esta igual...

El code por si acaso:

CSS:
Código: [Seleccionar]
.imagenmodulograndearriba {
width: 440px;
height: 10px;
background-image: url("../images/modulo_arriba_negro.gif");
background-repeat:no-repeat;
}
.imagenmodulograndecentro {
width: 440px;
background-image: url("../images/noticias_medio_negro.gif");
}
.imagenmodulograndeabajo {
width: 440px;
height: 10px;
background-image: url("../images/modulo_abajo_negro.gif");
background-repeat:no-repeat;
}
   
Html:
Código: [Seleccionar]
<table border="0" cellspacing="0" cellpadding="0" width="440">
<tr>
<td >&nbsp;</td>
</tr>
<tr>
<td class="imagenmodulograndearriba"></td>
</tr>
<tr>
<td class="imagenmodulograndecentro">&nbsp;</td>
</tr>
<tr>
<td class="imagenmodulograndeabajo">&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>

Vale ya esta solucionado x'D

7
Minichat o MC / Que hablen invitados en el MC de Ramfu
« en: 31 de Diciembre de 2009, 20:57:50 pm »
Buenas quiero ver como se hace para que hablen los invitados en el MC de ramfu. Porque les pide que se registren obligatoriamente y no quiero >.<, para que lo vean mi web es www.noctisduellum.es

8
Minichat o MC / Duda sobre MC de RamFu
« en: 20 de Diciembre de 2009, 02:59:41 am »
Hola buenas, acabo de instalar el minichat de RamFu en mi blog. Y quiero cambiarle el diseño para que esté acorde con el blog. Porque los colores por defecto del MC son el blanco y el azul. Y me gustaría cambiar los colores. He leído por ahí, que se cambia desde el archivo tag.php. En la etiqueta bg_color, pero en esa etiqueta hay una variable, que supongo que la pueda cambiar yo por algún lado y no se donde. Pero si borro esa variable y le pongo el color a mano, solo se cambia una linea, no todo el fondo entero. Así que mi duda es, como puedo cambiar el fondo y el color de los botones y todo eso¿? Mi web es www.noctisduellum.es

9
PHP / Poner algo parecido "a un anuncio de google" aun foro igual que este
« en: 18 de Junio de 2007, 17:16:22 pm »
Quiero poner algo parecido aun "anuncio de google" a un foro que es un SMF 1.1.2, me gustaría ponerlo abajo del todo donde pone

Powered by PHP       Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC    | Sitemap
 

Alguien sabe que archivo es y como¿?

Gracias de antemano.

10
PHP / Tengo un error sobre un pequeña aplicacion flash
« en: 24 de Noviembre de 2006, 17:20:59 pm »
Bueno estoy haciendo una pequeña aplicacion flash y hay intervienen unos archivos php, pero cuando enchunfo el server, me salta este error.

Fatal Error: Call to undifined function: socket_create<> in C:/Miserver/socket.php on line 165

La linea axacta es esto $listenfd socket_create(AF_INETSOCK_STREAM0);


Y si alguien quiere ver todo el archivo socket.php
<?
// to set the connection key 
$keyencryption "iamgoodseehowyoudecrypt";
//setting this to 0 lets scriphang around for ever
set_time_limit(0);

// defaults...
define(&#39;MAXLINE&#39;, 4096); // how much to read from a socket at a time
define(&#39;LISTENQ&#39;, 500); // listening queue
define(&#39;PORT&#39;, 10026); // the default port to run on
define(&#39;FD_SETSIZE&#39;, 500); // file descriptor set size (max number of concurrent clients)...


/* **********************************************
	
get usernames
********************************************** */
function getUsernames($r) {
	
global 
$ul;
	

	
//variable to hold usernamelist
	
$t = &#39;userlist&#39;;
	

	
for (
$i 0$i FD_SETSIZE$i++)
	
{
	
	
//if is array and same room
	
	
if(
is_array($ul[$i]) && $ul[$i][&#39;room&#39;] == $r)
	
	
	
$t .= &#39;#&#39;.$ul[$i][name].&#39;:&#39;.$ul[$i][id];
	
	
	
	

	
}
	
return 
$t;
	
unset(
$t);
	

}


/* **********************************************
	
get rooms
********************************************** */
function getRooms(){
	

	
global 
$ul;
	

	
$t = &#39;roomlist&#39;;
	
	
//variable to hold roomlist
	
$r = array();
	
	
	
//array to check if room is in our list
	
$u = array();
	
	
	
//array to hold number of users in room
	

	
for (
$i 0$i FD_SETSIZE$i++){
	
	
//if we have a client in allusers array
	
	
if(
is_array($ul[$i])){
	
	
	
//if current room is not in "room array", we add it and clients in room are = 1
	
	
	
if (!
in_array($ul[$i][&#39;room&#39;],$r)){
	
	
	
	
$r[] = $ul[$i][&#39;room&#39;];
	
	
	
	
$u[$ul[$i][&#39;room&#39;]] = 1;
	
	
	
} else {
	
	
	
	
//new client in room found, increase
	
	
	
	
$u[$ul[$i][&#39;room&#39;]]++;
	
	
	
}
	
	
}
	
}

// import and run the room list
include "roomlist.php";

	
//make the return string
	
foreach (
$r as $ro){
    
	
$t .= &#39;#&#39;.$ro.&#39;(&#39;.$u[$ro].&#39;)&#39;;
	
}
	

	
return 
$t;
	
	

}


/* **********************************************
	
join room (user, room, oldroom)
********************************************** */
function joinRoom($u$r$or$myid$param) {
	

	
global 
$ul$i$client;
	

	
$ul[$i][&#39;room&#39;] = $r;
	
	
	
//save room name before deleting the user
	
$n1 getUsernames($r);
	
	
	
//users in current room
	
$n2 getUsernames($or);
	
	
//users in old room
	
$ro getRooms();
	
	
	
	
//get all rooms
	


	

	
//update users from rooms
	
for (
$k 0$k FD_SETSIZE$k++)
	
{
	
	
if (
$client[$k] != null) {
	
	
	

	
	
	
//if same room
	
	
	
if (
$ul[$k][&#39;room&#39;] == $r){
	
	
	
	
socket_write($client[$k], &#39;enter#&#39;.$u.&#39;#&#39;.$myid."#".$param.chr(0));
	
	
	
	
socket_write($client[$k], $n1.chr(0));
	
	
	
	

	
	
	
//if old room
	
	
	
} else if (
$ul[$k][&#39;room&#39;] == $or){
	
	
	
	
socket_write($client[$k], &#39;leaveR#&#39;.$u.&#39;#&#39;.$myid."#".$param.chr(0));
	
	
	
	
socket_write($client[$k], $n2.chr(0));
	
	
	
}
	
	
	
//update all users roomlist
	
	
	

	
	
	
socket_write($client[$k], $ro.chr(0));
	
	
}
	
}
	
	

}


/* **********************************************
	
 for kill the server
********************************************** */
function killDaemon()
{
	
global 
$listenfd$client,$rooms;
	
$msg = &#39;msg#server#Daemon going down!<br>&#39;;
	
for (
$i 0$i FD_SETSIZE$i++)
	
{
	
	
if (
$client[$i] != null){
	
	
	
socket_write($client[$i], $msgstrlen($msg));
	
	
	
socket_close($client[$i]);
	
	
}
	
}
	
print &
#39;Shutting down the daemon<br>&#39;;
	
socket_close($listenfd);
	
exit;
}


/* **********************************************
	
  whenever a client disconnects...
********************************************** */
function closeClient() {
	
global 
$client$remote_host$remote_port$ul$i;
	

	
socket_close($client[$i]);
	
	
	
//close & unset socket
	
$client[$i] = null;
	
unset(
$remote_host[$i]);
	

	
$oldroom $ul[$i][&#39;room&#39;];
	
	
	
//save room name before unsetting user
	
$oldname $ul[$i][&#39;name&#39;];
	
	
	
//save username before unsetting user
	
unset(
$ul[$i]);
	

	
$users getUsernames($oldroom);
	
//get usernames in old room
	
$rooms getRooms();
	
	
	
	
//get rooms
	

	
//check to see if anyone is still attached, this will shutdown the 
	
//remove down from here if you want to remove this option server, remove if unwanted
	
$someoneconnected false;
	

	
for (
$k 0$k <= FD_SETSIZE$k++){
	
	
if(
$client[$k] != null){
	
	
	

	
	
	
$someoneconnected true;
	
	
	

	
	
	
//if someone is in old room
	
	
	
if (
$ul[$k][&#39;room&#39;] == $oldroom){
	
	
	
	
socket_write($client[$k], &#39;leave#&#39;.$oldname.chr(0));
	
	
	
	

	
	
	
	
socket_write($client[$k], $users.chr(0));
	

	
	
	
	
socket_write($client[$k], $rooms.chr(0));
	

	
	
	
//update all users rooms
	
	
	
} else {
	
	
	
	
socket_write($client[$k], $rooms.chr(0));
	

	
	
	
}
	
	
	

	
	
}
	
}
	

	
if(
$someoneconnected == false){
	
	
//killDaemon();
	
}
	
//stop removing here, for the auto shutdown feature
	

	
//search in roomname array and remove if nouonethere
	

}


// set up the file descriptors and sockets...
// $listenfd only listens for a connection, it doesn&#39;t handle anything
// but initial connections, after which the $client array takes over...
$listenfd socket_create(AF_INETSOCK_STREAM0);
if (
$listenfd) {
	
print &
#39;Listening on port &#39;.PORT.&#39;<br>&#39;;
} else {
	
die(&
#39;AIEE -- socket died!<br>&#39;);
}
 
//set servers ip here, leave if using a local host
//socket_setopt($listenfd, SOL_SOCKET, SO_REUSEADDR, 1); - old
if (!@socket_setopt($listenfdSOL_SOCKETSO_REUSEADDR0)) {
	
echo &
#39;socket_setopt() failed: reason: &#39;.socket_strerror(socket_last_error($listenfd));
	
exit;
}

if (!
socket_bind($listenfd, &#39;0.0.0.0&#39;, PORT)){
	
socket_close($listenfd);
	
die(
"AIEE -- Couldn&#39;t bind!");
}
socket_listen($listenfdLISTENQ);


// set up our clients. After listenfd receives a connection,
// the connection is handed off to a $client[]. $maxi is the
// set to the highest client being used, which is somewhat
// unnecessary, but it saves us from checking each and every client
// if only, say, the first two are being used.

//allow spaces for extra users, that will be automatically closed
for ($i 0$i LISTENQ$i++) {
	
$client[$i] = null;
}

// the main loop.
while(1){
	
$rfds[0] = $listenfd;
	
{
	
	
for (
$i 0$i <= FD_SETSIZE$i++)
	
	
	
if (
$client[$i] != null)
	
	
	
	
$rfds[$i 1] = $client[$i];
	
	
}
	
	
// block indefinitely until we receive a connection...
	
	

	
	
$nready socket_select($rfds$null$nullnull);
	
	

	
	
// if we have a new connection, stick it in the $client array,
	
	

	
	
if (
in_array($listenfd$rfds)) {
	
	
	
for (
$i 0$i <= FD_SETSIZE$i++){ //pick up the new spot
	
	
	

	
	
	
	
if (
$client[$i] == null){
	
	
	
	
	
$client[$i] = socket_accept($listenfd);
	
	
	
	

	
	
	
	
	
socket_setopt($client[$i], SOL_SOCKETSO_REUSEADDR0);
	
	
	
	
	
socket_getpeername($client[$i], $remote_host[$i], $remote_port[$i]);
	
	
	
	
	
// continue the server if connection allowed else allow next step
	
	
	
	
	
if (
$i FD_SETSIZE){
	
	
	
	
	
	
break;
	
	
	
	
	
}
	
	
	
	
}
	
	
	
	
	

	
	
	
	
if (
$i >= FD_SETSIZE){
	
	
	
	
	
//trigger_error("too many clients", E_USER_ERROR);
	
	
	
	
	
//exit;
	
	
	
	
	
//or close the new socket, 
	
	
	
	
	
closeClient();
	
	
	
	

	
	
	
	
	
break; 
// continue the server
	
	
	
	
}
	
	

	
	
	
}
	
	

	
	
	
if (--
$nready <= 0)
	
	
	
	
continue;
	
	
}
	
	

	
	

	
	
// check the clients for incoming data.
	
	

	
	
for (
$i 0$i <= FD_SETSIZE$i++){
	
	
	
if (
$client[$i] == null)
	
	
	
	
continue;
	
	
	

	
	
	
if (
in_array($client[$i], $rfds)){
	
	
	
	
$n trim(socket_read($client[$i], MAXLINE));
	
	

	
	
	
	
if (!
$n)
	
	
	
	
	
closeClient();
	
	
	
else {
	
	
	
	
// if a client has sent some data, do one of these:
	
	
	
	
$n2 explode (&#39;#&#39;, $n); 
	
	
	
	

	
	
	
switch (
$n2[0]) {

	
	
	
	
case &
#39;football&#39;:
	
	
	
	
// print football to other clients
	
	
	
	
// data to all of the clients in the $client array.
	
	
	
	
//$n is incoming data
	
	

	
	
	
	
for (
$j 0$j <= FD_SETSIZE$j++)
	
	
	
	
{
	
	
	
	
	
if (
$client[$j] != null && $ul[$i][&#39;room&#39;] == $ul[$j][&#39;room&#39;])
	
	
	
	
	
socket_write($client[$j], &#39;football#&#39;.$ul[$i][&#39;name&#39;].&#39;#&#39;.$n2[3].chr(0));
	
	
	
	
}
	
	
	
	
break;

	
	
	
	
case &
#39;attack&#39;:
	
	
	
	
// check password
	
	
	
	
//if ($n2[4] == $keyencryption){
	
	
	
	
// print attack to other clients
	
	
	
	
// data to all of the clients in the $client array.
	
	
	
	
//$n is incoming data
	
	

	
	
	
	
for (
$j 0$j <= FD_SETSIZE$j++)
	
	
	
	
{
	
	
	
	
	
if (
$client[$j] != null && $ul[$i][&#39;room&#39;] == $ul[$j][&#39;room&#39;])
	
	
	
	
	
socket_write($client[$j], &#39;attack#&#39;.$ul[$i][&#39;name&#39;].&#39;#&#39;.$n2[3].chr(0));
	
	
	
	
}
	
	
	
	
break;

	
	
	
	
case &
#39;admindisconnect&#39;:
	
	
	
	
if (
$client[$n2[3]] != null) {
	
	
	
	
	
	
	

	
	
	
	
socket_write($client[$n2[3]], &#39;admindisconnect#&#39;.$n2[1].&#39;#&#39;.$n2[3].chr(0));
	
	
	
	
}
	
	
	
	
break;

	
	
	
	
case &
#39;magic&#39;:
	
	
	
	
	
// check password
	
	
	
	
	
//if ($n2[4] == $keyencryption){
	
	
	
	
	
// print magic to other clients
	
	
	
	
	
// data to all of the clients in the $client array.
	
	
	
	
	
//$n is incoming data
	
	

	
	
	
	
	
for (
$j 0$j <= FD_SETSIZE$j++)
	
	
	
	
	
{
	
	
	
	
	
	
if (
$client[$j] != null && $ul[$i][&#39;room&#39;] == $ul[$j][&#39;room&#39;])
	
	
	
	
	
	
socket_write($client[$j], &#39;magic#&#39;.$ul[$i][&#39;name&#39;].&#39;#&#39;.$n2[3].chr(0));
	
	
	
	
	
}
	
	
	
	
	
break;


	
	
	
	
case &
#39;sysping&#39;:
	
	
	
	
if (
$client[$n2[3]] != null) {
	
	
	
	
	
	
	

	
	
	
	
socket_write($client[$n2[3]], &#39;sysping#&#39;.$n2[1].&#39;#&#39;.$n2[4].chr(0));
	
	
	
	
}
	
	
	
	
break;

	
	
	
	
case &
#39;systime&#39;:
	
	
	
	
if (
$client[$n2[3]] != null) {
	
	

	
	
	
	
//$servertime = getdate();
	
	
	
	
$servertime time();
	
	
	
	
socket_write($client[$n2[3]], &#39;systime#&#39;.$n2[1].&#39;#&#39;.$servertime.chr(0));
	
	
	
	
}
	
	
	
	
break;

	
	
	
	
case &
#39;away&#39;:
	
	
	
	
	
// print away status to other clients
	
	
	
	
	
// data to all of the clients in the $client array.
	
	
	
	
	
//$n is incoming data
	
	

	
	
	
	
	
for (
$j 0$j <= FD_SETSIZE$j++)
	
	
	
	
	
{
	
	
	
	
	
	
if (
$client[$j] != null && $ul[$i][&#39;room&#39;] == $ul[$j][&#39;room&#39;])
	
	
	
	
	
	
socket_write($client[$j], &#39;away#&#39;.$ul[$i][&#39;name&#39;].&#39;#&#39;.$n2[3].chr(0));
	
	
	
	
	
}
	
	
	
	
	
break;

	
	
	
	
case &
#39;busy&#39;:
	
	
	
	
if (
$client[$n2[3]] != null) {
	
	
	
	
	
	
	

	
	
	
	
socket_write($client[$n2[3]], &#39;busy#&#39;.$n2[1].&#39;#&#39;.$n2[4].chr(0));
	
	
	
	
}
	
	
	
	
break;

	
	
	
	
case &
#39;buy&#39;:
	
	
	
	
if (
$client[$n2[3]] != null) {
	
	
	
	
	
	
	

	
	
	
	
socket_write($client[$n2[3]], &#39;buy#&#39;.$n2[1].&#39;#&#39;.$n2[4].chr(0));
	
	
	
	
}
	
	
	
	
break;

	
	
	
	
case &
#39;buyreply&#39;:
	
	
	
	
if (
$client[$n2[3]] != null) {
	
	
	
	
	
	
	

	
	
	
	
socket_write($client[$n2[3]], &#39;buyreply#&#39;.$n2[1].&#39;#&#39;.$n2[4].chr(0));
	
	
	
	
}
	
	
	
	
break;


	
	
	
	
case &
#39;personal&#39;:
	
	
	
	
if (
$client[$n2[3]] != null) {
	
	
	
	
	
	
	

	
	
	
	
socket_write($client[$n2[3]], &#39;personal#&#39;.$n2[1].&#39;#&#39;.$n2[4].chr(0));
	
	
	
	
}
	
	
	
	
break;

	
	
	
	
case &
#39;personalinfo&#39;:
	
	
	
	
if (
$client[$n2[3]] != null) {
	
	
	
	
	
	
	

	
	
	
	
socket_write($client[$n2[3]], &#39;personalinfo#&#39;.$n2[1].&#39;#&#39;.$n2[4].chr(0));
	
	
	
	
}
	
	
	
	
break;


	
	
	
	
case &
#39;inventory&#39;:
	
	
	
	
if (
$client[$n2[3]] != null) {
	
	
	
	
	
	
	

	
	
	
	
socket_write($client[$n2[3]], &#39;inventory#&#39;.$n2[1].&#39;#&#39;.$n2[4].chr(0));
	
	
	
	
}
	
	
	
	
break;

	
	
	
	
case &
#39;inventoryinfo&#39;:
	
	
	
	
if (
$client[$n2[3]] != null) {
	
	
	
	
	
	
	

	
	
	
	
socket_write($client[$n2[3]], &#39;inventoryinfo#&#39;.$n2[1].&#39;#&#39;.$n2[4].chr(0));
	
	
	
	
}
	
	
	
	
break;

	
	
	
	
case &
#39;object&#39;:
	
	
	
	
	
// print object to other clients
	
	
	
	
	
// data to all of the clients in the $client array.
	
	
	
	
	
//$n is incoming data
	
	

	
	
	
	
	
for (
$j 0$j <= FD_SETSIZE$j++)
	
	
	
	
	
{
	
	
	
	
	
	
if (
$client[$j] != null && $ul[$i][&#39;room&#39;] == $ul[$j][&#39;room&#39;])
	
	
	
	
	
	
socket_write($client[$j], &#39;object#&#39;.$ul[$i][&#39;name&#39;].&#39;#&#39;.$n2[3].chr(0));
	
	
	
	
	
}
	
	
	
	
	
break;
	
	
	
	
case &
#39;location&#39;:
	
	
	
	
	
// print location to other clients
	
	
	
	
	
// data to all of the clients in the $client array.
	
	
	
	
	
//$n is incoming data
	
	

	
	
	
	
	
for (
$j 0$j <= FD_SETSIZE$j++)
	
	
	
	
	
{
	
	
	
	
	
	
if (
$client[$j] != null && $ul[$i][&#39;room&#39;] == $ul[$j][&#39;room&#39;])
	
	
	
	
	
	
socket_write($client[$j], &#39;location#&#39;.$ul[$i][&#39;name&#39;].&#39;#&#39;.$n2[3].chr(0));
	
	
	
	
	
}
	
	
	
	
	
break;
	
	
	
	
case &
#39;location_atonce&#39;:
	
	
	
	
	
// print attack to other clients
	
	
	
	
	
// data to all of the clients in the $client array.
	
	
	
	
	
//$n is incoming data
	
	

	
	
	
	
	
for (
$j 0$j <= FD_SETSIZE$j++)
	
	
	
	
	
{
	
	
	
	
	
if (
$client[$j] != null && $ul[$i][&#39;room&#39;] == $ul[$j][&#39;room&#39;])
	
	
	
	
	
socket_write($client[$j], &#39;location_atonce#&#39;.$ul[$i][&#39;name&#39;].&#39;#&#39;.$n2[3].chr(0));
	
	
	
	
	
}
	
	
	
	
	
break;
	
	
	
	
case &
#39;usrinfoback&#39;:
	
	
	
	
	
// check password
	
	
	
	
	
//if ($n2[4] == $keyencryption){
	
	
	
	
	
// the old usr send back its own location, exist, name, room
	
	
	
	
	
// data to all of the clients in the $client array.
	
	
	
	
	
//$n is incoming data
	
	

	
	
	
	
	
for (
$j 0$j <= FD_SETSIZE$j++)
	
	
	
	
	
{
	
	
	
	
	
	
if (
$client[$j] != null && $ul[$i][&#39;room&#39;] == $ul[$j][&#39;room&#39;])
	
	
	
	
	
	
socket_write($client[$j], &#39;usrinfoback#&#39;.$ul[$i][&#39;name&#39;].&#39;#&#39;.$n2[3].chr(0));
	
	
	
	
	
}
	
	
	
	
	
break;

	
	
	
	
case &
#39;msg&#39;:
	
	
	
	
	
// check password
	
	
	
	
	
//if ($n2[4] == $keyencryption){
	
	
	
	
	
// print something on the server, then echo the incoming
	
	
	
	
	
// data to all of the clients in the $client array.
	
	
	
	
	
//$n is incoming data
	
	

	
	
	
	
	
for (
$j 0$j <= FD_SETSIZE$j++)
	
	
	
	
	
{
	
	
	
	
	
	
if (
$client[$j] != null && $ul[$i][&#39;room&#39;] == $ul[$j][&#39;room&#39;])
	
	
	
	
	
	
	
socket_write($client[$j], &#39;msg#&#39;.$ul[$i][&#39;name&#39;].&#39;#&#39;.$n2[3].chr(0));
	
	
	
	
	
}
	
	
	
	
	
break;

	
	
	
	
case &
#39;user&#39;:
	
	
	
	
	
// check password
	
	
	
	
	
//if ($n2[4] == $keyencryption){
	
	
	
	
	
//assign new username to array
	
	
	
	
	
$ul[$i] = array(&#39;name&#39; => $n2[1], &#39;room&#39; => $n2[2], &#39;id&#39; => $i);
	
	
	
	
	
$users getUsernames($ul[$i]["room"]);
	
	
	
	
	
$rooms getRooms();
	
	
	
	
	

	
	
	
	
	
//tell username list to users in same room
	
	
	
	
	
for (
$j 0$j <= FD_SETSIZE$j++)
	
	
	
	
	
{
	
	
	
	
	
if (
$client[$j] != null) {
	
	
	
	
	
if (
$ul[$i][&#39;room&#39;] == $ul[$j][&#39;room&#39;]) {
	
	

	
	
	
	
socket_write($client[$j], &#39;enter#&#39;.$ul[$i][&#39;name&#39;].&#39;#&#39;.$ul[$i][&#39;id&#39;].&#39;#&#39;.$n2[3].chr(0));
	
	
	
	
	
socket_write($client[$j], $users.chr(0));
	
	
	
	
	
	
	
	
	

	
	
	
	
	

	
	
	
	
	
socket_write($client[$j], $rooms.chr(0));
	
	
	
	
	
	
	
	

	
	
	
	
	
}
	
	
	
	
	
}
	
	

	
	
	
	
	
break;

	
	
	
	
case &
#39;joinroom&#39;:
	
	
	
	
	
// check password
	
	
	
	
	
//if ($n2[4] == $keyencryption){
	
	
	
	
	
joinRoom($n2[1],$n2[2],$n2[3],$n2[4],$n2[5]);
	
	
	
	
	
break;

	
	
	
	
case &
#39;privatemessage&#39;:
	
	
	
	
	
if (
$client[$n2[3]] != null) {
	
	
	
	
	
	
	

	
	
	
	
	
	
socket_write($client[$n2[3]], &#39;pmsg#&#39;.$n2[1].&#39;#&#39;.$n2[4].chr(0));
	
	
	
	
	
	
socket_write($client[$i], &#39;psmsg#&#39;.$ul[$n2[3]][&#39;name&#39;].&#39;#&#39;.$n2[4].chr(0));
	
	
	
	
	
}
	
	
	
	
	
break;
	
	
	
	
case &
#39;/killmeonemoretime&#39;:
	
	
	
	
	
// check password
	
	
	
	
	
//if ($n2[4] == $keyencryption){
	
	
	
	
	
killDaemon();
	
	
	
	
	
//}
	
	
	
	
	
break;

	
	
	
	
case &
#39;/quit&#39;:
	
	
	
	
	
closeClient();
	
	
	
	
	
break;
	
	
	
	

	
	
	
	
}
	
	
	
}
	
	
if (--
$nready <= 0)
	
	
	
break;
	
	
}
	
}
}
?>

11
Minichat o MC / Quitar el Mantenimiento de mi MC
« en: 16 de Noviembre de 2006, 16:56:31 pm »
Miren pues puse el MC en Mantenimiento para cambiarle unas cosas y no se como quitarlo, no puedo entrar al panel.
Dicen que es cambiando algo del ftag.php pero no se, aqui dejo codigo,
(Este codigo lo cambio un amigo mio, si veis algo extraño xD)
<?
/*
	
Minichat v6.0
	
Editado por .::MaNiTaS::.
	
Nuevas Opciones:
	
	
	
	
	
	
- Instalador
	
	
	
	
	
	
- Deshabilitar Raton o No
	
	
	
	
	
	
- Comprobacion de archivo conectar.php
	
	
	
	
	
	
- Configuracion de Colores
	
	
	
	
	
	

	
Dudas o Bugs: Solicitud-Habbo@hotmail.com
*/
// Comprobamos si el archivo indispensable para le funcionamiento este presente
if(!file_exists("conectar.php")){
	
	
echo
"<body><title>
	
	
Error: archivo conectar inexistente!!</title><b><font size=3>¡¡El Archivo conectar.php no existe!!</font></b><br><br><h1><font face=verdana>Sin ese archivo dificilmente vas a poder usar el minichat ¬¬, arreglalo! xD</font></h1></body>"
;
	
} else {
// Comprobamos si el instalador esta presente en la carpeta
if(file_exists("instalador.php")){
	
	
echo
"<body><title>
	
	
Error: debes borrar el archivo instalar.php!!</title><b><font size=3>¡¡Para poder usar el minichat debes borrar el archivo instalador.php!!</font></b><br><br>
	
	
<h1><font face=verdana>Mas facil no puede ser, BORRA EL ARCHIVO instalador.php ;)</font></h1></body>"
;
	
} else {
session_start();
session_cache_limiter(&#39;nocache,private&#39;);

include("configtag.php");
include(
"lanzaralerta.php");
include(
"lanzaralertageneral.php");
include(
"colores.php");
include(
"funciones.php");
include(
"language/lang-".$langactual.".php");
?>

<? if ($activarMant == "off") { ?>
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Description" content="Minichat v6.0 COnsigue el tuyo en Habbonocturno.ya.st">
<meta name="Author" content=".::MaNiTaS::.">
<meta name="Generator" content="Minichat v<?=$version?>">
   <title>Minichat v<?=$version?></title> 
<link REL="STYLESHEET" HREF="style.css" TYPE="text/css">
<script language="javascript">
<? include("funciones.js"); ?>
function catalogo(URL) {
	
day = new Date();
	
id = day.getTime();
	
eval("page" + id + " = window.open(URL, &#39;" + id + "&#39;, &#39;toolbar=0,scrollbars=0,location=0,menubar=0,resizable=0,width=460,height=470,left = 152,top = 134&#39;);");
}

function ayuda(URL) {
	
day = new Date();
	
id = day.getTime();
	
eval("page" + id + " = window.open(URL, &#39;" + id + "&#39;, &#39;toolbar=0,scrollbars=0,location=0,menubar=0,resizable=0,width=307,height=263,left = 152,top = 134&#39;);");
}

</script>
<style type="text/css">
<!--
.CampoTexto { 
   font-size: 10px; 
   font-family: verdana; 
   border: 1px solid <? echo $bordecampo?>
   background: <? echo $fondocampo?>;

}
.Texto {
   font-family: verdana; 
   font-size: 10px; 
   font-weight: normal;
   color: <?=$colortexto?>;
}

-->
</style>
</head> 
<body bgcolor="<?=$colorfondo?>">
<table border="0" cellpadding="1" cellspacing="0">
<tr>
<td align="center">
<table border="0" cellpadding="0" cellspacing="0" width="180">
<tr>
<td background="img/fondo.gif" align="center" class="Texto" width="180">
<? 
if (isset($_SESSION[&#39;nnick&#39;]) && esAdmin($_SESSION[&#39;nnick&#39;])) { 
$query "SELECT * FROM `alerta_mod` WHERE leido = &#39;0&#39;";
$resp = @mysql_query($query);
$rows = @mysql_num_rows($resp);
if (
$rows) {
?>
&nbsp;<a href="panel.php?mostrar=alertasmod&<? echo session_name()."=".session_id() ?>" target="_blank" class="EnlaceMenu"><span style="font-family: Trebuchet MS; font-size: 16px;"><b><font color="#ffcc00">[Alertas <?= $rows;?>]</font></b></span></a>
<? } else { ?>
&nbsp;<span style="font-family: Trebuchet MS; font-size: 16px; color:red;"><b>[Alertas]</b></span>
<?
}
  if (!isset(
$_SESSION[&#39;iden&#39;])) {
	
$iden idenAdmin($_SESSION[&#39;nnick&#39;]); 
   
	
$_SESSION[&#39;iden&#39;] = $iden;
	
$id idAdmin($_SESSION[&#39;nnick&#39;]);
	
$_SESSION[&#39;id&#39;] = $id;
  
}
  
?>
<br>
<a href="panel.php?<? echo session_name()."=".session_id() ?>" class="EnlaceMenu" target="_blank"><span style="font-family: Trebuchet MS; font-size: 11px; color:white;"><b>Panel</b></span></a><? ?>
</td><td align="right" background="img/fondo.gif"><a href="javascript:catalogo(&#39;catalogo&#39;);"><img src="img/catalogo.gif" border="0"></a><a href="javascript:ayuda(&#39;ayuda&#39;);"><img src="img/interrogante.gif" border="0"></a></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<? 
include ("main.php"); 
if (
$_GET[&#39;mostrar&#39;] == "tag.php") {
?>
<iframe marginwidth="0" marginheight="0" src="tag.php?<?=session_name()."=".session_id(); ?>" frameborder="0" width="180" height="350" scrolling="yes" name="iframe"></iframe>

<?
} else {
?>
<div class="frame">
<? include($_GET[&#39;mostrar&#39;]); ?>
</div>
<? ?>
</td>
</tr>
<form onSubmit="return enviado()" method="post" 
action="procesar.php?<? echo session_name()."=".session_id() ?>" name="tag">
<tr>
<td align="center" class="Texto">
<? 

if (isset($_SESSION[&#39;nnick&#39;])) {
 
echo _WELLCOME." <b>"
 if (isset(
$_SESSION[&#39;nnick&#39;])) 
 
	
echo 
$_SESSION[&#39;nnick&#39;]; 
 
else if (isset($_POST[&#39;nick&#39;])) 
 
	
  
	
 echo 
$_POST[&#39;nick&#39;]; 
 
echo "</b> <a href=\"logout.php\" class=\"EnlaceMenu\">"._LOGOUT."</a>&nbsp;";
 } else { 

if (
$activarReg == "on")
	
$size "17";
else 
	
$size "30";

if (!isset(
$_GET[&#39;n&#39;]) || $_GET[&#39;n&#39;] == "")
	
$nick =_NICKNAME;
else
	
$nick $_GET[&#39;n&#39;];

?> 
<input name="nick" value="<?=$nick?>"  size="19" class="CampoTexto"
maxlength="<? echo $maxNick?>" onfocus="borrarNick();" onclick="borrarNick();">
<? if ($activarReg == "on") { ?>
<input name="clave" value="<?=_PASSWORD?>" size="10" maxlength="10" type="Password"
onfocus="borrarClave();" class="CampoTexto"><? ?><? ?>&nbsp;</td>
</tr>
<? if ($activarUrl == "on") {
if (!isset(
$_GET[&#39;u&#39;]) || $_GET[&#39;u&#39;] == "")
	
$web "http://";
else
	
$web $_GET[&#39;u&#39;];
?>
<tr>
<td align="center">
	
<input name="url" value="<?=$web?>" size=33 class="CampoTexto"></td>
</tr>
<? ?>
<tr>
<td align="left" class="Texto">
	
<input name="mensaje" size=27 value="<?=_MESSAGE?>" class="CampoTexto" onfocus="borrarMensaje();"
	
maxlength="<? echo $maxMsg ?>" onKeyPress="charsleft(this);" onKeyDown="charsleft(this);"
	
onBlur="charsleft(this);" onKeyUp="charsleft(this);" onFocus="charsleft(this);" wrap="VIRTUAL"
	
onChange="charsleft(this);">&nbsp;<input class="CampoTexto" size="2" value="<? echo $maxMsg ?>" name="num"
	
readonly>
</td>
</tr>
<tr>
<td align="center">
	
<input class="Boton" type="submit" value="Enviar" name="enviar">
	
<input class="Boton" type="Reset" value="<?=_RESET?>" name="borrar">
	
<input class="Boton" type="button" value="Actualizar" onclick="location.reload()">
</form>
</tr>
</table>
</body>
</html>
<? } else { ?>
<body bgcolor="#82A1D9">
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p align="center">
<img border="0" src="img/mantenimiento.gif">&nbsp; </p>
<? } } } ?>
<? 
if ($raton == "on") {?>
<script language="Javascript">
var vie=
parseFloat(navigator.appVersion.slice(navigator.appVersion.indexOf("MSIE")+4,navigator.appVersion.length));
function sinmenu()
{
event.cancelBubble = true;
event.returnValue = false;
return false;
}
function noclicderecho(e)

if (navigator.appName == &#39;Netscape&#39; && (e.which == 3 || e.which == 2)) return false;
else
if (navigator.appName == &#39;Microsoft Internet Explorer&#39; && (event.button == 2 || event.button == 3)) 

if (vie < 5) // -- para el IE4 -- \\
{
alert(&#39;Puedes personalizar este mensaje&#39;);
return false;
}
else
if (vie >= 5) // -- para el IE5 -- \\
{
document.oncontextmenu = sinmenu;
return false;
}
}
return true;

document.onmousedown=noclicderecho;

// -- Desabilita el clic derecho en las capas (layers) -- \\

if (document.layers)window.captureEvents(Event.MOUSEDOWN); 
window.onmousedown=noclicderecho;
</script>
<!--webbot bot="HTMLMarkup" endspan --><!--webbot bot="HTMLMarkup" startspan --><script language="JavaScript">
<!--

   function event_false() {
         window.event.returnValue = false
   }

document.onselectstart = event_false

//-->
</script><!--webbot bot="HTMLMarkup" endspan -->
<? ?>

12
Minichat o MC / Error en Enviarrespuesta.php, no me deja responder a las alertas
« en: 10 de Noviembre de 2006, 19:09:57 pm »
Error cuando respondo a las alertas.

Parse error: parse error, unexpected T_STRING in /home/webcindario/felipeadrian/MC/enviarrespuesta.php on line 19

13
Minichat o MC / Fecha y Hora en el MC
« en: 10 de Noviembre de 2006, 18:30:10 pm »
Buenas, mi MC solamente me muestra la hora donde se ha mandado el mensaje, como podria poner, la fecha tmb (ejemplo 09/11/2006 o 09/11/06)

14
Minichat o MC / Error en lo de poner mas rangos
« en: 01 de Noviembre de 2006, 20:52:01 pm »
El error es este:
Parse error: parse error, unexpected T_ELSE in /home/webcindario/felipeadrian/MC/funciones.php on line 374
y no se donde es, aqui teneis el funciones:


<?

	
function 
estaBaneado($ip) {

	
	
$query "SELECT * FROM `baneos` WHERE ip = &#39;$ip&#39;"

	
	
$resp = @mysql_query($query);

	
	
$rows = @mysql_num_rows($resp); 

	
	


	
	
if (
$rows) {

	
	
	
$ban = @mysql_fetch_array($resp);

	
	
	
if (
$ban[&#39;desbanear&#39;] == 0)

	
	
	
	
return 
true;

	
	
	
else {

	
	
	
	
$actual time();

	
	
	
	
if (
$ban[&#39;desbanear&#39;] <= $actual) {

	
	
	
	
	
$query "DELETE FROM `baneos` WHERE ip = &#39;$ip&#39;"

	
	
	
	
	
@
mysql_query($query);

	
	
	
	
	
return 
false;

	
	
	
	
} else

	
	
	
	
	
return 
true;

	
	
	
}
	


	
	
} else

	
	
	
return 
false;
	


	
}

	


 
	
function 
actualizarIps($esperar) {

	
	
$fecha2 microtime();

	
  
	
$fecha2 explode(" "$fecha2);

	
  
	
$fecha2 $fecha2[1];

	
	
	
  

	
	
$query "SELECT * FROM `flood`"

	
	
$resp = @mysql_query($query);

	
	
$rows = @mysql_num_rows($resp); 



	
	
if (
$rows)

	
	
	
while (
$flood = @mysql_fetch_array($resp)) {

	
	
	
	
$difseg $fecha2 $flood[&#39;tiempo&#39;];

	
	
    
	
if (
$difseg >= $esperar)

	
	
	
	
	
$query2 "DELETE FROM `flood` WHERE ip = &#39;".$flood[&#39;ip&#39;]."&#39;";

	
	
	
	
  
	
@
mysql_query($query2);

	
	
	
}

	
	
	
  
	
	
  

	
}

	


	
function 
actualizarIp($fecha$ip) {

	
	
$query "SELECT * FROM `flood` WHERE ip = &#39;$ip&#39;"

	
	
$resp = @mysql_query($query);

	
	
$rows = @mysql_num_rows($resp);

	
	


	
	
if (!
$rows)

	
	
	
$query "INSERT INTO `flood` (ip, tiempo) values (&#39;".$ip."&#39;, &#39;".$fecha."&#39;)";

	
	
else

	
	
	
$query "UPDATE `flood` set tiempo = &#39;".$fecha."&#39; WHERE ip = &#39;".$ip."&#39;";

	
	


	
	
@
mysql_query($query);



	
}

	


	
function 
validarIp($ip) {

	
	
	
 if (!
is_string($ip))

	
	
	
  return 
false;



	
	
	
 
$ip_long ip2long($ip);

	
	
	
 
$ip_reverse long2ip($ip_long);

	
	
	
 if (
$ip == $ip_reverse)

	
	
	
   return 
true;

	
	
	
 else

	
	
	
   return 
false;

    }
	




    function 
yaExiste($login) {

	
	
$query "SELECT * FROM `usuarios` WHERE nick = &#39;$login&#39;"

	
	
$resp = @mysql_query($query);

	
	
$rows = @mysql_num_rows($resp); 

	
	


	
	
if (!
$rows)

	
	
	
return 
false;

	
	
else

	
	
	
return 
true;

    } 
	


	


    
// Verifica que existe un usuario y que su password es el indicado

    
function comprobarNick($login$pas) {

	
	
global 
$activarReg;

	
	


	
    
$pas md5($pas);

	
	
$query "SELECT * FROM `usuarios` WHERE nick = &#39;".$login."&#39;"

	
	
$resp = @mysql_query($query);

	
	
$rows = @mysql_num_rows($resp); 

	
	


	
	
if (
$rows) {

	
	
	
$usuario = @mysql_fetch_array($resp);

	
	
	
if (
$activarReg == "on" && $usuario[&#39;rol&#39;] == "0") {
	


	
	
	
	
if (
$usuario[&#39;pass&#39;] == $pas)

	
	
	
	
	
return 
$usuario[&#39;nick&#39;];

	
	
	
	
else

	
	
	
	
	
return 
"-1";

	
	
	
}

	
	


	
	
	
if (
$usuario[&#39;rol&#39;] == "Owner"
	
	
	
|| 
$usuario[&#39;rol&#39;] == "Tecnico"

	
	
	
|| 
$usuario[&#39;rol&#39;] == "Moderador"

	
	
	
|| 
$usuario[&#39;rol&#39;] == "Rubi"

	
	
	
|| 
$usuario[&#39;rol&#39;] == "Zafiro"

	
	
	
|| 
$usuario[&#39;rol&#39;] == "Bronze") {

	
	
	
	
if (
$usuario[&#39;pass&#39;] == $pas)

	
	
	
	
	
return 
$usuario[&#39;nick&#39;];

	
	
	
	
else

	
	
	
	
	
return 
"-1";

	
	
	
}

	
	
	


	
	
}

	
	
	


        return 
"0";

    }

	


    function 
guardar($user$pas$email) {

	
	
$id "";

	
	
$query "INSERT INTO `usuarios` (id, nick, rol, pass, fecha_registro, censuras, email) VALUES (&#39;".$id."&#39;, &#39;".$user."&#39;, &#39;0&#39;, &#39;".md5($pas)."&#39;, &#39;".date("d.m.y, H:i:s")."&#39;, 0, &#39;".$email."&#39;)"

	
	
@
mysql_query($query);

    }
	


	


	
// Verifica que existe un usuario y un admin 

	
function 
existeUser($login$rol$id) { 

	
	
 global 
$activarReg

	
	
 

	
	
$query "SELECT * FROM `usuarios` WHERE nick = &#39;".strtolower($login)."&#39;"

	
	
$resp = @mysql_query($query);

	
	
$rows = @mysql_num_rows($resp);

	
	
if (
$rows)

	
	
	
$user = @mysql_fetch_array($resp);



	
	
 if (
$activarReg == "on") { 

	
	
 
	
if (
$rows && $user[&#39;rol&#39;] == "0") 

	
	
	
	
return 
true

	
	
 } 



	
	
if (
$rol == "Owner" && $rows && $user[&#39;rol&#39;] == "Owner" && $user[&#39;id&#39;] != $id)
	


	
	
 
	
return 
true;
	
	
 
	
	
if (
$rol == "Tecnico" && $rows && $user[&#39;rol&#39;] == "Tecnico" && $user[&#39;id&#39;] != $id)  
	
	
	
return 
true;



	
	
if (
$rol == "Zafiro" && $rows && $user[&#39;rol&#39;] == "Zafiro" && $user[&#39;id&#39;] != $id)  

	
	
 
	
return 
true

	
	


	
	
if (
$rol == "Moderador" && $rows && $user[&#39;rol&#39;] == "Moderador" && $user[&#39;id&#39;] != $id)  

	
	
 
	
return 
true
	


	
	


	
	
if (
$rol == "Rubi" && $rows && $user[&#39;rol&#39;] == "Rubi" && $user[&#39;id&#39;] != $id)  

	
	
 
	
return 
true
	


	
	


	
	
if (
$rol == "Bronze" && $rows && $user[&#39;rol&#39;] == "Bronze" && $user[&#39;id&#39;] != $id)  

	
	
 
	
return 
true
	




	
	
 return 
false

	
	


	


	
// Busca el Rango identificativo del admin

	
function 
idenAdmin($login) { 

	
	
$query "SELECT * FROM `usuarios` WHERE nick = &#39;$login&#39;"

	
	
$resp = @mysql_query($query);

	
	
$rows = @mysql_num_rows($resp);  

	
	
$usuario = @mysql_fetch_array($resp);

	
	


	
	
if (!
$rows)

	
	
   return -
1;
	


	
	
else 

	
	
   return 
$usuario[&#39;rol&#39;]; 

	
	


	


	
// Busca el numero identificativo del admin 

	
function 
idAdmin($login) { 

	
	
$query "SELECT * FROM `usuarios` WHERE nick = &#39;$login&#39;"

	
	
$resp = @mysql_query($query);

	
	
$rows = @mysql_num_rows($resp);  

	
	
$usuario = @mysql_fetch_array($resp);

	
	


	
	
if (!
$rows)

	
	
   return -
1;
	


	
	
else 

	
	
   return 
$usuario[&#39;id&#39;]; 

	
	


	


	
// Verifica si es uno de los administradores

	
function 
esAdmin($login) {

	
	
$query "SELECT * FROM `usuarios` WHERE nick = &#39;$login&#39;"

	
	
$resp = @mysql_query($query);

	
	
$rows = @mysql_num_rows($resp);  

	
	
$usuario = @mysql_fetch_array($resp);

	
	


	
	
if (
$usuario[&#39;rol&#39;] == "Owner"
	
	
|| 
$usuario[&#39;rol&#39;] == "Tecnico"

	
	
|| 
$usuario[&#39;rol&#39;] == "Moderador"

	
	
|| 
$usuario[&#39;rol&#39;] == "Zafiro"

	
	
|| 
$usuario[&#39;rol&#39;] == "Rubi"

	
	
|| 
$usuario[&#39;rol&#39;] == "Bronze")

	
	
	
return 
true;

	
	
else

	
	
	
return 
false;
	


	
}
	


	


	
// Verifica si es el SUPERadministrador

	
function 
esSuperAdmin($login) {

	
	
$query "SELECT * FROM `usuarios` WHERE nick = &#39;$login&#39;"

	
	
$resp = @mysql_query($query);

	
	
$rows = @mysql_num_rows($resp);  

	
	
$usuario = @mysql_fetch_array($resp);

	
	


	
	
if (
$usuario[&#39;rol&#39;] == "Owner")

	
	
	
return 
true;

	
	
else

	
	
	
return 
false;
	
 

	
}



    
// Función para reemplazar los códigos por su respectivo smilie

    
function reemplazarSmilies($palabra) {

	
	
$query "SELECT * FROM `smilies`";

	
	
$resp = @mysql_query($query);

	
	
$rows = @mysql_num_rows($resp);

	
	
if (
$rows) {

	
	
	
while (
$placa = @mysql_fetch_array($resp))

	
	
	
$palabra str_replace($placa[&#39;codigo&#39;] ,"<img src=".$placa[&#39;imagen&#39;]." align=middle>", $palabra);

	
	
}

	


	
    return 
$palabra;

    }

	


	
function 
bbcode($texto) {

        
$texto eregi_replace("\\[u\\]([^\\[]*)\\[/u\\]","<u>\\1</u>"$texto);



        
$texto eregi_replace("\\[i\\]([^\\[]*)\\[/i\\]","<em>\\1</em>"$texto);



        
$texto eregi_replace("\\[b\\]([^\\[]*)\\[/b\\]","<strong>\\1</strong>"$texto);



	
	
return 
$texto;

	
}

	


	
function 
arrayCensura() {

        
$query "SELECT * from censuras";

	
	
$resp = @mysql_query($query);

	
	
$palabras = array();

	
	
$i 0;

	
	
while (
$palabras[$i] = @mysql_fetch_array($resp)) {

	
	
	
$palabras[$i] = $palabras[$i][&#39;palabra&#39;];

	
	
	
$i ++;

	
	
}



	
	
return 
$palabras;

	
}



	
function 
arrayCaracteres() {

        
$query "SELECT * from caracteres";

	
	
$resp = @mysql_query($query);

	
	
$palabras = array();

	
	
$i 0;

	
	
while (
$palabras[$i] = @mysql_fetch_array($resp)) {

	
	
	
$palabras[$i] = $palabras[$i][&#39;caracter&#39;];

	
	
	
$i ++;

	
	
}



	
	
return 
$palabras;

	
}
	


	


    function 
guardarMensaje($login$texto$web$ipLogin) {

        global 
$maximo$existeNick$activarIp$activarHora$maxMsg$activarBBcode$mensajes,

	
	
       
$maxNick$colorowners$colormoderador$colorvip$coloranonimo$colorrubi$colorzafiro,

	
	
	
   
$colorbronze$activarAutomensaje$tAutomensaje;

	
    

	
	
if (
strlen($login) > $maxNick

	
	
  return 
_NEXCEEDSLIMITCHARS;

	
	
if (
strlen($texto) > $maxMsg)

	
	
  return 
_MEXCEEDSLIMITCHARS;

	
	


	
	
$login htmlentities($login);

        
// No permitir etiquetas HTML, ni espacios en blanco en el nick

        
$login reemplazarSmilies($login);

	
	
$web htmlentities($web);



        
// Aquí vamos a procesar el mensaje palabra por palabra para que ninguna 

	
	
// sea demasiado larga y destroce el diseño

        // Dividimos el mensaje por palabras

        
$palabrasm explode(" ",$texto);

        
// Contamos cuantas palabras son 

        
$numpalabras count($palabrasm); 



        
// Bucle "for" para recorrer las palabras y dividirlas si hay alguna larga

        
for ($i 0$i $numpalabras$i++) {

           
// Comparamos la longitud de las palabras con el máximo

           
if (strlen($palabrasm[$i]) > $maximo) {

             
// Dividimos las palabras que excedan el máximo  

             
$palabrasm[$i] = wordwrap($palabrasm[$i], $maximo"<br>"1);

	
	
	
 
$palabrasm[$i] = htmlentities($palabrasm[$i]);

	
	
	
 
$palabrasm[$i] = str_replace("&lt;","<"$palabrasm[$i]);

	
	
	
 
$palabrasm[$i] = str_replace("&gt;",">"$palabrasm[$i]);

           } else

	
	
   
	
	
$palabrasm[$i] = htmlentities($palabrasm[$i]);

           
$palabrasm[$i] = reemplazarSmilies($palabrasm[$i]);

        } 
// Fin bucle "for"



	
	
$palabras arrayCensura();

	
	
if (
$palabras[0] != "") {

	
	
for (
$i 0$i sizeof($palabrasm); $i ++)

	
	
   for (
$j 0$j < (sizeof($palabras) - 1); $j ++) {

	
	
      if (
eregi($palabras[$j], $palabrasm[$i])) {

	
	
	
    
$palabrasm[$i] = "****";  

	
	
	
	
if (isset(
$_SESSION[&#39;nnick&#39;])) {

	
	
	
	
	
$query "UPDATE `usuarios` SET censuras = censuras + 1 WHERE nick =&#39;".$_SESSION[&#39;nnick&#39;]."&#39;";

	
	
	
	
	
@
mysql_query($query);

	
	
	
	
	
}

	
	
	
	
}

	
	
	
}

	
	
}

	
	


	
	
$caracteres arrayCaracteres();

	
	
if (
$caracteres[0] != "") {

	
	
for (
$i 0$i sizeof($palabrasm); $i ++)

	
	
   for (
$j 0$j < (sizeof($caracteres) - 1); $j ++) {

	
	
      if (
eregi($caracteres[$j], $palabrasm[$i])) {

	
	
	
    
$palabrasm[$i] = "";  

	
	
	
	
if (isset(
$_SESSION[&#39;nnick&#39;])) {

	
	
	
	
	
$query "UPDATE `usuarios` SET censuras = censuras + 1 WHERE nick =&#39;".$_SESSION[&#39;nnick&#39;]."&#39;";

	
	
	
	
	
@
mysql_query($query);

	
	
	
	
	
}

	
	
	
	
}

	
	
	
}

	
	
}

	
	
	
	


        
// Unimos las palabras mediante espacios vacíos para crear el mensaje

        
$texto implode(" ",$palabrasm);



      
	
if (
$texto == "")

	
  
	
	
return 
_NOMESSAGE;

	
	
  

	
	
if (
$palabras[0] != "") {  

	
	
for (
$i 0$i < (sizeof($palabras) - 1); $i ++) {

	
	
   if (
eregi($palabras[$i],$login))
	
{

	
	
	
 
$login "****";

	
	
	
 if (isset(
$_SESSION[&#39;nnick&#39;])) {

	
	
	
	
	
$query "UPDATE `usuarios` SET censuras = censuras + 1 WHERE id =&#39;".$_SESSION[&#39;nnick&#39;]."&#39;";

	
	
	
	
	
@
mysql_query($query);

	
	
	
	
	
}

	
	
	
 }

	
	
}
	
	


	
	
}



	
	
if (
$caracteres[0] != "") {

	
	
for (
$i 0$i < (sizeof($caracteres) - 1); $i ++) {

	
	
   if (
eregi($caracteres[$i], $login)) {
	


	
	
	
 
$login "";

	
	
	
 if (isset(
$_SESSION[&#39;nnick&#39;])) {

	
	
	
	
	
$query "UPDATE `usuarios` SET censuras = censuras + 1 WHERE id =&#39;".$_SESSION[&#39;nnick&#39;]."&#39;";

	
	
	
	
	
@
mysql_query($query);

	
	
	
	
	
}

	
	
	
 }

	
	
}
	
	


	
	
}
	


	
	


      
	
if (
$login == "")

	
  
	
	
return 
_NONICK;

	
	


	
	
if (
$activarBBcode == "on")

	
	
  
$texto bbcode($texto);
	
	




        
// Fecha en la que se envió el mensaje

      
$fecha .= " "._AT." ";

       

       
$fecha .= Date("H:i");

        

        if (
$existeNick == "true") {

         
$rol idenAdmin($login);
	
 
	
if (
$rol == "Owner")
	
$color$colorowner;
	
	
else if (
$rol == "Tecnico")
	
	
	
$color$colortecnico
	
	
else if (
$rol == "Moderador")
	
	
	
$color $colormoderador;
	
	
else if (
$rol == "Zafiro")
	
	
	
$color $colorzafiro;
	
	
else if (
$rol == "Bronze")
	
	
	
$color $colorbronze;
	
	
else if (
$rol == "Rubi")
	
	
	
$color $colorrubi;
	
	
else if (
$rol == "0")
	
	
	
$color $colorvip;

// Comprobamos si no quiere mostrar placa, y activamos el autoplacas

if ($ocultarplaca != "si"){



if (
$placasAutomaticas == "on") {

if (
$rol == "Moderador")

$anadir "es";

else

$anadir "s";

$b $rol."".$anadir;

$sql "SELECT imagen FROM smilies WHERE mostrar = &#39;$b&#39;";

$resp mysql_query($sql);

$rows mysql_num_rows($resp);

if (
$rows) {

$placa mysql_fetch_array($resp);

$placa $placa[&#39;imagen&#39;];

$texto "<img border=\"0\" src=\"".$placa."\" style=\"float: left\">".$texto;

}

}

}

         if (
$rol == "Owner") {

               
$color $colorowners;

               
$texto "<img src=\"http://felipeadrian.webcindario.com/MC/img/lyg3061fn.gif\">".$texto;

         } else if (
$rol == "Tecnico") {

               
$color $colortecnico;

                    
$texto "<img src=\"http://felipeadrian.webcindario.com/MC/img/lyg3061fn.gif\">".$texto;
	
} else if (
$rol == "Moderador") {

               
$color $colormoderador;

                    
$texto "<img src=\"http://felipeadrian.webcindario.com/MC/img/badge_staff.gif\">".$texto;

         } else if (
$rol == "Zafiro"){

               
$color $colorzafiro;

                    
$texto "<img src=\"http://felipeadrian.webcindario.com/MC/img/p.gif\">".$texto;

         } else if (
$rol == "Bronze"){

               
$color $colorbronze;    

                    
$texto "<img src=\"http://felipeadrian.webcindario.com/MC/img/b.gif\">".$texto;

         } else if (
$rol == "Rubi"){

               
$color $colorrubi;

                    
$texto "<img src=\"http://felipeadrian.webcindario.com/MC/img/lyg3061fn.gif\">".$texto;

         } else if (
$rol == "0") {

               
$color $colorvip;

               
$texto "<img src=\"http://felipeadrian.webcindario.com/MC/img/badge_vampireopen.gif\">".$texto;

                    } 

	
	
	
	


	
	
	
$query "SELECT * FROM `usuarios` WHERE nick = &#39;".$login."&#39;"

	
	
	
$resp = @mysql_query($query);

	
	
	
$usuario = @mysql_fetch_array($resp);

	
	
	
$user_id $usuario[&#39;id&#39;];
	


	
	
	
$login "";

	
	
	
$query "UPDATE `usuarios` SET mensajes = mensajes + 1 WHERE id =&#39;" .$user_id"&#39;";

	
	
	
@
mysql_query($query);

        } else {

            
$color $coloranonimo;  // anonimo

	
	
	
$user_id = -1;

	
	
	
}

	
	
	


	
	
$query "UPDATE `configuracion` SET valor = valor + 1 WHERE campo = &#39;total_mensajes&#39;";

	
	
@
mysql_query($query);

	
	
	
	


	
	
$id "";

	
	
$tiempo microtime();

	
	
$tiempo explode(" "$tiempo);

	
	
$tiempo $tiempo[1];

	
	
$query "INSERT INTO mensajes (id, usuario, texto, web, color, ip, fecha, nombre, tiempo) VALUES (&#39;".$id."&#39;, &#39;".$user_id."&#39;, &#39;".$texto."&#39;, &#39;".$web."&#39;, &#39;".$color."&#39;, &#39;".$ipLogin."&#39;, &#39;".$fecha."&#39;, &#39;".$login."&#39;, &#39;".$tiempo."&#39;)";

	
	
@
mysql_query($query);

	
	


	
	
if (
$activarAutomensaje == "on") {

	
	
	
$query "SELECT * FROM `automensaje` WHERE id = &#39;1&#39;"

	
	
	
$resp = @mysql_query($query);

	
	
	
$automensaje = @mysql_fetch_array($resp);

	
	
	
$fecha1 $automensaje[&#39;ultimo&#39;];

	
	
	
$fecha2 microtime();

	
	
	
$fecha2 explode(" "$fecha2);

	
	
	
$fecha2 $fecha2[1];

	
	
	
if ((
$fecha2 $fecha1) >= $tAutomensaje) { 

	
	
	
	
$id "";

	
	
	
	
$fecha .= " "._AT." ";

	
    
	
	
$fecha .= Date("H:i");

	
	
	
	
$query "INSERT INTO mensajes (id, usuario, texto, web, color, ip, fecha, nombre, tiempo) VALUES (&#39;".$id."&#39;, &#39;-1&#39;, &#39;".$automensaje[&#39;texto&#39;]."&#39;, &#39;http://www.diver-habbo.net/&#39;, &#39;#cc0000&#39;, &#39;&#39;, &#39;".$fecha."&#39;, &#39;InfoMensaje&#39;, &#39;".$tiempo."&#39;)";

	
	
	
	
@
mysql_query($query);

	
	
	
	
$query "UPDATE `automensaje` set ultimo = &#39;".$fecha2."&#39; WHERE id = &#39;1&#39;";

	
	
	
	
@
mysql_query($query);

	
	
	
}

	
	


	
	
}

	
	


	
	
return 
"";

    }



?>




Haber quien lo sabe.

15
Minichat o MC / Opciones en el MC
« en: 31 de Octubre de 2006, 19:00:21 pm »
Hola, queria saber como podria restringir o admitir opciones en el MC en cada rango. ¿Alguien sabria?, porfavor espliquenlo, no ponerlo solo

Páginas: [1] 2