130520 User search and wetcat theme

This commit is contained in:
Daisuke
2020-05-13 15:26:38 -05:00
parent 1f2b2fd19c
commit 125b944385
21 changed files with 689 additions and 123 deletions

View File

@ -194,7 +194,6 @@ if ((!isset($thread[0]['id']) && !empty($thread)) || !is_array($thread)) {
}
$post['json'] = json_encode($json);
/* the options menu of the post */
$post['menu'] = "<ul>";
if ($logedin) {
@ -241,6 +240,7 @@ if ((!isset($thread[0]['id']) && !empty($thread)) || !is_array($thread)) {
if ($user_settings['attach'] != "off"){
$images = count($elem['media_attachments']);
$class = ($images === 1 ? "" : ($images > 4 ? "class='smaller'" : "class='small'"));
$m = 1;
foreach ($elem['media_attachments'] as $file) {
$ext = explode(".", $file['url']);
$ext = end($ext);
@ -259,12 +259,14 @@ if ((!isset($thread[0]['id']) && !empty($thread)) || !is_array($thread)) {
}
else {
/* 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 */
if ($elem['sensitive'] == true && $user_settings['explicit'] != 'off') {
$post['media'] .= " <div style='overflow:hidden; float:left; margin:2px;' $class>
$post['media'] .= " <div style='overflow:hidden; float:left; margin:2px;background-color:#".(($class != "") || ($elem['sensitive'] == true && $user_settings['explicit'] != 'off') ? averageColor($file['url']) : "000")."!important; ".($images === 1 ? "width:100%;" : "max-width:100%; max-height:100%;")."' $class>
<div class='toggleblur' style='height:25px;'>&#xe81b; Blur</div>
<a target='_blank' href='" . $file['url'] . "' onClick='return false;' style='width:100%;' class='blur'>
<noscript><img src='" . $file['url'] . "' style='width:100%;'></noscript>
<img " . ($e < 2 ? "src='" . $file['url'] . "'" : "data-src='" . $file['url'] . "'") . " class='lazyload' style='max-width:100%; max-height:100% vertical-align:middle;'>
<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;'>
</a>
<a target='_blank' href='" . $file['url'] . "' onClick='return false;' class='open-lightbox' style='display:none;'>
<img src='" . $file['url'] . "' class='lazyload' style='width:100%;'>
@ -272,10 +274,13 @@ if ((!isset($thread[0]['id']) && !empty($thread)) || !is_array($thread)) {
</div>";
}
else {
$post['media'] .= "<div style='margin:0px; background-color:#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>";
/* If the post was sensitive and wasn't caught by the nsfw filter and
didn't got blurred, then the image will be shown normally */
$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>";
}
}
$m++;
}
} else {
/* if the user turned off attachments we'll only show a link to it */