Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-27-2009, 02:35 PM
ULSS ULSS is offline
 
Join Date: Jan 2005
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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..
Reply With Quote
  #2  
Old 02-27-2009, 03:35 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 02-27-2009, 06:59 PM
ULSS ULSS is offline
 
Join Date: Jan 2005
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #4  
Old 02-27-2009, 08:32 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yep, that's how you do it!
Reply With Quote
  #5  
Old 02-27-2009, 09:00 PM
ULSS ULSS is offline
 
Join Date: Jan 2005
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #6  
Old 02-27-2009, 09:25 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>';

Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:19 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.03472 seconds
  • Memory Usage 2,211KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete