020620 general layout and css improvements.
This commit is contained in:
@ -251,19 +251,19 @@ if ((!isset($thread[0]['id']) && !empty($thread)) || !is_array($thread)) {
|
||||
$ext = explode(".", $file['url']);
|
||||
$ext = end($ext);
|
||||
$ext = explode("?", $ext) [0];
|
||||
if (in_array($ext,array('webm','mp4','ogv'))) {
|
||||
if (in_array($ext,array('webm','mp4','ogv')) || $file['type'] == "video") {
|
||||
$post['media'] .= "<div style='overflow:hidden; float:left; margin:2px;' $class><video preload='metadata' style='text-align:center; max-width:100%; max-height:100%;' controls ".($user_settings['videoloop'] == "on" ? "loop" : "").">
|
||||
<source src='" . $file['url'] . "' type='video/".($ext == "ogv" ? "ogg" : $ext)."'>
|
||||
</video></div>
|
||||
";
|
||||
}
|
||||
elseif (in_array($ext,array('mp3','ogg','oga','opus'))) {
|
||||
elseif (in_array($ext,array('mp3','ogg','oga','opus')) || $file['type'] == "audio") {
|
||||
$post['media'] .= "<div style='text-align:center; width:100%;'><audio controls>
|
||||
<source src='" . $file['url'] . "' type='audio/$ext'>
|
||||
Your browser does not support the audio tag.
|
||||
</audio> </div>";
|
||||
}
|
||||
else {
|
||||
elseif (in_array($ext,array('jpg','jpeg','png','gif','apng','svg')) || $file['type'] == "image") {
|
||||
/* we'll either hide the attachment or assign a css class depending on the user's settings */
|
||||
|
||||
/* if the post is marked as sensitive and nsfw hiding isn't turned off, we'll blur the image */
|
||||
@ -285,6 +285,9 @@ if ((!isset($thread[0]['id']) && !empty($thread)) || !is_array($thread)) {
|
||||
$post['media'] .= "<div style='margin:0px; ".($images == 3 && $m == 3 ? "width:100% !important;" : "")."background-color:#".($class != "" ? averageColor($file['url']) : "000").";' $class><a target='_blank' href='" . $file['url'] . "' onClick='return false;' class='open-lightbox'><img " . ($e < 2 ? "src='" . $file['url'] . "'" : "data-src='" . $file['url'] . "'") . " class='lazyload' style='" . ($images === 1 ? "width:100%;" : "max-width:100%; max-height:100%;") . " vertical-align:middle;'><noscript><img src='" . $file['url'] . "' style='width:100%;'></noscript></a></div>";
|
||||
|
||||
}
|
||||
} else {
|
||||
$post['media'] .= "<center><table><tr><td><a href='".$file['url']."' download><img src='img/doc.png' width=40 border=0></a></td><td><a href='".$file['url']."' target='_blank'>".$file['description']."</a></td></tr></table></center>";
|
||||
|
||||
}
|
||||
$m++;
|
||||
}
|
||||
|
Reference in New Issue
Block a user