vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Multiple-Selection Checkbox in Postbit? (https://vborg.vbsupport.ru/showthread.php?t=217064)

Glenn379 06-25-2009 12:40 AM

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! :D

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

Wired1 06-25-2009 02:03 AM

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>


Glenn379 06-26-2009 04:01 AM

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

Wired1 06-26-2009 07:23 AM

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>


Glenn379 06-26-2009 07:35 AM

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! :D

The only thing that changed is that now Professions: shows up but still no picture

Wired1 06-26-2009 07:47 AM

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

Glenn379 06-26-2009 08:02 AM

[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. :(

Wired1 06-26-2009 07:43 PM

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.


All times are GMT. The time now is 01:06 AM.

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.01135 seconds
  • Memory Usage 1,736KB
  • 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
  • (7)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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