Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
  #1  
Old 04-27-2013, 08:58 PM
RedTurtle's Avatar
RedTurtle RedTurtle is offline
 
Join Date: May 2006
Location: California
Posts: 205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How to show something in Member Profile Page?

Hello people,

I would like to be able to have certain text show under the "General Information" section of the About Me tab on a Member's Profile page for users who are in a certain usergroup and have this text only visible to the admin usergroup.

How would I go about doing this? Do I need to create a plugin or can I just put something in a template? If so which template would it be?

To clarify, I'd want something like:

If in usergroup admin, then you can see this text, which only shows up on profile pages of users who are in usergroup "blah blah".

Thank you so much for any help you can provide!
Reply With Quote
  #2  
Old 04-28-2013, 03:32 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There is a template hook - profile_stats_last So, just write a plugin to add whatever you want to add and put it into that template_hook.
Reply With Quote
  #3  
Old 04-28-2013, 03:51 PM
RedTurtle's Avatar
RedTurtle RedTurtle is offline
 
Join Date: May 2006
Location: California
Posts: 205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you for the help Lynne!

I'm afraid I am still a little lost as to how to do the code to show certain text for a certain user group only to a certain user group (admin).

Thank you for any further help you can provide.
Reply With Quote
  #4  
Old 04-28-2013, 03:55 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you only want to show it to usergroup x:

PHP Code:
if (is_member_of($vbulletin->userinfo,x)) {
code here

And you only want to show it if the user's profile is from usergroup y
PHP Code:
if (is_member_of($prepared,y)) {
code here

If you need further help, please post your plugin hook location and your exact code.
Reply With Quote
Благодарность от:
RedTurtle
  #5  
Old 04-28-2013, 06:05 PM
RedTurtle's Avatar
RedTurtle RedTurtle is offline
 
Join Date: May 2006
Location: California
Posts: 205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Lynne,

Thank you again for such a great response. I did just sit down and try to do this but I did have two more questions if you don't mind!

1) My version of vB (4.2.0 PL3) doesn't seem to have the hook profile_stats_last. Is there a way I can create this hook, or do I need to use a different one?

2) For the if (is_member_of($prepared_y)) } code here } section, I would like the "code here" to print out the usergroup of the user (whose profile page it is). So if I went to a moderator's profile page as the admin I would like it to say there "Usergroup: Moderator". I did search the forum and found a way to print the usergroup of the person viewing the page, but not sure how to print the usergroup of who the profile page belongs to.

Thank you so much again for devoting your time to this. You have always been so helpful here to me and other beginners.
Reply With Quote
  #6  
Old 04-28-2013, 08:25 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

1) It is a template_hook in the memberinfo_block_statistics template:
HTML Code:
{vb:raw template_hook.profile_stats_last}
So, in your plugin you would just assign what you want to the variable $template_hook['profile_stats_last']. You should take a look at the template so you have an idea how to format the html your your output.

2) If it is the person's profile, then use the variable $prepared for it.
Reply With Quote
  #7  
Old 04-28-2013, 09:07 PM
RedTurtle's Avatar
RedTurtle RedTurtle is offline
 
Join Date: May 2006
Location: California
Posts: 205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you Lynne, that last answer did help quite a bit. I kept looking for a profile_stats_last as the hook location to run my custom plugin that I create. I see now that was incorrect.

Do you know which of the vBulletin hooks I do need to assign my custom plugin code to hook into?

Thank you!
Reply With Quote
  #8  
Old 04-28-2013, 09:32 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't know. You may want to look at the member.php page and see what plugin hooks are called in there and try those. Otherwise, if you go into debug mode, you will see a list of all the plugin hooks called on the page.
Reply With Quote
Reply

Thread Tools
Display Modes

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 01:52 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03946 seconds
  • Memory Usage 2,234KB
  • 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_html
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (1)post_thanks_box_bit
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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_postinfo_query
  • fetch_postinfo
  • 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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete