Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 4,051 through 4,075 (of 32,481 total)
  • Author
    Search Results
  • #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 !

    #195602
    Robin W
    Moderator

    ok, I presume you meant this code

    //code to add tutor role 
     
    function add_new_roles( $bbp_roles )
    {
        /* Add a role called tutor */
        $bbp_roles['bbp_tutor'] = array(
            'name' => 'Tutor',
            'capabilities' => custom_capabilities( 'bbp_tutor' )
            );
     
        return $bbp_roles;
    }
     
    add_filter( 'bbp_get_dynamic_roles', 'add_new_roles', 1 );
     
    function add_role_caps_filter( $caps, $role )
    {
        /* Only filter for roles we are interested in! */
        if( $role == 'bbp_tutor' )
            $caps = custom_capabilities( $role );
     
        return $caps;
    }
     
    add_filter( 'bbp_get_caps_for_role', 'add_role_caps_filter', 10, 2 );
     
    function custom_capabilities( $role )
    {
        switch ( $role )
        {
     
            /* Capabilities for 'tutor' role */
            case 'bbp_tutor':
                return array(
                    // Primary caps
                    'spectate'              => true,
                    'participate'           => true,
                    'moderate'              => false,
                    'throttle'              => false,
                    'view_trash'            => false,
     
                    // Forum caps
                    'publish_forums'        => false,
                    'edit_forums'           => false,
                    'edit_others_forums'    => false,
                    'delete_forums'         => false,
                    'delete_others_forums'  => false,
                    'read_private_forums'   => true,
                    'read_hidden_forums'    => false,
     
                    // Topic caps
                    'publish_topics'        => true,
                    'edit_topics'           => true,
                    'edit_others_topics'    => false,
                    'delete_topics'         => false,
                    'delete_others_topics'  => false,
                    'read_private_topics'   => true,
     
                    // Reply caps
                    'publish_replies'       => true,
                    'edit_replies'          => true,
                    'edit_others_replies'   => false,
                    'delete_replies'        => false,
                    'delete_others_replies' => false,
                    'read_private_replies'  => true,
     
                    // Topic tag caps
                    'manage_topic_tags'     => false,
                    'edit_topic_tags'       => false,
                    'delete_topic_tags'     => false,
                    'assign_topic_tags'     => true,
                );
     
                break;
     
            default :
                return $role;
        }
    }

    so with that code loaded to my site, if I go to

    dashboard>users>all users and edit a user, I can change them to the tutor role, and back again and it saves.

    Can you confirm you are using the above code, and that it does not save if you perform the above ?

    #195600

    I added a link to a private forum in the menu so that a logged in user could easily access the forum. Yes I could add a menu for logged in users, but I decided to instead redirect the not logged in users.

    Here is the code I used:

    // Redirect private bbPress forum to specific page.
    add_action('template_redirect', 'private_content_redirect_to_login', 9);
    function private_content_redirect_to_login() {
      global $wp_query,$wpdb;
      if (is_404()) {
        $host = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
        $path = dirname($_SERVER['REQUEST_URI']);
        $forums = "forum";
        $location = "https://direitoshumanosangola.org/not-logged-in/";
        }
        if(strpos( $path, $forums ) !== false){
          wp_safe_redirect($location);
          exit;
      }
    }

    I made a tutorial for it here:
    https://www.easywebdesigntutorials.com/hide-buddypress-pages-and-bbpress-forums-from-not-logged-in-users/

    #195582
    Robin W
    Moderator

    @looimaster I’m just a bbpress user trying to put something back on the open software community

    bbpress has https://bbpress.trac.wordpress.org/ as it’s code improvement tool

    #195556
    ak08820
    Participant

    I found another way to add forums to the menu at DesignBombs which seems to do it. Instead of creating a page and embedding the short code in it, just used the forums to add to the menu. It does not initially have the top level page with 4 sub forums but that is OK.

    #195539
    ak08820
    Participant

    Hello
    I am trying to use bbPress for a forum and when I use the short code to generate the index it does not show correctly. It does show a link (http://localhost/my-app/wordpress/forums/forum/wvv-forums/)for the index and if I click on the link it shows a better formatted list.

    I have 4 sub-forums and instead of 1 per line, it shows 2 per line. Using Twenty Seventeen and have previewed with sixteen and fifteen themes, too with no effect.

    What do I need to do to fix this?

    Thanks in advance.

    #195538
    jotirmoy7
    Participant

    hi,
    I create a new forum site with bbpress and BuddyPress.to fillup all forum category I copy paste posts from another. When I copy and paste post in the new topic by visual edit option and publish it some off content comes with HTML code.how to solve this. here I give two pics for you.

    View post on imgur.com

    <script async src=”//s.imgur.com/min/embed.js” charset=”utf-8″></script>
    after publishing the articles its show like this.

    View post on imgur.com

    <script async src=”//s.imgur.com/min/embed.js” charset=”utf-8″></script>

    plz, give me a solution to this problem. thank you.

    #195526
    Mal
    Participant

    Wow, thank you for your quick reply, I didn’t expect that there will be one 🙂

    I’m using v2.6 RC-6 and this doesn’t update the freshness. v2.6 has the same bug sadly.

    And when I go to Tools > Forums and run all “Recalculate…” tasks then ['bbp-forum-index'] shortcode loses sub-forums display on my front page of website. To fix this I have to go to “Forums” and open every parent forum and click “Publish” again.

    #195522
    Robin W
    Moderator

    Try this – or much easier just add my style pack plugin to your site which has this fix built in, and let me know if it fixes

    bbp style pack

    //filter to correctly return last active ID for sub forums
    //note : a parent forum or category can get the wrong last active ID if a topic in a sub forum is marked as spam or deleted. This filter ignores the parent and works out the correct sub forum
    
    //don't add if pg filter exists as this will have done it already
    if (!function_exists ('private_groups_get_permitted_subforums')) {
    	add_filter ('bbp_get_forum_last_active_id' , 'rew_get_forum_last_active_id', 10 , 2 ) ;
    }
    
    function rew_get_forum_last_active_id ($active_id, $forum_id) {
    	$sub_forums = bbp_forum_get_subforums($forum_id) ;
    	if ( !empty( $sub_forums ) ) {
    		$active_id = 0;
    		$show = array();
    		//find the latest permissible 
    		foreach ( $sub_forums as $sub_forum ) {
    			$sub_forum_id =  $sub_forum->ID ;
    			$active_id = get_post_meta( $sub_forum_id , '_bbp_last_active_id', true );
    			$last_active = get_post_meta( $sub_forum_id, '_bbp_last_active_time', true );
    			if ( empty( $active_id ) ) { // not replies, maybe topics ?
    				$active_id = bbp_get_forum_last_topic_id( $sub_forum_id );
    				if ( !empty( $active_id ) ) {
    					$last_active = bbp_get_topic_last_active_time( $active_id );
    				}
    			}
    			if ( !empty( $active_id ) ) {
    				$curdate = strtotime($last_active);
    				$show[$curdate] = $active_id ;
    			}
    		}
    		//then add the forum itself in case it has the latest
    			$active_id = get_post_meta( $forum_id , '_bbp_last_active_id', true );
    			$last_active = get_post_meta( $sub_forum_id, '_bbp_last_active_time', true );
    			if ( empty( $active_id ) ) { // not replies, maybe topics ?
    				$active_id = bbp_get_forum_last_topic_id( $forum_id );
    				if ( !empty( $active_id ) ) {
    					$last_active = bbp_get_topic_last_active_time( $active_id );
    				}
    			}
    			if ( !empty( $active_id ) ) {
    				$curdate = strtotime($last_active);
    				$show[$curdate] = $active_id ;
    			}
    		$mostRecent= 0;
    		foreach($show as $date=>$value){
    			if ($date > $mostRecent) {
    				 $mostRecent = $date;
    			}
    		}
    		if ($mostRecent != 0) {
    			$active_id = $show[$mostRecent] ;
    		} else {
    			$active_id = 0;
    		}
    	}
    	return apply_filters( 'rew_get_forum_last_active_id', $active_id, $forum_id );
    }
    #195505
    Leandro
    Participant

    Hello,

    Recently I started to setup a community using buddypress and bbpress and only after a few tests I noticed that when someone create or reply a topic no notification is created. This is a bit frustrating considering how important the notifications are to keep track of what is happening in the community.

    Looking through the forum for a solution I found a topic with a similar subject, however when trying to use their code a empty notification is created (there is no text or description). Here is the topic: https://bbpress.org/forums/topic/new-reply-notification-link-to-the-reply/

    Anyone can tell me if the code above still working? I think that something changed since that this code was published, but I cant figured out what.

    #195503
    inderpreet2018
    Participant

    Hi,

    I added forum form to the frontend with the help of shortcode “[bbp-forum-form]” to forum page. But when I submit forum, it will not saved and redirected me to other saved forum.

    When I created sub-forum then it works fine.

    eigodeasobo
    Participant

    Hi,All.

    Is there a way to specify multiple tag IDs when display topics?

    It’s a common-sense way of thinking↓

    <?php echo do_shortcode('[bbp-single-tag id=777,111]'); ?>

    But this code did not work 🙁

    I wonder what I should do.

    Thanks.

Viewing 25 results - 4,051 through 4,075 (of 32,481 total)
Skip to toolbar