Browse Source

Update comment display style
Specify timezone for dates

k4be 1 năm trước cách đây
mục cha
commit
e537e86e0a
3 tập tin đã thay đổi với 14 bổ sung1 xóa
  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;
+}