Untested, but try this:
check_if_they_have_voted
my $poll_id = $_[0];
my $username = $USER->{Username};
my $count = $DB->table('PollResults')->count( { PollID => $poll_id, Username => $username } );
return { if_they_have_voted => $count }
}
<%if if_they_have_voted > 0%>
..they HAVE voted, so show the results link...
<%endif%>
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!
check_if_they_have_voted
Code:
sub { my $poll_id = $_[0];
my $username = $USER->{Username};
my $count = $DB->table('PollResults')->count( { PollID => $poll_id, Username => $username } );
return { if_they_have_voted => $count }
}
Code:
<%check_if_they_have_voted($PollID)%> <%if if_they_have_voted > 0%>
..they HAVE voted, so show the results link...
<%endif%>
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!