vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   what hook is the postbit attahment ? (https://vborg.vbsupport.ru/showthread.php?t=168663)

wolfe 01-24-2008 06:05 PM

what hook is the postbit attahment ?
 
i tried

PHP Code:

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

but no hook is working

--------------- Added [DATE]1201207108[/DATE] at [TIME]1201207108[/TIME] ---------------

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

PHP Code:

<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


All times are GMT. The time now is 02:25 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01123 seconds
  • Memory Usage 1,732KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete