Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 07-20-2008, 04:05 PM
youradhere4222 youradhere4222 is offline
 
Join Date: Sep 2007
Location: Houston, TX
Posts: 234
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Profile Field in Postbit - Displaying as #

Hello -

I included code in my postbit template to display a profile field in the postbit.

Code:
<div class="smallfont">
                    <if condition="$post['joindate']"><div>$vbphrase[join_date]: $post[joindate]</div></if>
                    <if condition="$post['field2']"><div>$vbphrase[location_perm]: $post[field2]</div></if>
                    <if condition="$post['age']"><div>$vbphrase[age]: $post[age]</div></if>
                    <div>
                        $vbphrase[posts]: $post[posts]
                    </div>
                                        <if condition="$post[field7]"><div class="smallfont">Affiliation: $post[field7]</div></if>
                    $template_hook[postbit_userinfo_right_after_posts]
                    <if condition="$show['infraction']"><div>$vbphrase[infractions]:
The bold, blue text is the text I added in. I'm also using the postbit that vbulletin.com is using, so I'm editing the postbit template, not the postbit_legacy template.

It is listed as field7, so I'm guessing I have the field right. It's a multiple-selection menu with 24 options, and a maximum of one can be selected. It's not private, it's not searchable but it does display on the Member's list.

The problem I'm experiencing is that the text Affiliation: shows up fine, but the text displayed isn't what I want. I'm looking for words - as those are the selections, but instead I'm getting numbers.

At first I selected the second option, and it displayed as a 2. Then I selected the last option, and it's displaying as 8388608.

Does anyone know what the problem could be?
Reply With Quote
  #2  
Old 07-20-2008, 05:52 PM
SLR722 SLR722 is offline
 
Join Date: Jul 2008
Location: 1
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What are the options here? I recently post on my blog. A modification for vBulletin Country Flags and you can see in my install how I have done it.

PHP Code:
<!-- K4Z.ORG Country Flags Start -->
<if 
condition="$post['field5']">
    
Country: <img src="$stylevar[imgdir_button]/flags/$post[field5].gif" alt="Users Flag!" border="" />
</if>
<!--
// K4Z.ORG Country Flags End --> 
Quote:
Title: Country Flag
Description:Add a country flag to your profile
Profile Field Category: (Uncategorized)
Options: Open the list.txt and copy and paste the whole file in here
Set Default: None
Display Order: 5 (Or whatever else is there)
Field Required: Yes, at registration and profile updating
Field Editable by User: Yes
Private Field: No
Field Searchable: No
Show on Members List: Yes
Allow user to input their own value for this option: No
Max length of allowed user input: SKIP
Field Length: SKIP
Regular Expression: SKIP
Display Page: Edit Your Details
I hope this helps. You can also try reading about the operator bits which are generated in multi choice with number options, check it out here..


How To Add A Profile Field To The Postbit

Reply With Quote
  #3  
Old 07-20-2008, 07:16 PM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
It's a multiple-selection menu with 24 options, and a maximum of one can be selected.
Doesn't limiting it to one select, defeat the purpose of a multiple selection option?

See the 2nd post of the link given above (How To Add A Profile Field To The Postbit)
Reply With Quote
  #4  
Old 07-21-2008, 04:07 AM
youradhere4222 youradhere4222 is offline
 
Join Date: Sep 2007
Location: Houston, TX
Posts: 234
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Opserty View Post
Doesn't limiting it to one select, defeat the purpose of a multiple selection option?

See the 2nd post of the link given above (How To Add A Profile Field To The Postbit)
Ah - thank you.

That's way to difficult to understand; I guess I'll allow users to input their own choices.
Reply With Quote
  #5  
Old 07-21-2008, 07:24 PM
SLR722 SLR722 is offline
 
Join Date: Jul 2008
Location: 1
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You do not need to follow the binary operators. Mine works the same way and does not follow the operator erand..
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 11:23 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04646 seconds
  • Memory Usage 2,210KB
  • Queries Executed 13 (?)
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
  • (1)bbcode_code
  • (1)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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_postinfo_query
  • fetch_postinfo
  • 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