koendb (@koendb)

Forum Replies Created

Viewing 9 replies - 26 through 34 (of 34 total)

  • koendb
    Participant

    @koendb

    Add a filter that removes the links.

    Copy the code below into your function.php file: (you might need to add <?php at the start and ?> at the end)

    add_filter( ‘bbp_get_author_link’, ‘remove_author_links’, 10, 2);
    add_filter( ‘bbp_get_reply_author_link’, ‘remove_author_links’, 10, 2);
    add_filter( ‘bbp_get_topic_author_link’, ‘remove_author_links’, 10, 2);

    function remove_author_links($author_link, $args) {
    $author_link = preg_replace(array(‘{<a[^>]*>}’,'{}’), array(”,”), $author_link);
    return $author_link;
    }


    koendb
    Participant

    @koendb

    Could try this:

    add to template: <?php bbp_forum_id(); ?>
    This way you’ll see the ID-number of a forum when you display it.
    Say, forum 1 has number xxx, 2 yyy, 3 zzz.
    Remove the line above from your template.

    Add this to the sidebar:
    <?php
    $forum = bbp_get_forum_id();
    if ($forum == xxx) {
    echo ‘code forum 1’;
    } else if ($forum == yyy) {
    echo ‘code forum 2’;
    } else if ($forum == zzz) {
    echo ‘code forum 3’;
    }
    ?>

    If you want to add a shortcode, you can do it this way in php.
    echo do_shortcode(‘[shortcode]’);

    Hope this will work 🙂


    koendb
    Participant

    @koendb

    Did you copy the files to YOURTHEME/bbpress?

    Just leave the name of the files the way they used to be.


    koendb
    Participant

    @koendb

    Hi R,

    Removing the search bar is easy; it’s a bbpress option. I don’t know the exact option description, cause my bbpress is in dutch, but should state something like this:
    [forum options] –> [allow to search through all of the forum]

    To remove the forums link the ‘ugly’ way, just add this to your .css file:
    article.forum h2.entry-title a { display: none; }

    I heavily edited all of my templates (both wp and bbpress), so don’t know how to remove the HTML, but I guess you’ll find your code in a content(-xxx).php file.

    The text ‘Forums’ is probably echo’d by the_title()


    koendb
    Participant

    @koendb

    You’re on the bbpress website. Bbpress is forum software, and you need more information about buddypress.

    To answer your questions: yes, it is possible. You can add as many custom fields to user pages as you want. I’ve never done this, so can’t tell you how difficult making a custum template will be though. Try the buddypress forum.


    koendb
    Participant

    @koendb

    Thanks Zearl, need to modify your code slightly to get it to work:
    Had to remove ‘$user_role’

    function my_custom_roles( $role, $user_id ) {
    if( $role == ‘Key Master’ )
    return ‘Site Owner’;
    return $role;
    }
    add_filter( ‘bbp_get_user_display_role’, ‘my_custom_roles’, 10, 3 );


    koendb
    Participant

    @koendb

    Hi JJJ,

    I really appreciate your effort on this forum!

    I understand you can’t spend to much time here, but I guess your answers are still quite complicated for most of the bbpress users, an example would be great. I managed to write this with your hints, and some further googling. Thanks!

    
    	function user_favorites_link( $args ) {
    		$args['favorite'] = 'Maak favoriet';
    		$args['favorited'] = 'geen favoriet meer';
    		return $args;
    	}
     add_filter( 'bbp_after_get_user_favorites_link_parse_args','user_favorites_link'); 

    koendb
    Participant

    @koendb

    
    <?php 
    echo '<br>Replies: '.bbp_get_user_reply_count_raw(bbp_get_reply_author_id());
    echo '<br>Topics: '. bbp_get_user_topic_count_raw(bbp_get_reply_author_id());
    ?>
    

    Output:
    Replies: 3
    Topics: 2

    or use

    
    echo 'Messages: ';
    echo bbp_get_user_reply_count_raw(bbp_get_reply_author_id()) + bbp_get_user_topic_count_raw(bbp_get_reply_author_id()); 
    

    Output:
    Messages 5


    koendb
    Participant

    @koendb

    Apparantly it’s an issue with user capabilities.

    I just started using bbpress myself, but this might help you: https://wordpress.org/support/topic/cheatin-uh-3?replies=5

Viewing 9 replies - 26 through 34 (of 34 total)