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

Reply
 
Thread Tools Display Modes
  #1  
Old 03-22-2010, 01:07 PM
Professional2's Avatar
Professional2 Professional2 is offline
 
Join Date: Nov 2009
Location: 1/2 Of the World
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 03-22-2010, 01:54 PM
Charlie98902 Charlie98902 is offline
 
Join Date: Dec 2006
Posts: 1,156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 03-31-2010, 12:53 PM
Professional2's Avatar
Professional2 Professional2 is offline
 
Join Date: Nov 2009
Location: 1/2 Of the World
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

but it didn't work for me.
Reply With Quote
  #4  
Old 03-31-2010, 01:49 PM
Charlie98902 Charlie98902 is offline
 
Join Date: Dec 2006
Posts: 1,156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works for me sorry it didn't for you.
Reply With Quote
  #5  
Old 03-31-2010, 01:53 PM
jan1024188 jan1024188 is offline
 
Join Date: Mar 2010
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

why I get bad request error when I try to open thread?
Reply With Quote
  #6  
Old 03-31-2010, 03:18 PM
Charlie98902 Charlie98902 is offline
 
Join Date: Dec 2006
Posts: 1,156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #7  
Old 04-01-2010, 03:55 AM
Professional2's Avatar
Professional2 Professional2 is offline
 
Join Date: Nov 2009
Location: 1/2 Of the World
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #8  
Old 04-01-2010, 10:25 AM
Charlie98902 Charlie98902 is offline
 
Join Date: Dec 2006
Posts: 1,156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Professional2 View Post
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>';
Reply With Quote
  #9  
Old 04-02-2010, 04:26 AM
Professional2's Avatar
Professional2 Professional2 is offline
 
Join Date: Nov 2009
Location: 1/2 Of the World
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

tnx man .I'll try it
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 02:00 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.06043 seconds
  • Memory Usage 2,236KB
  • Queries Executed 11 (?)
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
  • (2)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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