vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   hook location not in plugin manager (https://vborg.vbsupport.ru/showthread.php?t=232710)

ageurtse 01-10-2010 02:31 PM

hook location not in plugin manager
 
i have found a hook location in template memberaction_dropdown called {vb:raw template_hook.memberaction_dropdown_items}

but i can't find it back in the plugin manager, where is it or how can i add this hook location in the plugin manager.

Lynne 01-10-2010 02:52 PM

template_hooks are different than regular hooks. template_hooks are for inserting html into them from a plugin, like:

PHP Code:

$template_hook['memberaction_dropdown_items'] .= 'Some html here.'


BBR-APBT 01-10-2010 02:53 PM

That is a template hook. It is not meant to be in the plugin manager.

The hooks in the plugin manager are for adding code to the core vbulletin files with out actually editing the files.

ageurtse 01-10-2010 04:46 PM

Oke and where do i put this extra html data. I thought i do it by plugin but which one does it.
Can i use somthing lik forum start or something like that. In there i file THE template hook witheet html

Lynne 01-10-2010 05:08 PM

You need to pick a plugin that is eval prior to the template being evaled. You can try forumhome_start and see if it works for you. It really depends on what page you are doing this on.

ageurtse 01-10-2010 06:09 PM

i wish to add a extra icon to the members popup thing.
where you could go to the members page and pm and that kind of stuff.

i try some plugin hook locations.

Lynne 01-10-2010 06:12 PM

The members popup things on *what* page? They show up on several pages. You need to access a hook that is used when that particular popup is being rendered. For instance, if you were adding it to the posts on the showthread page, you would use the postbit_display_complete hook since that hook is accessed when the individual posts are being rendered. You need to do similar for wherever else you are wanting to add this.

ageurtse 01-10-2010 06:46 PM

It must be displayed on every page, where you can click on a
members name.

Lynne 01-10-2010 09:12 PM

You are going to need several plugins then.

BBR-APBT 01-10-2010 09:14 PM

Take a look at my Useful links modification in my profile and see how I did it.

ageurtse 01-11-2010 06:24 PM

i have found a hook location which works but now i have a new problem.

this is what i do but the template variables don't work when they called from within a plugin.
is there a way to inject these variables into the template.

the tekst "show attachments" is displayed at the left side in the members drop down menu

hook location is forumhome_start

this is my code

PHP Code:

$template_hook['memberaction_dropdown_items'] .= '
<li class="left">
<a href="{vb:link member, {vb:raw memberinfo}}&tab=AJGattach">
<img src="{vb:stylevar imgdir_siteicons}/profile.png" alt="" />
show attachments
</a>
</li>
'



Paul M 01-11-2010 08:44 PM

You cannot put template syntax into template hooks in that manner.

Think of it as like using the php echo command, and build the output you want as a string.

ageurtse 01-12-2010 05:05 AM

Oke that i can do.

ageurtse 01-13-2010 05:49 PM

i still have a problem

i made a plugin which create a temple and output its content to a hook location

this is the plugin code
PHP Code:

$templater vB_Template::create('add extra field to popupbox');
$template_hook['memberaction_dropdown_items'] .= $templater->render(); 

this is my template
Code:

<li class="left">
  <a href="{vb:link member, {vb:raw memberinfo}}&tab=AJGattach">
  <img src="{vb:stylevar imgdir_siteicons}/profile.png" alt="" />
  show attachments
  </a>
</li>

now think this part isn't working {vb:raw memberinfo},this should get the userid from where whe hit the right mouse button.
why isn't it getting the members id.

BBR-APBT 01-13-2010 05:51 PM

I do believe you have to add

Code:

$global memberinfo
at the top of your plugin.

ageurtse 01-13-2010 06:29 PM

In the plugin? I think

Lynne 01-13-2010 06:33 PM

You need tor register the variable memberinfo for use in your template.

BBR-APBT 01-13-2010 06:40 PM

Quote:

Originally Posted by Lynne (Post 1954729)
You need tor register the variable memberinfo for use in your template.

Yeah that too, I totally over looked that.

iDCamps 01-04-2011 05:42 PM

What hook did you end up using for this?

I can't get memberinfo to be a global in any of the hooks I've tried so far.

Thanks.

wolfe 06-22-2013 11:24 AM

you can add it to "template_render_output" plugin will show on all needed popups :)

when also using the template hook $template_hook['memberaction_dropdown_items'] =


All times are GMT. The time now is 03:04 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.01255 seconds
  • Memory Usage 1,753KB
  • 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_code_printable
  • (3)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (20)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