Anzahl Kommentare | Number of comments

News - Modul (WB 2.12.x / 2.13)

Sollte hier nichts zu sehen sein wie [123] in rot, dann wurde der Hack nach einem WB Upgrade noch nicht wieder eingespielt...

Noch eine News
Auf einem Bein kann man schlecht stehen, deshalb ... Weiterlesen
irgendeine News
Dies ist nur ein Testeintrag um ... Weiterlesen



Durch eine Anpassung von Bianka (Blackbird) wird die Anzahl abgegebener Kommentare (Number of comments) angezeigt [ x ] .
Um das umzusetzen muss man nur die view.php des News-Moduls gegen die aus Downloads austauschen (alte vorher sichern).

Oder man fügt in die view.php Zeile ca. 366 nach

$short = OutputFilterApi('ReplaceSysvar', $short);
und vor  (Code also hier!)
// Replace vars with values

folgenden Code ein

// --- quick and dirty hack to show number of comments ---
// --- added by Bianka Martinovic, 03.06.2009 ---
// get the number of comments for current post
$query_comments = $database->query("SELECT COUNT(*) FROM ".TABLE_PREFIX."mod_news_comments
        WHERE post_id = '".$post['post_id']."'");
if ( $query_comments->numRows() > 0 ) {
    $row = $query_comments->fetchRow();
    if ( $row[0] > 0 ) {
        $post['title'] = $post['title'] . ' <span title="' . $row[0] . ' Kommentare" class="anzahl-kommentare">[ ' . $row[0] . ' ]</span>';
    }
}
// --- end hack ---

 

Formatiert wird es über CSS z.B: so:


.anzahl-kommentare{
			margin-left:30px;
            color:#b22222;
            font-size:10px;
            font-weight:normal;
}

 

 

Alternative: das Modul WebsiteBaker Reviews kann Kommentare und Bewertungen zu News, Bakery, OneForAll und mehr! https://reviews.dev4me.nl