vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Change hook location? (https://vborg.vbsupport.ru/showthread.php?t=299627)

mathforum 06-29-2013 12:53 AM

Change hook location?
 
I have two images that are generated by modifications that I'd like to move a bit. They both appear in the same area on top of each other but I'd like them to fit into boxes like the rest of my postbit. The images are a trophy and a small medal. Here's what it looks like now:

https://vborg.vbsupport.ru/external/2013/06/5.png

I can see in the two plugins where the images are rendered and sent to "template_hook['postbit_userinfo_left']" but I don't know how to change the location from that spot. I realize I could replace the hook location but that won't help me.

Let's say that I want a new box to be below "Thanked" and for it to contain trophies and medals. Here is what the last few lines of the postbit_legacy look like:

Code:

<vb:if condition="$post['age']"><dt>{vb:rawphrase age}</dt> <dd>{vb:raw post.age}</dd></vb:if>
<dt>{vb:rawphrase posts}</dt> <dd>{vb:raw post.posts}</dd>
<dt>Thanks</dt> <dd>{vb:raw post.vbseo_likes_out} times</dd>


Could I do something like <dt>Awards</dt> <dd>{vb:raw template_hook.NEW_HOOK_LOCATION</dd>?

I'd have to change the PHP code to the new hook location but this seems a rather crude way to try this. Any ideas are very much appreciated! I've been at this for ages and I'm about to break. :(

kh99 06-29-2013 08:50 AM

I don't see anything wrong with doing it that way, as long as you make sure the value for NEW_HOOK_LOCATION is not something used for another template hook somewhere else, of course. Another way would be to create your own variable and preRegister() it to postbit_legacy.

mathforum 06-30-2013 12:08 AM

Right now in the mod I see this line which I am pretty sure outputs the image.

PHP Code:

$template_hook['postbit_userinfo_left'] .= $templater->render(); 

1) How do I create a new hook or variable for this spot? Shouldn't there already be a variable if multiple images have to be generated by the mod? I just can't seem to find anything like {vb:rank_image_path} that I can use.

2) Once I have that done I can use this code to generate the image?

PHP Code:

<dt>Awards</dt> <dd>{vb:raw template_hook.NEW_HOOK_LOCATION}</dd

or

PHP Code:

<dt>Awards</dt> <dd>{vb:variable name}</dd

3) What about the CSS associated with it?


All times are GMT. The time now is 10:15 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.00973 seconds
  • Memory Usage 1,723KB
  • 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
  • (1)bbcode_code_printable
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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