poprostu nic z nim nie robilem .,. sciagnalem paczke i w tej paczce on byl juz
<?
if (!defined("IN_FUSION")) { header("Location:../../index.php"); exit; }
// Settings
$upload_maxsize = 2097152;
$upload_extensions = array(
".exe",
".zip",
".rar",
".tar",
".jpg",
".gif",
".png",
".psd"
);
$upload_folder = BASEDIR."downloads/";
if (isset($del)) {
unlink($upload_folder."$del");
opentable($locale['800']);
echo "<center><br>
<div class='scapmain'>".$locale['801']."</div><br>
<a href='".$PHP_SELF.$aidlink."'>".$locale['802']."</a><br><br>
<a href='".ADMIN."index.php".$aidlink."'>".$locale['803']."</a><br><br>
</center>\n";
closetable();
} else if (isset($_POST['upload_file'])) {
$upload = $_FILES['upload'];
if ($upload['name'] != "" && !empty($upload['name']) && is_uploaded_file($upload['tmp_name']) && $upload['size'] <= $upload_maxsize) {
$upload_ext = strrchr($upload['name'],".");
if (in_array($upload_ext, $upload_extensions)) {
$upload_name = $upload['name'];
move_uploaded_file($upload['tmp_name'], $upload_folder.$upload_name);
chmod($upload_folder.$upload_name,0644);
} else {
$upload_error = $locale['824'];
}
} else {
$upload_error = $locale['825'];
}
opentable($locale['820']);
echo "<center><br>
<div class='scapmain'>".(!$upload_error ? $locale['823'] : $upload_error)."</div><br>
<a href='".$PHP_SELF.$aidlink."'>".$locale['802']."</a><br><br>
<a href='".ADMIN."index.php".$aidlink."'>".$locale['803']."</a><br><br>
</center>\n";
closetable();
} else {
opentable($locale['820']);
echo "<form name='uploadform' method='post' action='".$PHP_SELF.$aidlink."' enctype='multipart/form-data'>
<table align='center' width='100%' cellspacing='0' cellpadding='0' class='tbl'>
<tr>
<td align='right' width='35%'>".$locale['821']."</td>
<td><input type='file' name='upload' class='textbox' style='width:250px;'></td>
</tr>
<tr>
<td align='center' colspan='2'>
<input type='submit' name='upload_file' value='".$locale['820']."' class='button' style='width:100px;'><br>
".$locale['822'].parseByteSize($upload_maxsize)."<br>".$locale['826']."</form></td>
</tr>
</table>";
closetable();
$handle = opendir($upload_folder);
while ($file = readdir($handle)) {
if (!in_array($file, array(".", "..", "/", "index.php"))) $file_list[] = $file;
}
if (!isset($file_list)) $file_list=array("");
closedir($handle);
if (count($file_list)) sort($file_list);
opentable($locale['840']);
echo "<table width='100%' align='center' cellpadding='0' cellspacing='0' class='tbl-border'>
<tr>
<td class='tbl2' width='350'><b>".$locale['841']."</b></td>
<td align='center' class='tbl2'><b>".$locale['842']."</b></td>
<td align='center' class='tbl2'><b>".$locale['843']."</b></td>
</tr>\n";
$i = 0;
while (isset($file_list[$i]) && $file_list[$i]!="") {
$file_size = filesize($upload_folder.$file_list[$i]);
if ($i % 2 == 0) { $row_color = "tbl1"; } else { $row_color = "tbl2"; }
echo "<tr>
<td class='$row_color' width='350'><a href='".BASEDIR."downloads/$file_list[$i]'>$file_list[$i]</a></td>
<td align='center' class='$row_color'>".($file_size > 0 ? parseByteSize($file_size) : "-----")."</td>
<td align='center' class='$row_color'><a href='".$PHP_SELF.$aidlink."?del=$file_list[$i]'>".$locale['844']."</a></td>
</tr>\n";
$i++;
}
echo "</table>\n";
closetable();
}
echo "</td>\n";
?>
Edytowane przez Pieka dnia 27.09.2007 21:30:25
|