Merge remote-tracking branch 'origin/main' into feature/cleanup

# Conflicts:
#	theme/bulma/user_profile.php
#	theme/bulma/view.php
This commit is contained in:
Floorb 2021-08-25 19:19:55 -04:00
commit 7050190174
4 changed files with 83 additions and 32 deletions

View file

@ -64,6 +64,30 @@ function tagsToHtml(string|array $tags) : string {
return $output;
}
function tagsToHtmlUser(string | array $tags, $profile_username) : string {
$output = "";
if (is_array($tags)) {
$tagsSplit = array_map(function($tag) { return $tag['name']; }, $tags);
} else {
$tagsSplit = explode(",", $tags);
}
foreach ($tagsSplit as $tag) {
if (stripos($tag, 'nsfw') !== false) {
$tag = strtoupper($tag);
$tagcolor = "tag is-danger";
} elseif (stripos($tag, 'SAFE') !== false) {
$tag = strtoupper($tag);
$tagcolor = "tag is-success";
} elseif (str_contains($tag, '/')) {
$tagcolor = "tag is-primary";
} else {
$tagcolor = "tag is-info";
}
$output .= '<a href="/user.php?user=' . $profile_username . '&q=' . urlencode($tag) . '"><span class="' . $tagcolor . '">' . pp_html_escape(ucfirst($tag)) . '</span></a>';
}
return $output;
}
function getevent($conn, $event_name, $count) {
$query = $conn->prepare("SELECT id, visible, title, date, now_time, views, member FROM pastes WHERE visible='1' AND tagsys LIKE '%?%'

View file

@ -17,6 +17,16 @@
color: #bfbfbf;
}
.li1:target{
transition:background-color 1s ease-in;
-webkit-transition:background-color 1s ease-in;
-moz-transition:background-color 1s ease-in;
background-color: rgba(50, 152, 220, 0.3);
scroll-margin-top: 100px;
color: white !important;
}
.theme-switch-wrapper {
display: flex;
align-items: center;
@ -105,8 +115,27 @@ input:checked + .slider:before {
padding: 20px;
}
@media only screen and (max-width: 600px) {
.panel {
background-color: white;
background-color: #ffffff;
border: none !important;
border-style: none !important;
padding: 0px !important;
border-width: 0px !important;
box-shadow: none !important;
word-wrap: break-word;
}
}
.panel {
background-color: #ffffff;
border: #eeeeee;
border-style: solid;
padding: 10px;
border-width: 2px;
box-shadow: 5px 10px #eee;
word-wrap: break-word;
}
.tool-icon {

View file

@ -4,6 +4,7 @@
rowReorder: {selector: 'td:nth-child(2)'},
responsive: true,
pageLength: 50,
order: [[ 1, "desc" ]],
autoWidth: false,
initComplete: function () {
var search = new URLSearchParams(window.location.search);
@ -21,8 +22,9 @@
<script>
$(document).ready(function () {
$("#favs").dataTable({
rowReorder: {selector: 'td:nth-child(2)'},
rowReorder: { selector: 'td:nth-child(2)'},
responsive: true,
order: [[ 2, "desc" ]],
pageLength: 50,
autoWidth: false,
initComplete: function () {
@ -203,9 +205,7 @@
</td>
<td class="td-left">';
if (strlen($p_tags) > 0) {
foreach ($tagArray as $tags) {
echo '<a href="' . $protocol . $baseurl . '/user.php?user=' . $profile_username . '&q=' . $tags . '"><span class="tag is-info">' . trim($tags) . '</span></a>';
}
echo tagsToHtmlUser($p_tags,$profile_username);
} else {
echo ' <span class="tag is-warning">No tags</span>';
}
@ -292,9 +292,7 @@
</td>
<td class="td-left">';
if (strlen($f_tags) > 0) {
foreach ($tagArray2 as $tags) {
echo '<a href="' . $protocol . $baseurl . '/user.php?user=' . $profile_username . '&q=' . $tags . '"><span class="tag is-info">' . trim($tags) . '</span></a>';
}
echo tagsToHtmlUser($f_tags,$profile_username);
} else {
echo ' <span class="tag is-warning">No tags</span>';
}

View file

@ -212,7 +212,7 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was
} else {
echo 'paste.php?embed&id=';
}
echo $paste_id . '"></script>'; ?>' readonly/>
echo $paste_id . '"></script>'; ?>' readonly />
</div>
</div>
</div>
@ -232,7 +232,7 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was
<p><?= pp_html_escape($error) ?></p>
</div>
<?php elseif ($using_highlighter): ?>
<div id="paste" style="line-height:1!important;">
<div id="paste" style="line-height:18px !important;">
<div class="<?= pp_html_escape($paste['code']) ?>">
<ol>
<?php foreach ($lines as $num => $line):
@ -245,7 +245,7 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was
</div>
</div>
<?php else: ?>
<div id="paste" style="line-height:1!important;"><?= $p_content ?></div>
<div id="paste" style="line-height:18px !important;"><?= $p_content ?></div>
<?php endif; ?>
</div>
<!-- Guests -->
@ -295,7 +295,7 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was
<p class="control has-icons-left">
<input type="text" class="input" name="title"
placeholder="<?= $paste['title'] ?>"
value="<?= $paste['title'] ?>"/>
value="<?= $paste['title'] ?>" />
<span class="icon is-small is-left">
<i class="fa fa-font"></i>
</span>
@ -412,7 +412,7 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was
<div class="columns">
<div class="column">
<input type="text" class="input" name="pass" id="pass" value=""
placeholder="<?php echo $lang['pwopt']; ?>"/>
placeholder="<?php echo $lang['pwopt']; ?>" />
</div>
</div>
</div>