Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'bbpress'

Viewing 25 results - 27,301 through 27,325 (of 64,744 total)
  • Author
    Search Results
  • moonoi
    Participant

    I have a few questions that I was hoping one of the bbPress developers would be able to give me a quick hint about offhand.

    I’m getting results that leave me completely puzzled, as I try to hook into or directly modify the `bbp_get_caps_for_role()` function in `/core/capabilities.php`.

    The `bbp_get_caps_for_role` filter
    My purpose is to try and return an array with true on all caps for any role, because I need to find out why only the keymaster gets to upload images.

    My first attempt is just to use the `’bbp_get_caps_for_role’` filter provided by the function. This is where the mysterious stuff starts…

    I can add the filter, and when I check the `$wp_filters` global afterwards, I can verify that the filter has been added correctly. However it doesn’t fire. When I check the `$wp_filters` array inside the `bbp_get_caps_for_role()` function, just before the hook is applied, my filter has vanished. So somewhere there must be a function removing my filter. But where, and why!?

    Testing by returning the `$caps` array with all caps set to `true`
    So giving up on the filter for now, I simply try to hardcode the all-true `$caps` array directly into the `bbp_get_caps_for_role()` function and returns this, regardless of role. What then happens is even weirder. – Now my user can not even post a reply in the forum.

    How can setting all caps to true end up giving my user less rights in the forum?!

    Thanks in advance guys!

    For reference, here is the bottom part of my hacked `bbp_get_caps_for_role()` function:
    `
    …
    ‘assign_topic_tags’ => true,
    );

    break;
    }

    $caps = 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
    );

    return $caps;
    //return apply_filters( ‘bbp_get_caps_for_role’, $caps, $role );
    }
    `

    #126289
    moonoi
    Participant

    Ok so after digging and reading for many hours, getting a bit more into the situation, I’ve found answers to my questions above. So now I guess I’d just like to chime in to help find the best solution.

    Members plugin
    As I understand it, Justin’s Members plugin has pretty much fixed WP’s handling of capabilities by saving these roles in wp_usermeta as if they were capabilities, and allowing the assignment of capabilities to roles, instead of assigning them to individual user (which is just mad).

    Even though WP already supports multiple roles per user, its own user edit form sabotages this by removing all but one role if you click “save”.

    So it seems to me that if (hopefully when) the Members plugin become part of core, there shouldn’t be any need for bbPress to introduce a role handling interface – instead it would just add to the confusion, which I think is the case now, even though I realize that it is a valiant effort to fix a problem with WP core at this point in time.

    Solution?!
    So wouldn’t all this be solved right now by just modifying WP’s user edit form to allow for multiple role assignment?

    moonoi
    Participant

    Ok, so I fixed half of this problem. Turns out that somewhere, someone has made the bbP function that checks if the wp_editor should be used return false, if the user is not “keymaster”.

    Since I have no idea where or why this happens, I’ve overridden it by inserting this in my theme (maybe someone else has the same problem):
    `
    add_filter(‘bbp_use_wp_editor’, ‘ml_allow_wp_editor’, 1000, 2);
    function ml_allow_wp_editor($value, $default) {
    return true;
    }
    `

    The “participant” users still get an error, when they try to upload a file. I hope someone who knows the inner workings of bbP can help.

    Thanks!

    moonoi
    Participant

    I also just discovered that this is related to another problem I have:

    Only the keymaster can upload files in the new media manager screen. If a “participant” tries to upload, it just returns the standard “Error – try again later” message.

    #126282
    undyingearth
    Participant

    I’ve almost got this working, but my PHP-fu skills are not quite strong enough. @johnjamesjacoby and @thesnowjunkies pointed me in the right direction, but I feel like I must be making a basic mistake in the implementation.

    I found the function bbp_get_time_since in /plugins/bbpress/includes/common/functions.php

    I managed to achieve the desired effect by deleting the following:

    `
    // Step two: the second chunk
    if ( $i + 2 $since ) {
    $output = $unknown_text;

    // We only want to output two chunks of time here, eg:
    // x years, xx months
    // x days, xx hours
    // so there’s only two bits of calculation below:
    } else {

    // Step one: the first chunk
    for ( $i = 0, $j = count( $chunks ); $i < $j; ++$i ) {
    $seconds = $chunks[$i][0];

    // Finding the biggest chunk (if the chunk fits, break)
    $count = floor( $since / $seconds );
    if ( 0 != $count ) {
    break;
    }
    }

    // If $i iterates all the way to $j, then the event happened 0 seconds ago
    if ( !isset( $chunks[$i] ) ) {
    $output = $right_now_text;

    } else {

    // Set output var
    $output = ( 1 == $count ) ? '1 '. $chunks[$i][1] : $count . ' ' . $chunks[$i][2];

    // Step two: the second chunk
    if ( $i + 2 < $j ) {
    $seconds2 = $chunks[$i + 1][0];
    $name2 = $chunks[$i + 1][1];
    $count2 = floor( ( $since – ( $seconds * $count ) ) / $seconds2 );

    // Add to output var
    if ( 0 != $count2 ) {
    $output .= ( 1 == $count2 ) ? _x( ',', 'Separator in time since', 'bbpress' ) . ' 1 '. $name2 : _x( ',', 'Separator in time since', 'bbpress' ) . ' ' . $count2 . ' ' . $chunks[$i + 1][2];
    }
    }

    // No output, so happened right now
    if ( ! (int) trim( $output ) ) {
    $output = $right_now_text;
    }
    }
    }

    // Append 'ago' to the end of time-since if not 'right now'
    if ( $output != $right_now_text ) {
    $output = sprintf( $ago_text, $output );
    }

    return apply_filters( 'bbp_get_time_short', $output, $older_date, $newer_date );
    }

    `

    This almost works. It cuts off the extra chunk. The problem is, it also returns a freshness value that is several years off. Instead of saying "10 minutes ago", it gives me "12 years ago"!

    Any ideas what I'm doing wrong? I can achieve what I want by editing the core plugin, but I'd really like to update-proof this.

    Thanks!

    J.S.

    #126281
    youngmoneychina
    Participant

    Hi,

    Sorry to jump in but this is exactly the function i am looking to implement.

    Did you get anywhere with it?

    I have found various plugins that will allow you to do option 2 and 3 but your first option is where i am also stumped. Justins “members” plugin seems to look like it should option 1 but it does not seem to.

    Like you i basically need a way of making forums or topics only visible to a specific member and the admin.

    for example:

    I post a topic “Johns support topic”

    When i log in as admin i can see it and participate in it.

    When other users log in they cannot see it or participate in it.

    When John logs in he can see it and participate in it.

    The issue is i will need a large amount of these “Support topics” so cannot make John able to see “hidden_forums” etc.

    Thanks, any advice is appreciated.

    #126279

    Topic: New Frugal Community

    in forum Showcase
    Ben
    Participant

    A huge thank you to the entire bbPress community!

    I am excited to launch my frugal community today. This has been a bucket list item for a long time, and thanks to the hard work of everyone here it is now a reality.

    Please feel free to take a look. Comments are always welcome and appreciated.
    http://www.afrugalreality.com/

    Best,
    Ben

    #126278
    Peter
    Participant

    Hello, Is there a way to edit the bbpress registration email when a user first registers. I know in previous version you could do this by editing the functions.bb-users.php file, But what about the new version? I am using version 2.2.4. Any help is appreciated.

    Thank you

    florianbottermann
    Participant

    I added a code line to functions.php. Now, the name of the commentator is linked. But the is only a forwarding to the blog entry, not to the bbPress profile page of the commentator…
    commentator name

    florianbottermann
    Participant

    Here comes the functions.php code:
    functions.php

    And here comes the bbPress code:
    bbPress

    florianbottermann
    Participant

    I’m working at a WordPress site in which I want to use the bbPress plugin. Now, I want to create a link between the normal WordPress comment function and bbPress. I just want to do one thing. Under my standard WordPress blog entries, the users of my site can post comments. The comments are listed under the respective blog article. Next to each comments there the picture of the user that creates the comment. Now I want to create a link between the picture of the commentator and his bbPress profile page. When someone presses the picture of the commentator, there should be a forwarding to the bbPress profile page of the commentator. Observer of my blog can get a few informations about the commentator by that. Unfortunately I’m not able to create the link.

    This is the code of my functions.php, that describes the comments setup of my normal WordPress commenting system:

    And this is the bbPress php code which creates the user avatar link to the profile page:

    Can somebody tell me the way how I have to modify the WordPress functions.php?

    Even now, many thanks for your Help!

    #126273
    kraigg
    Participant

    You could install the BuddyPress plugin, which has forums listed under groups. If you decide to go with this option, make sure to do a backup of your database first, just in case.

    Or you could customise your forum list page using bbPress shortcodes (https://codex.bbpress.org/shortcodes/). You would just need to get the IDs of the forums. Such as:

    Forums page
    ———–

    Main forums
    [bbp-single-forum id=32]
    [bbp-single-forum id=1]
    [bbp-single-forum id=5]

    Other forums
    [bbp-single-forum id=23]
    [bbp-single-forum id=12]
    [bbp-single-forum id=54]
    [bbp-single-forum id=3]
    [bbp-single-forum id=7]
    [bbp-single-forum id=8]

    #126270
    Stephen Edgar
    Keymaster
    #126268
    xmasons
    Participant

    I’m trying to create a page that includes only recent topics which would only be available to a forum role of Participant and a visibility of Private.

    Creating a new page and using the short code [bbp-topic-index] doesn’t work, as the Private page visibility is based on WordPress user roles and not bbPress.

    Is there a way to create an additional forum template that lists recent topics? This would not replace the main forum list view, but would be an additional page.

    #126267

    In reply to: bbPress 2.2.4 Released

    hatherley
    Participant

    Still, my music forum is still only capable of using BBpress 2.1.2 – The “Automatically assign default role to new, registered users upon visiting the site.” doesn’t seem to work for me. My newly registered users cant use the forum if I update 🙁

    moonoi
    Participant

    After upgrading to 2.2.4, only the “keymaster” role gets the normal fancy post editor with a choice between WYSIWYG view and source code view.

    Normal “participant” users only get the source code view (exactly like in this support forum). There’s the row of helper buttons to insert code, but you can’t switch to the WYSIWYG view.

    I checked that there are no JS errors. (This is usually what prevents the tabs for switching to show up).

    I figure it must have something to do with the capabilities of the forum roles, but I don’t know how I would be able to view or change these. I use the Members plugin to edit roles and caps for the rest of WP.

    #126265
    moonoi
    Participant

    Thanks Justin and John for all your amazing contributions to the community. I have a few questions/thoughts…

    Dynamic roles – how to edit their caps?
    The switch to “dynamic” roles in the most recent BBPress has left me completely puzzled. I’m still not sure what “dynamic” is supposed to mean?!

    I can’t seem to find anywhere to view and/or edit the caps of these new forum roles. I’d like to, for some reason only “keymaster” users get the wysiwyg post edit form, whereas “participant” can only see the source code pane (no, there are no js errors?!).

    Roles and capabilities in WP
    I have been using Justin’s Members plugin, which made roles and caps in WordPress work like I feel it should. In the same way as in Drupal core. Any number of roles can be assigned to a user. Caps are assigned to roles – never to one single user of course. One specific user will have the combined capabilities of the roles he/she has.

    Am I right that the only thing keeping us from just having a happy life together with Members plugin – assigning many roles to one user – is WP core’s User Edit screen that cuts everything else but one role away when you click save? If so, this should be easy to fix by just modifying this User Edit form. Right!?

    Thanks! 🙂

    #126262
    intimez
    Participant

    Hoping someone can confirm this bug to avoid this issue being skipped for the 2.3 release since it is considered critical

    ———————–
    john the admin creates group1 – jane creates group2 (private)

    when jane visits group2 to create a forum post, it is posted to group1 and everyone can view the private forum post.

    tested twice with new installs wordpress 3.5.1 + buddypress trunk-6779 + bbpress trunk 4761

    jane is a standard user (participant)

    #126255
    VictorTookes
    Participant

    Does anyone know if this works, or if there is any ability to make it work? I’m manually transferring a busy forum over to bbpress.

    #126244
    #126242
    paucal
    Participant

    Hi, I have BBPress installed in my wordpress GEO Theme. My site is US nationwide which means people can post their place listing for every State and City. I would like to offer the option to the place listing owners to create a private forum for their place. So, it will more than likely be thousands of private forums within my site. Is this possible with BBPress?

    #126241
    dwbroad
    Participant

    Thanks for your reply.

    I have just tried putting something at the top of the bbpress.php file but it seems that it never even reaches that file, wordpress seems to decide straight away that the page doesn’t exist so sends it to the 404 bypassing bbpress completely….

    #126237
    sontru
    Participant

    `
    <?php
    /*
    Plugin Name: Test add_user_to_blog with bbPress
    Plugin URI:
    Description: Does what it says! Menu item will appear under Users Menu in admin’s CP
    Author: sontru
    Version: 1.0.0
    Author URI:
    */

    add_action( ‘admin_menu’, ‘ad_the_wp_menu’);

    function ad_the_wp_menu() {
    global $bbtestpage;
    $bbtestpage = add_users_page(‘bbPressBugtest’, ‘bbPress Bug Test’, ‘administrator’, __FILE__, ‘addsutoblogfunc’);
    }

    function addsutoblogfunc()
    {
    if(trim($_POST[‘username’]) === ” || trim($_POST[’email’]) === ”) {
    echo ‘<h3>bbPress Bug Test</h3>’;
    echo ‘<p>Activate the bbPress plugin. Add a user using this page, refresh by displaying to All Users. If there is an issue, all sub sites will appear in this user\’s My Sites drop down list.</p>’;
    echo ‘<form method=”post” name=”create-user-test” action=”‘ . the_permalink() . ‘” />’;
    echo ‘Username: <input type=text value=”” name=”username”> Email: <input type=text value=”” name=”email”><input type=submit value=”Create User”>’;
    }
    else {
    $my_user = trim($_POST[‘username’]);
    $my_email = trim($_POST[’email’]);
    $my_user_id = username_exists($my_user);
    if( !$my_user_id and email_exists($my_email) == false) {
    $random_password = wp_generate_password( $length=12, $include_standard_special_chars=false );
    $my_user_id = wp_create_user( $my_user, $random_password, $my_email );
    echo “<p>Creating new user: $my_user with email: $my_email | Generated userID: $my_user_id</p>”;
    if($my_user_id && !is_error_id($my_user_id))
    add_user_to_blog(get_current_blog_id(),$my_user_id,’administrator’);
    } else echo ‘<p>User: $my_user exists or email: $my_email exists! Nothing done!</p>’;
    }

    }
    ?>

    `

    Use with care!

    #126236
    sontru
    Participant

    Thanks for confirming the first bug. (I’ve also found that this bug can be fixed by simply saving the settings as is.)

    I’ve been doing some more investigation on the second issue. It looks like it is not the add_user_to_blog function but the wp_create_user function (probably used in conjuction with add_user_to_blog) that is causing the problem. I’ve written a simple admin page (menu item appears under the Users menu) that will manifest the issue on my multisite setup.
    `
    [code with angle brackets removed to be posted]
    `
    Unfortunately, I have not been able to replicate this using a new install of WordPress MS v3.4.2, bbPress and a few sub sites and users. I will have to carry on looking to why my live MS site is causing this issue to manifest.

    #126234
    Hieke
    Participant

    Thanks for your reply.

    I suspect Better WP Security and bbpress and/or BuddyPress are not compatible or I didn’t figure out the right settings yet.

    What is happening: one creates an account, and after receiving an activating e-mail, one fills in name and password, and after that the defeault WP login screen appears (huh) an one has to fill name and password again. I think this is where one can make an new user?

    WP-login is supposed to be hidden by Better WP Security, instead some sort of redirect appears in the URL. See testforum http://www.nietdragenmaarklagen.nl

    The users multiplied by night, there are 5 now. What is remarkable: these users have WP user role: subscriber and Forum role: none.

    The next question is: how to secure this forum? With what plugin or settings?

    Thanks.

Viewing 25 results - 27,301 through 27,325 (of 64,744 total)
Skip to toolbar