diff --git a/src/Model/Entity/Claim.php b/src/Model/Entity/Claim.php index 8faa889..e2d3cb7 100644 --- a/src/Model/Entity/Claim.php +++ b/src/Model/Entity/Claim.php @@ -5,7 +5,14 @@ namespace App\Model\Entity; use Cake\ORM\Entity; class Claim extends Entity { - + function getLbryLink() { + $link = $this->Name; + if (isset($this->Publisher->Name)) { + $link = $this->Publisher->Name . '/' . $link; + } + $link = 'lbry://' . $link; + return $link; + } } ?> \ No newline at end of file diff --git a/src/Template/Main/claims.ctp b/src/Template/Main/claims.ctp index f2ec67a..0507716 100644 --- a/src/Template/Main/claims.ctp +++ b/src/Template/Main/claims.ctp @@ -40,14 +40,6 @@ $a = ['purple', 'orange', 'blue', 'teal', 'green', 'yellow']; $autoThumbText = ''; -$link = $claim->Name; -$rawLink = $claim->Name; -if (isset($claim->Publisher->Name)) { - $link = urlencode($claim->Publisher->Name) . '/' . $link; - $rawLink = $claim->Publisher->Name . '/' . $rawLink; -} -$link = 'lbry://' . $link; -$rawLink = 'lbry://' . $rawLink; if ($claim->ClaimType == 1) { $autoThumbText = strtoupper(substr($claim->Name, 1, min( strlen($claim->Name), 10 ))); } else { $str = str_replace(' ', '', (strlen(trim($claim->Title)) > 0) ? $claim->Title : $claim->Name); $autoThumbText = strtoupper(mb_substr($str, 0, min( strlen($str), 10 ))); @@ -81,7 +73,7 @@ if (strlen(trim($desc)) == 0) {