initialisation du projet (partie 4)
This commit is contained in:
parent
6284bc535d
commit
5a1f3b9b01
1
static/includes/botnet.php
Normal file
1
static/includes/botnet.php
Normal 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
38
static/includes/cards.php
Normal 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 . '" />';
|
||||
}
|
||||
|
||||
?>
|
26
static/includes/opengraph.php
Normal file
26
static/includes/opengraph.php
Normal 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">';
|
||||
}
|
||||
|
||||
?>
|
18
static/includes/permavideo.php
Normal file
18
static/includes/permavideo.php
Normal 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>';
|
||||
}
|
||||
|
||||
?>
|
68
static/includes/preview.php
Normal file
68
static/includes/preview.php
Normal 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>';
|
||||
}
|
||||
|
||||
?>
|
Loading…
x
Reference in New Issue
Block a user