Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/01/2012, 15:17
marcoss2009
 
Fecha de Ingreso: agosto-2011
Ubicación: Argentina
Mensajes: 46
Antigüedad: 12 años, 8 meses
Puntos: 0
error en cometchat

hola, ya me tiene cansado el localhost de que me tire errores en todo el script de cometchat, mas o menos lo fui adaptando al sistema de mi web y ya mas o menos anda, solamente tengo un error que no se que tiene qué me tira este error.

Cita:
Parse error: syntax error, unexpected T_IF, expecting T_FUNCTION in C:\AppServ\www\cometchat\php4functions.php on line 466 y otras lineas mas
Código:
if (class_exists('PEAR_Error')) {

    class Services_JSON_Error extends PEAR_Error
    {
        function Services_JSON_Error($message = 'unknown error', $code = null,
                                     $mode = null, $options = null, $userinfo = null)
        {
            parent::PEAR_Error($message, $code, $mode, $options, $userinfo);
        }
    }

} else {
    class Services_JSON_Error
    {
        function Services_JSON_Error($message = 'unknown error', $code = null,
                                     $mode = null, $options = null, $userinfo = null)
        {

        }
    }

}
if( !function_exists('json_encode') ) {
	function json_encode($data) {
        $json = new Services_JSON();
        return( $json->encode($data) );
    }
}
if( !function_exists('json_decode') ) {
	function json_decode($data) {
        $json = new Services_JSON();
        return( $json->decode($data) );
    }
}

if (!function_exists('str_ireplace')) {
	function str_ireplace($find,$replace,$string)
	{
	    if(!is_array($find))
	        $find = array($find);
	        
	    if(!is_array($replace))
	    {
	        if(!is_array($find))
	            $replace = array($replace);
	        else
	        {
	            $c = count($find);
	            $rString = $replace;
	            unset($replace);
	            for ($i = 0; $i < $c; $i++)
	            {
	                $replace[$i] = $rString;
	            }
	        }
	    }
	    foreach($find as $fKey => $fItem)
	    {
	        $between = explode(strtolower($fItem),strtolower($string));
	        $pos = 0;
	        foreach($between as $bKey => $bItem)
	        {
	               $between[$bKey] = substr($string,$pos,strlen($bItem));
	               $pos += strlen($bItem) + strlen($fItem);
	        }
	        $string = implode($replace[$fKey],$between);
	    }
	    return($string);
	}
}
necesito saber como arreglar eso,ese codigo viene del archivo php4functions.php muchas gracias

Última edición por marcoss2009; 29/01/2012 a las 15:49