vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   looking for the right hooks (https://vborg.vbsupport.ru/showthread.php?t=206809)

ULSS 02-27-2009 02:35 PM

looking for the right hooks
 
Hi.. I'm looking for the hooks (if they exist) to add custome links to the areas below. I know I can do it via Template Edits, but would like to use the Plugin System if possible, as it's easier to do upgrades that way.

1. In a post, each user has an Icon next to their name that opens a menu with options like "View Profile", "Send PM", etc... I wish to add a new link to this menu.

2. When viewing a members profile, there are several boxes to the right. "Mini stats", "Friends", "Albums", etc. Is there a way to add a custom box? or to add a links to the Mini Stats box?

3. Is there a way to auto add content to a users signature?

4. Is there a way to add content to the area on a users post where it shows Join Date and Number of posts?

Thanks..

Lynne 02-27-2009 03:35 PM

1. Find the template and look in it to see if there is a template_hook - yes, there is ( $template_hook[postbit_user_popup] ) Then use a plugin to use it. If you are in debug mode, you can see the list of plugins called at the bottom of the page.

2. You may find the template and add to it. To find the template - vboptions > General Settings > Add Template Name in HTML Comments > set to Yes . Then go back to your page and view the source code and you will see the name of the template called around your part of the code. Sometimes the template is the one mentioned at the very top of the page source. (edit: And again, is there a template_hook in there to use? Yes, there is.)

3. Again, look in the template and see if there is a template_hook. (yes, there are two - one before and one after)

4. Look at the template for a template_hook in that area. Again, yes there is a template_hook.

ULSS 02-27-2009 06:59 PM

Thanks a million Lynne..

I didn't know what to look for in the source and honestly, hadn't even thought about looking in that manner.. I was just trying to find sometihng meaningful in the dropdown list on the plugins page, and there were so many, i couldn't find what I was looking for..

Thanks again :)

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

I guess i'm still a little confused..

I see those hook locations in the templates, such as the one you mentiond.. $template_hook[postbit_user_popup] .. however, in the plugins system, I can't find that hook in the dropdown to use..

the only postbit hooks I see listed in the dropdown are:
postbit_attachment
postbit_display_complete
postbit_display_start
postbit_factory
postbit_imicons


FYI: I'm on vB 3.7.3 PL1

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

ok.. i see the difference between a code hook and a template hook.

I used postbit_display_start code hook for the plugin, and within that code i set $template_hook['postbit_user_popup'] to the HTML for adding a new item to the popup menu.

Thanks again.. I cant take it from here :)

Lynne 02-27-2009 08:32 PM

Yep, that's how you do it! :)

ULSS 02-27-2009 09:00 PM

:( having a hard time firguring out which plugin hook can be used to modify $template_hook[profile_ministats_list]

I've tried a bunch of the hooks that start with "member" and "profile"

any ideas?

Lynne 02-27-2009 09:25 PM

I did that one recently.... it's a weird one. :) Use the "member_profileblock_fetch_unwrapped" location. But, wrap the content in an if statement otherwise it goes through this plugin for every block (and if you have queries, that means it does the query each time!):
PHP Code:

global $vbulletin;
if (
$title == $vbphrase['mini_statistics']){
Whatever you want to do...
    
$template_hook[profile_ministats_list] .= '<dt class="shade">Whatever</dt><dd>More of Whatever</dd>';




All times are GMT. The time now is 05:23 AM.

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.01051 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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