Log in

View Full Version : what hook is the postbit attahment ?


wolfe
01-24-2008, 06:05 PM
i tried


eval('$post[otherattachments] = "' . fetch_template('new_attachemnt_layout') . '";');


but no hook is working

--------------- Added 1201207108 at 1201207108 ---------------

figured it out but now the attachment is dead ?

cheesegrits
01-24-2008, 09:47 PM
Can you give us a bit more detail to go on? What are you trying to do? You talk about a hook, but the code is a template eval. And "the attachment is dead" isn't very informative ...

-- hugh

wolfe
01-25-2008, 05:24 AM
well what it is m8 is i wanted to have a different attachment layout for certain forums. so i did it and the new layout worked but none of the varibles worked like the

link to download: $attachment[attachmentid] dead
attachment views: $attachment[counter]
attachment size: $attachment[filesize]

all are dead if the template is not postbit_attachment any other name and it wont work. any ideas

cheesegrits
01-25-2008, 05:42 AM
In which case we'll need to see your alternate template.

-- hugh

wolfe
01-25-2008, 03:17 PM
<tr>
<td>
<fieldset class="bbfieldset">
<legend class="bblegend">Download File</legend>
<div style="padding-left:120px;">
<img class="inlineimg" src="$stylevar[imgdir_attach]/zip.gif" alt="Zip" width="20" height="18" border="0" style="vertical-align:baseline" />&nbsp;<a href="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;d=$attachment[dateline]"<if condition="$show['newwindow']"> target="_blank"</if> id="attachment_filename_$attachment[attachmentid]"><b>Download .Zip</b></a><br />
<b>Zip File Size: $attachment[filesize]</b><br />
<b>Downloads: $attachment[counter]</b>
</div>
</fieldset></td>
</tr>

cheesegrits
01-25-2008, 04:38 PM
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

asdfadrian
05-20-2011, 03:58 AM
What hook did you use to get the custom template to display? I cant get anything to display with any hooks