Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 9,651 through 9,675 (of 32,519 total)
  • Author
    Search Results
  • #157302
    Robin W
    Moderator

    ok,

    firstly if you just create a page for your forum and use the shortcode

    [bbp-single-forum id=$forum_id] – Display a single forums topics. eg. [bbp-single-forum id=32]

    then just that forum will be displayed.

    to change the breadcrumb display – see

    Layout and functionality – Examples you can use

    #157297
    Robin W
    Moderator

    @stagger-lee

    no problem in your post – and followed it right up until

    I am talking about plain old CSS2/CSS3. No database queries, and you “sell” your product/code.

    I didn’t understand that part – can you explain further !

    #157294
    Robin W
    Moderator

    Is there something that I’m missing?

    possibly.

    but the rest of the codes don’t work.

    This again isn’t really helpful. What do you mean by ‘don’t work’ – nothing shows? something shows but it is not what you want? a picture would be useful.

    I cannot help unless I get detailed problems 🙂

    #157293
    DevilWoIf
    Participant

    Sorry. I mean, I tried the shortcodes in my page but the forums aren’t separating the way I need them to like in my picture. The codes dont seem to work… I added the stat code that shows how many users and that works but the rest of the codes don’t work.

    I put the correct forum ID and everything and they weren’t showing. Is there something that I’m missing?

    #157284
    Stagger Lee
    Participant

    First, for a whole week now I am collecting, testing, verifiyng snippets around the web, most from this forum, and make my own collection. To have it all on one place on localhost. Stop making it, it never ends. 🙂 bbPress is so, so, so manageable and easy to add all functions other forum software have.

    Second, you won hearts of coders and developers. What about WP/bbPress beginners ?
    As you already lose your time coding make some new theme for this support forum. To make it as demo for bbPress, to make it shine and stick out.

    There is a reason why WP holds so much of web, and bbPress is not in this league.
    Dont get me wrong, I read your topic about complicating things and rised support with new functions/options. I am talking about plain old CSS2/CSS3. No database queries, and you “sell” your product/code.

    So, thanks and apologies if I offended someone.

    #157280

    In reply to: first post

    Matthias
    Participant

    I put the whole code in the editor. But I get the same error…

    #157277

    In reply to: Sidebar not Showing

    Robin W
    Moderator
    #157276
    Robin W
    Moderator

    I know nothing about visual composer, but a quick google produces

    http://codecanyon.net/item/bbpress-shortcodes-for-visual-composer/9073637

    which suggests that standard shortcodes don’t work?

    #157273
    Robin W
    Moderator

    my plugin

    bbp additional shortcodes

    has a code

    [display-forum-index forum= ‘2932, 2921′ breadcrumb=’no’ search=’no’] Displays the selected forum indexes

    which lets you organise the order of forums

    #157269

    In reply to: first post

    Matthias
    Participant

    I think we are close, but it gives me an error in this line
    echo “Replies only viewable for logged in users”;

    Parse error: syntax error, unexpected ‘only‘ (T_STRING), expecting ‘,’ or ‘;’
    Seems like it uses the message as code?

    #157266
    webplayer
    Participant

    I am creating a page using visual composer and making it have tabs. One of those tabs is forum, and when I embed a bbpress shortcode in that tab and publish the page. bbpress breaks our of visual composer and takes over the whole page. Any idea for why this is happening?

    #157265

    In reply to: bbPress Moderation

    cyclesha
    Participant

    Probably the same problem, however, I have the code.

    #157257
    Stagger Lee
    Participant

    Old topic but if it can help someone. Code is tested and still works, just formatting of code on this forum is wrong.

    add_filter('bbp_current_author_ip', 'my_anonymize_ip');
    
    function my_anonymize_ip($retval) {
    $retval = '0.0.0.0';
    return $retval;
    }
    #157254
    peter-hamilton
    Participant

    I had no knowledge of PHP when I started a few months ago and made it by cutting and pasting, copying and changing plugin codes, lot of topicsand tutorials read and many sleepless nights.

    Deffo a lot of work but I hope it is paying off.

    I have a dummy account for people who want to see members only functions like a “like” system and lots of profile functions

    username : demo
    password : demo

    Now working on @media queries so it is easier to use on mobiles

    #157251
    Stagger Lee
    Participant

    A lot of work ? Looks very nice. I had to check source code to see if you are cheating. 🙂

    #157250
    Stagger Lee
    Participant

    This seem to works. Or seems to work, I never know difference.

    add_filter('bbp_before_get_reply_author_role_parse_args', 'ntwb_bbpress_reply_css_role' );
    function ntwb_bbpress_reply_css_role() {
    
    	$role = strtolower( bbp_get_user_display_role( bbp_get_reply_author_id( $reply_id ) ) );
    	$args['class']  = 'bbp-author-role bbp-author-role-' . $role;
    	$args['before'] = '';
    	$args['after']  = '';
    
    	return $args;
    }
    
    add_filter('bbp_before_get_topic_author_role_parse_args', 'ntwb_bbpress_topic_css_role' );
    function ntwb_bbpress_topic_css_role() {
    
    	$role = strtolower( bbp_get_user_display_role( bbp_get_topic_author_id( $topic_id ) ) );
    	$args['class']  = 'bbp-author-role bbp-author-role-' . $role;
    	$args['before'] = '';
    	$args['after']  = '';
    
    	return $args;
    }
    #157249
    Robin W
    Moderator

    you could try something like the following in your function file (not tested)

    add_action  ('bbp_template_after_replies_loop', 'bbp_breadcrumb' ); 
    
    #157247

    In reply to: first post

    Matthias
    Participant

    Hm, it shows this error…
    Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'bb_auth_reply_view' not found or invalid function name in ..../blog/wp-includes/plugin.php on line 213

    #157245

    In reply to: first post

    Robin W
    Moderator

    I thought I can do it with a filter in functions.php.

    unfortunately not that easy if you don’t want to show the replies, as the loop-replies file has no easy filter to hook to !

    yes you can put this in your main theme, just be aware itr will get overwritten by any theme update, so keep a good note of what you did, so you can do it again if needed.

    create a directory on your theme called ‘bbpress’
    ie wp-content/%your-theme-name%/bbpress
    find
    wp-content/plugins/bbpress/templates/default/bbpress/loop-replies.php
    Make a copy of this file, and put in in the directory called bbpress that you created above, so you end up with
    wp-content/%your-theme-name%/bbpress/loop-replies.php
    bbPress will now use this template instead of the original

    so that gets the right file

    I wish I had time to write a solution for you for free, but I’m tied up in other work.

    but basically you want to look at lines

    <?php while ( bbp_replies() ) : bbp_the_reply(); ?>
    
    <?php bbp_get_template_part( 'loop', 'single-reply' ); ?>
    
    

    You want to stop it getting the template loop-single-reply if it is after pos 1, so something like

    <?php while ( bbp_replies() ) : bbp_the_reply(); ?>
    
    <?php // if user is not logged in and is the first reply
    if( !is_user_logged_in() && $rep_position =2 ) {
    echo  "Replies only viewable for logged in users";
    }
    // if user is not logged in and is after the forst reply, then don't do naything
    elseif( !is_user_logged_in() && $rep_position >2 ) {
    }
    //otherwise carry on as usual
    else bbp_get_template_part( 'loop', 'single-reply' ); ?>
    
    
    #157243

    In reply to: first post

    Matthias
    Participant

    I thought I can do it with a filter in functions.php.
    Don’t want to setup a child theme for this.
    Is it possible to do it with just adding a additonal bbpress file to my theme?

    My php-code knowledge is just search, copy and paste 😉

    Thanks
    Matthias

    #157242

    In reply to: first post

    Robin W
    Moderator

    the filter is just applying to the reply content.

    You probably want to amend a template – How php code/wordpress knowledgable are you?

    #157239

    In reply to: first post

    Matthias
    Participant

    I found a nice code, that shows the first message in a thread for everyone.
    Answer are shown only to logged in users.

    Perfekt so far.
    BUT the code shows in every answer the same message for non logged users
    “Replies only viewable for logged in users”

    Does anyone know, how to change the code, to show only one template-notice
    “Replies only viewable for logged in users” instead?

    
    function bb_auth_reply_view( $reply_id ) {
    $reply_id = bbp_get_reply_id( $reply_id );
    
    // Check if password is required
    if ( post_password_required( $reply_id ) )
    return get_the_password_form();
    
    $content = get_post_field( 'post_content', $reply_id );
    
    // first topic reply shouldn't be hiding
    $rep_position = bbp_get_reply_position($reply_id);
    
    // if user is not logged in and not the first post topic
    if( !is_user_logged_in() && $rep_position > 1 ) {
    return "Replies only viewable for logged in users";
    } else {
    // return normal
    return $content;
    }
    
    }
    add_filter( 'bbp_get_reply_content', 'bb_auth_reply_view' );

    Thanks
    Matthias

    #157234
    Robin W
    Moderator

    The you’ll need to add it into a function and add it to two actions

    ‘bbp_theme_before_reply_content’

    and

    ‘bbp_theme_after_reply_content’

    so for example

    Function agbams_share () {
    your code in here
    }
    
    add_action ('bbp_theme_after_reply_content' , 'agbams_share' ) ;
    add_action ('bbp_theme_after_reply_content' , 'agbams_share' ) ;
    

    see

    Step by step guide to setting up a bbPress forum – part 4

    #157231
    Robin W
    Moderator

    it will all depend on the order that the different css files bare loaded, so bbpress may be overwriting your theme ones

    try

    {
     font-size: 13px !important;
     }

    That says ‘don’t overwrite’

    #157225
    Stagger Lee
    Participant
    add_action( 'bp_before_member_header_meta', 'devb_show_role_on_profile');
    function devb_show_role_on_profile(){
     global $wp_roles;
     
    $user_id = bp_displayed_user_id();
     
    $user = get_userdata( $user_id );
     
    $roles = $user->roles;
     
     if( !$roles)
     return ;
     
     if ( !isset( $wp_roles ) )
     $wp_roles = new WP_Roles();
     
     $named_roles = array();
     
    foreach( $roles as $role ){
     
    $named_roles [] = $wp_roles->role_names[$role];
     }
     
    if( $named_roles )
     echo '<span class="user-role activity">'. join( ', ', $named_roles ) . '</span>';
     
    }

    Showing User role on BuddyPress Profile

Viewing 25 results - 9,651 through 9,675 (of 32,519 total)
Skip to toolbar