A lot of things

This commit is contained in:
2026-06-16 16:21:43 +02:00
parent 4415a2e8c4
commit 73471162bf
37 changed files with 654 additions and 4 deletions

25
Helper/Helpers.php Normal file
View File

@@ -0,0 +1,25 @@
<?php
namespace RomhackPlaza\Master\Helper;
use XF\Mvc\Entity\Entity;
class Helpers
{
public static function getContentTitle( Entity $content, string $contentType )
{
return match ($contentType) {
'thread' => $content->title ?? '',
'post' => $content->Thread?->title ?? '',
'user' => $content->username ?? '',
'profile_post' => \XF\Util\Str::substr($content->content ?? '', 0, 50),
'profile_post_comment' => \XF\Util\Str::substr($content->content ?? '', 0, 50),
// Custom
'club' => $content->title ?? '',
'rhpz_entry_featurerequest' => $content->entry_title ?? '',
default => $content->title ?? $content->username ?? $content->content ?? "#{$content->getEntityId()}",
};
}
}