PDA

View Full Version : Change hook location?


mathforum
06-29-2013, 12:53 AM
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:

<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.

$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?

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

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

3) What about the CSS associated with it?