From 33b39f46d3b437ef1125eba30e54edd20c97f212 Mon Sep 17 00:00:00 2001
From: Starbeamrainbowlabs <sbrl@starbeamrainbowlabs.com>
Date: Sun, 12 Feb 2017 09:55:37 +0000
Subject: [PATCH] Link usernames in recent changesto their respective user
 pages

---
 build/index.php                    | 8 +++++---
 core.php                           | 4 ++--
 module_index.json                  | 2 +-
 modules/feature-recent-changes.php | 4 +++-
 4 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/build/index.php b/build/index.php
index 7a54088..e8a561d 100644
--- a/build/index.php
+++ b/build/index.php
@@ -874,7 +874,7 @@ function render_pagename($rchange)
 	return $pageDisplayName;
 }
 /**
- * Renders an editor's name in HTML.
+ * Renders an editor's or a group of editors name(s) in HTML.
  * @param  string $editorName The name of the editor to render.
  * @return string             HTML representing the given editor's name.
  */
@@ -1448,7 +1448,7 @@ class page_renderer
 		$result = "";
 		if(in_array($name, $settings->admins))
 			$result .= $settings->admindisplaychar;
-		$result .= $name;
+		$result .= "<a href='?page=" . rawurlencode(get_user_pagename($name)) . "'>$name</a>";
 
 		return $result;
 	}
@@ -2411,6 +2411,8 @@ function render_recent_changes($recent_changes)
 				if(!in_array($recent_changes[$key]->user, $users))
 					$users[] = $recent_changes[$key]->user; 
 			}
+			foreach($users as &$user)
+				$user = page_renderer::render_username($user);
 			$userDisplayHtml = render_editor(implode(", ", $users));
 			
 			$next_entry = "<li><details><summary><a href='?page=" . rawurlencode($rchange_first->page) . "'>$pageDisplayHtml</a> $userDisplayHtml $timeDisplayHtml</summary><ul class='page-list'>$next_entry</ul></details></li>";
@@ -2433,7 +2435,7 @@ function render_recent_change($rchange)
 {
 	global $pageindex;
 	$pageDisplayHtml = render_pagename($rchange);
-	$editorDisplayHtml = render_editor($rchange->user);
+	$editorDisplayHtml = render_editor(page_renderer::render_username($rchange->user));
 	$timeDisplayHtml = render_timestamp($rchange->timestamp);
 	
 	$revisionId = false;
diff --git a/core.php b/core.php
index 8a6a44d..3a032c2 100644
--- a/core.php
+++ b/core.php
@@ -555,7 +555,7 @@ function render_pagename($rchange)
 	return $pageDisplayName;
 }
 /**
- * Renders an editor's name in HTML.
+ * Renders an editor's or a group of editors name(s) in HTML.
  * @param  string $editorName The name of the editor to render.
  * @return string             HTML representing the given editor's name.
  */
@@ -1129,7 +1129,7 @@ class page_renderer
 		$result = "";
 		if(in_array($name, $settings->admins))
 			$result .= $settings->admindisplaychar;
-		$result .= $name;
+		$result .= "<a href='?page=" . rawurlencode(get_user_pagename($name)) . "'>$name</a>";
 
 		return $result;
 	}
diff --git a/module_index.json b/module_index.json
index 4cdb018..57f01cd 100755
--- a/module_index.json
+++ b/module_index.json
@@ -68,7 +68,7 @@
         "author": "Starbeamrainbowlabs",
         "description": "Adds recent changes. Access through the 'recent-changes' action.",
         "id": "feature-recent-changes",
-        "lastupdate": 1482008539,
+        "lastupdate": 1486893286,
         "optional": false
     },
     {
diff --git a/modules/feature-recent-changes.php b/modules/feature-recent-changes.php
index 8980450..d671813 100644
--- a/modules/feature-recent-changes.php
+++ b/modules/feature-recent-changes.php
@@ -172,6 +172,8 @@ function render_recent_changes($recent_changes)
 				if(!in_array($recent_changes[$key]->user, $users))
 					$users[] = $recent_changes[$key]->user; 
 			}
+			foreach($users as &$user)
+				$user = page_renderer::render_username($user);
 			$userDisplayHtml = render_editor(implode(", ", $users));
 			
 			$next_entry = "<li><details><summary><a href='?page=" . rawurlencode($rchange_first->page) . "'>$pageDisplayHtml</a> $userDisplayHtml $timeDisplayHtml</summary><ul class='page-list'>$next_entry</ul></details></li>";
@@ -194,7 +196,7 @@ function render_recent_change($rchange)
 {
 	global $pageindex;
 	$pageDisplayHtml = render_pagename($rchange);
-	$editorDisplayHtml = render_editor($rchange->user);
+	$editorDisplayHtml = render_editor(page_renderer::render_username($rchange->user));
 	$timeDisplayHtml = render_timestamp($rchange->timestamp);
 	
 	$revisionId = false;
