You don't need to know how it works. All you need to do is add the code into your center block. Then it will automatically put the recent topics in your center block.
Goto TPadmin, then edit blocks. Scroll down to to center block and add a php block. Then put the code in it from here.