Announcement

Collapse
No announcement yet.

Vbulletin 4 : how to display User Profile Fields(Multiple-Selection) in other pages.

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Vbulletin 4 : how to display User Profile Fields(Multiple-Selection) in other pages.

    Hi all

    I am trying to change the template and display the user profile fields on other pages.
    I created a plugin and get the value from $vbulletin->userinfo[field*]; and register it to the template. somegthings like below. but the problem is, it works fine for text field, but for selection field, it will display a number, not the selected text data. any idea how do i display the selected text??

    PHP Code:
    $postcode $vbulletin->userinfo[field9];
    vB_Template::preRegister('navbar',array('postcode' => $postcode)); 

  • Thalada
    replied
    Thank you

    Leave a comment:


  • Lynne
    replied
    What type of profile field did you create?

    Have you read this - How To Add A Profile Field To The Postbit

    Leave a comment:


  • ashy
    replied
    Thanks for the reply, in this case, if i changed the field content, for example added another option fish, i have to change from my plugin as well
    how is the vbulletin link the number to the text? i did a print_r($vbulletin) output, but i can't see the select text(cat, dog etc) anywhere. it displays ok for vbulletin build-in profile editor





    Originally posted by Lynne View Post
    What you probably want to do is in your plugin, define the text you want to display. Something like:

    PHP Code:
    if ($vbulletin->userinfo[field9] == '1'$postcode 'Cat';
    else if (
    $vbulletin->userinfo[field9] == '2'$postcode 'Dog';
    else if (
    $vbulletin->userinfo[field9] == '0'$postcode '';

    vB_Template::preRegister('navbar',array('postcode' => $postcode)); 

    Leave a comment:


  • Lynne
    replied
    What you probably want to do is in your plugin, define the text you want to display. Something like:

    PHP Code:
    if ($vbulletin->userinfo[field9] == '1'$postcode 'Cat';
    else if (
    $vbulletin->userinfo[field9] == '2'$postcode 'Dog';
    else if (
    $vbulletin->userinfo[field9] == '0'$postcode '';

    vB_Template::preRegister('navbar',array('postcode' => $postcode)); 

    Leave a comment:

widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X