Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 4,076 through 4,100 (of 32,517 total)
  • Author
    Search Results
  • #195994
    Robin W
    Moderator

    by code

    //create vertical list subforum layout
    function custom_bbp_sub_forum_list() {
      $args['separator'] = '
    ';
      return $args;
    }
     add_filter('bbp_after_list_forums_parse_args', 'custom_bbp_sub_forum_list' );

    or this plugin has it as a setting in

    dashboard>settings>bbp style pack>Forum Display

    bbp style pack

    #195990
    Martin J
    Participant

    On the home of the forum, I have categories with sub forums in them, but need to change the layout to be 2 columns instead of comma separated forums. What file can I add to my theme to override this? bbPress has a crazy common between the <li> tags and drives me nuts because you can’t remove that using css.

    lookingahead
    Participant

    @robin-w oh no worries on this being a ‘new’ thing for you to hear — as someone who does not work with buddypress like yourself you’re never going to hear this. it’s because it is a way that bbpress sends information to buddypress when buddypress pulls info from bbpress into it, when it uses bbpress programming to create ‘group forums.’

    it’s not a bug; it’s how the interface between bbpress and buddypress works.

    at least, that’s what i’m gathering now, after reading other people’s posts with the same issue in forums all over the web.

    so my question to you now: what is the file that bbpress uses to say what the slug is — the URL name, which in this case is just ‘forum’….not ‘forums’ but ‘forum’ — so i can alter that?

    i HHAAAATE altering core files, but in this case it’s likely needed.

    whatever ‘default URL/slug’ command is used when buddypress pulls in forum creation/function into bbpress……chances are, that is the file i will (gulp!) need to modify.

    i’m guessing that the same code/file is used to be the ‘default slug name’ in bbpress. which is….’forum’

    what file does that? creates a default ‘forum’ in the URL/slug when a forum is created?

    #195972

    In reply to: Theme

    Robin W
    Moderator

    unfortunately when themes don’t obbey the rules, I can’t code for them 🙂

    #195966

    In reply to: Theme

    Robin W
    Moderator

    apologies put

    .bbp-topic-content p {
        color: black !important;
    }
    #195961

    In reply to: Theme

    Robin W
    Moderator

    put this is my plugin’s custom css tab

    bbp-topic-content p {
        color: black !important;
    }
    #195956
    Robin W
    Moderator

    untested, but this should do it

    add_filter ('bbp_after_has_search_results_parse_args', 'my_function')
    
    my_function ($args) {
    	
    		// bbp_get_closed_status_id() REMOVED,
    		$post_statuses = array(
    			bbp_get_public_status_id(),
    			bbp_get_spam_status_id(),
    			bbp_get_trash_status_id()
    		);
    
    		// Add support for private status
    		if ( current_user_can( 'read_private_topics' ) ) {
    			$post_statuses[] = bbp_get_private_status_id();
    		}
    
    		// Join post statuses together
    		$args['post_status'] = implode( ',', $post_statuses );
    		
    return $args ;
    
    }
    #195947
    Vili
    Participant

    That is indeed it, thanks! So I was barking the wrong tree, nothing wrong with WordPress being able to access bbPress.

    Where should one look for bbPress function documentation these days? I notice that I have difficulties finding information, and when I do find something, figuring out if the functions are for bbPress 1, bbPress 2, or BuddyPress is sometimes difficult. There is some sort of a list here but bbp_get_topic_tag_names() is not included, among others.

    #195946
    Robin W
    Moderator

    sorry, untested and taken from my files – try

    function rew_no_reply_per_forum ($reply_address) {
    	$forum_id = bbp_get_forum_id() ;
    	if ($forum_id == 6 ) $reply_address =  'xxx@yyy.com' ;
    	if ($forum_id == 7) $reply_address =  'abd@hdhd.com' ;
    	return $reply_address ;
    }
    
    add_filter ('bbp_get_do_not_reply_address', 'rew_no_reply_per_forum') ;
    #195945
    maxlevel
    Participant

    I pasted it in the functions.php file of my child theme and it threw this error message before I could save it:
    ————————————-

    Your PHP code changes were rolled back due to an error on line 271 of file wp-content/themes/kleo-child/functions.php. Please fix and try saving again.

    syntax error, unexpected ‘$forum_id’ (T_VARIABLE), expecting ‘(‘

    ————————————-

    Line 271 is:

    if $forum_id = 18747 $reply_address = 'mlt-club@monalisa-twins.com' ;

    The first item in the list of forums

    #195937
    Robin W
    Moderator

    try this in your functions file

    function rew_no_reply_per_forum ($reply_address) {
    	$forum_id = bbp_get_forum_id() ;
    	if $forum_id = 6 $reply_address =  'xxx@yyy.com' ;
    	if $forum_id = 7 $reply_address =  'abd@hdhd.com' ;
    	return $reply_address ;
    }
    
    add_filter ('bbp_get_do_not_reply_address', 'rew_no_reply_per_forum') ;
    #195933
    Robin W
    Moderator

    @mrwrongusername

    is doable but would require a small amount of custom code beyond free help

    contact me via

    http://www.rewweb.co.uk/contact-me/

    #195920
    billysgtr
    Participant

    I am replying my own post in case anyone has the same problem.
    I solved my problem using the following script https://gist.github.com/ntwb/7797990
    and I added style attribute for the html elements I need. Now everything works fine.

            // Span
            'span'             => array(
                'class'     => true,
                'style'     => true,
            ),
    #195917
    AiratTop
    Participant

    bbPress 2.5.14:

    FILE: /var/www/test.site/wp-content/plugins/bbpress/includes/admin/converter.php
    -------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------
     310 | WARNING | INI directive 'safe_mode' is deprecated since PHP 5.3 and removed since PHP 5.4
    -------------------------------------------------------------------------------------------------
    
    FILE: /var/www/test.site/wp-content/plugins/bbpress/includes/admin/tools.php
    -----------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------
     144 | WARNING | Function create_function() is deprecated since PHP 7.2; Use an anonymous function instead
    -----------------------------------------------------------------------------------------------------------

    In bbPress 2.6-RC6 everything is good.

    bbPress 2.5.14
    PHP Compatibility Checker 1.4.6

    #195915
    billysgtr
    Participant

    I have enabled the Visual Editor for topics and replies using the following:

    function bbp_enable_visual_editor( $args = array() ) {
        $args['tinymce'] = true;
        return $args;
    }
    add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );

    The problem is that only administrator can add text-colors font-styes and other things like that.

    I am getting html format when a subscriber uses colors and font-styles
    <span style=”color: #00ff00;”><span style=”font-family: ‘book antiqua’, palatino, serif;”>wfwffwwf</span></span>

    WP Version 4.9.8
    bbPress Version 2.5.14

    I would really appreciate any help,
    Thanks!

    #195890
    Robin W
    Moderator

    this should do it – make sure anonymous is turned on to allow creation, then this stops topics being created – ie the topic form being shown

    add_filter ( 'bbp_current_user_can_publish_topics', 'rew_prevent_anonymous' );
    
    function rew_prevent_anonymous ($retval) {
    	// prevent topic creation if user is not logged in
    	if ( !is_user_logged_in()) {
    		$retval = false;
    	}
    
    return $retval;
    
    }

    if you don’t know how to add to the functions file, use this plugin and put the code in there

    Code Snippets

    #195889
    Robin W
    Moderator

    do you know how to add a function to a function file if I gave you the code ?

    #195844
    marketing050
    Participant

    Okay, i used shortcodes for pages and redirected the index to these specific pages. But now the different users can’t see the specific topics. They are listed in the index with all the topics, but when you click further on a specific topic, I still get an 404 error. How do i change this?

    #195789

    In reply to: Importer major issue

    Al_ambique
    Participant

    I forgot to mention the other SQL script required to fix the import.
    Only the first post of each topic was displayed. A quick glance at the database and I saw that post_parent of each reply was set on the forum and not the topic.
    So here we go :

    UPDATE wp_posts m1 
    LEFT JOIN wp_postmeta m2 ON m1.ID = m2.post_id AND meta_key = '_bbp_topic_id'
    LEFT JOIN wp_posts m3 ON m1.post_parent = m3.ID AND m3.post_type != 'forum'
    SET m1.post_parent = m2.meta_key
    WHERE m1.post_type = 'reply' AND m1.post_parent != m2.meta_value
    #195790

    In reply to: Importer major issue

    Al_ambique
    Participant

    I forgot to mention the other SQL script required to fix the import.
    Only the first post of each topic was displayed. A quick glance at the database and I saw that post_parent of each reply was set on the forum and not the topic.
    So here we go :

    UPDATE wp_posts m1 
    LEFT JOIN wp_postmeta m2 ON m1.ID = m2.post_id AND meta_key = '_bbp_topic_id'
    LEFT JOIN wp_posts m3 ON m1.post_parent = m3.ID AND m3.post_type != 'forum'
    SET m1.post_parent = m2.meta_key
    WHERE m1.post_type = 'reply' AND m1.post_parent != m2.meta_value
    #195695
    Willyth
    Participant

    Maybe I’m missing something, but I want to create two separate indexes (two separate sets of forums) on the same website. Right now, I have one set running using the short code [bbp-forum-index]. I assume if I use the same shortcode on a different page, I’ll get the same list of forums, when what I really want is a separate set of forums. This should be easy so I’m probably missing something… Help please! Thanks!

    #195671
    pandraka
    Participant

    I’m having the same issue, all topics created by participants get set to pending. Then a moderator needs to open the topic. It is frustrating the participants. I’m using the twentytwelve theme which has been customize. so far I’m not seeing any code setting topics to pending. I’m still digging, but if anyone has an idea where to look that would really help.

    jbjorgaard
    Participant

    Using the following code, when I select Outfit Leader as the bbpress role, it displays ‘Member’ where it used to say ‘Keymaster’ on a forums post under the bbp-author-role class tag.

    	function add_custom_role( $bbp_roles ) {
     
    	$bbp_roles['my_custom_role1'] = array(
    	'name' => 'Outfit Leader',
    	'capabilities' => bbp_get_caps_for_role( bbp_get_keymaster_role() )
    	);
    	$bbp_roles['my_custom_role2'] = array(
    	'name' => 'Chief of Staff',
    	'capabilities' => bbp_get_caps_for_role( bbp_get_keymaster_role() ) 
    	);
    	$bbp_roles['my_custom_role3'] = array(
    	'name' => 'Executive Officer',
    	'capabilities' => bbp_get_caps_for_role( bbp_get_keymaster_role() ) 
    	);
    	return $bbp_roles;
    	}
    	add_filter( 'bbp_get_dynamic_roles', 'add_custom_role', 1 );

    Expected functionality: Custom Roles would replace the name of the role they are getting capabilities from. So in this case each forums topic by this user would have their avatar, name below that, role name below that, and finally IP address below that.

    #195614
    Robin W
    Moderator

    most themes and plugins do not lose settings if you just deactivate, but as theme and plugin authors can write any code they like, I cannot guarantee that !

Viewing 25 results - 4,076 through 4,100 (of 32,517 total)
Skip to toolbar