Add author to the search content / fix sidebar link to channels

This commit is contained in:
Michael 2023-09-22 05:16:46 +00:00
parent 508d84b2b7
commit c66e841c38
2 changed files with 8 additions and 3 deletions

View File

@ -53,7 +53,9 @@ class Engagement
return; return;
} }
$parent = Post::selectFirst(['uri-id', 'created', 'owner-id', 'uid', 'private', 'contact-contact-type', 'language', 'title', 'content-warning', 'body'], ['uri-id' => $item['parent-uri-id']]); $parent = Post::selectFirst(['uri-id', 'created', 'owner-id', 'uid', 'private', 'contact-contact-type', 'language',
'title', 'content-warning', 'body', 'author-name', 'author-nick', 'author-addr', 'owner-name', 'owner-nick', 'owner-addr'],
['uri-id' => $item['parent-uri-id']]);
if ($parent['created'] < DateTimeFormat::utc('now - ' . DI::config()->get('channel', 'engagement_hours') . ' hour')) { if ($parent['created'] < DateTimeFormat::utc('now - ' . DI::config()->get('channel', 'engagement_hours') . ' hour')) {
Logger::debug('Post is too old', ['uri-id' => $item['uri-id'], 'parent-uri-id' => $item['parent-uri-id'], 'created' => $parent['created']]); Logger::debug('Post is too old', ['uri-id' => $item['uri-id'], 'parent-uri-id' => $item['parent-uri-id'], 'created' => $parent['created']]);
@ -108,7 +110,10 @@ class Engagement
private static function getSearchText(array $item): string private static function getSearchText(array $item): string
{ {
$body = $item['title'] . "\n" . $item['content-warning'] . "\n" . $item['body'] . "\n"; $body = $item['title'] . ' ' . $item['content-warning'] . ' ' . $item['body'] . ' ' .
$item['author-name'] . ' ' . $item['author-nick'] . ' ' . $item['author-addr'] . ' ' .
$item['owner-name'] . ' ' . $item['owner-nick'] . ' ' . $item['owner-addr'];
$body = Post\Media::addAttachmentsToBody($item['uri-id'], $body); $body = Post\Media::addAttachmentsToBody($item['uri-id'], $body);
$text = BBCode::toPlaintext($body, false); $text = BBCode::toPlaintext($body, false);

View File

@ -124,7 +124,7 @@ class BaseSettings extends BaseModule
$tabs[] = [ $tabs[] = [
'label' => $this->t('Channels'), 'label' => $this->t('Channels'),
'url' => 'settings/channels', 'url' => 'settings/channels',
'selected' => static::class == Settings\Display::class ? 'active' : '', 'selected' => static::class == Settings\Channels::class ? 'active' : '',
'accesskey' => '', 'accesskey' => '',
]; ];