I've modified a few globals from the forum to display a short description which can link your rewrite details pages.
The problem is I can't seem to make it return the Title or ($Title) from the global below. Can anyone tell me what's wrong with it? For some reason the code displays $Title as the link ID# on my link.html pages.
Thanks for any help with this!
my $id = $_[0];
my $desc = $_[1];
my $chars = $_[2] || '700';
my $build_url = $CFG->{build_root_url};
my $Title = shift;
if (!$desc) { return "No description yet for this site"; }
length $desc < $chars and return $desc;
my $short = substr ($desc, 0, $chars);
$short =~ s/\s\S+?$//;
my $cats = $DB->table('Links')->get_categories($id);
my ($cat_id,$cat_full_name) = each %$cats;
my $cat_url = $DB->table('Category')->as_url($cat_full_name);
$Title =~ y/ \t\r\n?"'#/__/d;
my $detailed_url = "http://www.mysite.com/...itle-$id/$Title.html";
$short .= qq|<b>... <a href="$detailed_url">More</a></b>|;
}
The problem is I can't seem to make it return the Title or ($Title) from the global below. Can anyone tell me what's wrong with it? For some reason the code displays $Title as the link ID# on my link.html pages.
Thanks for any help with this!
Code:
sub { my $id = $_[0];
my $desc = $_[1];
my $chars = $_[2] || '700';
my $build_url = $CFG->{build_root_url};
my $Title = shift;
if (!$desc) { return "No description yet for this site"; }
length $desc < $chars and return $desc;
my $short = substr ($desc, 0, $chars);
$short =~ s/\s\S+?$//;
my $cats = $DB->table('Links')->get_categories($id);
my ($cat_id,$cat_full_name) = each %$cats;
my $cat_url = $DB->table('Category')->as_url($cat_full_name);
$Title =~ y/ \t\r\n?"'#/__/d;
my $detailed_url = "http://www.mysite.com/...itle-$id/$Title.html";
$short .= qq|<b>... <a href="$detailed_url">More</a></b>|;
}