Código PHP:
<?php
/************************************************
fusion news
by the fusion team
version 2.5
[url]www.fusionphp.com[/url]
versi—n espa–ola y adaptaci—n realizadas por
c—digo libre, [url]http://www.codigolibre.com[/url]
*************************************************/
// variables (cambia los nombres de estos archivos si hace falta)
$config = "config.php"; // archivo de configuraci—n
$users = "users.php"; // archivo de usuarios
// no edites nada a partir de aqu’ ********
include $config;
//start
if($id == ""){
if($first == "yes"){
$title = "instalación de fusion";
$content = <<< html
revisa estos datos y asegúrate de que son correctos.<br>
<br>
<table width=600 cellspacing=0 cellpadding=0 border=0>
<tr>
<td width=380 valign="top">
<form action="?id=go" method="post">
url de tu sitio:
</td>
<td width=220 valign="top">
<input type="text" name="site1" value="http://$SERVER_NAME" size=31>
</td>
</tr>
<tr>
<td width=380 valign="top">
url del directorio de fusion:
</td>
<td width=220 valign="top">
<input type="text" name="furl1" value="http://$SERVER_NAME/news" size=31>
</td>
</tr>
<tr>
<td width=380 valign="top">
url del archivo de noticias completas (news.php):
</td>
<td width=220 valign="top">
<input type="text" name="fullnews" value="http://$SERVER_NAME/news/news.php" size=31>
</td>
</tr>
<tr>
<td width=380 valign="top">
url de la página "enviar a un amigo" (send.php):
</td>
<td width=220 valign="top">
<input type="text" name="send" value="http://$SERVER_NAME/news/send.php" size=31>
</td>
</tr>
<tr>
<td width=380 valign="top">
¿permitir bbcode?
</td>
<td width=220 valign="top">
<input type="radio" name="bbc" value="y" checked> sí<br>
<input type="radio" name="bbc" value="n"> no
</td>
</tr>
<tr>
<td width=380 valign="top">
¿permitir html?
</td>
<td width=220 valign="top">
<input type="radio" name="html" value="y" checked> sí<br>
<input type="radio" name="html" value="n"> no
</td>
</tr>
<tr>
<td width=380 valign="top">
¿usar sonrisitas?
</td>
<td width=220 valign="top">
<input type="radio" name="sm" value="y" checked> sí<br>
<input type="radio" name="sm" value="n"> no
</td>
</tr>
<tr>
<td width=600 valign="top">
<b>info del administrador</b><br>
<br>
</td>
</tr>
<tr>
<td width=380 valign="top">
nombre:
</td>
<td width=220 valign="top">
<input type="text" name="username">
</td>
</tr>
<tr>
<td width=380 valign="top">
contraseña:
</td>
<td width=220 valign="top">
<input type="text" name="password">
</td>
</tr>
<tr>
<td width=380 valign="top">
email:
</td>
<td width=220 valign="top">
<input type="text" name="email">
</td>
</tr>
<input type="hidden" name="icon">
<input type="hidden" name="le" value="2">
<tr>
<td width=200 valign="top">
<input type="submit" value="guardar"></form>
</td>
</tr>
</table>
<br>
html;
}
}
else{
$title = "instalación completada";
$content = "instalación completada";
}
//go
if($id == "go"){
if($bbc == "y"){
$bbca = 1;
}
else{
$bbca = 0;
}
if($html == "y"){
$h = 1;
}
else{
$h = 0;
}
if($sm == "y"){
$sm = 1;
}
else{
$sm = 0;
}
$p1 = $SCRIPT_FILENAME;
$p2 = str_replace("/installer.php", "", $p1);
//what to write
$save = "<?php
\$site = \"$site1\";
\$furl = \"$furl1\";
\$hurl = \"$furl1/news.txt\";
\$fullnewsurl = \"$fullnews\";
\$newsfile = \"$p2/news.txt\";
\$headlines = \"$p2/headlines.txt\";
\$fnewsfile = \"$p2/news.php\";
\$dfile = \"$p2/news.db\";
\$arc = \"$p2/archive.txt\";
\$datefor = \"d/m/y\";
\$numofposts = 20;
\$numofh = 20;
\$bb = $bbca;
\$ht = $h;
\$first = \"no\";
\$header = \"<html>
<head>
<title>Noticias</title>
<meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=iso-8859-1\\\">
</head>
<body bgcolor=\\\"#FFFFFF\\\"><br>\";
\$footer = \"<br></body></html>\";
\$skin = \"standard\";
\$temp = \"<table width=550 cellspacing=0 cellpadding=0 border=0>
<tr>
<td valign=\\\"top\\\">
<b>{subject}</b> - publicado por {user} en fecha {date}<br>
{news}
</td>
</tr>
</table><br>\";
\$ftemp = \"<table width=550 cellspacing=0 cellpadding=0 border=0>
<tr>
<td valign=\\\"top\\\">
<b>{subject}</b> - publicado por {user} en fecha {date}<br>
{news}</td></tr>
<tr><td align=\\\"right\\\">{pl}<br>{send}
</td>
</tr>
</table>\";
\$smilies = $sm;
\$sflink = \"$send\";
\$sf = \"Enviar artículo a un amigo\";
\$pl = \"Versión para imprimir\";
\$fs = \"<b>Leer entero</b>\";
?>";
$configfile = fopen($config,w);
fputs($configfile,$save);
fclose($configfile);
//what to write
$fp = fopen($users,a);
fwrite($fp,"$username|$email|$icon|$password|$le|\n");
fclose($fp);
$title = "todo listo";
$content = "todo listo. <a href=\"$furl1\">entra</a> y visita "admin" para revisar las configuraciones.";
}
?>
<html><head>
<title>fusion</title>
<style>
<!--
body { color: black; font: 8pt verdana; font-weight: none; text-decoration: none }
a:link { color: 58BEFF; font: 8pt verdana; font-weight: none; text-decoration: underline }
a:visited { color: 58BEFF; font: 8pt verdana; font-weight: none; text-decoration: underline }
a:active { color: 58BEFF; font: 8pt verdana; font-weight: none; text-decoration: underline }
td { color: black; font: 8pt verdana; font-weight: none; text-decoration: none }
a:hover { color: 58BEFF; font: 8pt verdana; font-weight: none; text-decoration: underline }
input { color:black; font: 8pt verdana; font-weight: none; text-decoration: none; background: white; border: 1 solid black; }
textarea { color:black; font: 8pt verdana; font-weight: none; text-decoration: none; background: white; border: 1 solid black; }
-->
</style>
</head><body bgcolor="white" text="black" link="58BEFF" vlink="58BEFF" alink="58BEFF">
<center>
<table width="611" border="0" cellspacing="1" cellpadding="2" bgcolor="#bbbbbb">
<tr>
<td bgcolor="white" colspan="2">
<img src="http://www.fusionphp.com/fusion/fusion.gif"></td>
</tr>
</table>
<br>
<table width="611" border="0" cellspacing="1" cellpadding="2" bgcolor="bbbbbb">
<tr>
<td bgcolor="#58beff" colspan="2">
<font color="white">
<?echo $title;?>
</font>
</td>
</tr>
<tr>
<td bgcolor="white" colspan="2">
<?echo $content;?>
</td>
</tr>
</table>
<br>
con motor <a href="http://www.fusionphp.com">fusion</a>
</center>
<br>
</body>
</html>