• Resolved jaaaay

    (@jaaaay)


    Hi Robin,

    I hope you’re still supporting this ??

    I found a problem with the field display when a multiple selection option is used (checkboxes, multi select box): it looks like it spits out the IDs or something along with the item. For example, if I select two options for a field, I get something like a:2:{i:0;s:9:”my_option1″;i:1;s:11:”my_option2″;} instead of “my_option1, my_option2” under the user name in bbPress. Looks fine for single selection options (radio buttons, drop down select). Makes no difference whether or not labels are shown.

    Can this be fixed?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter jaaaay

    (@jaaaay)

    Did some searching and fixed it myself: in the plugin’s display.php, replace

    
    		//show item1 if activated show on topics/replies
    		if ($rbi_options['itemshow_item1'] == true) {
    			echo '<li>' ;
    			$label1 =  $rbi_options['item1_label'] ;
    			//show label if required
    				if($rbi_options['labelshow_item1'] == true) {
    				echo $label1." : " ;
    				}
    			$xpid=$wpdb->get_var("select id from $xfields where name = '$label1'") ;
    			$xpdata2= $wpdb->get_var("select VALUE from $xdata where field_id  = '$xpid' AND user_id = '$user_id' ") ;
    			echo $xpdata2;
    			echo '</li>' ;	
    			
    		}

    with

    		//show item1 if activated show on topics/replies
    		if ($rbi_options['itemshow_item1'] == true) {
    			echo '<li>' ;
    			$label1 =  $rbi_options['item1_label'] ;
    			//show label if required
    				if($rbi_options['labelshow_item1'] == true) {
    				echo $label1." : " ;
    				}
    			$xpid=$wpdb->get_var("select id from $xfields where name = '$label1'") ;
    			$xpdata2  = bp_get_member_profile_data( array( 'field'=>$label1,'user_id' => $user_id ) );
     			echo $xpdata2 ;
    			echo '</li>' ;	
    			
    		}

    repeat for remaining three fields. I’m sure this is hacky, but everything looks perfect! ??

    Thank you @jaaaay, that helped me a lot ??

    Thread Starter jaaaay

    (@jaaaay)

    Awesome! Great this still works for you @divvy ??

    bulld_digital

    (@eskamediawork)

    Exactly what I was looking for, I had the same problem!

    It even fixed another problem I was having: the labels showing the labels in plural instead of singular.

    @jaaaay you are a livesaver.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Multi selection field display broken in bbPress’ is closed to new replies.