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

Two globals joined together

Quote Reply
Two globals joined together
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;


Quote Reply
Re: [minesite] Two globals joined together In reply to
globals are just snippets of perl code. Otherwise known as subroutines.

They have access to the basic $CFG and $USER variables, and using regular links calls, you can get them to access pretty much anything in links.

PUGDOG´┐Ż Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.