Hi. I'm trying to write a modification to GCommunity, so we can put an online members area up on UltraNerds.
I have the following global;
my $User = shift;
my $table = $DB->table('comm_users');
my $sth = $table->select( { comm_username => $User } ) ;
while (my $hit = $sth->fetchrow_hashref) {
my @cut = split /\n/, $hit->{prof_OwnedPrograms};
my $back;
foreach (@cut) {
$back .= qq|$_ - <a href="community.cgi?do=download&file=$_">Download</a>|;
}
#$back =~ s|([^\/]+)|GT::CGI->unescape( $1 )|e;
#return GT::CGI->unescape($back);
return GT::CGI->unescape($back);
}
}
...The problem is, that it outputs it like;
href="community.cgi?do=download&file=Ace_PPC">Download</a>
....as you can see, its escaping the whole string.
If I replace;
...with;
or...
Does anyone know if this is a bug, or just something stupid I'm doing? I'm pretty new with GCommunity, so this is pretty new to me. Do globals not work the same way as LinksSQL? In LSQL, you could use 'return' and it would just return whatever the string held, and not escape it?
TIA
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!
I have the following global;
Code:
sub { my $User = shift;
my $table = $DB->table('comm_users');
my $sth = $table->select( { comm_username => $User } ) ;
while (my $hit = $sth->fetchrow_hashref) {
my @cut = split /\n/, $hit->{prof_OwnedPrograms};
my $back;
foreach (@cut) {
$back .= qq|$_ - <a href="community.cgi?do=download&file=$_">Download</a>|;
}
#$back =~ s|([^\/]+)|GT::CGI->unescape( $1 )|e;
#return GT::CGI->unescape($back);
return GT::CGI->unescape($back);
}
}
...The problem is, that it outputs it like;
Quote:
Ace_PPC - <a href="community.cgi?do=download&file=Ace_PPC">Download</a>
....as you can see, its escaping the whole string.
If I replace;
Code:
return GT::CGI->unescape($back);...with;
Code:
print $back;or...
Code:
print GT::CGI->unescape($back);Does anyone know if this is a bug, or just something stupid I'm doing? I'm pretty new with GCommunity, so this is pretty new to me. Do globals not work the same way as LinksSQL? In LSQL, you could use 'return' and it would just return whatever the string held, and not escape it?
TIA
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!