Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [Gorospe] Links in DB

Quote Reply
Re: [Gorospe] Links in DB In reply to
Hi,

You could probably do it with a global;

replace_words_with_links

Code:
sub {

my @words = split /\n/, q|some word::http://www.domain.com
another::http://www.google.com|;

my $tmp = $_[0];
foreach (@words) {
my ($word,$link) = split /::/, $_;
$tmp =~ s|\b$word|<a href="$link" target="_blank">$word</a>|sig;
}
return $tmp;
}


..then just use something like this:

<%replace_words_with_links($Description)%>

Untested, but something like that should do the trick =)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Subject Author Views Date
Thread Links in DB Gorospe 15604 Oct 31, 2008, 9:36 AM
Thread Re: [Gorospe] Links in DB
Andy 15249 Oct 31, 2008, 9:57 AM
Thread Re: [Andy] Links in DB
Gorospe 15181 Oct 31, 2008, 10:09 AM
Thread Re: [Gorospe] Links in DB
Andy 15228 Oct 31, 2008, 10:12 AM
Thread Re: [Andy] Links in DB
Gorospe 15179 Oct 31, 2008, 10:43 AM
Thread Re: [Gorospe] Links in DB
Andy 15284 Oct 31, 2008, 10:59 AM
Thread Re: [Andy] Links in DB
Gorospe 15271 Oct 31, 2008, 11:46 AM
Thread Re: [Gorospe] Links in DB
Andy 15183 Nov 1, 2008, 1:47 AM
Thread Re: [Andy] Links in DB
Gorospe 15192 Nov 1, 2008, 8:02 AM
Thread Re: [Gorospe] Links in DB
Andy 15240 Nov 1, 2008, 8:04 AM
Thread Re: [Andy] Links in DB
Gorospe 15223 Nov 1, 2008, 8:08 AM
Thread Re: [Gorospe] Links in DB
Andy 15147 Nov 1, 2008, 8:17 AM
Thread Re: [Andy] Links in DB
Gorospe 15142 Nov 1, 2008, 8:23 AM
Post Re: [Gorospe] Links in DB
Andy 15162 Nov 1, 2008, 8:40 AM
Thread Re: [Andy] Links in DB
MJ_ 15237 Nov 1, 2008, 10:33 AM
Thread Re: [MJ_] Links in DB
Andy 15189 Nov 1, 2008, 11:00 AM
Thread Re: [Andy] Links in DB
MJ_ 15157 Nov 1, 2008, 2:17 PM
Thread Re: [MJ_] Links in DB
Andy 15112 Nov 3, 2008, 8:37 AM
Thread Re: [Andy] Links in DB
Andy 15111 Nov 3, 2008, 8:54 AM
Thread Re: [Andy] Links in DB
Andy 15093 Nov 3, 2008, 9:25 AM
Thread Re: [Andy] Links in DB
MJ_ 15143 Nov 3, 2008, 10:15 AM
Thread Re: [MJ_] Links in DB
Andy 15071 Nov 3, 2008, 10:17 AM
Thread Re: [Andy] Links in DB
MJ_ 15066 Nov 3, 2008, 10:34 AM
Thread Re: [MJ_] Links in DB
Andy 15079 Nov 3, 2008, 10:37 AM
Thread Re: [Andy] Links in DB
MJ_ 15102 Nov 3, 2008, 10:43 AM
Post Re: [MJ_] Links in DB
Andy 2577 Nov 3, 2008, 10:44 AM
Post Re: [MJ_] Links in DB
Andy 2600 Nov 3, 2008, 11:32 PM