Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [tora] ajax rating system

Quote Reply
Re: [tora] ajax rating system In reply to
Hi,

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!
Subject Author Views Date
Thread ajax rating system jdgamble 28761 May 26, 2009, 1:24 PM
Post Re: [jdgamble] ajax rating system
Andy 28466 May 27, 2009, 12:34 AM
Thread Re: [jdgamble] ajax rating system
Andy 28470 May 27, 2009, 12:45 AM
Thread Re: [Andy] ajax rating system
tora 12387 Apr 8, 2018, 4:02 AM
Thread Re: [tora] ajax rating system
Andy 12337 Apr 11, 2018, 12:08 AM
Post Re: [Andy] ajax rating system
tora 12331 Apr 11, 2018, 12:46 AM
Thread Re: [Andy] ajax rating system
tora 12324 Apr 11, 2018, 12:52 PM
Thread Re: [tora] ajax rating system
Andy 12315 Apr 12, 2018, 12:59 AM
Post Re: [Andy] ajax rating system
tora 12311 Apr 12, 2018, 1:21 AM
Thread Re: [jdgamble] ajax rating system
tandat 28431 May 27, 2009, 4:53 AM
Thread Re: [tandat] ajax rating system
jdgamble 28391 May 27, 2009, 8:08 AM
Thread Re: [jdgamble] ajax rating system
Andy 28378 May 27, 2009, 8:31 AM
Thread Re: [Andy] ajax rating system
jdgamble 28375 May 27, 2009, 10:38 AM
Thread Re: [jdgamble] ajax rating system
Andy 28439 May 27, 2009, 10:44 AM
Thread Re: [Andy] ajax rating system
jdgamble 28326 May 29, 2009, 11:34 AM
Thread Re: [jdgamble] ajax rating system
Matthias70 28340 May 29, 2009, 11:44 AM
Thread Re: [Matthias70] ajax rating system
jdgamble 28289 May 29, 2009, 6:55 PM
Thread Re: [jdgamble] ajax rating system
jdgamble 28280 May 29, 2009, 10:15 PM
Thread Re: [jdgamble] ajax rating system
jdgamble 28276 May 30, 2009, 7:22 PM
Thread Re: [jdgamble] ajax rating system
Andy 28392 May 31, 2009, 1:58 AM
Thread Re: [Andy] ajax rating system
jdgamble 28186 Jun 6, 2009, 10:48 AM
Thread Re: [jdgamble] ajax rating system
Andy 28275 Jun 6, 2009, 11:05 AM
Thread Re: [Andy] ajax rating system
jdgamble 28226 Jun 6, 2009, 12:42 PM
Post Re: [jdgamble] ajax rating system
Andy 28232 Jun 6, 2009, 11:58 PM