Ajax star rating bar |
[eluser]wiredesignz[/eluser]
Sorry for the late reply draude, I ported the star rating system to CI as an exercise, You're on your own when it comes to modifications. Thanks ![]()
[eluser]debian4tw[/eluser]
great stuff wiredesignz! i'm going to be implementing this for sure, i'll let you know how that goes.
[eluser]debian4tw[/eluser]
hey guys, this is strange on an apache running on windows (wamp) everything works fine, now on an apache running on a linux server i get : The URI you submitted has disallowed characters. any ideas? thanks
[eluser]taewoo[/eluser]
read this: http://ellislab.com/forums/viewthread/72933/
[eluser]Silvrbak[/eluser]
I am having trouble with this. The loading clock just runs, the page does not refresh. If I refresh manually the vote has been cast. Any ideas?
[eluser]debian4tw[/eluser]
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 ![]() 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' 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 = ''; hope it helps thanks again
[eluser]wiredesignz[/eluser]
You're welcome debian4tw, feel free to create a wiki article for this library and modify as you wish. Sorry I don't have time to support this any longer.
[eluser]Isern Palaus[/eluser]
Hello, I'm trying to use this script on my new project but seems that is not working fine. At first I've to say that I was having problems on the countBy_ip() function because I'm using a DB prefix. I solved with replacing the function with: Code: function countBy_ip($ip, $id) Now this is working fine. Whats more, I am trying to use it but seems that it's not working fine (well, it does not work at all). I've been trying first with the examples that wiredesignz provided and none of them works. Firebug is showing me this: Quote:Params: Well the route hack ($route['rpc.php'] = ...) do not works and I don't know what more to do. I'm using a mod_rewrite to split up the index.php/. Thank you in advance, -- Isern Palaus
[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 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 ![]() 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' 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 = ''; hope it helps thanks again[/quote]
[eluser]debian4tw[/eluser]
Hi guys, sorry about the delay. some exams@unviersity are keeping me busy. let's see if you can make it work with these modified/updated files, basically: -you'll need jquery library. -no need to use routes. -no need to enable query strings, it uses uri segments. -no need for ratings.js and behavior.js, just one simple 505 bytes jquery file that does the javascript part. -with javascript disabled you should be redirected to the referer page. so you can delete the nojspage in config here are the files: rater.js Code: $(document).ready(function() { modified index function on ratings_rpc controller Code: $url = $this->uri->uri_string(); and...on dynamic_rating_view.php you need to change the href link to uri segments Code: // nojs-1 in url provides for javascript being disabled That should do it, if not letme know... hope it helps |
Welcome Guest, Not a member yet? Register Sign In |