initialisation du projet (partie 3)

This commit is contained in:
Esenjin_Asakha 2024-12-27 14:25:53 +00:00
parent aac6c28476
commit 695aa68a87
2 changed files with 88 additions and 0 deletions

3
share/.htaccess Normal file
View File

@ -0,0 +1,3 @@
RewriteEngine On
RewriteRule ^([^?]*) index.php?filename=$1 [NC,L,QSA]

85
share/index.php Normal file
View File

@ -0,0 +1,85 @@
<?php
//Get filename from URL
if (isset($_GET["filename"]) && $_GET["filename"] != "" && $_GET["filename"] != " ") {
$filename = htmlentities($_GET["filename"]);
}
//404 if no value
else {
$filename = "404.png";
}
//404 if file doesn't exist
if (file_exists ("../file/" . $filename)) {
}
else {
header("HTTP/1.0 404 Not Found");
$filename = "404.png";
}
//Set the variables for the direct link
$filelocation = "../file/" . $filename;
//Find extensions to use for preview
$extension = explode('.', $filename);
$extension = strtolower(end($extension));
?>
<!DOCTYPE html>
<html>
<head>
<title><?php echo $filename; ?> - Cyla</title>
<meta charset="UTF-8">
<!-- Twitter cards -->
<?php
include_once("../static/includes/cards.php")
?>
<!-- OpenGraph for Facebook -->
<?php
include_once("../static/includes/opengraph.php")
?>
<!-- Stylesheets -->
<link rel="stylesheet" type="text/css" href="../static/CSS/view.css">
<link rel="stylesheet" type="text/css" href="../static/colors.css">
<?php
include_once("../static/includes/video.php")
?>
</head>
<body>
<!-- There, I use Piwik now, be happy botnet freaks -->
<?php include_once("../static/includes/botnet.php") ?>
<h1 class="dltext">"<?php echo $filename;?>"</h1>
<div class="buttoncontainer">
<a href="<?php echo $filelocation;?>" target="_blank" >
<div class="button">Voir/écouter/télécharger</div>
</a>
<a href="http://ersatz.xyz/yourls-api.php?signature=a2eefde33d&action=shorturl&format=simple&url=http://concepts.esenjin.xyz/cyla/v2/file/<?php echo $filename;?>" onclick="window.open(this.href, 'Popup', 'scrollbars=1,resizable=1,height=60,width=200'); return false;" target="_blank">
<div class="button">Raccourcir l'url</div>
</a>
<a href="../">
<div class="button">Héberger un autre fichier</div>
</a>
</div>
<?php include_once("../static/includes/preview.php") ?>
</body>
</html>