initialisation du projet (partie 4)
This commit is contained in:
parent
5a1f3b9b01
commit
432f6758ac
38
static/includes/randomcards.php
Normal file
38
static/includes/randomcards.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 . '/random/file/' . $filename . '" />
|
||||
<meta name="twitter:url" content="' . $site . '/random/perma/' . $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 . '/random/file/' . $filename . '" />
|
||||
<meta name="twitter:url" content="' . $site . '/random/perma/' . $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 . '/random/file/' . $filename . '" />
|
||||
<meta name="twitter:url" content="' . $site . '/random/perma/' . $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 . '/random/perma/' . $filename . '" />';
|
||||
}
|
||||
|
||||
?>
|
26
static/includes/randomopengraph.php
Normal file
26
static/includes/randomopengraph.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 . '/random/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 . '/random/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 . '/random/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">';
|
||||
}
|
||||
|
||||
?>
|
32
static/includes/randompreview.php
Normal file
32
static/includes/randompreview.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?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>';
|
||||
}
|
||||
?>
|
12
static/includes/video.php
Normal file
12
static/includes/video.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
if($extension == "webm") {
|
||||
echo '<link href="../static/video-js/video-js.css" rel="stylesheet">
|
||||
<script src="//vjs.zencdn.net/4.9/video.js"></script';
|
||||
}
|
||||
elseif($extension == "mp4") {
|
||||
echo '<link href="../static/video-js/video-js.css" rel="stylesheet">
|
||||
<script src="//vjs.zencdn.net/4.9/video.js"></script';
|
||||
}
|
||||
|
||||
?>
|
Loading…
x
Reference in New Issue
Block a user