Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 1 through 25 (of 41 total)
  • @amkh

    Participant

    I tied to combine the two codes into one. But this also didnt worked. Please see my code below:-

    /* Display Members directory based on gender */
    add_filter ('bp_ajax_querystring', 'modify_members_loop', 20, 2);
    function modify_members_loop ($qs=false, $object=false)
    {
    	global $wpdb;
    	if ($object != 'members')  return $qs;
    
    	// figure out if the logged-in user is male or female
    	$gender = xprofile_get_field_data (9, bp_loggedin_user_id ());
    
    	if ($gender == 'Male')
    		$query = "SELECT user_id FROM {$wpdb->prefix}bp_xprofile_data WHERE field_id = 9 AND value = 'Female'";
    	else
    		$query = "SELECT user_id FROM {$wpdb->prefix}bp_xprofile_data WHERE field_id = 9 AND value = 'Male'";
    
    	$custom_ids = $wpdb->get_col ($query);
    	$user_ids = array('40','39','37','35'); 
        $excluded_user=  join(',', $user_ids);
    	$args = wp_parse_args ($qs);
    	$args['include'] = implode (',', $custom_ids);
        $args['exclude'] = implode (',', $excluded_user);
    	$qs = build_query ($args);
    
    	return $qs;
    }
    

    @amkh

    Participant

    I tried with both 9 and then 9999. In both cases it still does not work.

    @amkh

    Participant

    I have this working code to display members directory gender specific. For males a directory of females and vice versa. Maybe this code is the one causing your code not to work?

    @amkh

    Participant

    is it because of above code?. hence it is not working?

    @amkh

    Participant

    @amkh

    Participant

    I am not able to reply to this post with my code..i keep getting ERROR: Your reply cannot be created at this time.

    @amkh

    Participant

    Thank you very much. I added the snippet mentioned in the snippets plugin. However the profiles are still seen in membership directory.

    function ps_exclude_current_user( $qs = false, $object = false ) {
    
     if( !is_user_logged_in() )
         return $qs;
     $user_ids = array('40','39','37','35');
     $excluded_user=  join(',', $user_ids);
      
     if( $object !='members' )
    	return $qs;
      
     $args=wp_parse_args($qs);
      
     if( !empty( $args[ 'user_id' ] ) )
    	return $qs;
      
     if( !empty( $args['exclude'] ) )
    	$args['exclude'] = $args['exclude'] .','. $excluded_user;
     else
    	$args['exclude'] = $excluded_user;
      
    	$qs = build_query( $args );
      
     return $qs;
      
    }
    add_action('bp_ajax_querystring','ps_exclude_current_user', 21, 2 );

    @amkh

    Participant

    It does not work. The message still appears.

    @amkh

    Participant

    I think you didn’t got me. See the plugin has one message box under the section I mentioned above. The message in the box shows on activation page as well as on profile page. My need was this message should only appear on profile page and not on activation page. If I hit space and remove the message in the box then it will not appear on profile page as well. I don’t want this to happen as I want this message to appear on profile page.

    @amkh

    Participant

    True dear Prashant.. But additionally the message from this section(“Activate & Profile Alert Message:”) of plugin is also shown on activation page. And also the same message is shown on Profile page also till the user is moderated. Hence I do not want this message to appear on Activation page.

    @amkh

    Participant

    Thank you very much. Just a question :- I do not want the message in section “Activate & Profile Alert Message:” of plugin to be displayed on activation page. But I want it to be displayed on profile page. How can I achieve this?

    @amkh

    Participant

    I added your code. When I register I still get this message after registering :-

    You have successfully created your account! To begin using this site you will need to activate your account via the email we have just sent to your address.

    The expected displayed message was the above plugin instead. Also the email is not received. Probably more needs to be done.

    I tried disabling above code. Then I received the activation email. But the content of email is confusing. Just above the Activation key is written “Please prove a valid activation key” This confuses members and they try to wonder if the key mentioned in the activation key textbox is valid or not.

    @amkh

    Participant

    Thank you very much. I tried this plugin but still the activation email contains the activation code that we have to click which opens activation page and i need to click activate. The only change I noticed is this activation page now contains additional message of this plugin

    @amkh

    Participant

    Thank you very much. I tried this plugin but still the activation email is sent. Is the email activation unavoidable with this plugin too?

    @amkh

    Participant

    Thank you very much for your reply. With my little knowledge of coding can you help me out with this code for TinyMCE?

    @amkh

    Participant

    Thank you very much dear Prashant for pointing out the mistake. However I noticed the code works for the “text” field whereas for “multiline text” field it does not work. Kindly check the screenshots for multiline text field and the screenshot of the code.

    https://prnt.sc/l7xg0k
    https://prnt.sc/l7xgf8

    @amkh

    Participant

    Kindly check screenshots below

    https://prnt.sc/l6odfb

    https://prnt.sc/l6od8u

    @amkh

    Participant

    Hi Prashant
    I added the code in the mentioned plugin. I tested by editing that field. I was able to add numbers 1 @ both in this field

    @amkh

    Participant

    This is my exact code that I am using it

    jQuery(document).ready(function(){
          jQuery('.profile-edit #field_2372').bind('keydown',function (event) {
                var regex = new RegExp("^[0-9.@]+$");
                var key = event.key;
                if (regex.test(key)) {
                    event.preventDefault();
                    return false;
                }
          });
    });

    @amkh

    Participant

    I tried with one text field but keeps giving me the error mentioned below. Though I do not see any problem in your code.

    Don't Panic
    The code snippet you are trying to save produced a fatal error on line 2:
    
    syntax error, unexpected ')', expecting variable (T_VARIABLE)
    The previous version of the snippet is unchanged, and the rest of this site should be functioning normally as before.
    
    Please use the back button in your browser to return to the previous page and try to fix the code error. If you prefer, you can close this page and discard the changes you just made. No changes will be made to this site.

    @amkh

    Participant

    Also I do not get about #input . Can you please elaborate more?

    @amkh

    Participant

    Thank you for your quick response. Is this code valid for “Legacy” template?

    @amkh

    Participant

    It worked perfectly. Thanks

    @amkh

    Participant

    I checked this out already. This plugin does not map “Date-of-Birth” and “Gender” fields of Buddypress.

    @amkh

    Participant

    Hi
    I would prefer to use your code instead of modifying the template. The reason is I do not want the exit button to be displayed on 2nd and 3rd profile group tabs. While I want it to be shown from profile group 4 onward. I have more than 6 profile group tabs now. Request you to kindly re-write the code for legacy template and taking above point into consideration that the button should only showup after group 4.
    Thank you very much in advance.

Viewing 25 replies - 1 through 25 (of 41 total)
Skip to toolbar