AJAX thread voting
Reg Devs, can you please change the voting on forum posts to use AJAX? In this day and age it's a bit silly to be opening another page just to register a vote ..
This topic was created by magnetik .
Hi Drew,
It looks to me like you've simply removed the step of making the user click the button on the voting pages, ideally you'd have a jquery function that automatically attaches to the upvote/downvote buttons via selectors and fires off an ajax call to a PHP* script on click, the PHP handles the voting** and returns true/false to the javascript function which then increments or decrements the votecount on their screen.
That would be reddit class, user clicks a vote button, moments later the vote count adjusts to reflect it, and the voting button they clicked is marked as disabled (CSS style is changed), It's pretty easy to find examples of this on the web you can deconstruct.
While I'm here again (purely by chance), being alerted that someone has replied to you would also be reddit class.
* or whatever you're using.
** valid session check, target comment exists check, voting enabled check, has user already voted check, if ok change vote in db, if not return false or prompt user to login etc.
[EDIT] Nice job on the edit button, time remaining is a nice touch.
[EDIT2} Just noticed time remaining decrements in place, and doesn't reset with every edit, very nice, needs a cancel button though.