From afa342e57f6447a5def345d2349f945123ede002 Mon Sep 17 00:00:00 2001 From: cbo Date: Fri, 15 Mar 2024 15:56:59 +0100 Subject: [PATCH] Badges fixes in articles list --- html/src/css/style.css | 6 ++++++ include/objects.php | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/html/src/css/style.css b/html/src/css/style.css index 45cc04db..8026f43d 100755 --- a/html/src/css/style.css +++ b/html/src/css/style.css @@ -180,6 +180,12 @@ footer { font-size: 0.8em; } +.articles-list .certification { + transform: translate(0, +10%); + width: 1.1em; + margin-left: 0.5em; +} + .articles-list .article-title { font: 1.5em cfont, Arial; padding: 0.5em 0; diff --git a/include/objects.php b/include/objects.php index cbd00032..997e61ca 100644 --- a/include/objects.php +++ b/include/objects.php @@ -40,8 +40,8 @@ function listArticles($result, $rootPageURL, $badges) { $articleResume = $article['resume']; $miniatureURL = empty($article['miniature']) ? $rootPageURL . "src/img/empty.jpg" : $article['miniature']; - if(isset($article['username']) && isset($article['display_name']) && isset($article['certification'])) { - $badge = $article['certification'] > 0 ? '' . $badges[$userCertification] . '' : ""; + if (isset($article['username'])) { + $badge = $article['certification'] > 0 ? '' . $badges[$article['certification']] . '' : ""; $authorLink = ' | ' . $article['display_name'] . $badge . ''; } else { $authorLink = ''; @@ -58,7 +58,7 @@ function listArticles($result, $rootPageURL, $badges) { echo(''); echo('
'); - echo('
n° ' . $articleID . ' | ' . $pubDate . '
'); + echo('
n° ' . $articleID . ' | ' . $pubDate . $authorLink . '
'); echo(''); echo('
' . $articleTitle . '
');