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

Two globals joined together

Quote Reply
Two globals joined together
Hi
I joined two globals together to get the one below.
( Short Description and Description formatted )

It seems to work OK but is it the best way to do it ?

Also, is there any references apart from Gossamer in regard to globals which explains them in detail.

sub {
#Displays the Description formatted with line breaks limited to 400 characters.
my $tags = shift;
my $Description = $tags->{Description};
$Description = GT::CGI::html_escape($Description);
$Description =~ s/\n/<BR>\n/g;
$Description =~ s,\[(/?i)\],<$1>,g;
$Description =~ s,\[(/?b)\],<$1>,g;
length $Description <400 and return $Description;
my $short = substr ($Description, 0, 400);
$short =~ s/\s\S+?$//;
$short .= " ...";
return $short;
}

Regards

minesite
Subject Author Views Date
Thread Two globals joined together minesite 1562 Feb 13, 2004, 9:21 PM
Post Re: [minesite] Two globals joined together
pugdog 1493 Feb 13, 2004, 10:38 PM