Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: bpContents 0.1X Core Code – Dev Sneak Peek


Burt Adsit
Participant

@burtadsit

http://ourcommoninterest.org/downloads/bpcontents013.zip

Changes 0.13

– Added OCI_Container::delete() to delete the current container and all it’s children

– Removed OCI_Tree::tree_get_containers($node), added tree_get_children($node, $type)

– Changing thing to remove php 5 dependencies.

– Made all class methods static where possible, yes Andy it’s better this way

– Added OCI_Template_Items class for container template loops in themes, no pretty bells and whistles yet. I cut out all non-essential things to understand it better.

– Added a few oci_get_the_item_xxx(), oci_the_item_xxx() template tag functions to test the template class.

– Added a oci-test-template.php file for testing the template class and template tags. I drop it into the bp home theme dir and create a wp page using that as a template for the page. It’ll show up as “OCI Test Template” in the wp back end.

– To use the template you need to point the loop start tag to an existing container like “/recent” if you are testing using blog posts.

<?php if ( oci_has_items(“/recent”)) : ?>

Point it to where ever you are sending blog posts. The following in oci_contents_setup_globals() sends blog posts from any blog to /recent and /other/place

$recent = new OCI_Container(“/recent”, true);

$other = new OCI_Container(“/other/place”, true);

$oci->listeners->blog_posts = new OCI_Item_Blog_Post_Listener();

$oci->listeners->blog_posts->add_destination(“/recent”);

$oci->listeners->blog_posts->add_destination(“/other/place”);

So you can change the loop start tag to:

<?php if ( oci_has_items(“/other/place”)) : ?>

Then browse to your new test template page to view the results instead of using oci_test_print_tree.php to just dump the tree.

Skip to toolbar