mirror of
https://github.com/Neetpone/ponepaste.git
synced 2025-03-12 14:40:09 +01:00
Merge remote-tracking branch 'origin/main' into feature/cleanup
# Conflicts: # theme/bulma/user_profile.php # theme/bulma/view.php
This commit is contained in:
commit
7050190174
4 changed files with 83 additions and 32 deletions
|
@ -64,6 +64,30 @@ function tagsToHtml(string|array $tags) : string {
|
||||||
return $output;
|
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) {
|
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 '%?%'
|
$query = $conn->prepare("SELECT id, visible, title, date, now_time, views, member FROM pastes WHERE visible='1' AND tagsys LIKE '%?%'
|
||||||
|
|
|
@ -17,6 +17,16 @@
|
||||||
color: #bfbfbf;
|
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 {
|
.theme-switch-wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -105,8 +115,27 @@ input:checked + .slider:before {
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media only screen and (max-width: 600px) {
|
||||||
.panel {
|
.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 {
|
.tool-icon {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
rowReorder: {selector: 'td:nth-child(2)'},
|
rowReorder: {selector: 'td:nth-child(2)'},
|
||||||
responsive: true,
|
responsive: true,
|
||||||
pageLength: 50,
|
pageLength: 50,
|
||||||
|
order: [[ 1, "desc" ]],
|
||||||
autoWidth: false,
|
autoWidth: false,
|
||||||
initComplete: function () {
|
initComplete: function () {
|
||||||
var search = new URLSearchParams(window.location.search);
|
var search = new URLSearchParams(window.location.search);
|
||||||
|
@ -23,6 +24,7 @@
|
||||||
$("#favs").dataTable({
|
$("#favs").dataTable({
|
||||||
rowReorder: { selector: 'td:nth-child(2)'},
|
rowReorder: { selector: 'td:nth-child(2)'},
|
||||||
responsive: true,
|
responsive: true,
|
||||||
|
order: [[ 2, "desc" ]],
|
||||||
pageLength: 50,
|
pageLength: 50,
|
||||||
autoWidth: false,
|
autoWidth: false,
|
||||||
initComplete: function () {
|
initComplete: function () {
|
||||||
|
@ -203,9 +205,7 @@
|
||||||
</td>
|
</td>
|
||||||
<td class="td-left">';
|
<td class="td-left">';
|
||||||
if (strlen($p_tags) > 0) {
|
if (strlen($p_tags) > 0) {
|
||||||
foreach ($tagArray as $tags) {
|
echo tagsToHtmlUser($p_tags,$profile_username);
|
||||||
echo '<a href="' . $protocol . $baseurl . '/user.php?user=' . $profile_username . '&q=' . $tags . '"><span class="tag is-info">' . trim($tags) . '</span></a>';
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
echo ' <span class="tag is-warning">No tags</span>';
|
echo ' <span class="tag is-warning">No tags</span>';
|
||||||
}
|
}
|
||||||
|
@ -292,9 +292,7 @@
|
||||||
</td>
|
</td>
|
||||||
<td class="td-left">';
|
<td class="td-left">';
|
||||||
if (strlen($f_tags) > 0) {
|
if (strlen($f_tags) > 0) {
|
||||||
foreach ($tagArray2 as $tags) {
|
echo tagsToHtmlUser($f_tags,$profile_username);
|
||||||
echo '<a href="' . $protocol . $baseurl . '/user.php?user=' . $profile_username . '&q=' . $tags . '"><span class="tag is-info">' . trim($tags) . '</span></a>';
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
echo ' <span class="tag is-warning">No tags</span>';
|
echo ' <span class="tag is-warning">No tags</span>';
|
||||||
}
|
}
|
||||||
|
|
|
@ -232,7 +232,7 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was
|
||||||
<p><?= pp_html_escape($error) ?></p>
|
<p><?= pp_html_escape($error) ?></p>
|
||||||
</div>
|
</div>
|
||||||
<?php elseif ($using_highlighter): ?>
|
<?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']) ?>">
|
<div class="<?= pp_html_escape($paste['code']) ?>">
|
||||||
<ol>
|
<ol>
|
||||||
<?php foreach ($lines as $num => $line):
|
<?php foreach ($lines as $num => $line):
|
||||||
|
@ -245,7 +245,7 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php else: ?>
|
<?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; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
<!-- Guests -->
|
<!-- Guests -->
|
||||||
|
|
Loading…
Add table
Reference in a new issue