Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 11,801 through 11,825 (of 32,504 total)
  • Author
    Search Results
  • demonboy
    Participant

    I have added this code to my functions.php file

    function mycustom_breadcrumb_options() {
    	// Home - default = true
    	$args['include_home']    = false;
    	// Forum root - default = true
    	$args['include_root']    = true;
    	// Current - default = true
    	$args['include_current'] = false;
    
    	return $args;
    }
    
    add_filter('bbp_before_get_breadcrumb_parse_args', 'mycustom_breadcrumb_options' );

    … but that last argument only works for the original post, which returns something like this:

    Forums › Assignment Submissions ›

    On the replies underneath it includes the current location, something like this:

    Forums › Assignment Submissions › Assignment 24: 1st 24 hours in Crown Point, Tobago

    You can see this in action here.

    How do I remove that last part in the replies?

    NewSha
    Participant

    I want the users to get email alerts every time their forum role changes to a specific role.

    Namely, I have to notify them only if their role has changed from Spectator to Participant.

    I found a way to do this with standard WordPress roles, but it doesn’t work with bbPress roles.

    http://clicknathan.com/web-design/notify-a-wordpress-user-when-their-role-has-been-changed-to-a-specific-role/

    I tried changing if ($new_role == 'contributor') to if ($new_role == 'participant') and even to this if ($new_role == 'bbp_participant') – nothing worked.

    Perhaps someone knows the solution?

    WordPress version: 3.8.2
    bbPress version: 2.5.3

    #146797
    helmutforren
    Participant

    I had the same kind of problem, but with a different version of the functions.php file. Robin pointed out this post, and it worked after I adapted it slightly for my version. See my fix, which “zooms in” on the code a little further to more clearly point out the change, at https://bbpress.org/forums/topic/forum-still-not-working-right/#post-146790

    #146795
    helmutforren
    Participant

    Robin, your advice worked, once properly adapted. Thanks very much.

    For others, here’s how you get to the place to edit functions.php. From the Dashboard, select Appearance then Editor. Notice list of files on the RIGHT column. Find “Theme Functions (functions.php)” and click on that. Now you’ll be editing the correct file.

    For my version of Academica 1.2.2, there was only one occurrence of text “is_single”, and that was the right place.

    OLD SINGLE LINE OF CODE NEEDING CHANGE (see later for more lines to get context):

    
            echo get_category_parents( $cat, true, $sep ) . $before . get_the_title() . $after;
    

    NEW SIX LINES REPLACING LINE ABOVE (see later for more lines to get context):

    
            //support bbPress.  HgF per adaptation of akkkarki
            if (empty($cat)) {
                echo $before . get_the_title() . $after;
            } else {
                echo get_category_parents( $cat, true, $sep ) . $before . get_the_title() . $after;
            }
    

    OLD CODE (MORE LINES FOR CONTEXT):

    
    } elseif ( is_single() ) {
        if ( is_attachment() ) {
            global $post;
            echo 'post_parent ) . '">' . get_the_title( $post->post_parent ) . '' . $sep . $before . get_the_title() . $after;
        } else {
            $cat = get_the_category(); $cat = $cat[0];
            echo get_category_parents( $cat, true, $sep ) . $before . get_the_title() . $after;
        }
    

    NEW CODE (MORE LINES FOR CONTEXT):

    
    } elseif ( is_single() ) {
        if ( is_attachment() ) {
            global $post;
            echo 'post_parent ) . '">' . get_the_title( $post->post_parent ) . '' . $sep . $before . get_the_title() . $after;
        } else {
            $cat = get_the_category(); $cat = $cat[0];
            //support bbPress.  HgF per adaptation of akkkarki
            if (empty($cat)) {
                echo $before . get_the_title() . $after;
            } else {
                echo get_category_parents( $cat, true, $sep ) . $before . get_the_title() . $after;
            }
        }
    
    #146787
    lagrou
    Participant

    Back to topic, just updated the GitHub repo with the following:
    – Add User section
    – Fix & make use of callback_forum_status, add Forum status (Open or Closed)
    – Fix & make use of callback_sticky_status
    All this tested OK on my nested test install. I’m leaving the “pre-alpha code” warning, though.

    Some more questions raised at this stage:
    – How do you access a parentless topic in bbPress ? Could these be used for WP Symposium groups forum topics ?
    – Could you clarify what a forum and a category refer to, in bbPress terminology ? Is a category a subforum, which has necessarily a parent forum, while a forum has no parent ? In such a case, there should be a test over symposium_cats.cat_parent in callback_forum_type(), otherwise it can be simply disregarded…

    #146784
    dugfunny
    Participant

    Using this code I have made it to where only updates and rtmedia posts show up on my activity stream

    /**
     * Activity Stream Default Updates
     */
    function make_swa_show_notice_only( $retval ) {	
    	
    	 if ( bp_is_page( 'activity' ) ) {
    		$retval['action'] = 'activity_update, rtmedia_update';					
    	 }
    	
    	return $retval;
    	
    }
    
    add_filter( 'bp_after_has_activities_parse_args', 'make_swa_show_notice_only' );

    I would like bbpress forum posts to show up on my wall as well. What would i put next to

    ‘activity_update, rtmedia_update’

    in my code to make that happen? Thanks!

    #146772
    smileyriley21
    Participant

    Firstly, Thanks for building this module.

    I installed it, had a play and got it working in no time.

    On your support page you have the restriction “The shortcode [bbp-topic-form] will show the existence of all forums”. Is it possible to show only the forums that that user can access?

    If you can do this, I will love you forever and donate some cash as this will meet my clients requirements.

    Thanks for reading.

    demonboy
    Participant

    Well, I guess I should put my money where my mouth is when I say I’m fairly au fait with CSS! I managed to solve it and it was pretty obvious. Just swap the floating elements from left to right, where content becomes right and sidebar becomes left. Remember to end with the !important to override any other CSS. Code is thus:

    .bbpress.single-forum #main #content {float:right!important;}
    .bbpress.single-forum #main #sidebar {float:left!important;}
    .bbpress.single-topic #main #content {float:right!important;}
    .bbpress.single-topic #main #sidebar {float:left!important;}
    #146767
    helmutforren
    Participant

    This is regarding http://saveourgrace.com/forums/

    I believe I followed all the instructions properly. However, initially, my WordPress “Page” with link above was blank. I found advice at http://bbpress.org/forums/topic/bbpress-forum-blank-pages/ that it may be a theme issue, so I simply added the short code [bbp-forum-index].

    This got the page working as you can see it now. It properly shows the “Fundraising” forum. However, the number of topics is listed as 0, and when I click on the forum name, I get the otherwise blank page at http://saveourgrace.com/forums/forum/fundraising/ .

    I did add a topic per the instructions, and confirmed on the topics list page that my topic belongs to the fundraising forum.

    I am using the theme “Academica” version 1.2.2. I changed to “Twenty Thirteen” temporarily, and things seemed much better. I could see and get into the topic. If I figure out how to make the topic show with “Academica”, am I nevertheless going to find myself fighting an endless battle with this theme? Or should one more fix take care of it? (Of course, if it is just one more fix, what might that fix be?)

    Note I’m using WordPress 3.9.1.

    Thanks very much,
    Helmut

    demonboy
    Participant

    I’m using an Avada child theme and have inserted the search shortcode. Unfortunately it is showing two forms. I’m sure I could get rid of one by doing a display:none on the relevant div but I’d like to know why this is happening. You can see the page here, whilst the code is here:

    [one_half last="no"]Welcome to the Itinerant Writers Club. This is a closed group but anyone interested in discussing travel writing is invited to join. It is a dedicated group where, each month, every essay written by the members is critiqued by the others. Here's why you should join:
    
    [checklist icon="pencil" iconcolor="#6dd622" circle="yes"]
    <ul>
    	<li>High rate of published members</li>
    	<li>Dedicated, monthly critique of your work</li>
    </ul>
    [/checklist]
    
    [bbp-search]
    
    [/one_half]
    [one_half last="yes"]<tt>[bbp-forum-index]</tt>[/one_half]
    Robin W
    Moderator

    ok, so put this in your functions file

    //This function adds the author to the reply
    function bbp_author_display () {
    	if (bbp_get_reply_author_id() == bbp_get_topic_author_id() ) {
    	echo '<span class="topic-author">' ;
    	echo '<ul><li>' ;
    	echo 'Topic Author' ; 
    	echo '</li></ul></span>' ;
    	}
    	else return ;
    	}
    	
    	add_action ('bbp_theme_after_reply_author_details', 'bbp_author_display') ;

    and this in your style.css

    #bbpress-forums .topic-author{
      background: none repeat scroll 0 0 #5BB75B;
      color: #FFFFFF;
      display: block;
      padding: 5px;
    }
    

    Job done !

    #146747
    Richard B
    Participant

    bbpress bypasses the standard profile update of WordPress with its own form. So, none of the standard plug-ins are likely to do this. The function that needs to be modified is: bbp_edit_user_handler in wp-content\plugins\bbpress\includes\common\functions.php.

    I added my own edit check (just before the caps check):

    $symbol = preg_quote('~!@#$%^&*()_+-=[]{}"|?<>.,|£’);
    if (strlen($_POST[‘pass1’])<12)
    {
    if(!preg_match(‘/^(?=.*\d)(?=.*[A-Z])(?=.*[a-z])(?=.*[‘ . $symbol . ‘])[0-9A-Za-z’ . $symbol . ‘]{6,16}$/’, $_POST[‘pass1’])) {

    bbp_add_error( ‘bbp_update_user_capability’, __( ‘ERROR: The password must be 6 or more characters with at least one uppercase, one lowercase, one digit and one symbol.’, ‘bbpress’ ) );
    return;
    }
    }`

    It’s not really a check for “strong passwords” based on the WordPress meter, but it is better than nothing. I don’t really know enough about PHP/JavaScript etc. to do that. I also had the password generated modified to fit these rules, but the reality is that the generated password is already a “strong password”.

    #146737
    dryan1144
    Participant

    Thanks Robin I will have a look at your code.

    #146714

    In reply to: Requirement Questions

    Robin W
    Moderator

    Multiple user levels https://wordpress.org/support/plugin/bbp-private-groups plugin should do this
    Capacity to see at a glance live updated list of who has commented – could be coded but is not in the current version.
    Is there a way to integrate Dropbox – not that I know
    He would like a tag cloud also. – yes that’s there

    #146712
    peter-hamilton
    Participant

    Hello

    I am quite a newbie in regards to web design/development, especially wordpress and bbpress are quite tricky to learn when not knowing anything about php etc.

    For about 5 months i have been hacking away and pasting existing code to create what I hope to be a nice allround bbpress/buddypress theme.

    It is still being worked on but I would love some feedback on my progress.

    BBFacelook theme development

    Thanks in advance
    Peter Hamilton

    #146706

    In reply to: Tamriel Foundry Forums

    peter-hamilton
    Participant

    One of my main motivators of continuing with BBPress is Tamriels foundry, one of the few examples that show that it is possible to create a forum similar to that of premium forums, with the added bonus of having wordpress/bbpress and budypress with their helpful communities.

    You guys rock and thanks to looking at your code I am able to create my own community site.
    http://www.cultivators-forum.com

    +1

    P.H.

    #146701

    In reply to: Help with forum layout

    Robin W
    Moderator

    bbpress will use your standard page template.

    see

    Step by step guide to setting up a bbPress forum – Part 1

    for the order and which one to look for.

    But it is styling that will determine the width.

    look in your theme’s style.css for code something like

    #sidebar
    {
    padding: 20px 0 10px 0;
    margin-left: 545px;
    width: 190px;
    }

    and you may need to play with the content

    #content {
    float: left;
    width:500px;
    }

    If you just want it changed for bbpress pages, then try

    #bbpress-forums.sidebar
    {
    padding: 20px 0 10px 0;
    margin-left: 545px;
    width: 190px;
    }

    may or may not work, css not my strong point !

    #146699
    Robin W
    Moderator

    ‘You can pass wp_query args into bb_has_topics(), but I can only only come up with code that shows topics from one forum – not multiple forums.’

    I’m afraid I don’t have time at the moment to do lots of coding for others, but take a look at this plugin

    bbp Private Groups

    Look at includes/topics.php for how I did this for private groups – called pg_has_topics, it may give you some help – I used ‘post__in’ to create a list of topics to display

    So you could do a coupe of loops to create this list and the pass that to the bbp_has_topics function.

    ‘post__in’ is realy, useful sometimes

    see

    https://codex.wordpress.org/Class_Reference/WP_Query

    #146694
    Robin W
    Moderator

    Great stuff !

    It always amazes me how long I spend to produce so little code 🙂

    Bet you learned a lot along the way though!

    #146683
    Stephen Edgar
    Keymaster

    99% sure it is a compatibility issue with that Headway theme you are using.

    I can’t find a reference to bbPress on their site, only a dead link to a BuddyPress article on their FAQ page http://headwaythemes.com/frequently-asked-questions/ that I think eventually lands you at this page https://headwaythemes.com/downloads/community-builder/ which mentions ‘Discussion Forums’ in the image, no specific bbPress reference.

    If you don’t have a bbpress.php file in your theme folder try creating one based on your preferred page template, e.g. page.php or page-sidebar.php etc, just make a copy of the file and rename it to bbpress.php.

    Short of that working I think you will need to contact the Headway support to find out if they support bbPress or not.

    Stephen Edgar
    Keymaster

    A couple of thoughts, not explicitly what you asked for but are related 😉

    Use bbp_show_lead_topic, here on bbpress.org if you go to a topic with many pages (actually more than 1 page) you always see the original topic at the top of the page.

    And

    Use CSS, take a look at the source of this topic, you’ll notice that any reply by the original topic author has a CSS class topic-author

    #146680
    Stephen Edgar
    Keymaster

    You can also use https://codex.bbpress.org/bbp_show_lead_topic/ it is what is used here on bbpress.org to seperate the topic from the replies using different template parts.

    Take a look at content-single-topic-lead.php, you will also see bbp_show_lead_topic() in various other template parts such as the ones you originally mentioned.

    #146678

    In reply to: Forum Error

    Stephen Edgar
    Keymaster

    I have no idea what that could be, bbPress v2.x does NOT include a file named forum.php

    Are you sure you are using bbPress?

    #146665
    Nathan
    Participant

    So, after DAYS of working on this I finally have a solution. I have not done a lot of testing, but this has worked so far.

    Basically what is happening is that for forums (not replies) the logic is inverted. This means that users are subscribed to a forum unless they unsubscribe (ie. are added to the DB).

    Just add this to your theme’s function.php and it should work.

    I hope this helps someone, because it has taken a LOT of work!

    add_filter( 'bbp_get_user_subscribe_link', 'invert_get_user_subscribe_link', 10, 4 ); //invert forum subscription
    add_filter( 'bbp_is_user_subscribed_to_forum', 'invert_is_user_subscribed_to_forum', 10, 4 ); //invert forum subscription
    add_filter( 'bbp_get_forum_subscribers', 'invert_get_forum_subscribers' ); //invert forum subscription
    add_filter( 'bbp_is_user_subscribed', 'invert_is_user_subscribed', 10, 4 ); //invert forum subscription
    
    function invert_is_user_subscribed($retval, $user_id, $object_id, $subscribed_ids) {
    	if (get_post_type( $object_id ) == bbp_get_forum_post_type())
    		return !$retval;
    	else	
    		return $retval;
    }
    
    function strContains($needle, $haystack) {
    	if (strpos($haystack, $needle) !== false) {
    		return true;
    	} else {
    		return false;
    	}
    }
    
    function invert_get_user_subscribe_link ($html, $r, $user_id, $topic_id) {
    	if (strContains( "bbp_unsubscribe", $html )) {
    		$html = str_replace("bbp_unsubscribe", "bbp_subscribe", $html);
    	} else {
    		$html = str_replace("bbp_subscribe", "bbp_unsubscribe", $html);
    	}
    	return $html;
    }
    
    function invert_get_forum_subscribers( $users ) {
    	$args = array('fields' => 'id');
    	$all_users = get_users($args);
    	$send_to_users    = array_diff($all_users, $users);
    	return $send_to_users;
    }
    
    function invert_is_user_subscribed_to_forum( $retval, $user_id, $forum_id, $subscribed_ids ) {
    	return !$retval;
    }
    

    I also include make users “subscribed” to anything they write by default. All they have to do is uncheck the box. The following code is also added to function.php.

    add_action('bbp_theme_after_topic_form_subscriptions', 'subscribed_by_default'); //default subscribe
    add_action('bbp_theme_after_reply_form_subscription', 'subscribed_by_default'); //default subscribe
    
    function subscribed_by_default() 
    	echo '<script type="text/javascript">jQuery("#bbp_topic_subscription").prop("checked","checked");</script>';
    }
    Robkk
    Moderator

    @robin-w hey thanks for helping me out

    and i was using 5 pages as an example

    i would like the topic starter label throughout a topic , for whatever number pages it may have

    so should i basically use this

    //This function adds the author to the reply
    function reply_display_author () {
    	if( get_post_type() == 'reply' ) {
    	echo '<span class="bbp-topic-started-by">' ;
    	printf( __( 'Topic started by: %1$s', 'bbpress' ), bbp_get_topic_author_link( array( 'size' => '14' ) )) ; 
    	echo '</span>' ;
    	}
    	else {
    	return ;
    	}
    	}
    add_action ('bbp_theme_before_reply_content', 'reply_display_author') ;

    with this function instead??

    <?php if ( bbp_thread_replies() ) : ?>
    
    			<?php bbp_list_replies(); ?>
    			
    			
    		<?php else : ?>
    			<?php global $countr ;
    			$countr=-1 ; ?>
    		
    			<?php while ( bbp_replies() ) : bbp_the_reply(); ?>
    			
    			<?php 
    			$countr ++ ;?>
    			
    			<?php bbp_get_template_part( 'loop', 'single-reply' ); ?>
    
    			<?php endwhile; ?>
    			
    			
    		<?php endif; ?>
Viewing 25 results - 11,801 through 11,825 (of 32,504 total)
Skip to toolbar