Welcome Guest, Not a member yet? Register   Sign In
Ajax star rating bar
#39

[eluser]Silvrbak[/eluser]
That would be great if you could up the revised versions of the Jscripts. I hooked up Firebug and the error I am getting is this,

Code:
viewer has no properties
changeText(" unit_long66334", "unit_long66334")rating.js (line 94)
handleResponse()rating.js (line 79)
sndReq("3", "66334", "<IP ADDRESS>", "10")rating.js (line 67)
onclick()rating.js (line 120)
[Break on this error] viewer[removed] = text;

This is in the ratings.js script.


[quote author="debian4tw" date="1212742865"]Hi guys!

@Silvrbak

Looks to me that at somepoint javascript is getting problems, probably when showing the response once the vote has been comited, have you tried to check what happens if you disable javascript? or are you getting any javascript errors? firebug says something? let me know and maybe we can figure out togheter whats going on there.

anyway i slightly modified this library to work with query strings off and use uri segments, also i replaced the whole js work (behavior.js and rating.js ) with a few lines of jquery code. let me clean it up a little bit tomorrow and i'll post mi modifications here (if thats ok with wiredesignz) hopefully you'll have better luck with it, or someone will find it usefull Tongue

btw:
@wiredesignz
thank you very much sir =) this lib was very helpfull.
One thing that i've noticed is that you're making 2 queries. One to get the current rating and another to check if the user has voted or not(logically to allow the user or not to vote). the last one:
Code:
SELECT used_ips FROM ratings WHERE used_ips LIKE '#7.0.0.1%' AND id = '2'
Imho it's unnecesary to make that query if you call for a static rating from the view.
for instance in a blog, probably you'll want to show the static rating (no rating submit allowed ) when you list and paginate all the articles with the short description and the "read more link". And only let them vote when they are on the "full article" view.
So in the first case by just checking the current rating youre done, and you have 10 or 20 unnecesary queries that are trying to find an ip on a longtext field, i think that's not very cool.

i dont know if it is the best way to solve it, but i've fixed by modifying ratings_model.php, replace:
Code:
$voted = (bool)$this->countBy_ip($ip, $id);

with:
Code:
$voted = '';
if (!$static){
  $voted = (bool)$this->countBy_ip($ip, $id);
}

hope it helps
thanks again[/quote]


Messages In This Thread
Ajax star rating bar - by El Forum - 02-14-2008, 12:12 AM
Ajax star rating bar - by El Forum - 02-14-2008, 12:14 AM
Ajax star rating bar - by El Forum - 02-14-2008, 12:16 AM
Ajax star rating bar - by El Forum - 02-14-2008, 12:20 AM
Ajax star rating bar - by El Forum - 02-14-2008, 12:32 AM
Ajax star rating bar - by El Forum - 02-14-2008, 12:51 AM
Ajax star rating bar - by El Forum - 02-15-2008, 12:13 AM
Ajax star rating bar - by El Forum - 02-16-2008, 07:20 AM
Ajax star rating bar - by El Forum - 02-16-2008, 07:36 AM
Ajax star rating bar - by El Forum - 02-16-2008, 11:49 AM
Ajax star rating bar - by El Forum - 02-16-2008, 03:34 PM
Ajax star rating bar - by El Forum - 02-16-2008, 06:06 PM
Ajax star rating bar - by El Forum - 02-16-2008, 07:26 PM
Ajax star rating bar - by El Forum - 02-18-2008, 12:11 AM
Ajax star rating bar - by El Forum - 02-18-2008, 03:25 AM
Ajax star rating bar - by El Forum - 02-18-2008, 02:43 PM
Ajax star rating bar - by El Forum - 02-18-2008, 03:14 PM
Ajax star rating bar - by El Forum - 02-18-2008, 08:40 PM
Ajax star rating bar - by El Forum - 02-18-2008, 08:43 PM
Ajax star rating bar - by El Forum - 02-18-2008, 08:47 PM
Ajax star rating bar - by El Forum - 02-18-2008, 08:52 PM
Ajax star rating bar - by El Forum - 02-18-2008, 08:56 PM
Ajax star rating bar - by El Forum - 02-18-2008, 09:51 PM
Ajax star rating bar - by El Forum - 02-18-2008, 10:20 PM
Ajax star rating bar - by El Forum - 02-18-2008, 10:32 PM
Ajax star rating bar - by El Forum - 02-19-2008, 12:45 AM
Ajax star rating bar - by El Forum - 02-19-2008, 02:00 AM
Ajax star rating bar - by El Forum - 02-19-2008, 06:23 PM
Ajax star rating bar - by El Forum - 02-19-2008, 09:13 PM
Ajax star rating bar - by El Forum - 03-14-2008, 06:18 PM
Ajax star rating bar - by El Forum - 03-17-2008, 01:17 PM
Ajax star rating bar - by El Forum - 03-18-2008, 07:54 PM
Ajax star rating bar - by El Forum - 03-19-2008, 07:53 PM
Ajax star rating bar - by El Forum - 03-19-2008, 08:06 PM
Ajax star rating bar - by El Forum - 06-02-2008, 04:05 PM
Ajax star rating bar - by El Forum - 06-05-2008, 10:01 PM
Ajax star rating bar - by El Forum - 06-05-2008, 10:25 PM
Ajax star rating bar - by El Forum - 06-06-2008, 06:39 AM
Ajax star rating bar - by El Forum - 06-06-2008, 12:28 PM
Ajax star rating bar - by El Forum - 06-11-2008, 06:53 PM
Ajax star rating bar - by El Forum - 06-12-2008, 01:00 PM
Ajax star rating bar - by El Forum - 06-17-2008, 07:42 AM
Ajax star rating bar - by El Forum - 06-17-2008, 11:04 AM
Ajax star rating bar - by El Forum - 06-17-2008, 10:50 PM
Ajax star rating bar - by El Forum - 06-23-2008, 11:43 AM
Ajax star rating bar - by El Forum - 08-24-2008, 07:10 AM
Ajax star rating bar - by El Forum - 10-15-2008, 12:30 AM
Ajax star rating bar - by El Forum - 02-24-2009, 04:11 AM
Ajax star rating bar - by El Forum - 06-03-2009, 10:47 PM
Ajax star rating bar - by El Forum - 06-03-2009, 10:56 PM
Ajax star rating bar - by El Forum - 06-04-2009, 04:34 AM
Ajax star rating bar - by El Forum - 06-04-2009, 05:27 AM
Ajax star rating bar - by El Forum - 08-09-2009, 01:26 PM
Ajax star rating bar - by El Forum - 10-28-2009, 03:18 AM
Ajax star rating bar - by El Forum - 07-01-2010, 03:39 PM
Ajax star rating bar - by El Forum - 07-02-2010, 01:18 AM
Ajax star rating bar - by El Forum - 07-02-2010, 02:04 AM
Ajax star rating bar - by El Forum - 07-02-2010, 05:41 AM
Ajax star rating bar - by El Forum - 07-04-2010, 12:14 AM
Ajax star rating bar - by El Forum - 03-10-2011, 01:56 PM
Ajax star rating bar - by El Forum - 06-26-2011, 08:53 PM
Ajax star rating bar - by El Forum - 08-16-2011, 09:43 AM
Ajax star rating bar - by El Forum - 02-01-2012, 10:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB