Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 21 replies - 1 through 21 (of 21 total)

  • alpha2
    Participant

    @neoseeyou

    I solved myself; i give solution here if someone needs

    <?php
    global $bp;
    get_currentuserinfo(); 
    $user_data = get_userdata($user_ID);
    $joined= date("F Y", strtotime($user_data ->user_registered));
    echo '' . $joined. '';
    ?>

    alpha2
    Participant

    @neoseeyou

    each user can create new post of course


    alpha2
    Participant

    @neoseeyou

    Hello @shanebp and thank you for your quick answer. Do you know specific plugins that can be suit my needs? That would be great!

    Thank you


    alpha2
    Participant

    @neoseeyou

    I tried to apply my code in this template just before <?php bp_activity_content_body(); ?> but unfortunatly it doesn’t render anything. I am not a dev so my knowledges are not enaugh to accomplish this task.


    alpha2
    Participant

    @neoseeyou

    thank you Henry i will have a try


    alpha2
    Participant

    @neoseeyou

    bump any help plz?


    alpha2
    Participant

    @neoseeyou

    of course! as simple as that. Thank you @henrywright !


    alpha2
    Participant

    @neoseeyou

    Yes it is. But rather than using a plugin (for this project i am nearly at 53 active plugins…too much) maybe its better to use a function.
    i use this thread to ask you another question, some users (registered before i applied this plugin) named their account with a period: john.doe . Actually it’s not a big deal because buddypress (or wordpress natively) transform this dot into hyphen in each link.

    On one specific page template, I have special function i created with the help of a dev to display all users by a custom taxonomy (ranks)

    Only mater is that every hyperlink that link to account like john.doe are display like this http://www.website.com/members/john.doe and not http://www.website.com/members/john-doe

    I search into the code and found this:

    <div><?php $user = get_user_by('id', $gold ); ?><a href="<?php echo site_url();?>/members/<?php echo $user->user_login;?>/buddyblog/"><?php echo bp_core_fetch_avatar( array( 'item_id' => $gold, 'type' => 'full' ) ); ?></a><a href="<?php echo site_url();?>/members/<?php echo $user->user_login;?>/buddyblog/"><?php echo $user->user_login; ?></a>Performances: <?php echo count_user_posts( $gold ); ?></div>

    I must change how is display the username.

    Thank you for your time and your help!


    alpha2
    Participant

    @neoseeyou

    i didn’t try the answer in that link because i find the previous plugin before i view your answer.

    Maybe it’s better to use a simple function that a plugin 😉


    alpha2
    Participant

    @neoseeyou

    Thank you @shanebp for this link.

    So for few users who enter as username their email address, what can i do?

    Thank


    alpha2
    Participant

    @neoseeyou

    I have found an answer for my second question: i use the plugin restrict usernames. Work great


    alpha2
    Participant

    @neoseeyou

    of course i am an idiot ahah

    add_action('wp_enqueue_scripts', 'cutting',100);
    
    function cutting() {
    if(bp_is_change_avatar()){
       wp_register_style( 'connected4', get_stylesheet_directory_uri() . '/connected4.css' );
        wp_enqueue_style( 'connected4' );
    }
    }

    Thank you


    alpha2
    Participant

    @neoseeyou

    i try with different combinaisons:

    !== false
    ===true (work but too much, it apply this css to /profile/modification or profile too)


    alpha2
    Participant

    @neoseeyou

    Hello and thank you

    Still not working!

    add_action('wp_enqueue_scripts', 'cutting',100);
    
    function cutting() {
    $uri = $_SERVER['REQUEST_URI'];
    if(strpos($uri,'members/'. bp_is_user_change_avatar() .'profile/change-avatar') !== false){
       wp_register_style( 'connected4', get_stylesheet_directory_uri() . '/connected4.css' );
        wp_enqueue_style( 'connected4' );
    }
    }

    or

    add_action(‘wp_enqueue_scripts’, ‘cutting’,100);

    function cutting() {
    $uri = $_SERVER[‘REQUEST_URI’];
    if(strpos($uri,’members/’. bp_is_change_avatar() .’profile/change-avatar’) !== false){
    wp_register_style( ‘connected4’, get_stylesheet_directory_uri() . ‘/connected4.css’ );
    wp_enqueue_style( ‘connected4’ );
    }
    }


    alpha2
    Participant

    @neoseeyou

    Wow thank you for your fast answer Sir.

    My php skills are too light 😉

    Thank you


    alpha2
    Participant

    @neoseeyou

    Thank you so much Danbp

    Work like a charm


    alpha2
    Participant

    @neoseeyou

    I tried to apply this inside the single.php file

    <?php if ( function_exists( ‘bp_add_friend_button’ ) ) : ?>
    <?php bp_add_friend_button() ?>
    <?php endif; ?>

    But nothing appears. I tried many code without luck

    If someone can help me? Thank you


    alpha2
    Participant

    @neoseeyou

    sorry to bump but i am really stuck with these.

    Many thanks


    alpha2
    Participant

    @neoseeyou

    I just found this solution my self

    
    <?php
        $user_id = bp_get_member_user_id(); 
        $query = new WP_Query( 'author=' . $user_id );
    
     echo count_user_posts($user_id,'post');
    
    //reset for next member
    wp_reset_postdata();
    ?>

    But yours is really better 😉

    Thank you Henry


    alpha2
    Participant

    @neoseeyou

    Yea ok you mean to override the proper template file


    alpha2
    Participant

    @neoseeyou

    Hello and thank you for fast answer 😉 I will have a look at this link for sure.

    Unfortunatly i am not that good with php, so i hope i will be able to create the function myself

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