Argh..this is a pain! I'm trying to write a global, so that an icon is only shown if the owner of the link, has their username set to 'isPro' in the links_Users table.
At the moment I have;
# check if a user is a pro...
my $check_user = shift;
print $check_user . "<BR>";
my $isPro;
my $table = $DB->table('Users');
my $sth = $table->select( { Username => $check_user } );
while (my $hit = $sth->fetchrow_hashref) {
$isPro = $hit->{isPro};
} # end while...
return $isPro;
}
For some reason, this is printing out;
HASH(0x86d155c)
admin
HASH(0x86a3a88)
admin
HASH(0x8706cf0)
admin
This is coming from print $check_user . "<BR>";, but the problem is that this HASH() thing keeps appearing
I am using;
<%if check_pro($Username)%>
stuff here]
<%endif%>
to try call the global....can anyone see why it wont work? I've been fumbling over this for the last few hours.
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!
At the moment I have;
Code:
sub { # check if a user is a pro...
my $check_user = shift;
print $check_user . "<BR>";
my $isPro;
my $table = $DB->table('Users');
my $sth = $table->select( { Username => $check_user } );
while (my $hit = $sth->fetchrow_hashref) {
$isPro = $hit->{isPro};
} # end while...
return $isPro;
}
For some reason, this is printing out;
HASH(0x86d155c)
admin
HASH(0x86a3a88)
admin
HASH(0x8706cf0)
admin
This is coming from print $check_user . "<BR>";, but the problem is that this HASH() thing keeps appearing

<%if check_pro($Username)%>
stuff here]
<%endif%>
to try call the global....can anyone see why it wont work? I've been fumbling over this for the last few hours.
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!