WPMU Hacks for BDP RSS, Optimal, & YouTube

In my previous post I failed to detail how I hacked WPMU in order to include BDP RSS & Optimal in a static page and embed YouTube videos in posts. Sorry for this oversight, below you will find the play-by-play (soon to be ported over to bavawiki).

Integrating BDP RSS & Optimal into a WP Page
In a one-off WP install this would not be a hack because you could use the Exec-PHP plug-in to quickly and easily execute the requisite PHP code for BDP RSS and Optimal in a page or post. However, WPMU intentionally disables the Exec-PHP plugin, effectively forbidding the administrator from executing PHP in pages and posts. Therefore, we have to do some minor surgery. The way I got the PHP to work in a static page is by inserting it into a custom page template (one of several ways I am sure, and not necessarily the prettiest). Here’s how:

  • To create a new page template, copy the code from the page.php file in your theme directory. (Note: I am using K2 -this may be slightly different for other themes -but the logic should be similar.) Copy the code into a blank document in your favorite text editor and include the following line of code at the very beginning of your new template:

    In the space that says “Name your template here” name the template. For example, “John Smith’s English 101”.

  • Once you have done this, find the following lines of code in the file:

    Most Recent Posts

    And copy the BDP RSS php code on the line after this code. It should look like this for the K2 theme:

    Most Recent Posts


    Presto, that should paste the BDP RSS feeds into the page content, just save the file with the name of your choice with a *.php extension and copy it into your current themes directory. You can the select it from the “Page-Template” drop-down menu in the right-hand sidebar when creating a new page.

    Please note that you have to customize your own BDP RSS settings according to your own output logic.

  • I chose to put the Optimal plugin code in the sidebar, but have enabled the sidebar widgets, I can’t really customize this space as I would like, namely only have the optimal plugin display. So, I further hacked this template to only put the PHP code for the optimal plugin in the sidebar. Replace the code in this template with the following code:

    List of Class Blogs with posts

    A couple of notes here, I am using blogbridge (thanks to Darcy) to publish the OPML file for each class.

    Please note, once again, that you are going to have to customize your own link and settings for the optimal plugin.

  • Finally, I understand that such a process may be a tad bit laborious for a large number of classes as it stands now. But this is a work-around until there is a safe, manageable way to execute PHP code with pages and posts in WPMU. Until then, think of this as a shortcut to keep the testing and experimenting real time.

Integrating YouTube into WPMU

  • This one’s a little shorter, this hack was offered by the user malandry on the WPMU forums here. Warning: there are some potential security risks for allowing embed tags in a post, so if you don’t control who is using your blogs to some degree, I would highly recommend not including the YouTube hack for WPMU.

May the force be with you, and have fun!

This entry was posted in WordPress, wordpress multi-user and tagged , , , , , , , , , , , , , . Bookmark the permalink.

9 Responses to WPMU Hacks for BDP RSS, Optimal, & YouTube

  1. Matt says:

    Thanks so much for posting this, Jim — I had been having trouble getting the BDP Aggregation going without exec-php. Thanks to your post, I’ve got it working now.

    It seems to me that providing aggregation from student blogs in a WPMU installation is essential to making WPMU work. Ideally, this should be built into WPMU itself . . . perhaps it will be in future versions.

  2. jimgroom says:

    I whole-heartedly agree, Matt. ITDamager has created a WPMU sitewide feed, but it is only working with dynamic sub domain installs thus far, and we are not running that option just yet.

    I think playing with the feed possibilities right now is the next step to a larger system-wide integration. I am fairly certain, given my scouring of the forums, that more sophisticated feed capabilities will be in the near-future builds.

    Functionality I would love to see, that comes stock with WordPress.com sites, is the community tags. This could be extremely useful for feeding student content to specific courses, groups, organizations, etc. The digital five ring binder manifested!

    Also, isn’t time WordPress integrated with MediaWiki in more sophisticated ways? I can think of a million and one uses for this relationship.

  3. Gardner says:

    Blowin’ my mind. As always. Thanks, Jim.

  4. Pingback: “We aint one-at-a-timin’ here, we’re mass communicatin’!” at bavatuesdays

  5. Pingback: WPMu Smackdown: RSS, Autoblogs, Aggregators, o-matics, and more… at ELS Blogs

  6. Pingback: jimgroom » WPMu Smackdown: RSS, Autoblogs, Aggregators, o-matics, and more…

  7. Pingback: jimgroom » “We aint one-at-a-timin’ here, we’re mass communicatin’!”

  8. Pingback: Semiologic Test » Playing with SimplePie for WordPress

  9. Brian says:

    Oh man oh man is this a timesuck… You are a brave and noble man, Ranger Jim.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.