View Full Version : How to show something in Member Profile Page?
RedTurtle
04-27-2013, 08:58 PM
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!
Lynne
04-28-2013, 03:32 PM
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.
RedTurtle
04-28-2013, 03:51 PM
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.
Lynne
04-28-2013, 03:55 PM
If you only want to show it to usergroup x:
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
if (is_member_of($prepared,y)) {
code here
}
If you need further help, please post your plugin hook location and your exact code.
RedTurtle
04-28-2013, 06:05 PM
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.
Lynne
04-28-2013, 08:25 PM
1) It is a template_hook in the memberinfo_block_statistics template:
{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.
RedTurtle
04-28-2013, 09:07 PM
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!
Lynne
04-28-2013, 09:32 PM
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.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.