<?php
$name
=
'Mapcycle'
;
$version
=
'beta'
;
$readme
= <<<README
Mapcycle ohne Readme ;)
ACHTUNG: Alte mapcycle Tabelle wird gelöscht!!!
README;
$name2
= htmlentities(preg_replace(
'%([^/s])%'
,
'$1 '
,
$name
.
' ('
.
$version
.
')'
));
$name
= htmlentities(
$name
);
$rows
= substr_count(
$readme
,
"\n"
);
if
(
$rows
> 45)
$rows
= 45;
?>
<html>
<head><title>... ::: [ I n s t a l l a t i o n f ü r <?php
echo
$name2
;?> f ü r i l c h 1 . 1 M] ::: ...</title>
<link rel=
"stylesheet"
href=
"include/designs/ilchClan/style.css"
type=
"text/css"
>
</head>
<body>
<form method=
"post"
>
<table width=
"70%"
class
=
"border"
border=
"0"
cellspacing=
"0"
cellpadding=
"25"
align=
"center"
>
<tr><th
class
=
"Chead"
align=
"center"
>... ::: [ I n s t a l l a t i o n f ü r <u style=
"white-space:pre;"
><?php
echo
$name2
;?></u> f ü r i l c h 1 . 1 M] ::: ...</th></tr>
<tr>
<td
class
=
"Cmite"
>
<?php
if
(
empty
(
$_POST
[
'step'
]) ) {
?>
<div align=
"center"
>
<h2>Readme</h2>
<textarea cols=
"120"
rows=
"<?php echo $rows; ?>"
><?php
echo
htmlentities(
$readme
); ?></textarea><br /><br />
Dieses Script soll
die
nötigen Datanbankändernungen für das <strong><?php
echo
$name
; ?></strong> - Modul machen<br />
<br />
<input type=
"hidden"
name=
"step"
value=
"2"
/>
<input type=
"submit"
value=
"Installieren"
/>
</div>
<?php
}
elseif
(
$_POST
[
'step'
] == 2) {
define (
'main'
, TRUE );
require_once
(
'include/includes/config.php'
);
require_once
(
'include/includes/func/db/mysql.php'
);
db_connect();
$sql_statements
=
array
();
$sql_statements
[] =
"DROP TABLE `prefix_mapcycle`"
;
$sql_statements
[] =
"CREATE TABLE `prefix_mapcycle` (`id` MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY,`uid` MEDIUMINT NOT NULL, `server` VARCHAR( 50 ) NOT NULL , `mapname` VARCHAR( 50 ) NOT NULL, `dllink` VARCHAR( 255 ) NOT NULL) ENGINE = MYISAM"
;
$errors
= 0;
foreach
(
$sql_statements
as
$sql_statement
) {
if
( trim(
$sql_statement
) !=
''
) {
echo
'<pre>'
.
$sql_statement
.
'</pre>'
;
$e
= db_query(
$sql_statement
);
if
(!
$e
) {
$errors
++;
echo
'<font color="#FF0000"><b>Es ist ein Fehler aufgetreten</b></font>:<div style="border: 1px dashed grey; padding: 5px; background-color: #EEEEEE">'
. mysql_error().
'<hr>'
.
$sql_statement
.
'</div>'
;
}
echo
'<hr>'
;
}
}
if
(
$errors
> 0) {
echo
'<font color="#FF0000"><b>Es ist ein Fehler aufgetreten</b></font>, bitte alles auf dieser Seite kopieren und auf ilch.de oder mairu.ilch.net im Forum fragen...:<br /><span style="font-weight:bold;font-size:3em;">Es sei denn,</span> es ist ein Fehler mit <i>duplicate entry</i> oder <i>already exists</i> aufgetreten, das liegt einfach nur daran, dass du die Updatedatei mehrmals ausgeführt hast.<br />'
;
}
else
{
echo
'<br /><br />Es scheinen keine Fehler aufgetreten und die Installation ohne Probleme verlaufen sein. Du solltest die <strong>'
.
$_SERVER
[
'SCRIPT_NAME'
].
'</strong> nun vom Webspace löschen.'
;
}
}
?>
</td></tr></table>
</form>
</body>
</html>