Hi,
It's been a while since I've played with that. You could try a new global:
check_if_has_rated
my $type = $_[0];
my $link_id = $_[1];
if ($DB->table("ClickTrack")->do_query(qq|SELECT LinkID FROM glinks_ClickTrack WHERE LinkID = $link_id AND ClickType = "$type" AND IP = "$ENV{REMOTE_ADDR}"|)->fetchrow) {
# they have already rated/reviewed etc
return { already_done => 1 };
} else {
return { already_done => 0 }
}
}
Then call with :
<%if already_done%>
they have already rated this link
<%endif%>
The first value can be "Rate", "Hits" or "Review". You will need to play around with those, as without digging into the GT code I can't remember exactly what each of those represent.
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!
It's been a while since I've played with that. You could try a new global:
check_if_has_rated
Code:
sub { my $type = $_[0];
my $link_id = $_[1];
if ($DB->table("ClickTrack")->do_query(qq|SELECT LinkID FROM glinks_ClickTrack WHERE LinkID = $link_id AND ClickType = "$type" AND IP = "$ENV{REMOTE_ADDR}"|)->fetchrow) {
# they have already rated/reviewed etc
return { already_done => 1 };
} else {
return { already_done => 0 }
}
}
Then call with :
Code:
<%check_if_has_rated("Rate",$ID)%> <%if already_done%>
they have already rated this link
<%endif%>
The first value can be "Rate", "Hits" or "Review". You will need to play around with those, as without digging into the GT code I can't remember exactly what each of those represent.
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!