





























| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |
[ 106 a 120 de 387 ]






























Editado por Daniel el 29/04/2008 a las 04:52:35h.
EDIT: Tenéis disponible una versión pública en esta web, donde podéis convertir cualquier web. Podéis acceder por el menú "Aplicaciones".
Editado por Daniel el 11/06/2008 a las 11:08:21h.
- PR:5 - Solo blogs, logo a cambio.Editado por Daniel el 24/04/2008 a las 17:30:15h.
Editado por Daniel el 21/04/2008 a las 08:38:16h.
Editado por Daniel el 15/09/2008 a las 05:12:01h.
<?php
$config["BASE_PATH"] = ""; // Si especificais el directorio de trabajo del script odreis incluirlo y usarlo desde cualquier parte.
$file = $config["BASE_PATH"].$_GET["uri"];
if(!file_exists($file)){ // No existe, url incorrecta.
header('Status: 404 Not Found');
header('HTTP/1.0 404 Not Found');
header("Location: /404.shtml"); // Aquí coloca la página de error de tu servidor, o una bien guapa que te crees
exit();
}
$htmlstart = 0;
$headstart = -1;
$bodystart = -1;
$html = file_get_contents( $file );
// Detectamos las posiciones de diversos elementos.
$htmltag = stripos( $html, "<html" );
if( $htmltag !== false ) $htmlstart = strpos( $html, ">", $htmltag+1 ) + 1;
$headtag = stripos( $html, "<head" );
if( $headtag !== false ) $headstart = strpos( $html, ">", $headtag+1 ) + 1;
$bodytag = stripos( $html, "<body" );
if( $bodytag !== false ) $bodystart = strpos( $html, ">", $bodytag+1 ) + 1;
$bodystopbool = true;
$bodystop = stripos( $html, "</body>" );
if( bodystop == -1 ) {
$bodystop = strlen( $html );
$bodystopbool = false;
}
require_once($config["BASE_PATH"]."comun/__conecta.inc.php");
require_once($config["BASE_PATH"]."comun/__cookies.inc.php");
if( $headstart != -1 && $bodystart != -1 ) { // pagina completa, maquetamos bien el head y el body.
if($htmlstart <= 0 ) echo "<html>";
echo substr($html, 0, $headstart)." ";
?>
// Escribe aquí lo que quieras añadir en el 'head': keywords, favicon, description.....
<?php echo substr($html, $headstart, $bodystart - $headstart )." "; ?>
// Escribe aquí lo que quieras añadir al principio de la web, justro tras el tag de body: Menus, etc... Se pueden usar 'includes' de php.
<?php echo substr($html, $bodystart, $bodystop - $bodystart)." "; ?>
// Escribe aquí lo que quieras añadir al principio de la web, justro al final del tag de body: Contadores, pies de página, etc...
<? echo substr($html, $bodystop)." ";
}
else if( $headstart == -1 && $bodystart != -1 ) { // pagina sin head, se lo anyadimos
if($htmlstart > 0) echo substr($html, 0, $htmlstart)." ";
else echo "<html>";
?>
<head>
// Escribe aquí lo que quieras añadir en el 'head': keywords, favicon, description.....
</head>
<?php echo substr($html, $htmlstart, $bodystart - $htmlstart )." "; ?>
// Escribe aquí lo que quieras añadir al principio de la web, justro tras el tag de body: Menus, etc... Se pueden usar 'includes' de php.
<?php echo substr($html, $bodystart, $bodystop - $bodystart)." "; ?>
<?php echo substr($html, $bodystart, $bodystop - $bodystart)." "; ?>
// Escribe aquí lo que quieras añadir al principio de la web, justro al final del tag de body: Contadores, pies de página, etc...
<?php
if($bodystopbool) echo substr($html, $bodystop)." ";
}
else {// Ni head ni body
if($htmlstart > 0) echo substr($html, 0, $htmlstart)." ";
else echo "<html>";
?>
<head>
// Escribe aquí lo que quieras añadir en el 'head': keywords, favicon, description.....
</head>
<body>
// Escribe aquí lo que quieras añadir al principio de la web, justro tras el tag de body: Menus, etc... Se pueden usar 'includes' de php.
<?php echo substr($html, $htmlstart, $htmlstop - $htmlstart )." ";
// Escribe aquí lo que quieras añadir al principio de la web, justro al final del tag de body: Contadores, pies de página, etc...
<?php } ?>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} ^/universidad/wiki(.*)$
RewriteCond %{REQUEST_URI} ^(.*).htm(l?)$
RewriteRule ^(.*)$ /parse.php?uri=$1 [L]
Editado por Daniel el 14/04/2008 a las 10:47:52h.
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |
[ 106 a 120 de 387 ]