Update der Suchfunktionen um nach tags zu suchen

This commit is contained in:
rirat-0
2026-06-30 23:58:02 +02:00
parent 15ea5ddbfb
commit a0a469a9df
2 changed files with 5 additions and 2 deletions
+2 -1
View File
@@ -338,7 +338,8 @@ class DatabaseArticleManager implements ArticleManagerDAO {
$sql = "SELECT id, title, content, author, category, tags, created
FROM articles
WHERE title LIKE :keyword
OR content LIKE :keyword;";
OR content LIKE :keyword;
OR tags LIKE :keyword";
$command = $db->prepare($sql);
if (!$command) {
+3 -1
View File
@@ -211,9 +211,11 @@ class LocalArticleManager implements ArticleManagerDAO {
foreach ($articles as $article) {
$title = isset($article['title']) ? strtolower((string)$article['title']) : '';
$content = isset($article['content']) ? strtolower((string)$article['content']) : '';
$tags = isset($article['tags']) ? strtolower((string)$article['tags']) : '';
if (($cleanKeyword !== '' && strpos($title, $cleanKeyword) !== false) ||
($cleanKeyword !== '' && strpos($content, $cleanKeyword) !== false)) {
($cleanKeyword !== '' && strpos($content, $cleanKeyword) !== false) ||
($cleanKeyword !== '' && strpos($tags, $cleanKeyword) !== false)) {
$likes = isset($article['likes']) && is_array($article['likes']) ? $article['likes'] : [];
$filteredArticles[] = new Article(