From 7b09db512e1de16fa0a6a0cc0bb61fc36cb5633b Mon Sep 17 00:00:00 2001
From: Matthew Juhl <mjuhl24@gmail.com>
Date: Fri, 30 Oct 2009 21:01:39 +0000
Subject: [PATCH] Detect URLs in wire posts and create a HREF on home page.

---
 customindex/views/default/customindex/content.php | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/customindex/views/default/customindex/content.php b/customindex/views/default/customindex/content.php
index 8fe42d7a..eff8434b 100644
--- a/customindex/views/default/customindex/content.php
+++ b/customindex/views/default/customindex/content.php
@@ -361,7 +361,11 @@
 							if (isloggedin()) {echo('291px;');}else{echo('51px;');}
 						echo '"></span>';
 						echo '	<div style="padding:10px;">';
-						echo '<p style="margin:0;"><a href="pg/profile/' . $row3['username'] . '">' . $row3['name'] . '</a>: ' . $row2['description'] . '</p>';
+						
+						;
+						
+						echo '<p style="margin:0;"><a href="pg/profile/' . $row3['username'] . '">' . $row3['name'] . '</a>: ' . preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@', '<a href="$1">$1</a>', $row2['description']) . '</p>';
+						//echo '<p style="margin:0;"><a href="pg/profile/' . $row3['username'] . '">' . $row3['name'] . '</a>: ' . $row2['description'] . '</p>';
 						echo '<p style="margin:2px 0 3px 0; font-size:10px; clear:both;float:right"><em>' . friendly_time($row['time_updated']) . '</em></p>';
 						echo '	</div>';
 						echo '</div><div class="clear"></div>';
-- 
GitLab