OK, so presumably this is the template you are using as an alternative to postbit_attachment. It looks OK. Which means the problem must be in where / how you are evaluating it.
Can you explain where you are trying to do it? From looking at the code in class_postbit, the postbit_attachment hook won't work because it gets called before vB itself uses it's own templates. So unless you've made some code edits, I'm not sure where else you could hook in that would have $attachment in scope.
If you are doing it with code edits, could you post them, along with a few lines of context (vB's code) top and bottom so we can see exactly where the code is.
-- hugh
|