diff --git a/includes/functions.php b/includes/functions.php index 8a532f6..e1bb7a9 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -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 .= '' . 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 '%?%' diff --git a/theme/bulma/css/paste.css b/theme/bulma/css/paste.css index fa60880..e14d60f 100644 --- a/theme/bulma/css/paste.css +++ b/theme/bulma/css/paste.css @@ -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 { diff --git a/theme/bulma/user_profile.php b/theme/bulma/user_profile.php index ccef281..48d2208 100644 --- a/theme/bulma/user_profile.php +++ b/theme/bulma/user_profile.php @@ -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); @@ -19,23 +20,24 @@
@@ -203,9 +205,7 @@ '; if (strlen($p_tags) > 0) { - foreach ($tagArray as $tags) { - echo '' . trim($tags) . ''; - } + echo tagsToHtmlUser($p_tags,$profile_username); } else { echo ' No tags'; } @@ -291,13 +291,11 @@ '; - if (strlen($f_tags) > 0) { - foreach ($tagArray2 as $tags) { - echo '' . trim($tags) . ''; - } - } else { - echo ' No tags'; - } + if (strlen($f_tags) > 0) { + echo tagsToHtmlUser($f_tags,$profile_username); + } else { + echo ' No tags'; + } echo ' diff --git a/theme/bulma/view.php b/theme/bulma/view.php index 5e977c8..89eec52 100644 --- a/theme/bulma/view.php +++ b/theme/bulma/view.php @@ -212,7 +212,7 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was } else { echo 'paste.php?embed&id='; } - echo $paste_id . '">'; ?>' readonly/> + echo $paste_id . '">'; ?>' readonly /> @@ -232,7 +232,7 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was

-
+
    $line): @@ -245,7 +245,7 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was
-
+
@@ -295,7 +295,7 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was

+ value="" /> @@ -412,7 +412,7 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was

+ placeholder="" />