From cef0d39f184e85369f61f72f79737f77158c4532 Mon Sep 17 00:00:00 2001
From: aftercase <74765798+aftercase@users.noreply.github.com>
Date: Wed, 25 Aug 2021 16:58:18 +0100
Subject: [PATCH 1/4] created new function for userpage
username needed to added to url within tags.
---
includes/functions.php | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/includes/functions.php b/includes/functions.php
index f7f471e..06390b7 100644
--- a/includes/functions.php
+++ b/includes/functions.php
@@ -76,6 +76,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 .= '' . pp_html_escape(ucfirst($tag)) . '';
+ }
+ 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 '%?%'
From 755bf5fe5d05de87c538010437a5a1cebf3cdea7 Mon Sep 17 00:00:00 2001
From: aftercase <74765798+aftercase@users.noreply.github.com>
Date: Wed, 25 Aug 2021 17:09:13 +0100
Subject: [PATCH 2/4] updated userpage
Page now displays colored tags, and favored pastes now load in updated order.
---
theme/bulma/user_profile.php | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/theme/bulma/user_profile.php b/theme/bulma/user_profile.php
index bc1c4d6..f04f4f7 100644
--- a/theme/bulma/user_profile.php
+++ b/theme/bulma/user_profile.php
@@ -21,6 +21,7 @@ $protocol = paste_protocol();
rowReorder: { selector: 'td:nth-child(2)'},
responsive: true,
pageLength: 50,
+ order: [[ 1, "desc" ]],
autoWidth: false,
initComplete: function () {
var search = new URLSearchParams(window.location.search);
@@ -40,6 +41,7 @@ $protocol = paste_protocol();
$("#favs").dataTable({
rowReorder: { selector: 'td:nth-child(2)'},
responsive: true,
+ order: [[ 2, "desc" ]],
pageLength: 50,
autoWidth: false,
initComplete: function () {
@@ -220,9 +222,7 @@ $protocol = paste_protocol();
';
if (strlen($p_tags) > 0) {
- foreach ($tagArray as $tags) {
- echo '' . trim($tags) . '';
- }
+ echo tagsToHtmlUser($p_tags,$profile_username);
} else {
echo ' No tags';
}
@@ -307,9 +307,7 @@ $protocol = paste_protocol();
|
';
if (strlen($f_tags) > 0) {
- foreach ($tagArray2 as $tags) {
- echo '' . trim($tags) . '';
- }
+ echo tagsToHtmlUser($f_tags,$profile_username);
} else {
echo ' No tags';
}
From 4de5e5dafa7746dd52240dd743e3af04cd0becd5 Mon Sep 17 00:00:00 2001
From: aftercase <74765798+aftercase@users.noreply.github.com>
Date: Wed, 25 Aug 2021 22:51:11 +0100
Subject: [PATCH 3/4] Fixed Pastedown bugs
Fix bug on Pastedown where text broke through it's container.
Fix mobile responsive bug where containers where remaining full size.
Changes to UI
---
theme/bulma/css/paste.css | 28 +++++++++++++++++++++++++++-
theme/bulma/view.php | 6 +++---
2 files changed, 30 insertions(+), 4 deletions(-)
diff --git a/theme/bulma/css/paste.css b/theme/bulma/css/paste.css
index fa60880..704f005 100644
--- a/theme/bulma/css/paste.css
+++ b/theme/bulma/css/paste.css
@@ -17,6 +17,13 @@
color: #bfbfbf;
}
+/* For future use
+.li1 {
+ padding-left: 0.5em;
+ text-indent: -0.5em;
+}
+*/
+
.theme-switch-wrapper {
display: flex;
align-items: center;
@@ -105,8 +112,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 {
diff --git a/theme/bulma/view.php b/theme/bulma/view.php
index bb1e052..f9e10ac 100644
--- a/theme/bulma/view.php
+++ b/theme/bulma/view.php
@@ -218,7 +218,7 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was
-
+
= pp_html_escape($error) ?>
-
+
$line):
@@ -245,7 +245,7 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was
- = $p_content ?>
+ = $p_content ?>
From 64a892a40ea31e6202d44fed96643b140e6e2f7a Mon Sep 17 00:00:00 2001
From: aftercase <74765798+aftercase@users.noreply.github.com>
Date: Wed, 25 Aug 2021 23:48:17 +0100
Subject: [PATCH 4/4] added line highlight function
Line id from url now highlights.
---
theme/bulma/css/paste.css | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/theme/bulma/css/paste.css b/theme/bulma/css/paste.css
index 704f005..e14d60f 100644
--- a/theme/bulma/css/paste.css
+++ b/theme/bulma/css/paste.css
@@ -17,12 +17,15 @@
color: #bfbfbf;
}
-/* For future use
-.li1 {
- padding-left: 0.5em;
- text-indent: -0.5em;
+.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;
|