Thanks for the updated. I actually just tried that mod on my test forum (which is still 4.1.10) to see if I could troubleshoot, but I can't recreate the database error. I tried making sure there were attachments in threads and tried the various options for the 9xpro mod, but just can't get the database error to appear.
From your original error I see the line is from a query in the 9xpro mod:
Code:
WHERE attachment.contentid = ".$thread['firstpostid']."
So for some reason $thread['firstpostid'] is empty...
$thread is getting passed into the function but I wonder if a possible fix would be to simply make $thread global in the function instead. I had hope to test this but without getting the error I can't really confirm.