. Class done by David Marco Martinez */ // Funcion de autodeclaracion de clases. Atributos indeterminados function stringForJavascript($in_string) { $str = ereg_replace("[\r\n]", " \\n\\\n", $in_string); $str = ereg_replace('"', '\\"', $str); Return $str; } function autoload( ) { //$str = 'if( file_exists( \'../lib/cls/\'.$file ) ) require_once( \'../lib/cls/\'.$file );'; $str = 'if( false );'; foreach( func_get_args( ) as $dir ) $str .= 'elseif( file_exists( \''.$dir.'\'.$file ) ) require_once( \''.$dir.'\'.$file );'; $cmd = 'function __autoload( $cls ) { $file = ucfirst( $cls ).\'.cls.php\'; '.$str.' }'; eval( $cmd ); } // Control de HTTP_SERVER_VARS if( !function_exists( 'updateMagicQuotes' ) ) { function updateMagicQuotes( $HTTP_VARS ) { if( is_array( $HTTP_VARS ) ) { foreach( $HTTP_VARS as $name => $value ) { if( !is_array( $value ) ) $HTTP_VARS[$name] = addslashes( $value ); } } global $$name; $$name = &$HTTP_VARS[$name]; } } return $HTTP_VARS; } if( !get_magic_quotes_gpc( ) ) { /*$HTTP_GET_VARS = updateMagicQuotes( $HTTP_GET_VARS ); $HTTP_POST_VARS = updateMagicQuotes( $HTTP_POST_VARS ); $HTTP_COOKIE_VARS = updateMagicQuotes( $HTTP_COOKIE_VARS );*/ $HTTP_GET_VARS = updateMagicQuotes( $_GET ); $HTTP_POST_VARS = updateMagicQuotes( $_POST ); $HTTP_COOKIE_VARS = updateMagicQuotes( $_COOKIE ); } } if( !isset($HTTP_SERVER_VARS['REQUEST_URI'] ) ) { $HTTP_SERVER_VARS['REQUEST_URI'] = $_SERVER['PHP_SELF']; } ?>