Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 9,901 through 9,925 (of 32,505 total)
  • Author
    Search Results
  • #155945
    Bob1nz
    Participant

    Next one is on the shortcodes you mentioned. https://codex.wordpress.org/Shortcode
    The bbpress codes work in a similar fashion to wordpress’s shortcodes and there are a few examples on that page as to how they work.
    While they are useful I’m not entirely convinced you need them at this stage.

    They can be used to put features of the forums on other pages that are not your main forums such as login, one category of your forums, tag clouds etc. You can use the [bbp-forum-index] on a page if you have created one but I’m pretty sure you shouldn’t need to unless that what you want.

    I believe that plugin would still be fine with your current version of WP and bbP.

    Had to split the reply as I don’t seem to be able to post more than one link per reply

    #155944
    Bob1nz
    Participant

    Ok no worries.

    Im going to give you some links to look at as they have some potentially useful info.

    First one is for the permalinks https://codex.wordpress.org/Using_Permalinks
    I normally have these setup with post name checked in the settings but you are free to choose your own.
    It also makes it easier to find posts and topics etc with “pretty” names in your url bar. My websites forums for example are at myurl/forums <– easy peasy. I never setup a page for bbpress and this worked out fine.

    #155942
    sharongraylac
    Participant

    I’VE GOT IT!!!!! πŸ™‚

    This is what I did to create a title for my bbpress pages (when I had disabled my title-wrapper), in case it helps anyone else.

    I first called the title in, by adding the following code to my bbpress.php file (formerly page.php):

    <?php the_title();?>

    Then I wrapped it in a div like so:

    <div id= bbpressTitle>
    <?php the_title();?></div>

    Then I created CSS, based on this new class:

    #bbpressTitle {
    font-size: 32px;
    font-family: Roboto Slab;
    Font-weight: 200;
    display: block;
    color: #70908F;
    }

    And it actually worked. Please take this with a grain of salt… I’m an acupuncturist, not a coder. πŸ˜‰

    Thanks again for all of your help, Bob1nz!

    Goodnight,
    Sharon

    #155939
    cyclesha
    Participant

    First, I believe I do have permalinks enabled, however, I’m such a novice I don’t know where to look.

    4.1 isn’t much different than 4.0.1 and 4.0 wasn’t much different than 4.0.1. I’ve had all of them and everything else worked. Oh well, I research it further.

    I definitely want forums. I just need to clear (approve) topics before they appear and approve replies as well. Other so called motorcycle websites have real problems with their forums and and have found themselves deleting a lot of what users put in. It’s all about approval.

    I found bbPress shortcodes: https://codex.bbpress.org/shortcodes/ Would any of these help? and where would I put them?

    Between the two of us we’ll get this straightened out.

    #155929
    cyclesha
    Participant

    I also found the bbPress short codes: https://codex.bbpress.org/shortcodes/ . Would any of these help and where do I put them?

    #155923
    Hephaestus_Xii
    Participant

    Hi, I would like to know how to change the “forum” link in the breadcrumbs to link to another page I built the forums using the shortcodes and the “forum” link in the breadcrumbs takes me to the default forum page.

    I would like it to go to the page I created.

    #155920
    WilRC
    Participant

    Fixed, to everyone who it will be useful:

    / Verify the reply ID
    		$topic_id = bbp_get_topic_id($widget_query->post->ID);
    		$forum_id = bbp_get_reply_topic_id($topic_id); 
    		$reply_id   = bbp_get_reply_id( $widget_query->post->ID );
    		$topic_count       = bbp_get_forum_reply_count( $forum_id, false, true );
    		$total_reply_count = bbp_get_topic_reply_count($forum_id);
    
    					$reply_link = '<a class="bbp-reply-topic-title" href="' . esc_url( bbp_get_reply_url( $reply_id ) ) . '" title="' . esc_attr( bbp_get_reply_excerpt( $reply_id, 50 ) ) . '">' . bbp_get_reply_topic_title( $reply_id ) . '</a> ('.$total_reply_count.')<br />'. esc_attr( bbp_get_reply_excerpt( $reply_id, 40 ) ) . '';
    
    #155916
    sharongraylac
    Participant

    Ah, thanks for pointing that out, Bob1nz. I removed the code from a Custom CSS file, but didn’t realize it was in my style.css.

    Is there another way to add a custom title to the forum without removing this CSS?

    The reason it’s there is to avoid a different (bigger) problem between my theme and Woocommerce pages. In general, I’d rather not have titles at all- Just the forum and topics.

    Please let me know if you think I’m making a grave mistake though…

    Thanks!
    Sharon

    #155914
    Bob1nz
    Participant

    ok so I have made some small progress

    add_filter('bbp_get_user_role_map','custom_bbp_get_user_role_map');
    function custom_bbp_get_user_role_map($role_map){
        $role_map['admin'] = bbp_get_admin_role();
        $role_map['guest'] = bbp_get_guest_role();
        return $role_map;
    }

    Works if I use the built in bbpress roles eg where is says bbp_get_admin_role(); have bbp_get_keymaster_role(); , bbp_get_moderator_role(); , bbp_get_admin_role(); bbp_get_participant_role();.

    I seem to be stuck on getting the custom roles that I have created in bbpress to be picked up in the map.

    The error I get is Fatal error: Call to undefined function bbp_get_admin_role() in [pathtomyfunctions.php] on line 550 which is $role_map[‘admin’] = bbp_get_admin_role();

    #155911
    Skisma
    Participant

    @robin-w Ahh ok I see, so basically they are only used for actual pages. That’s what I didn’t get before, I was wondering how I’d accomplish that using the shortcode for a widget. Now I understand this isn’t possible and shortcodes are only used for pages. Thanks man!

    #155910
    WilRC
    Participant

    Help!
    I’m trying to get replycounts after the the latest posttitle. (widget)
    e.g:
    Avatar – Name – date – title – (number of replies)
    I can’t get it working. This is sofar I have now:

    $forum_id = bbp_get_topic_forum_id($topic_id); 
    		$topic_id = bbp_get_topic_id($widget_query->post->ID);
    		$reply_id   = bbp_get_reply_id( $widget_query->post->ID );
    
    					$reply_link = '<a class="bbp-reply-topic-title" href="' . esc_url( bbp_get_reply_url( $reply_id ) ) . '" title="' . esc_attr( bbp_get_reply_excerpt( $reply_id, 50 ) ) . '">' . bbp_get_reply_topic_title( $reply_id ) . '</a> ('.bbp_get_topic_post_count($forum_id, $topic_id, $total_count).')<br />'. esc_attr( bbp_get_reply_excerpt( $reply_id, 40 ) ) . '';
    

    This is a snippet form the BBP latest post widget. It counts replies but not for separatly the latest post. It gives wrong results and those countresults are different on what page you’re visting. (index, forum, topicpage ect.)
    Could somebody put me in the wright direction?

    Many thanks in advance.

    #155909
    melanie bund
    Participant

    Hi my forum appears in a part of the site that has a generic login. So what i need is that users have to type in email and name in order to post – is this possible? is there a shortcode for this or do i have to add something to the bbpress.php?
    thank you in advance
    Melanie

    #155896
    Bob1nz
    Participant

    I found this

    /**
     * Return a map of WordPress roles to bbPress roles. Used to automatically grant
     * appropriate bbPress roles to WordPress users that wouldn't already have a
     * role in the forums. Also guarantees WordPress admins get the Keymaster role.
     *
     * @since bbPress (r4334)
     *
     * @return array Filtered array of WordPress roles to bbPress roles
     */
    function bbp_get_user_role_map() {
    
    	// Get the default role once here
    	$default_role = bbp_get_default_role();
    
    	// Return filtered results, forcing admins to keymasters.
    	return (array) apply_filters( 'bbp_get_user_role_map', array (
    		'administrator' => bbp_get_keymaster_role(),
    		'editor'        => $default_role,
    		'author'        => $default_role,
    		'contributor'   => $default_role,
    		'subscriber'    => $default_role
    	) );
    }

    Is there any way to add extra roles in that without editing the plugin files directly?

    #155894
    Robin W
    Moderator

    ok, the software is held in files, the content (forums, topics etc) is held in the database.

    Please read

    https://codex.bbpress.org/creating-a-test-site/

    for a long explanation of how wordpress is structured.

    I believe you issue is as simple as that the level of user that you are does not permit you to se the ‘backend’ – that is the forum stuff in the dashboard – so deleting and recreating the plugin will not help you.

    The answer I think is to go into phpmyadmin, and edit your entry to give yourself permission as per previous answer.

    The link above should give you sufficient to be able to find your entry and edit it.

    #155869
    Bob1nz
    Participant

    Hi πŸ™‚

    Well I am setting up a small community for a minecraft server and we have a plugin for minecraft that will sync the ranks in game to the website http://www.spigotmc.org/resources/communitybridge.2232/

    So I am trying to replicate the ranks in game on the wordpress website.

    The end goal is
    InGameRank -> WordPressRole -> bbPressRole
    Owner -> Owner -> Owner
    Co-Owner -> Co-Owner -> Co-Owner
    Admin -> Admin -> Admin
    Moderator -> Moderator -> Moderator
    Member -> Member -> Member
    Guest -> Guest -> Guest

    The owner would essentially be bbPress’s keymaster but I would like to define the capabilities of each role.

    Using the code I posted I am unable to change my forum role.
    I am currently still set as Administrator in the Site Role.
    When I select my user in the dashboard and select change the forum role to the owner rank I created and click change it just reloads the page and my forum role is still keymaster.
    I am able to change other users forum roles correctly.

    My main question is how to get the wordpress roles to sync to the bbPress roles effectively making it so if i change the wordpress role the bbpress role will also change.

    (what is up with the tag changes I did not put those)

    #155867
    Robin W
    Moderator

    @skisma

    The shortcodes can be used on any wordpress page

    so if fro instance you wanted a menu item that display the most recent 15 topics across all your forums, so that when people selected this menu item that what they saw, then you would

    1. create a page – maybe called ‘latest topics’
    2. put the shortcode into the content section in this case

    [bbp-topic-index]
    

    3. add that page to the menu

    #155864
    Robin W
    Moderator

    Thanks for posting the code, which if needed I’ll delve into

    but firstly

    It doesn’t appear to be working as intended though as I cannot give myself the owner role
    

    Can you give a bit more detail here as to exactly what you are doing, and where what you expect to happen isn’t, and any error messages etc.

    That is fully explain what ‘I cannot give myself’ means

    Thanks

    #155861
    Robin W
    Moderator

    I think you mean breadcrumbs the following shows breadcrumbs

    Layout and functionality – Examples you can use

    They are still there, so you should see them, might be another plugin or your theme is hiding them

    try

    Plugins

    Deactivate all but bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.

    Themes

    If plugins don’t pinpoint the problem, as a test switch to a default theme such as twentytwelve, and see if this fixes.

    #155848
    Hephaestus_Xii
    Participant

    Just in case it is not understood what i am looking to do. I want to be able to distinguish each forum as categories for example

    General discussions forum ————— Topics —————–Posts

    Topic 1
    Topic 2

    Funny Video Forum ———————— Topics ——————— Posts

    Topic 1
    Topic 2

    And so on …. so that it is broken into sections. I have made the forums and used the shortcode to display the forums.

    #155847
    Ellievant
    Participant

    Hey there,
    after having recently started with bbpress 2.5.4 and WP 4.1, I ran into a “404” problem after having created forum and topic as per the step-by-step directive (using method #2 with shortcode).
    Right from the start, a “404” appeared when startgin from the forum index page (the one with the shortcode). I spent the last 40 hrs reading and trying the various proposed fixes, none worked.
    However, deactivating the installed plugins and trying did point to WooCommerce Multilingual
    being the culprit, since the forums, subforums, categories, topics work fine when WC Mutlilingual is deactivated. If WC ML is activated, the same URL (using “postname”) is crashing to a “404”.

    I somebody has run into similar problem and/or a diagnosis on what the reason is-
    or even better can provide the magic fix, please step up and collect the praise… I myself m at the very end of my wits and carry a dangerous 1/8 knowledge about what I am doing…

    Cheers,
    O.

    #155845
    Robin W
    Moderator

    To change it in the database, you need to

    find out the id of the user – you can look that up in the ‘users’ table – probably called ‘wp_users’, just look for a line with the username in, and the user_id will be in the ID column.

    Then in the usermeta table sort by user_id, and look for your user, then the entry called

    wp_capabilities

    For a keymaster and admin it needs to say

    a:2:{s:13:"administrator";s:1:"1";s:13:"bbp_keymaster";b:1;}

    so FIRST copy what is already in there and save it to notepad or somewhere safe – you’ll want to be able to change it back if it doesn’t work and locks you out !!

    Then edit and put the above in.

    #155844
    Bob1nz
    Participant

    Hi

    This is my third time trying to post here hopefully it sticks this time.

    I am trying to add some custom roles to the bbpress forums and I have followed the Custom Capabilities codex page.

    It doesn’t appear to be working as intended though as I cannot give myself the owner role

    I would like these roles in bbpress to sync with some custom wp roles made with the members plugin.

    sorry for the wall of text below but its an effort to get this topic posted (i had links in the previous topics)

    here is what i have in my child themes functions.php

    // add bbPress Roles********************************************
    
     
    function add_new_roles( $bbp_roles )
    {
        /* Add a role called BlockFusion Owner */
        $bbp_roles['bbp_owner'] = array(
            'name' => 'BlockFusion Owner',
            'capabilities' => custom_capabilities( 'bbp_owner' )
            );
     
        /* Add a role called Co-Owner */
        $bbp_roles['bbp_co_owner'] = array(
            'name' => 'Co-Owner',
            'capabilities' => custom_capabilities( 'bbp_co_owner' )
            );
     
        /* Add a role called Admin */
        $bbp_roles['bbp_admin'] = array(
            'name' => 'Admin',
            'capabilities' => custom_capabilities( 'bbp_admin' )
            );
     
        /* Add a role called Moderator */
        $bbp_roles['bbp_moderator'] = array(
            'name' => 'Moderator',
            'capabilities' => custom_capabilities( 'bbp_moderator' )
            );
     
        /* Add a role called Member */
        $bbp_roles['bbp_member'] = array(
            'name' => 'Member',
            'capabilities' => custom_capabilities( 'bbp_member' )
            );
     
        /* Add a role called Guest */
        $bbp_roles['bbp_guest'] = array(
            'name' => 'Guest',
            'capabilities' => custom_capabilities( 'bbp_guest' )
            );
     
        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_owner' )
            $caps = custom_capabilities( $role );
     
        if( $role == 'bbp_co_owner' )
            $caps = custom_capabilities( $role );
     
        if( $role == 'bbp_admin' )
            $caps = custom_capabilities( $role );
     
        if( $role == 'bbp_moderator' )
            $caps = custom_capabilities( $role );
     
        if( $role == 'bbp_member' )
            $caps = custom_capabilities( $role );
     
        if( $role == 'bbp_guest' )
            $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 'BlockFusion Owner' role */
            case 'bbp_owner':
                return array(
    
    				// Keymasters only
    				'keep_gate'             => true,
                    
                    // Primary caps
                    'spectate'              => true,
                    'participate'           => true,
                    'moderate'              => true,
                    'throttle'              => true,
                    'view_trash'            => true,
     
                    // Forum caps
                    'publish_forums'        => true,
                    'edit_forums'           => true,
                    'edit_others_forums'    => true,
                    'delete_forums'         => true,
                    'delete_others_forums'  => true,
                    'read_private_forums'   => true,
                    'read_hidden_forums'    => true,
     
                    // Topic caps
                    'publish_topics'        => true,
                    'edit_topics'           => true,
                    'edit_others_topics'    => true,
                    'delete_topics'         => true,
                    'delete_others_topics'  => true,
                    'read_private_topics'   => true,
     
                    // Reply caps
                    'publish_replies'       => true,
                    'edit_replies'          => true,
                    'edit_others_replies'   => true,
                    'delete_replies'        => true,
                    'delete_others_replies' => true,
                    'read_private_replies'  => true,
     
                    // Topic tag caps
                    'manage_topic_tags'     => true,
                    'edit_topic_tags'       => true,
                    'delete_topic_tags'     => true,
                    'assign_topic_tags'     => true,
                );
     
                /* Capabilities for 'Co-Owner' role */
            case 'bbp_co_owner':
                return array(
                    // Primary caps
                    'spectate'              => true,
                    'participate'           => true,
                    'moderate'              => true,
                    'throttle'              => true,
                    'view_trash'            => true,
     
                    // Forum caps
                    'publish_forums'        => true,
                    'edit_forums'           => true,
                    'edit_others_forums'    => true,
                    'delete_forums'         => true,
                    'delete_others_forums'  => true,
                    'read_private_forums'   => true,
                    'read_hidden_forums'    => true,
     
                    // Topic caps
                    'publish_topics'        => true,
                    'edit_topics'           => true,
                    'edit_others_topics'    => true,
                    'delete_topics'         => true,
                    'delete_others_topics'  => true,
                    'read_private_topics'   => true,
     
                    // Reply caps
                    'publish_replies'       => true,
                    'edit_replies'          => true,
                    'edit_others_replies'   => true,
                    'delete_replies'        => true,
                    'delete_others_replies' => true,
                    'read_private_replies'  => true,
     
                    // Topic tag caps
                    'manage_topic_tags'     => true,
                    'edit_topic_tags'       => true,
                    'delete_topic_tags'     => true,
                    'assign_topic_tags'     => true,
                );
     
                /* Capabilities for 'Admin' role */
            case 'bbp_admin':
                return array(
                    // Primary caps
                    'spectate'              => true,
                    'participate'           => true,
                    'moderate'              => true,
                    'throttle'              => true,
                    'view_trash'            => true,
     
                    // 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'    => true,
     
                    // Topic caps
                    'publish_topics'        => true,
                    'edit_topics'           => true,
                    'edit_others_topics'    => true,
                    'delete_topics'         => true,
                    'delete_others_topics'  => true,
                    'read_private_topics'   => true,
     
                    // Reply caps
                    'publish_replies'       => true,
                    'edit_replies'          => true,
                    'edit_others_replies'   => true,
                    'delete_replies'        => true,
                    'delete_others_replies' => true,
                    'read_private_replies'  => true,
     
                    // Topic tag caps
                    'manage_topic_tags'     => true,
                    'edit_topic_tags'       => true,
                    'delete_topic_tags'     => true,
                    'assign_topic_tags'     => true,
                );
     
                /* Capabilities for 'Moderator' role */
            case 'bbp_moderator':
                return array(
                    // Primary caps
                    'spectate'              => true,
                    'participate'           => true,
                    'moderate'              => true,
                    'throttle'              => true,
                    'view_trash'            => true,
     
                    // 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'    => true,
     
                    // Topic caps
                    'publish_topics'        => true,
                    'edit_topics'           => true,
                    'edit_others_topics'    => true,
                    'delete_topics'         => true,
                    'delete_others_topics'  => true,
                    'read_private_topics'   => true,
     
                    // Reply caps
                    'publish_replies'       => true,
                    'edit_replies'          => true,
                    'edit_others_replies'   => true,
                    'delete_replies'        => true,
                    'delete_others_replies' => true,
                    'read_private_replies'  => true,
     
                    // Topic tag caps
                    'manage_topic_tags'     => true,
                    'edit_topic_tags'       => true,
                    'delete_topic_tags'     => true,
                    'assign_topic_tags'     => true,
                );
     
                /* Capabilities for 'Member' role */
            case 'bbp_member':
                return array(
                    // Primary caps
                    'spectate'              => true,
                    'participate'           => true,
                    'moderate'              => false,
                    'throttle'              => true,
                    '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'         => true,
                    'delete_others_topics'  => false,
                    'read_private_topics'   => true,
     
                    // Reply caps
                    'publish_replies'       => true,
                    'edit_replies'          => true,
                    'edit_others_replies'   => false,
                    'delete_replies'        => true,
                    'delete_others_replies' => false,
                    'read_private_replies'  => true,
     
                    // Topic tag caps
                    'manage_topic_tags'     => true,
                    'edit_topic_tags'       => true,
                    'delete_topic_tags'     => true,
                    'assign_topic_tags'     => true,
                );
     
                /* Capabilities for 'Guest' role */
            case 'bbp_guest':
                return array(
                    // Primary caps
                    'spectate'              => true,
                    'participate'           => true,
                    'moderate'              => false,
                    'throttle'              => true,
                    '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'         => true,
                    'delete_others_topics'  => false,
                    'read_private_topics'   => true,
     
                    // Reply caps
                    'publish_replies'       => true,
                    'edit_replies'          => true,
                    'edit_others_replies'   => false,
                    'delete_replies'        => true,
                    'delete_others_replies' => false,
                    'read_private_replies'  => true,
     
                    // Topic tag caps
                    'manage_topic_tags'     => true,
                    'edit_topic_tags'       => true,
                    'delete_topic_tags'     => true,
                    'assign_topic_tags'     => true,
                );
     
                break;
     
            default :
                return $role;
        }
    }
    
    #155805

    In reply to: CSS issue

    Robkk
    Moderator

    try this

    add this code anywhere you can put custom css

    li.bbp-body div.hentry {
    margin-bottom: 0;
    overflow: hidden;
    padding: 0px !important;
    }
    Robkk
    Moderator

    the loop-forums.php file you downloaded from github

    and in the same file you can change word Freshness to whatever you want.

    just change this

    <li class="bbp-forum-freshness"><?php _e( 'Freshness', 'bbpress' ); ?></li>

    to something like this for example.

    <li class="bbp-forum-freshness"><?php _e( 'Last Post', 'bbpress' ); ?></li>

    #155789

    In reply to: Import Hung?

    Robkk
    Moderator

    we are not dead :/


    @netweb
    is the bbPress community’s import specialist

    the guy is most likely asleep now because he was working on some bbPress tickets all night… or all day depending on Aussie time??

    as for bbcodes bbcodes is not a default feature for bbPress you would need an additional plugin for that.

    https://wordpress.org/plugins/gd-bbpress-tools/ this plugin comes with a quote feature and more.

    there is another plugin called bbpress 2 bbcode which would also need the whitelist plugin by the same developer.

Viewing 25 results - 9,901 through 9,925 (of 32,505 total)
Skip to toolbar