A massive copy and paste of your code is not helpful, no one wants to read a wall of code with no formatting, next time use the “code” button in the toolbar to wrap your code so it’s a little easier to read, also only post the specific parts of the code that is relevant.
Either way, I’m closing this as a duplicate of your other post as that was readable and I’ve answered it. http://bbpress.org/forums/topic/pagination-on-forum-listing-page/