Spudnic (@spudnic072)

Forum Replies Created

Viewing 18 replies - 1 through 18 (of 18 total)
  • In reply to: HTML tags not working

    @spudnic072

    Participant

    @spudnic072

    Participant

    `
    $user_id = get_userdata( bbp_get_reply_author_id( bbp_get_reply_id() ) ); // Return the get_userdata information
    $user = new WP_User( $user_id );
    if ( !empty( $user->roles ) && is_array( $user->roles ) ) {
    $roles = $user->roles;
    echo $roles[0]; //echos only the first role index of 0 of array $roles;
    /* Echos all roles
    foreach ( $user->roles as $role )
    echo $role.””; */
    }
    `

    Accomplished Display the Replies author’s role with the Above ^. Seems like alot of code for such a simple thing but it works :D. Thanks.

    @spudnic072

    Participant

    Thanks again, ill look through the code some.

    @spudnic072

    Participant

    `$id = get_comment(bbp_get_reply_id(), OBJECT)->user_id;
    echo $id;`

    Doesn’t seem to want to work either :/

    @spudnic072

    Participant

    on an unrelated topic;

    i have `bbp_get_reply_id()`, which is getting me the id of the topic reply, and im trying to use it to get the id of the author so that i can print any of the authors meta data, role, name, url, etc.

    Does bbPress have a method for getting the author id? Sofar using
    `
    $comment = get_comment( bbp_get_reply_id() );
    $comment_author_id = $comment->user_id;
    `

    returns me my favorite:

    Notice: Trying to get property of non-object in C:\xampp\htdocs\wordpress\wp-content\themes\WoW_Public_Vent_Theme\functions.php on line 275

    @spudnic072

    Participant

    Doing the above ^ didnt seem to change anything?

    I did however change

    `bbp_reply_author_link( array( ‘sep’ => ”, ‘show_role’ => false ) ); `

    from true to false. It appears to accomplish what i want it to, but wasn’t sure if it would mess anything else up that relied on it?

    Is this the proper way to hide the users forum role?

    Thanks.

    @spudnic072

    Participant

    Your the man. Works beautifully.

    Surprised this isn’t standard option ive seen alot of questions on it.

    If i continue to use bbPress i might make alittle “customization” faq and will def include this.

    Thanks again you’ve been supremely helpful.

    @spudnic072

    Participant

    That got me to:

    http://localhost/wordpress/author/

    Still missing the user name at the end of the url

    @spudnic072

    Participant
    add_filter( 'bbp_get_user_profile_url', 'my_custom_author_link' );
    function my_custom_author_link( $user_id ){
    $author_info = get_userdata( 1 );
    $author_name = $author_info->user_nicename; 
    return get_author_posts_url( false, $author_name );
    }

    is working properly.

    but when i change the input of
    $author_info = get_userdata( 1 );
    to
    $author_info = get_userdata( $user_id );

    I get:

    Notice: Trying to get property of non-object in C:\xampp\htdocs\wordpress\wp-content\themes\WoW_Public_Vent_Theme\functions.php on line 274

    and it does not work :(;

    Soo close.

    @spudnic072

    Participant

    I Tried:

    add_filter( 'bbp_get_user_profile_url', 'my_custom_author_link' );
    function my_custom_author_link( $user_id ){
        return get_author_posts_url(false, $user_id);
    }

    get_author_link(); appears to have been depreciated.

    So using:

    add_filter( 'bbp_get_user_profile_url', 'my_custom_author_link' );
    function my_custom_author_link( $user_id ){
    return get_author_posts_url( $user_id, false );
    }

    I am able to get to:

    http://localhost/wordpress/author/

    which is sooo close to what i need.

    I need it to return http://localhost/wordpress/author/$user_name

    @spudnic072

    Participant

    Thank you for your speedy reply.

    This is working great for adding additional information.

    But how can i edit what is already displayed in that field by default? IE; totally remove the author role and even author name so i can display custom links there.

    you may have already touched on this in my other thread, i will need to re-read it more carefully.

    @spudnic072

    Participant

    I have seen some discussion on this, but in the thread they talk about editing the post.php file, but i dont see how that would effect bbPress, and those topics are from around 3 years ago.

    @spudnic072

    Participant

    Seeing as i am novice in my theme development skills, i had included Enque_Scripts in my functions.php. I was not aware that wp_footer(); included the standard jQuery.

    After using i believe it was deQue_Scripts() or unQue_Scripts() in my funciton.php i realized i could just remove the Enque_Scripts() and let the wp_footer() do it.

    So lesson learned.

    Thanks.

    @spudnic072

    Participant

    Changing Permalinks to post-name seemed to have fixed it.

    @spudnic072

    Participant

    few people having this issue, seems nobody wants to help.

    @spudnic072

    Participant

    When i remove the 404.php template, after you submit a reply you are now redirected to the index.

    @spudnic072

    Participant

    accidental double post.

    @spudnic072

    Participant

    This also occurs when I have the Twenty Twelve Theme enabled.

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