krz/hn

A brutalist web client for Hacker News.

clone: git clone https://gitbay.org/krz/hn.git

9fcf6929aa23c0eee6c2a9bf5c29d4e2015ba936

unsigned

author: Christian Cleberg <hello@cleberg.net> · 2023-06-01T14:48:58Z

format line lengths
 index.php | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/index.php b/index.php
index 89eab4d..8afaa13 100644
--- a/index.php
+++ b/index.php
@@ -140,8 +140,10 @@ function get_stories($api_url, $inline_title) {
 
 		$html = '<div><a href="' . $sub_response['url'] . '">' . $sub_response['title'] . '</a>';
 		$html .= '<p><time datetime="' . date('Y-m-d h:m:s', $sub_response['time']) . '">';
-		$html .= date('Y-m-d h:m:s', $sub_response['time'])  . '</time> by ';
-		$html .= $sub_response['by'] . ' | ' . $sub_response['score'] . ' points</p></div>';
+		$html .= date('Y-m-d h:m:s', $sub_response['time'])  . '</time> by <a';
+		$html .= 'href="/user/'. $sub_response['by'] . '">';
+		$html .= $sub_response['by'] . ' | ' . $sub_response['score'];
+		$html .= 'points</p></div>';
 		$html_output .= $html;
 	}