Temp user profile fix.

This commit is contained in:
Floorb 2021-08-09 04:26:36 -04:00
parent 78427b410a
commit f1742c65d9
2 changed files with 6 additions and 7 deletions

View file

@ -179,9 +179,8 @@ $protocol = paste_protocol();
$p_dateui = $p_date->format("d F Y"); $p_dateui = $p_date->format("d F Y");
$p_views = Trim($row['views']); $p_views = Trim($row['views']);
$p_visible = intval($row['visible']); $p_visible = intval($row['visible']);
$p_tags = Trim($row['tagsys']); $tagArray = array_map(function($tag) { return $tag['name']; }, getPasteTags($conn, $p_id));
$tagArray = explode(',', $p_tags); $p_tags = implode(',', $tagArray);
$tagArray = array_filter($tagArray);
$p_visible = match ($p_visible) { $p_visible = match ($p_visible) {
@ -209,7 +208,7 @@ $protocol = paste_protocol();
</td> </td>
<td class="td-left">'; <td class="td-left">';
if (strlen($p_tags) > 0) { if (strlen($p_tags) > 0) {
foreach ($tagArray as $key => $tags) { 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 '<a href="' . $protocol . $baseurl . '/user.php?user=' . $profile_username . '&q=' . $tags . '"><span class="tag is-info">' . trim($tags) . '</span></a>';
} }
} else { } else {

View file

@ -178,10 +178,10 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was
<div class="column is-4 has-text-right"> <div class="column is-4 has-text-right">
<div class=""> <div class="">
<div class="panel-tools"> <div class="panel-tools">
<?php if ($current_user !== null) { <?php
$fav_paste = checkFavorite($conn, $paste_id, $current_user->user_id); if ($current_user !== null) {
echo checkFavorite($conn, $paste_id, $current_user->user_id);
} }
echo $fav_paste;
?> ?>
<a class="icon tool-icon" class="flip" onclick="openreport()"><i <a class="icon tool-icon" class="flip" onclick="openreport()"><i
class="far fa-flag fa-lg has-text-grey" title="Report Paste"></i></a> class="far fa-flag fa-lg has-text-grey" title="Report Paste"></i></a>