[Affelio-cvs 1049] CVS update: affelio/apps/bb

Back to archive index

Yoshihisa Fukuhara higef****@users*****
2006年 1月 25日 (水) 22:59:21 JST


Index: affelio/apps/bb/bb.pm
diff -u affelio/apps/bb/bb.pm:1.3 affelio/apps/bb/bb.pm:1.4
--- affelio/apps/bb/bb.pm:1.3	Thu Jan 12 14:33:50 2006
+++ affelio/apps/bb/bb.pm	Wed Jan 25 22:59:21 2006
@@ -753,6 +753,13 @@
     return $str;
 }
 
+sub autolink {
+	my ($self, $str) = @_;
+	
+	$str =~ s/(https?|ftp)\:([\w|\:\!\#\$\%\=\&\-\^\`\\\|\@\~\[\{\]\}\;\+\*\,\.\?\/]+)/<a href=\"$1\:$2\" target=\"_blank\">$1\:$2<\/a>/ig;
+
+	return $str;
+}
 ############################################################################
 # get user URI
 ############################################################################
Index: affelio/apps/bb/view_topic.cgi
diff -u affelio/apps/bb/view_topic.cgi:1.1 affelio/apps/bb/view_topic.cgi:1.2
--- affelio/apps/bb/view_topic.cgi:1.1	Mon Dec 19 15:46:27 2005
+++ affelio/apps/bb/view_topic.cgi	Wed Jan 25 22:59:21 2006
@@ -164,7 +164,7 @@
 		TITLE	=>	$_->{title},
 		USER	=>	$_->{user},
 		AFID	=>	$uri,
-		COMMENT	=>	$_->{comment},
+		COMMENT	=>	$bb->autolink($_->{comment}),
 		YEAR	=>	$year,
 		MONTH	=>	$mon,
 		DAY		=>	$mday,


Affelio-cvs メーリングリストの案内
Back to archive index