Falsche Zeitdarstellung bei Kommentaren durch qTranslateWrong Time Display on Comments with qTranslate

Plugins, WordPress
6. Dezember 2009

Fehlerhafte Darstellung der Zeitanzeige bei Kommentaren in WordPress durch qTranslate

Seit geraumer Zeit wurde die Darstellung der Kommentare in WordPress völlig neu gestaltet. Berücksichtigt man diese neue Kommentarfunktion in seinem Theme, erhält man durch das Mehrsprachen-Plugin qTranslate eine falsche Darstellung des Zeitpunkts, wann ein Kommentar erstellt wurde.

Abhilfe schafft eine Änderung in den Quelldateien der aktuellen WordPress Version.
Wrong Time Display on Comments in WordPress by qTranslate

Times ago the appearance of comments in WordPress has been completely redesigned. Using this new comment feature in its theme, a misrepresentation of the date, when a comment has been written, is obtained by the multi-language plugin qTranslate.

In this case the change in the source files of the latest version of WordPress will solve the problem.

Konkret bedarf es einer Erweiterung im Quelltext der Datei „comment-template.php“ im Ordner „wp-includes“. Wie unten dargestellt wird im DIV, welches die Kommentar-Metadaten anzeigt, der Anzeige-Code geändert (ab Zeile 1270 in der WordPress-Version 2.8.6):

1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
<?php /* AENDERUNG */?>
<div class="comment-meta commentmetadata">
		<a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>">
			<?php echo get_comment_date('l, j.F Y') . " - " . get_comment_time('H:i') ; ?>
		</a>
 
		<?php edit_comment_link(__('(Edit)'),'&nbsp;&nbsp;','') ?></div>
<?php /* AENDERUNG ENDE */?>
 
	<?php comment_text() ?>


Specifically, it requires an expansion in the source code of the file “comment-template.php” in the folder “wp-includes”. As shown below, the DIV, which displays the comment metadata, is changed by a fitting display code (from line 1270 in WordPress version 2.8.6):

1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
<?php /* CHANGE */?>
<div class="comment-meta commentmetadata">
		<a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>">
			<?php echo get_comment_date('l, j.F Y') . " - " . get_comment_time('H:i') ; ?>
		</a>
 
		<?php edit_comment_link(__('(Edit)'),'&nbsp;&nbsp;','') ?></div>
<?php /* CHANGE finish */?>
 
	<?php comment_text() ?>

Plugins, WordPress
6. Dezember 2009

Kommentar schreiben