Ajax ratings issue in CI architecture... - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Ajax ratings issue in CI architecture... (/showthread.php?tid=24385) |
Ajax ratings issue in CI architecture... - El Forum - 11-09-2009 [eluser]Zeeshan Rasool[/eluser] Hello, I am using Ajax ratings script in a CI site but i am unable to stop a user to rate twice, i am calling a controller function thru Ajax and passing to it 2 param one post ID and second user ID but where will i put a check to stop it again? if user make a rating and refresh the page then he cant make rate again as i am checking from db if he is already did that . But if he first time make a rate and could't refresh page and again click on rating then i am unable to put a check in javascript . Please any idea ? Thanks in very advance ! Ajax ratings issue in CI architecture... - El Forum - 11-09-2009 [eluser]InsiteFX[/eluser] You should be able to set a variable say to TRUE to know that the user has already set the rating or you could refresh the page yourself in code. Enjoy InsiteFX Ajax ratings issue in CI architecture... - El Forum - 11-09-2009 [eluser]saidai jagan[/eluser] After the ajax response show the rated amount of image.If he doesnt rated show the rating icon. Ajax ratings issue in CI architecture... - El Forum - 11-09-2009 [eluser]Zeeshan Rasool[/eluser] [quote author="InsiteFX" date="1257774555"]You should be able to set a variable say to TRUE to know that the user has already set the rating or you could refresh the page yourself in code. Enjoy InsiteFX[/quote] Thanks to you both ! InsiteFX i have required to use this with ajax so page refresh is not an option. @Jagan . thank dude its also good option but i need a quick solution that can be implement in my current script. just a flag type variable that can hold the value so next time it can stop rating by same user. Also i need this thing in on first time rating beacuse if a user come again from any other page then i have already puted a check to stop rating. Main point is on first rating time i need to stop him for twice. thanks Ajax ratings issue in CI architecture... - El Forum - 11-09-2009 [eluser]saidai jagan[/eluser] Are u inserting the user details while rating? If so u can check every time the user is rated or not. |