Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 15,151 through 15,175 (of 32,519 total)
  • Author
    Search Results
  • #120503

    There’s sekrit codez in the codez.

    #120487
    remike
    Participant

    Thank you for your reply.

    I’m quite surprised to hear that. It looks completely broken for me and my users.The “forum” link from the menu does work fine as I pasted the shortcode on a page.

    What doesn’t work is the link “forums” in the navigation bar http://hosting0948899.az.pl/wp/forums/
    as well as the user profile pages
    http://hosting0948899.az.pl/wp/uzytkownik/bulka_tarta/

    It copies the index form on 30 pages on one after another. It looks really strange,
    http://img4.imageshack.us/img4/8997/forumbroken.png

    #120483
    htz77
    Participant

    Wow! Bingo! THANK YOU JJJ. Super simple fix too. Here’s what I did, if this helps anyone else:

    add_filter('bbp_get_user_role_map','my_bbPress_role_map');
    function my_bbPress_role_map($role_map){
    $role_map['student'] = bbp_get_participant_role();
    return $role_map;
    }

    This is added to my functions.php.

    #120479

    @tzeldin88 – Again, difficult to be confident, but you could filter bbPress’s role mapping, to add custom comparisons for your newly created roles. Then bbPress will just naturally make:

    X site role = Y forum role

    with each new user that visits the site.

    The filter you’d want to use, is bbp_get_user_role_map. It looks like 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
    	) );
    }
    #120477

    In reply to: bbPress 2.2.1

    @rossagrant – BuddyPress is a whole different animal. It assumes every user on your site always has a link to their root profile. If you have BuddyPress bolted on top, you’re probably okay.

    What BuddyPress does *not* do yet, and likely won’t for some time, is separate multiple bbPress forums across multiple sites on a multisite network, and give them their own spot in a user profile.

    I’ll end up building something similar to this for WordPress.org/BuddyPress.org/bbPress.org eventually, but until then, it’s only pseudo-code in my imagination.

    #120455

    I’m getting this on all my sites that have upgraded to 2.2.x (tested on 2.2.1 too):

    Uncaught TypeError: Object [object Object] has no method 'suggest'

    This relates to this part of the code added to every page of the WP Admin area:


    jQuery(document).ready(function() {

    var bbp_topic_id = jQuery( '#bbp_topic_id' );

    bbp_topic_id.suggest( ajaxurl + '?action=bbp_suggest_topic', {

    onSelect: function() {
    var value = this.value;
    bbp_topic_id.val( value.substr( 0, value.indexOf( ' ' ) ) );
    }
    } );
    });

    #120447
    sambedingfield
    Participant

    Disabled my cache plugin and re-saved permalink and forum settings with no luck.

    I’ve scanned my custom code to see if there’s a custom hook I’ve played with in the past that’s overwriting it – but can’t find anything.

    Here’s the problem page: http://www.ratsclan.com/users/admin/

    #120445

    In reply to: bbPress 2.2.1

    @rossagrant – The display role is actually a bit different than taking the literal role from the user. It uses capabilities rather than the role, to adjust the output based on the user’s ability.

    See the bbp_get_user_display_role function for more.

    It does this because it needs to handle Inactive users (spam/deleted) as well as anonymous/logged-out users, neither of which have a literal role, but also have different “roles” in the forum, for lack of a better way to put it.

    “Member” is the ambiguous word I used for “user is registered, but does not actually have a literal role on this site in the database.”

    Open to suggestions here, if it’s too confusing.

    #120440
    Sami Keijonen
    Participant

    Thanks Pippin. Justin Tadlock gave me same advice to go into that file. Let me tell you that it’s little out of my head. But I definitely try this out and report here if I find a solution.

    $query->set( 'meta_key', '_bbp_last_active_time' );
    $query->set( 'orderby', 'meta_value' );

    This actually works better because now sticky posts are in their ‘natural’ position, not last.

    Olivier Lettinga
    Participant

    Thnx!

    I just saw this post a bit too late and was already half way rewriting the original twentyten theme files.

    Now this page: https://codex.bbpress.org/theme-compatibility/ is also outdated then.

    What is the proper way to make a child theme now?

    fuzzybee
    Participant

    I’m trying to create a custom forum index page which should look exactly like the default forum index page with forum names, number of topics, number of posts, last active topic etc. but sorted alphabetically based on forum names.

    I’m looking at at bbp_has_forums, bbp_forums and bbp_list_forums inside /wp-content/plugins/bbpress/bbp-includes/bbp-forum-template.php.

    However, I’m puzzled which function to use and
    What arguments/ parameters I should pass?
    the comments in bbp-forum-template.php itself says the same parameters as WP_Query() but would it make sense at all to have something like “post_type” => “forum”
    I’m sure one can be clearer/ more explicit about the parameters here in some form of documentation

    I gave it wild tries as follows
    1) The following gives me fatal error:

    $args = array(

    'orderby' => 'title',
    'order' => 'ASC',

    );

    while (bbp_forums($args)){
    bbp_the_forum();

    echo bbp_get_template_part( 'content', 'archive-forum' );

    }

    The error:
    Fatal error: Call to undefined method stdClass::have_posts() in C:\www\forums.local\wp-content\plugins\bbpress\bbp-includes\bbp-forum-template.php on line 109 Call Stack: 0.0004 333592 1. {main}() C:\www\forums.local\index.php:0 0.0006 337280 2. require(‘C:\www\forums.local\wp-blog-header.php’) C:\www\forums.local\index.php:17 0.3864 38499368 3. require_once(‘C:\www\forums.local\wp-includes\template-loader.php’) C:\www\forums.local\wp-blog-header.php:16 0.3920 38515824 4. include(‘C:\www\forums.local\wp-content\themes\bp-tap\custom-index.php’) C:\www\forums.local\wp-includes\template-loader.php:43 0.4732 38674368 5. bbp_forums() C:\www\forums.local\wp-content\themes\bp-tap\custom-index.php:42

    2) While the following just takes forever to load:

    $args = array(

    'orderby' => 'title',
    'order' => 'ASC',

    );

    while (bbp_has_forums($args)){
    bbp_the_forum();

    echo bbp_get_template_part( 'content', 'archive-forum' );

    }

    I’m using WordPress 3.4.2 and bbPress 2.1.2.
    I’ve copied all files and directories from /wp-content/plugins/bbPress/bbp-themes/bbp-twentyten/ to my theme directory.

    • This topic was modified 13 years, 7 months ago by fuzzybee.
    • This topic was modified 13 years, 7 months ago by fuzzybee.
    • This topic was modified 13 years, 7 months ago by fuzzybee.
    • This topic was modified 13 years, 7 months ago by fuzzybee.
    • This topic was modified 13 years, 7 months ago by fuzzybee.
    • This topic was modified 13 years, 7 months ago by fuzzybee.
    • This topic was modified 13 years, 7 months ago by fuzzybee.
    • This topic was modified 13 years, 7 months ago by fuzzybee.
    fuzzybee
    Participant

    Thanks, John, those are very helpful.

    I managed to insert all the postmeta and I had a successful migration with plain PHP and MySQL a while back.

    I suppose there is not off documentation in place yet and I’m just need to read codes, I think.

    1 thing comes across as odd though: I’m using 2.1.2 and I seem to find the _insert_function‘s inside ...wp-content/plugins/bbpress/bbp-includes/bbp-forum-functions.php and so on instead of what you mentioned?

    Are you speaking in terms of some older version bbPress?

    #120414
    Sami Keijonen
    Participant

    I finally started playing with bbPress. There are lot to learn because I want to display topics totally differently what is the default output.

    First I want to display latest topics by latest activity like usual. I’ve created archive-topic.php in my theme so I can decide output.

    After that I can filter topic post type so that topics are ordered by latest activity.

    add_action( 'pre_get_posts', 'my_filter_topic' );

    function my_filter_topic( $query ) {

    if( $query->is_main_query() && is_post_type_archive( 'topic' ) ) {

    $query->set( 'meta_key', '_bbp_last_active_id' );
    $query->set( 'orderby', 'meta_value_num' );
    $query->set( 'order', 'DESC' );

    }

    }

    But this doesn’t display sticky posts first. They are more like last. Does someone have an idea how I get sticky posts to show first?

    #120402
    Stephen Edgar
    Keymaster

    How about giving our ‘Get Started with bbPress’ document a go?

    https://codex.bbpress.org/getting-started-with-bbpress/

    If you have any problems following this let us know and we will try to improve it.

    fuzzybee
    Participant

    Someone mentioned using loop the bbPress’ way bbp_has_forums()

    Would you like to give it a try?

    #120380
    Stephen Edgar
    Keymaster

    Create a new WordPress page and pick and choose some shortcodes from the following URL and add them to that page… https://codex.bbpress.org/shortcodes/

    #120376

    My first guess is s2member hooks in too late, or some other plugin is loading the current user way too early in the stack. bbPress doesn’t perform any of those actions until it expects WordPress to make them happen naturally.

    If the current_user is loaded before the ‘after_setup_theme’ action is called (because of an is_super_admin() check, a call to current_user_can(), etc…) bbPress fails gracefully, and waits until it’s time. If S2member waits until init to add its roles, or if the WP_Roles array doesn’t include the s2Member roles by the time ‘after_setup_theme’ has fired, $wp->init(); will get called, loading the current user, and bbPress will map the roles accordingly.

    Another possible problem is bbp_get_user_role_map() not mapping custom roles; it only maps to WordPress core roles. A possible fix to bbp_set_current_user_default_role() would be to array_diff() editable_roles() vs bbp_get_dynamic_roles(), loop through them, use the map where it matters, and use the default role otherwise.

    #120371

    bbPress 2.2 implements a new way to think about user roles in both WordPress and bbPress. A few users have posted up having issues after upgrading, so I’m going to take some time to explain what changed and why.

    The problem bbPress 2.2 addresses, is the situation where a users ability to take certain actions in the forums was dictated by their role on the entire site, or their “blog role” as I’ll refer to it in some places going forward.

    This means that in the past, a user could not be both a blog Editor and a forum Moderator at the same time; you’d need to be one or the other, and it was clear this wasn’t what anybody wanted.

    In bbPress 2.0 and 2.1, every time you activated bbPress on a site, it went in and added a bunch of capabilities to the database. You never knew this, but it needed these roles so that users could perform certain tasks. bbPress would go in and modify the core WordPress roles, to add these capabilities to them. This made multisite installations a challenge, and network activation was very difficult too, because these roles needed to be added to every single site.

    For existing users of sites, bbPress performed a bunch of calculations and educated guesses to automatically grant users with certain roles and capabilities. To do this, it would eventually need to add capabilities to the user, or switch them to a role that had those capabilities already; Forum Participant.

    Subsequent updates to bbPress required database migration scripts for every change to user roles and capabilities. This is a lot of work for very little gain, since we’re not solving any problems with users needing multiple roles, and at the same time we’re polluting the database with a bunch of data that doesn’t change 99% of the time.

    Under the hood, WordPress comes with support for users having multiple roles, and this is a perfect use-case for needing that functionality. Roles are just groups of capabilities. If a user has a role, it’s safe to assume they also have certain capabilities, right?

    Wrong. Kind of. Sometimes.

    Capabilities are saved in the database, per user, per site, and they bubble based on the role they are granted. If you use any plugin that modifies editable roles or capabilities in the database, what you’re doing is changing the individual capabilities for every user that gets that role going forward, but not necessarily every user that had that role in the past.

    Remember, individual users have individual capabilities. When a user gets a new role that is modified in some way, they also get assigned the changed capabilities, either positive or negative. Negative capabilities are explicitly negative, and neither WordPress nor bbPress use these in core. They’re tricky, and make it easy to break things.

    Once you’ve gone this far in, you’re playing with fire and will likely get burned. You now have altered core user roles, extra forum user roles, and a mish-mash of registered users with a random assortment of capabilities, based on when they signed up, what role they were granted, and what you happened to have changed that blog role’s capabilities to be at that moment.

    To top this all off, there is no “repair” for your users, they’re basically stuck.

    For bbPress users that never modified user roles or capabilities, their update process would be smooth sailing. It’s the modifications to database permissions that cause issues with bbPress 2.2. Why?

    bbPress 2.2 introduces the concept of “dynamic roles” VS WordPress’s “editable roles.” What’s the difference? Editable roles are saved in the database, and allow you to completely shoot yourself in the foot (as above) once you start changing them around. Dynamic roles do not touch the database in any way, other than to assign the 1 role to the user, side-by-side with any other role they might have on your site.

    bbPress comes with filters to allow you to modify the roles, and it’s still possible to add or subtract specific forum capabilities to a user if you needed to, and without all the fuss and danger of bbPress interfering with existing user roles and capabilities.

    For users that are stuck with users that can’t access the forums, try using the forums role repair tool, located in: Admin > Tools > Forums

    That tool loops through your users, and grants them a forum role based on their blog role based on the following map:

    Admin = Keymaster
    Editor = Participant
    Author = Participant
    Contributor = Participant
    Subscriber = Participant

    The map can be filtered, as can the default role of Participant. The problem will come in with existing users that have modified Participant roles that you may have tinkered with. They’ll end up with capabilities that are totally out of whack, no matter what you do. You’ll need to use an additional tool on top of this, if you want to clean up those old roles introduced by plugins like S2member.

    Going forward, I’d like to get a better idea on what these plugins are doing, and make sure that bbPress plays as nicely as it can with them. Dynamic roles in WordPress core are probably a few releases away, but it’s important to bbPress’s future to have them in and working as soon as possible, to get everything dialed in for everyone.

    #120370
    Stephen Edgar
    Keymaster

    If I get a change today i’ll try to update https://codex.bbpress.org/bbpress-user-roles-and-capabilities/

    That said though if anyone else wants to update it before I get a chance feel free to do so, if you have a bbpress.org username and pass you can edit the codex docs yourself. There are quite a few updates needed for 2.2 in the codex docs and any help would be greatly appreciated.

    Just click ‘login’ at the top right of the page using the same bbPress username & password you use here at bbpress.org and edit away.

    #120333
    caneblu
    Participant

    Hi@all
    dont know if is my installation or not.. After upgrading BBpress 2.2 editor users (role author) can’t use Editor because is not available and tabs Visual and HTML also not working .
    As administrator works fine…
    I have on my theme some shortcodes integrated into MCE. Just try to deactivate it but no success. If i shutdown BBPress all works back.
    Any suggestions?

    #120324
    kraigg
    Participant

    Thanks so much @jmdodd!

    I had some redirect code in /wp-content/plugins/bp-custom.php, which redirected user straight to the forum page when they clicked on a group, instead of the group’s homepage which a lot of our users found confusing.

    I just had to change the last line from “forums” to “forum” and that seems to have done the trick.


    function redirect_group_home() {
    global $bp;
    $path = clean_url( $_SERVER['REQUEST_URI'] );
    $path = apply_filters( 'bp_uri', $path );
    if (bp_is_group_home() && strpos( $path, $bp->bp_options_nav[$bp->groups->current_group->slug]['home']['slug'] ) === false ) {
    $bp->groups->current_group->status == 'private' || $bp->groups->current_group->status == 'hidden') {
    if ($bp->groups->current_group->status == 'public' || ($bp->groups->current_group->is_user_member && $bp->groups->current_group->status == 'private') || ($bp->groups->current_group->is_user_member && $bp->groups->current_group->status == 'hidden')) {
    // bp_core_redirect( $path . 'forums/' );
    bp_core_redirect( $path . 'forum/' );
    }
    }
    }


    @johnjamesjacoby
    feel free to toy around with website and test the installation. The link is in my previous post. I’m not using S2members though, but User Role Editor. I still need to do some more thorough testing before I move all this onto my production website.

    #120309
    Anonymous User 7670885
    Inactive

    OK, thank JJJ (maybe is a good idea to put inside codex page) 🙂

    #120306

    In reply to: New Topic button?

    1. Make a new WordPress page.
    2. Use the bbp-topic-form shortcode.
    3. Done.
    #120295
    Mark Maunder
    Participant

    Jennifer,

    Yes we’re using S2Member but nothing changed with that. The upgrade seems to have triggered it so perhaps it’s an incompatibility between s2member and 2.2.

    After I downgraded to 2.1.3 I’m getting “You do not have permission to create new topics.” for any user including admin when they try to create a new topic. Looks like the 2.2 upgrade changed the DB schema making downgrade impossible?

    So we’re between a rock and a hard place. I’m going to dive into the bbPress code because this is a production website supporting our security plugin. If you have any additional pointers like the s2member suggestion which was very helpful I’d very much appreciate them.

    Regards,

    Mark.

    #120289
    lucianoippolito
    Participant

    *** UPDATE ***

    I was able to fix it. My problem was I was pasting the URLs in visual mode and wordpress converted it in hyperlinks. Pasting the URL in HTML mode fixes the problem.

    Thank you for your help,
    Luciano

Viewing 25 results - 15,151 through 15,175 (of 32,519 total)
Skip to toolbar