Change Nick render back to alway show nick and server

This commit is contained in:
sørenpeter 2025-02-11 18:36:08 +01:00
parent 9a9a1bca9a
commit 154464bab5
3 changed files with 7 additions and 2 deletions

View file

@ -475,6 +475,7 @@ function getTwtsFromTwtxtString($url) {
} }
// Fallback for nick and url if not set in twtxt.txt // Fallback for nick and url if not set in twtxt.txt
if ($twtxtData->nick === "") { if ($twtxtData->nick === "") {
$str = parse_url($url, PHP_URL_HOST); $str = parse_url($url, PHP_URL_HOST);
$str = str_replace("www.", "", $str); $str = str_replace("www.", "", $str);
@ -486,14 +487,18 @@ function getTwtsFromTwtxtString($url) {
} }
// Use only nick as handle if nick and domain is the same // Use only nick as handle if nick and domain is the same
$twtxtData->domain = parse_url($twtxtData->mainURL, PHP_URL_HOST); $twtxtData->domain = parse_url($twtxtData->mainURL, PHP_URL_HOST);
/*
if ($twtxtData->nick === $twtxtData->domain) { if ($twtxtData->nick === $twtxtData->domain) {
$twtxtData->domain = ""; $twtxtData->domain = "";
} else { } else {
$twtxtData->domain = "@".$twtxtData->domain; $twtxtData->domain = "@".$twtxtData->domain;
} }
*/
//
if (!str_starts_with($currentLine, '#')) { if (!str_starts_with($currentLine, '#')) {
$explodedLine = explode("\t", $currentLine); $explodedLine = explode("\t", $currentLine);

View file

@ -63,7 +63,7 @@ if ($is_gallery) {
<div> <div>
<a href="<?=$profileURL?>" class="author"> <a href="<?=$profileURL?>" class="author">
<strong>@<?=$profile->nick?></strong><?=$profile->domain?> <strong><?=$profile->nick?></strong> (<?=$profile->domain?>)
</a> </a>
<p><?=$profile->description?></p> <p><?=$profile->description?></p>

View file

@ -20,7 +20,7 @@ include_once 'partials/pagination.php';
</a> </a>
<div> <div>
<a href="<?=$baseURL?>/profile?url=<?=$twt->mainURL?>" class="author"> <a href="<?=$baseURL?>/profile?url=<?=$twt->mainURL?>" class="author">
<strong>@<?=$twt->nick?></strong><?=$twt->domain?> <strong><?=$twt->nick?></strong> (<?=$twt->domain?>)
</a> </a>
<div class="twt-msg"> <div class="twt-msg">