I don't understand what that mod has to do with this, I thought you were trying to create a php type forum block. In that case you'd be entering that code (from the first post) in the Forum Block manager when you create a new "Custom HTML/PHP" block. But one thing I forgot is that using $output is for widgets. For forum blocks you need to return the value, so you'd also have to add
as the last line.