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 custom fields in showthread profile (https://vborg.vbsupport.ru/showthread.php?t=238832)

Professional2 03-22-2010 01:07 PM

how to show custom fields in showthread profile
 
hi i want to define some custom filed like Mobile model and ... then show them in profile of members in showthread.
what shoud i do?
by the way my version os 4.0.2

Charlie98902 03-22-2010 01:54 PM

This isn't to hard and this is what I did:

1. Create a new plugin via the plugin manager.

2. product - vbulletin

3. Hook - postbit_display_start

4. title - extra profile fields

5. execution order - mine is set at 5.

6. plugin php code:


Code:

if($post[fieldx]) $html .= '<dt>Name</dt> <dd>'.$post[fieldX].'</dd>';
if($post[fieldx]) $html .= '<dt>Name</dt> <dd>'.$post[fieldX].'</dd>';
$html .='<br /><br />';

$template_hook['postbit_userinfo_right_after_posts'] .= $html;

Edit all the red and as you can see you can add more to it copying and pasting the one line of code to have 3,4,5,6, etc.... You do need to edit the red so you will need to make the profile fields first then add this plugin.

Professional2 03-31-2010 12:53 PM

but it didn't work for me.

Charlie98902 03-31-2010 01:49 PM

Works for me sorry it didn't for you.

jan1024188 03-31-2010 01:53 PM

why I get bad request error when I try to open thread?

Charlie98902 03-31-2010 03:18 PM

The fields were made b4 you made the plugin active right? Did you put the changes needed in red to represent your profiles & field numbers?

Professional2 04-01-2010 03:55 AM

right but i did it.
for example i want 2 custom set:
1)gender: female or male
2)mobile: nokia,apple,sony ericsson

what shoud i do exactly?
tnx for your answer

Charlie98902 04-01-2010 10:25 AM

Quote:

Originally Posted by Professional2 (Post 2013831)
right but i did it.
for example i want 2 custom set:
1)gender: female or male
2)mobile: nokia,apple,sony ericsson

what shoud i do exactly?
tnx for your answer

Oops I see I forgot to highlight 2 areas in red that you need to change the field11 and field12 at the beginning of the hook sorry. Here is what yours needs to show but O left the field number with an x as I do not know what it would be on your end but you'll know when you create the profile field.

Code:

if($post[fieldx]) $html .= '<dt>mobile</dt> <dd>'.$post[fieldX].'</dd>';
if($post[fieldx]) $html .= '<dt>gender</dt> <dd>'.$post[fieldX].'</dd>';


Professional2 04-02-2010 04:26 AM

tnx man .I'll try it


All times are GMT. The time now is 06:57 PM.

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.01025 seconds
  • Memory Usage 1,727KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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