vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   How to show something in Member Profile Page? (https://vborg.vbsupport.ru/showthread.php?t=297652)

RedTurtle 04-27-2013 08:58 PM

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!

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:

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.

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:
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.

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.


All times are GMT. The time now is 03:42 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.01079 seconds
  • Memory Usage 1,728KB
  • 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_html_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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