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

Reply
 
Thread Tools Display Modes
  #1  
Old 06-25-2009, 12:40 AM
Glenn379's Avatar
Glenn379 Glenn379 is offline
 
Join Date: Aug 2002
Location: San Francisco, California
Posts: 111
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Multiple-Selection Checkbox in Postbit?

Hey everyone!
I've been editing my postbit to use custom user profile fields. I have one field that I want to be in the postbit that is a Multiple-Selection Checkbox type. Each person is to choose 3 options out of the 10 to be displayed. I'm trying to figure out a way to show one with a line break in between the next so that all three are neat and clean.

Originally I figured they would show up fine but crammed together. For whatever reason when I chose some options as a test it gave me the number of the options. For example if I chose the first, third, and fifth options it would read 135. I'd like it to display the entered text with those line breaks.

Does anyone have any idea how to do this? Thanks guys!

EDIT: I am also curious if anyone knows how to display images instead of text as options in the postbit while still having the text option in the selection process. For example, I want to choose a profession that's listed. I select cook from the dropdown in the user cp. Then in the postbit it shows cook.gif or whatever it may be. Any ideas? Thanks
Reply With Quote
  #2  
Old 06-25-2009, 02:03 AM
Wired1's Avatar
Wired1 Wired1 is offline
 
Join Date: Nov 2003
Location: Orlando, FL, USA
Posts: 1,361
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Multiple mods here (including mine) allow you to place the results of a multi-selection profile field into the postbit, and as you saw, it doesn't work. It's because the data is saved differently in this case.

It's possible if you know that a multi-selection profile field is specifically being called. You just have to use the data pulled from the standard profile field call (e.g. the result is 135) into a database call that gets the correct data.

As for your edit question, something like this may work:

Code:
<if $post['field5'] == "cook">
   <img src="cook.gif" />
</if>
Reply With Quote
  #3  
Old 06-26-2009, 04:01 AM
Glenn379's Avatar
Glenn379 Glenn379 is offline
 
Join Date: Aug 2002
Location: San Francisco, California
Posts: 111
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ccan you give me a link to the hack/addon you're talking about please? I looked through your hacks but didn't see one for that specifically. Thank you again!

--------------- Added [DATE]1245994022[/DATE] at [TIME]1245994022[/TIME] ---------------

Code:
<if $post['field5'] == "cook">
   <img src="cook.gif" />
</if>
[/QUOTE]

When I try the following based on your advice I get an error

Code:
  <tr> 
    <td><if condition="$post['field17']"></td>
    <td><div><B>Professions:</B> <if $post['field17'] == "Cook">
   <img src="http://fainte.com/forums/images/lotro/guardian.png" />
</if></div>
	
      </if></td>
  </tr>
Any ideas? I'm getting the following error:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /mnt/w0209/d36/s22/b029b64a/www/fainte.com/forums/includes/adminfunctions_template.php(3596) : eval()'d code on line 196

line 196 is the line where it says cook
Reply With Quote
  #4  
Old 06-26-2009, 07:23 AM
Wired1's Avatar
Wired1 Wired1 is offline
 
Join Date: Nov 2003
Location: Orlando, FL, USA
Posts: 1,361
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Dropdown mod.

Yeah, looks like I had the semantics wrong on the if statement I suggested. Try this:


Code:
<tr> 
   <if condition="$post['field17']">
      <td><div><B>Professions:</B>
      <if condition="$post['field17'] == 'Cook'">
         <img src="http://fainte.com/forums/images/lotro/guardian.png" />
      </if>
      </div></td>
   </if>
</tr>
Reply With Quote
  #5  
Old 06-26-2009, 07:35 AM
Glenn379's Avatar
Glenn379 Glenn379 is offline
 
Join Date: Aug 2002
Location: San Francisco, California
Posts: 111
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
<tr> 
   <if condition="$post['field17']">
      <td><div><B>Professions:</B>
      <if condition="$post['field17'] == 'Cook'">
         <img src="http://fainte.com/forums/images/lotro/guardian.png" />
      </if>
      </div></td>
   </if>
</tr>
Thanks for the response!

The only thing that changed is that now Professions: shows up but still no picture
Reply With Quote
  #6  
Old 06-26-2009, 07:47 AM
Wired1's Avatar
Wired1 Wired1 is offline
 
Join Date: Nov 2003
Location: Orlando, FL, USA
Posts: 1,361
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

May need to take the single quotes off of around Cook. Not 100% sure. Also, needs an alt tag (e.g. alt="Cook") after the src snippet.

Code:
<img src="http://fainte.com/forums/images/lotro/guardian.png" alt="Cook" />
http://www.w3schools.com/tags/tag_IMG.asp
Reply With Quote
  #7  
Old 06-26-2009, 08:02 AM
Glenn379's Avatar
Glenn379 Glenn379 is offline
 
Join Date: Aug 2002
Location: San Francisco, California
Posts: 111
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[QUOTE=Wired1;1837648]May need to take the single quotes off of around Cook. Not 100% sure. Also, needs an alt tag (e.g. alt="Cook") after the src snippet.

I've tried with single quotes and without. I've used an alt as well. Still no luck. Even without the image it doesn't work though. If you replace the image with a word like Cook then it doesn't work either. I think it may be something to do with the line above that. I was thinking I wonder if there is a way to say a specific option.

The link to edit an option appears as

Code:
http://fainte.com/forums/admincp/profilefield.php?do=renamecheckbox&profilefieldid=17&id=1
Maybe something involving profilefieldid=17&id=1 or id=1? I'm still unsure but I haven't been able to figure any of this out with text or without.
Reply With Quote
  #8  
Old 06-26-2009, 07:43 PM
Wired1's Avatar
Wired1 Wired1 is offline
 
Join Date: Nov 2003
Location: Orlando, FL, USA
Posts: 1,361
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well the code will only work if the profile field contains that word. As I stated above, multiple selection fields don't contain it. It will contain 135 or whatever. You'd have to set the conditional for what's really in the field instead of Cook.
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 09:18 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.07131 seconds
  • Memory Usage 2,242KB
  • 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
  • (7)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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