Skip to:
Content
Pages
Categories
Search
Top
Bottom

Announcing Unofficial Version 1.2 of bp-skeleton-component


  • Jeff Sayre
    Participant

    @jeffsayre

    Since it was necessary for us to have an up-to-date skeleton component from which to work, we went through all the Changesets since v1.1 of this component was released, making any necessary changes to bp-skeleton-component-1_1. I thought it would be useful for the community, so I polished it up a little bit and packaged it in a zip file.

    We started all the way back at Changset 1046 (the first Changeset dated february 10, 2009, the date v1.1 of the skeleton component was released) and ending with the most recent Changeset 1324. That’s 278 changesets of changes to scour.

    We’ve created a readme file, that’s distributed with the package, that lists all the Changesets implemented.

    I cannot and do not guarantee that we got everything right. I would not use this in a production environment. Only use it for development and testing purposes at this time. So, you’ve been properly warned! ;)

    Please post any issues you may have with this version of the skeleton component within this thread. As this is not an official BuddyPress pacakge, do not report bugs in trac.

    So, with that caveat, if you’re looking for the most-up-to-date BuddyPress skeleton component version, then I present to you bp-skeleton-component-1_2_URC1. The first unofficial release candidate for a version 1.2 of this developers’ bare-bones component:

    UPDATE: This version is now official (along with some more updates) please download this version. Huge thanks to Jeff Sayre for all his work on this!

    http://testbp.org/resources/bp-skeleton-component-1.2.zip

    I hope you find this useful.

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

  • Jeff Sayre
    Participant

    @jeffsayre

    More Details:

    To use this unofficial version of the skeleton component, you should at least be running WPMU 2.7.1 beta1 and BP r1324 (although you’ll probably be okay if you just have r1303 installed). But, you should at least by aware of this important change: https://trac.buddypress.org/changeset/1316

    I’ll keep the package posted at the above location until it is either proved a disaster or is found useful and becomes an official BuddyPress package (Hint Hint).

    We did not make changes through a subversion controlled environment. I did not deem that necessary. We did, however, comment all of our changes and started each comment or comment group with “v1.2_URC1:”. So, you can search on that phrase and see where we’ve made changes.

    Andy, it would be great if others with more intimate knoweldge of the inner workings of BuddyPress and the recent changes could look at this unofficial version of the skeleton component. I’d be more than happy to transfer it to your domain to use as is or alter as necessary.


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    So is this the official announcement of the unofficial plugin, or the unofficial announcement of the unofficial plugin?

    I’d hate to get the two confused. ;)

    Either way it’s awesome for you to keep up with that. I’m sure Andy will appreciate it. I will probably be using it too shortly for a few projects as well, so while I’m not grateful yet, you can count on it eventually. ;)

    Good work!


    Jeff Sayre
    Participant

    @jeffsayre

    Thanks, John!

    So is this the official announcement of the unofficial plugin, or the unofficial announcement of the unofficial plugin?

    I’m not officially at liberty to say. Unofficially I’m confused too! ;)

    Jeff, you’re a genius. I shall begin construction of a temple to worship you straight after dinner.


    Jeff Sayre
    Participant

    @jeffsayre

    Thanks, DJPaul!

    No temple necessary. A small shrine, however, might be nice. ;)


    nicolagreco
    Participant

    @nicolagreco

    This will work anyway if bp is switched off and when someone switch on it he will give a redeclaration error

    Look here:

    $active_plugins = get_site_option( 'active_sitewide_plugins' );
    if ( isset( $active_plugins['buddypress/bp-loader.php'] ) )
    require_once( BP_PLUGIN_DIR . 'bp-core.php' );

    or making a system of hooks in hooks i made fo bpdev plugins to prevent “undefinied functions error”


    nicolagreco
    Participant

    @nicolagreco

    bp-core.php should be bp-loader.php


    Jeff Sayre
    Participant

    @jeffsayre

    Hi, Nicola!

    That code does not exist in the skeleton component. I assume you are suggesting that it be added?


    nicolagreco
    Participant

    @nicolagreco

    yes to make it working with bp 1303+ sure!

    this plugin has to be installed in /plugins

    Since exactly WHEN have we needed to include bp-loader.php in plugins? Last I knew it was bp-core.php.


    Jeff Sayre
    Participant

    @jeffsayre

    I guess I’m a little confused as well.

    I know that bp-loader.php was added to the repo and included as part of the BP package in Changeset 1311, but I thought it simply managed the “loading” of activated BP components.

    All custom plugins need to reference bp-core.php.


    nicolagreco
    Participant

    @nicolagreco

    it’s the same, bp-loader loads all bp components (bp-core included)

    Using bp-loader is better because a plugin could require some code that is included in a bp component that is switched off.

    Anyway “it should”, not “it must” :)


    Jeff Sayre
    Participant

    @jeffsayre

    @Nicola-

    I understand what you’re saying.

    But when I look at bp-loader, I don’t see how referencing it will allow a custom plugin to access code in a switched off BP component. Only enabled components get included.

    Correct me if I’m wrong Nicola, but Andy mentioned bp-loader in IRC shortly after the move to WP 2.7.1 branch – you were talking about the warnings that your series of plugins were triggering.

    I’m 99% sure that as Andy was looking through he said bp-loader at one point but retracted that.


    exay
    Participant

    @exay

    In the languages / language file is missing … when it is available?

    Exactly the same place the language file is in the version 1.1.


    Jeff Sayre
    Participant

    @jeffsayre

    @Exay-

    The skeleton component does not come with a language file. It has a language directory in which you can place your custom language file–if any.

    It is up to each component developer to offer language support (beyond the typical l10n coding) if they choose to do so.


    Jeff Sayre
    Participant

    @jeffsayre

    Has anyone had an opportunity to look at this yet–or even begin developing with it.

    Please remember, as this is not (yet?) an official BuddyPress package, you should post any issues you find with bp-skeleton-component-1_2_URC1 in this thread and not in trac.

    Of course, trac would not even be the proper place to post any issues with the official version of the skeleton component. ;)

    Jeff

    I am using this to work through a cool plugin idea I have, but i’m not the world’s quickest coder. I’ll let you know if I get problems.


    Jeff Sayre
    Participant

    @jeffsayre

    @DJPaul

    Sounds good!

    By the way, I’m not that quick of a coder either. When it comes to coding, I say it’s better to be good than quick. :)

    You’ve gone and tempted fate now. Here’s the first something I noticed in bp-example-classes.php:

    function bp_example_tablename( $id = null ) {
    if ( $id ) {
    $this->id = $id;
    $this->populate( $this->id );
    }
    }

    /**
    * populate()
    *
    * This method will populate the object with a row from the database, based on the
    * ID passed to the constructor.
    */
    function populate() {
    global $wpdb, $bp, $creds;

    if ( $row = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->example->table_name} WHERE id = %d", $this->id ) ) ) {
    $this->field_1 = $row->field_1;
    $this->field_2 = $row->field_2;
    $this->field_3 = $row->field_3;
    }
    }

    ;)

    I think, but aren’t sure and am not going to go back to test right now, that I have to move the call that created the admin menu – it wasn’t working out of the box.


    Jeff Sayre
    Participant

    @jeffsayre

    If I understand correctly what’s happening–or rather not happening–, you’ve created a Buddybar menu item that is not working / not showing up. Is that the issue?

    Hooking into the Buddybar menu occurs by adding an add_action call within a given function in the bp-example file, not bp-example-class file. Of course, you need to be hooking into something. The class file is only for coding your database access.

    Now, if you’re trying to create site admin menus in WPMU’s backend, then you do so in bp-example-admin.php. Look at the bp-xprofile-admin.php file for great examples of how this is done.

    Or, maybe I’m misunderstanding the issue.

    no meant two things. dont worry about admin thing but there’s an error in the code – populate() doesn’t take arguemtn


    Jeff Sayre
    Participant

    @jeffsayre

    Ah, I see.

    Okay, let me look at this and make the necessary changes. Since we did not change this code in v1.2, this bug was also in version 1.1 as well.


    Jeff Sayre
    Participant

    @jeffsayre

    Hum…

    Well, as it is written in the example, the populate function gets called directly through the bp_example_tablename(), passing the contents of $id via $this->id.

    There are some alternative examples of the populate function that do take arguments. In particular, look at populate() in bp-blogs-classes.php, bp-groups-classes.php, bp-messages-classes.php, and bp-xprofile-classes.php. In some of those files, there is more than one occurrence of the populate function. They exist in different classes.

    Perhaps in the skeleton we should provide a commented out example of a populate function that takes arguments.

Viewing 25 replies - 1 through 25 (of 33 total)
  • The topic ‘Announcing Unofficial Version 1.2 of bp-skeleton-component’ is closed to new replies.
Skip to toolbar