Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 1 through 25 (of 41 total)

  • chatty24
    Participant

    @chatty24

    @jessiewordpress

    If the code is not working for you then you can try the following plugin

    WP Change Default Email —-> https://wordpress.org/plugins/wp-change-default-email/

    Hope it helps 😀


    chatty24
    Participant

    @chatty24

    @henrywright , @bphelp

    Thanks for the replies. I would check the solution.
    And do you guys know anyway to remove my activities from the site-wide activities?


    chatty24
    Participant

    @chatty24

    BUMP!


    chatty24
    Participant

    @chatty24

    @danbp

    Thanks for the reply but when I am adding this code to functions.php file the image upload plugin I am using is not uploading the pictures. 🙁


    chatty24
    Participant

    @chatty24

    @henrywright

    That works exactly the way I wanted. Thank a lot


    chatty24
    Participant

    @chatty24

    Try to add it to your theme’s function.php file instead of bp-custom.php


    chatty24
    Participant

    @chatty24

    Try This Code :

    add_action( 'wp', 'custom_lockdown_redirect', 3 );
    function custom_lockdown_redirect(){
    global $wp;
    	if (!is_user_logged_in()){
    	if ( bp_is_activation_page()
    		|| bp_is_register_page()
    		|| ( in_array( $GLOBALS['pagenow'], array( '/login' )))
    		)
    	 return;
    		bp_core_redirect(get_option('http://yoursite.com') . "/login");
    		exit;
    		}
    	}

    Make sure the you change /login with your login link.

    Add it to your theme’s function.php file


    chatty24
    Participant

    @chatty24

    The only plugin I know is this one —> BPDEV Username Availability Checker


    chatty24
    Participant

    @chatty24

    In 1st point, I am talking about the web browser of a mobile phone… missed it by mistake.

    Thanks


    chatty24
    Participant

    @chatty24

    @sbrajesh

    Could that also happen in real time (without refreshing the page)?

    Thanks


    chatty24
    Participant

    @chatty24

    @sbrajesh

    WOW!!!

    Thanks a lot Brajesh!
    You solved my problem and this is exactly what I wanted.

    Thanks a lot. I really appreciate your help.
    Have a nice day!


    chatty24
    Participant

    @chatty24

    And also it is showing notification of the users of whose profiles I visit. I just want the notification of the currently logged in user…

    Thanks


    chatty24
    Participant

    @chatty24

    @danbp
    I have edited the code a bit and now it is getting displayed on all the pages as I wanted but, How can I hide the modified title when the notification count is 0. By current code is below –

    function bpfr_add_notification_to_page_title( $title, $original_title, $sep, $seplocation  ) {
    	global $bp;
    	if( bp_is_user() && ! bp_get_member_user_id() ) {
            $user_id = 'displayed: '. bp_displayed_user_id();
        } else {
            $user_id = 'get_member_user: '. bp_get_member_user_id();
        }
    
    	if (bp_notifications_get_unread_notification_count( $user_id ) ) {
    
    		$counter = 0;
    			for ( $i = 0; $i < count($notifications); $i++ ) {
    				echo $notifications[$i];
    			$counter++;
    			}	
    
    	
    		
    			$title = "You Have " . bp_notifications_get_unread_notification_count() . " New Notification(s) - ";
        
    		return $title;
    	}
    }
    add_filter( 'wp_title', 'bpfr_add_notification_to_page_title', 9, 4 );
    

    Thanks


    chatty24
    Participant

    @chatty24

    @danbp

    And how to hide the notification count from title bar when it is 0.

    Thanks


    chatty24
    Participant

    @chatty24

    @danbp

    The code works but only on profile pages. Can this come on each page including the home page…

    Thanks a lot for your help! 😀


    chatty24
    Participant

    @chatty24

    @henrywright
    No.. You can look at the screenshot below


    chatty24
    Participant

    @chatty24

    @henrywright

    I tried using the below code but it is returning the value to zero too 🙁

    echo bp_notifications_get_unread_notification_count( bp_loggedin_user_id() );


    chatty24
    Participant

    @chatty24

    @henrywright

    Opps… I did not call it.

    But, how do I get it?


    chatty24
    Participant

    @chatty24

    @henrywright

    Thanks for the reply but

    I used the below code to print the notification count on my page to match it with the notification count which is shown by wordpress and I noticed that the below code returns the value to zero no matter what ever the original notification count is.

    
    echo bp_notifications_get_unread_notification_count( $user_id );

    and yes I need unread notification count.


    chatty24
    Participant

    @chatty24

    @danbp

    count($notifications) is returning the value to ‘1’ no matter whatever the notification count is…


    chatty24
    Participant

    @chatty24

    @danbp

    Thanks for the answer but, what is the notification count in this code? I mean, what would be the term that I would use to compare with ‘0’.

    if ( what_do_I_keep_here >0) {
    
    // Some action here
    
    }

    Thanks


    chatty24
    Participant

    @chatty24

    I think the word ‘Title bar’ might be confusing. By, title bar I mean, ‘Title of the page’ the one that gets displayed on the title bar of the web browser.

    Thanks


    chatty24
    Participant

    @chatty24

    @henrywright

    Just ignore the other question that I asked. I got it figured out.

    Thank you so much for your help. Have a great weekend.

    Thanks! 😀


    chatty24
    Participant

    @chatty24

    @henrywright
    By single link I mean. Like, example.com/me/ redirects to the username of the person who is logged in. Now, I can just put this example.com/me/ link anywhere and it would redirect to the respective username of the people. This is what I mean by single link….


    chatty24
    Participant

    @chatty24

    @henrywright

    I edited the code and now it is working as it should be. So, the final code is –

    function my_redirect() {
        if ( is_page( 'me' ) && is_user_logged_in() )
            bp_core_redirect( bp_loggedin_user_domain() );
    }
    add_action( 'wp', 'my_redirect' );

    I have replaced
    add_action( 'template_redirect', 'my_redirect' );

    with

    add_action( 'wp', 'my_redirect' );

    Thanks for your help, @henrywright & @shanebp

    Just wanted to ask another question. If I want a single link to redirect to other things like notifications, then all I need is to do is this right,

    bp_core_redirect( bp_loggedin_user_domain() . '/notifications' );

    Thanks!

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