3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-29 23:39:24 +01:00

Exported factoids now have clickable links

This commit is contained in:
Pragmatic Software 2010-07-01 01:43:49 +00:00
parent affb2c66d5
commit 28a5d47af1
2 changed files with 6 additions and 2 deletions

View File

@ -137,7 +137,11 @@ sub export_factoids {
print FILE "<tr>\n";
}
print FILE "<td width=100%><b>$trigger</b> is " . encode_entities($self->factoids->hash->{$channel}->{$trigger}->{action}) . "</td>\n";
my $action = $self->factoids->hash->{$channel}->{$trigger}->{action};
$action =~ s/(.*?)http(s?:\/\/[^ ]+)/encode_entities($1) . "<a href='http$2'>http$2<\/a>"/ge;
$action =~ s/(.*)<\/a>(.*$)/"$1<\/a>" . encode_entities($2)/e;
print FILE "<td width=100%><b>$trigger</b> is " . $action . "</td>\n";
print FILE "<td align=\"right\" nowrap>- submitted by " . $self->factoids->hash->{$channel}->{$trigger}->{owner} . "<br><i>" . localtime($self->factoids->hash->{$channel}->{$trigger}->{created_on}) . "</i>\n</td>\n</tr>\n";
}

View File

@ -13,7 +13,7 @@ use warnings;
# These are set automatically by the build/commit script
use constant {
BUILD_NAME => "PBot",
BUILD_REVISION => 225,
BUILD_REVISION => 226,
BUILD_DATE => "2010-06-30",
};