initialisation du projet (partie 4)

This commit is contained in:
Esenjin_Asakha 2024-12-27 14:27:41 +00:00
parent 6284bc535d
commit 5a1f3b9b01
5 changed files with 151 additions and 0 deletions

View File

@ -0,0 +1 @@
<!-- Place a botnet code here if you have one (Google Analytics, Piwik and that stuff) -->

38
static/includes/cards.php Normal file
View File

@ -0,0 +1,38 @@
<?php
//Site base URL
$site = "http://file.quad.moe";
if($extension == "jpg") {
echo '<meta name="twitter:card" content="photo" />
<meta name="twitter:site" content="@QuadPiece" />
<meta name="twitter:title" content="QuadFile" />
<meta name="twitter:description" content="Image uploaded to QuadFile" />
<meta name="twitter:image" content="' . $site . '/file/' . $filename . '" />
<meta name="twitter:url" content="' . $site . '/share/' . $filename . '" />';
}
elseif($extension == "jpeg") {
echo '<meta name="twitter:card" content="photo" />
<meta name="twitter:site" content="@QuadPiece" />
<meta name="twitter:title" content="QuadFile" />
<meta name="twitter:description" content="File uploaded to QuadFile" />
<meta name="twitter:image" content="' . $site . '/file/' . $filename . '" />
<meta name="twitter:url" content="' . $site . '/share/' . $filename . '" />';
}
elseif($extension == "png") {
echo '<meta name="twitter:card" content="photo" />
<meta name="twitter:site" content="@QuadPiece" />
<meta name="twitter:title" content="QuadFile" />
<meta name="twitter:description" content="File uploaded to QuadFile" />
<meta name="twitter:image" content="' . $site . '/file/' . $filename . '" />
<meta name="twitter:url" content="' . $site . '/share/' . $filename . '" />';
}
else {
echo '<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@QuadPiece" />
<meta name="twitter:title" content="QuadFile" />
<meta name="twitter:description" content="' . $extension . ' file uploaded to QuadFile" />
<meta name="twitter:image" content="' . $site . '/static/logo.png" />
<meta name="twitter:url" content="' . $site . '/share/' . $filename . '" />';
}
?>

View File

@ -0,0 +1,26 @@
<?php
//Site base URL
$site = "http://file.quad.moe";
if($extension == "jpg") {
echo '<meta property="og:title" content="' . $filename . ' - QuadFile">
<meta property="og:image" content="' . $site . '/file/' . $filename . '">
<meta property="og:description" content="Image file uploaded to QuadFile">';
}
elseif($extension == "jpeg") {
echo '<meta property="og:title" content="' . $filename . ' - QuadFile">
<meta property="og:image" content="' . $site . '/file/' . $filename . '">
<meta property="og:description" content="Image file uploaded to QuadFile">';
}
elseif($extension == "png") {
echo '<meta property="og:title" content="' . $filename . ' - QuadFile">
<meta property="og:image" content="' . $site . '/file/' . $filename . '">
<meta property="og:description" content="Image uploaded to QuadFile">';
}
else {
echo '<meta property="og:title" content="' . $filename . ' - QuadFile">
<meta property="og:image" content="' . $site . '/static/logo.png">
<meta property="og:description" content="' . $extension . ' file uploaded to QuadFile">';
}
?>

View File

@ -0,0 +1,18 @@
<?php
if($extension == "webm") {
echo '<link href="../../static/video-js/video-js.css" rel="stylesheet">
<script src="../../static/video-js/video.js"></script>
<script>
videojs.options.flash.swf = "../../static/video-js/video-js.swf"
</script>';
}
elseif($extension == "mp4") {
echo '<link href="../../static/video-js/video-js.css" rel="stylesheet">
<script src="../../static/video-js/video.js"></script>
<script>
videojs.options.flash.swf = "../../static/video-js/video-js.swf"
</script>';
}
?>

View File

@ -0,0 +1,68 @@
<?php
// //Echo previews for supported formats (This gon be messy son)
// if($extension == "webm") {
// echo '<video class="video-js vjs-default-skin videoprev" width="854" height="480" controls data-setup=' . "'" . '{"example_option":true}' . "'" . '><source src="../file/' . $filename . '" type="video/webm">Get a browser that supports WebM fag.</video>';
// }
// elseif($extension == "mp4") {
// echo '<video class="video-js vjs-default-skin videoprev" width="854" height="480" controls data-setup=' . "'" . '{"example_option":true}' . "'" . '><source src="../file/' . $filename . '" type="video/webm">Get a browser that supports WebM fag.</video>
// <p class="dltext subtle">Some MP4 files will play, some will not. There is unfortunately nothing we can do about this.</p>';
// }
// elseif($extension == "jpg") {
// echo '<img src="../file/' . $filename . '">';
// }
// elseif($extension == "jpeg") {
// echo '<img src="../file/' . $filename . '">';
// }
// elseif($extension == "png") {
// echo '<img src="../file/' . $filename . '">';
// }
// elseif($extension == "gif") {
// echo '<img src="../file/' . $filename . '">';
// }
// elseif($extension == "mp3") {
// echo '<audio class="audioprev" src="../file/' . $filename . '" controls>';
// }
// elseif($extension == "ogg") {
// echo '<audio class="audioprev" src="../file/' . $filename . '" controls>';
// }
// else {
// echo '<p class="dltext subtle">We do not support previews for this filetype.</p>';
// }
switch($extension) {
case "webm":
echo '<video class="video-js vjs-default-skin videoprev" width="854" height="480" controls data-setup=' . "'" . '{"example_option":true}' . "'" . '><source src="../file/' . $filename . '" type="video/webm">Get a browser that supports WebM fag.</video>';
break;
case "mp4":
echo '<video class="video-js vjs-default-skin videoprev" width="854" height="480" controls data-setup=' . "'" . '{"example_option":true}' . "'" . '><source src="../file/' . $filename . '" type="video/webm">Get a browser that supports WebM fag.</video>
<p class="dltext subtle">Some MP4 files will play, some will not. There is unfortunately nothing we can do about this.</p>';
break;
case "jpg":
case "jpeg":
case "png":
case "gif":
echo '<img src="../file/' . $filename . '">';
break;
case "mp3":
case "ogg":
echo '<audio class="audioprev" src="../file/' . $filename . '" controls>';
break;
case "txt":
$textcontent = file_get_contents('../file/' . $filename);
echo '<p class="filetext">';
echo strip_tags($textcontent);
echo '</p>' . "\n";
echo '<p class="dltext subtle">Some content may have been stripped from the file. Click download to see the original.</p>';
break;
default:
echo '<p class="dltext subtle">We do not support previews for this filetype.</p>';
}
?>