1. magnetik

    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 ..

  2. jubtastic1

    It's sorta working

    Just upvoted someone without a click through, massive improvement but it's not reddit class yet.

    1. Anonymous Coward
      Anonymous Coward

      Re: It's sorta working

      What would make it reddit class?

      1. Graham Marsden

        Re: It's sorta working

        How about the upvote registering without the page re-setting to put the message at the top of the page?

    2. jubtastic1

      Re: It's sorta working

      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.

      1. Anonymous Coward
        Anonymous Coward

        Re: It's sorta working

        Thanks jubtastic - will put your suggestions into the thinking pot.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon