Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 1 through 25 (of 457 total)

  • Boris
    Participant

    @travel-junkie

    @hnla
    I do see the point and I did not mean at all that we don’t need a codex. I was merely replying to an earlier comment.


    Boris
    Participant

    @travel-junkie

    @mercime
    Linking to a wikipedia article will not, apparently, get you any brownie points with @ethanvan ;)

    @ethanvan
    Just start writing on the codex. If you can’t cause of permissions or whatever, let the core team know and they’ll sort you out. This is a community-driven project. The more you participate, the more you’ll be recognized. Being disrespectful to people that have already shown their dedication and involvement will only make you look weak.

    A codex is a valuable thing to have, no doubt, but I don’t believe that the lack of one will cause developers to turn away from the project. If you can write code then you can read and understand code. If you work with any of the dozens of IDEs out there, then any function, class or method is only 1 or 2 clicks away. That way is quicker than trawling through the codex, WP or BP. For me anyways.


    Boris
    Participant

    @travel-junkie

    `Wait until you have a myriad of new features and THEN make a release`

    Now, that’s bad practice right there. Ever heard of release early, release often?

    I agree that the codex isn’t anywhere near where it should be. But holding a release up to finish documentation shouldn’t happen.


    Boris
    Participant

    @travel-junkie

    Rather than doing two loops, one of which will run through all available groups to perform a database request each time, just do 1 query that gets all group ids and then pass those ids to the include parameter. Something like this:

    `function my_get_groups_for_country( $country = ” ) {
    global $wpdb, $bp;

    $group_ids = $wpdb->get_col( $wpdb->prepare( “
    SELECT group_id
    FROM {$bp->groups->table_name_groupmeta}
    WHERE meta_key = ‘group-country’
    AND meta_value = %s
    “, $country ) );

    return $group_ids:
    }`


    Boris
    Participant

    @travel-junkie

    Oh, yeah, forgot that BP_User_Query’ll only land in v1.7. Can’t think of anything else apart from a custom SQL query then. Maybe a good idea to refactor it once you upgraded to BP 1.7, though.


    Boris
    Participant

    @travel-junkie

    Also, a select box might not be the best option for what you have in mind. Imagine you’ll get a result of a couple hundred users. Becomes completely unusable. Not sure what your ultimate goal is with that selectbox, but I’d look at other options.


    Boris
    Participant

    @travel-junkie

    What do you need the profile fields for? Seems like WP_User_Query would do the job perfectly.
    https://codex.wordpress.org/Class_Reference/WP_User_Query.

    If role is stored as an xprofile field, you might want to look at BP_User_Query. Haven’t used that class yet, but it might do what you want.


    Boris
    Participant

    @travel-junkie

    The time spent on running all the filters and actions is negligible, really. And if you need the extra functionality a plugin provides, then it doesn’t matter if you include the code as a plugin or include it via your theme’s functions.php file. It’s got to get loaded anyways. The only difference is the time when it gets loaded.

    Personally, I have a look at the code before I install a plugin for the first time. Nicely formatted code and proper in-code documentation give you a good first impression of the code you’re about to run. Of course, to most end-users this will only be goobldygook, but there are tools out there. YSlow, Debug Bar Console, etc. Then there’s plugins that monitor the load time and can give you detailed information about the load times (had a quick look for one I sometimes use, but couldn’t find it).


    Boris
    Participant

    @travel-junkie

    It’s a myth that a WP site runs slower or more poorly the more plugins you have installed. The more plugins you install, the greater the chance that one of them is written poorly, which could then cause a bottleneck of some kind and slow your site down. So it’s about the quality of the plugins and not the amount of them.


    Boris
    Participant

    @travel-junkie

    Sorry, that txt file seems to have gotten deleted during the redesign and general housecleaning a year or so ago. I don’t have it around anymore neither. It’s fairly easy to write yourself, though. Just have a look at the groups API functions and pack it into a foreach loop.


    Boris
    Participant

    @travel-junkie

    Well, this is really a support site rather than a social network, even if it does use BP, so a chat plugin of any kind is probably not appropriate (at least in my opinion).


    Boris
    Participant

    @travel-junkie

    First of all, I guess that’s what the personal activity stream is for. Anyways, comments are linked to post ids and members are (not yet? maybe never? who knows…) not a custom post type yet.

    You could probably create a new activity type and add that to the profile. Seems to be the easiest, I guess, although I don’t really see the point.


    Boris
    Participant

    @travel-junkie

    Something like this in bp-custom.php:

    `function my_filter_group_stati( $stati ) {
    if( $key = array_search( ‘hidden’, $stati ) ) {
    unset( $stati[$key] );
    }

    return $stati;
    }
    add_filter( ‘groups_valid_status’, ‘my_filter_group_stati’ );`


    Boris
    Participant

    @travel-junkie

    What @mercime said together with filtering `groups_valid_status` to only return public and private should do the trick.


    Boris
    Participant

    @travel-junkie

    Have you had a look at Mapology?
    http://shop.shabushabu.eu/plugins/mapology.html

    There’s a test site at http://test.shabushabu.eu where you can try the plugin before commiting to buy.

    Please note that I am the developer of that plugin.


    Boris
    Participant

    @travel-junkie

    Create a page called forums, or discusssions or whatever you like (if you haven’t already), then go to the BP pages settings and chose the page you created for your forums component. Save and all sshould be good.


    Boris
    Participant

    @travel-junkie

    Don’t include the [ ] in the syntax :)

    So it’d be like this:
    `UPDATE wp_bp_activity SET action = replace(action,’admin1‘,’admin2‘);`


    Boris
    Participant

    @travel-junkie

    That would be something like this:
    `UPDATE [tablename] SET [fieldname] = replace([fieldname],'[string_to_find]’,'[string_to_replace]’);`

    You’ll need to substitute stuff like [tablename] with the correct values.


    Boris
    Participant

    @travel-junkie

    You’ll have to enqueue the Javascript files in bp-messages/js/autocomplete and the css file in bp-messages/css/autocomplete. There’s also some inline JS that needs to be included, which you can find in bp-messages/bp-messages-cssjs.php.

    The file paths above are for BP 1.5. Not sure, but could be slightly different for lower versions.


    Boris
    Participant

    @travel-junkie

    If you want to add a record, then there are API functions to do that for you for the most part. `xprofile_insert_field()` is one such function. There’s more in bp-xprofile/bp-xprofile-functions.php.

    If you really do need to query the database directly, then you can find the table names within the $bp global, e.g. `$bp->groups->table_name` for the main groups table.

    If there are API functions, then you should use these. Only query directly if you can’t find a function to do the heavy lifting for you.


    Boris
    Participant

    @travel-junkie

    That would’ve been something like this:
    `function bpe_setup_globals()
    {
    global $bp;

    // some stuff

    $bp->active_components = 1;

    // some more stuff
    }
    add_action( ‘bp_setup_globals’, ‘bpe_setup_globals’ );`

    It’s probably been 5 days to a week since the last upgrade.

    Mine might not be the most elegant solution, but at least it makes sure that my plugin is working :)


    Boris
    Participant

    @travel-junkie

    Ended up using `register_activation_hook` and `register_deactivation_hook` to modify the `bp-active-components` option, which populates the `$bp->active_components` array.


    Boris
    Participant

    @travel-junkie

    This site here is not a sandbox. It’s not meant to test things out. That would be http://testbp.org, as you can see from the theme, for example. testpb runs the default theme, while we have a more or less functional custom theme here ;)

    Install BuddyPress in a subdomain or, better locally on your home computer, and test out what it can do and what it can’t do. testbp is good in that you can see what you can do as an end user, but you won’t know what you can adjust as a site admin.


    Boris
    Participant

    @travel-junkie

    Allright, cheers! More than a few days should be enough to fit everything in :) There’s never enough hours in a day, though…


    Boris
    Participant

    @travel-junkie

    These are not bugs, they’re notices, meaning that the plugin will still work. These have been resolved in BP 1.5, btw.

Viewing 25 replies - 1 through 25 (of 457 total)
Skip to toolbar