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
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
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
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates

