浏览代码

Update comment display style
Specify timezone for dates

k4be 1 年之前
父节点
当前提交
e537e86e0a
共有 3 个文件被更改,包括 14 次插入1 次删除
  1. 1 1
      include/comment.php
  2. 3 0
      include/config-example.php
  3. 10 0
      style.css

+ 1 - 1
include/comment.php

@@ -110,7 +110,7 @@ function generate_comment_field($comments, $type, $id) {
 		$output = '<h2>' . $headertexts[$type] . '</h2>';
 	}
 	foreach ($comments as $comment) {
-        	$output .= '<div class="comment-block"><div class="comment-author">Autor: ' . htmlspecialchars($comment['author']) . ', data: ' . date('j.m.Y G:i:s', $comment['date']) . '</div><div class="comment-text">' . htmlspecialchars($comment['content']) . '</div></div>';
+        	$output .= '<div class="comment-block"><div class="comment-header">Autor: <span class="comment-author">' . htmlspecialchars($comment['author']) . '</span>, data: <span class="comment-date">' . date('j.m.Y G:i:s', $comment['date']) . '</span></div><div class="comment-text">' . htmlspecialchars($comment['content']) . '</div></div>';
 	}
 
 	$output .= '<h2>Dodaj nowy komentarz</h2><form id="comment-form" method="post" action="sendcomment.php"><table id="comment-form-table"><tr><td class="form-caption">Autor:</td><td><input type="text" name="comment-nick" id="comment-nick"></td></tr>';

+ 3 - 0
include/config-example.php

@@ -14,5 +14,8 @@ $config = [
 	'imagepath' => '/obrazki/',	// webroot path for image dirs (keep the trailing /)
 	'thumbnailpath' => '/obrazki/miniatury/',	// webroot path for thumbnails (keep the trailing / and do not change for now)
 	'thumbnailsize' => 70,		// thumbnail width in pixels, do not change for now)
+	'timezone' => 'Europe/Warsaw',	// timezone for date display
 ];
+
+date_default_timezone_set($config['timezone']);
 ?>

+ 10 - 0
style.css

@@ -111,4 +111,14 @@ img.pelny {
 	margin-bottom: .8em;
 }
 
+.comment-author {
+	font-weight: bold;
+}
+
+.comment-date {
+	font-weight: bold;
+}
 
+.comment-header {
+	margin-bottom: .3em;
+}