Nikos,
Actually this hack is written for Photopost 3.2 and Ubbthreads 6.2. It is even specified as such.
You can adapt it for prior versions and and just simply remove the header include. So instead of trying to comment out the main-inc.php file just do not use the header-inc.php file. In fact is you look close at the header-inc.php with Photopost 3.2 it only supports vbportal and vbulletin boards.
This hack works just fine the way it stands since Photpost 3.2 does not use the header include for Threads any longer. That was thrown out when Michael wrote 3.2 since it was causing so many problems.