Redbrick Planet for X-Dashboard

This is rather funky. If your a WordPress user there is this nice plugin called X-Dashboard which allows you to configure the ‘dashboard’ on the WordPress interface.

I only recently figured out how to get the Dashboard working properly on Redbrick (see the Redbrick Wiki Topic “Installing WordPress”) so I fired up the plugin and am now able to configure what appears in it.

Whats just a little bit cooler is that you can write mini plugins for the plugin that allow you to include different feeds. So I wrote two, one for Planet Redbrick and one for Planet Irish Gaming.

Install the X-Dashboard plugin normally. There should be a folder in your plugins directory called x-dash-plugins. Create a file called redbrick_feed.php (you can use nano, pico or touch) with these contents:

< ?php
/*
x-Dash-Plugin-Name:Planet Redbrick

*/

global $wpdb, $user_ID;

$rss = @fetch_rss('http://planet.redbrick.dcu.ie/rss20.xml');
if ( isset($rss->items) && 0 != count($rss->items) )
{
xdash_show_title(‘Planet Redbrick’);

if ($xdash_cur_section == ‘main’) {
?>

< ?php _e('Below is the latest blogs from Redbrick users, click on a title to go that site.'); ?>

< ?php } ?>

    < ?php
    $rss->items = array_slice($rss->items, 0, 6);
    foreach ($rss->items as $item )
    {
    ?>

  • ‘>< ?php echo wp_specialchars($item['title']); ?> — < ?php echo human_time_diff( strtotime($item['pubdate'], time() ) ); ?> < ?php _e('ago'); ?>
  • < ?php
    }
    echo "

“;
}
?>

and chmod it to 755. Now you can have the latest redbrick blog posts in your dashboard!

Likewise for the Irish Gaming Planet feed, create a file called igp_feed.php with this:

< ?php
/*
x-Dash-Plugin-Name:Irish Gaming Feed

*/

global $wpdb, $user_ID;

$rss = @fetch_rss('http://irishgamingwiki.com/planet/rss20.xml');
if ( isset($rss->items) && 0 != count($rss->items) )
{
xdash_show_title(‘Planet Irish Gaming’);

if ($xdash_cur_section == ‘main’) {
?>

< ?php _e('Below is the latest news from Irish Gaming, click on a title to go that site.'); ?>

< ?php } ?>

    < ?php
    $rss->items = array_slice($rss->items, 0, 6);
    foreach ($rss->items as $item )
    {
    ?>

  • ‘>< ?php echo wp_specialchars($item['title']); ?> — < ?php echo human_time_diff( strtotime($item['pubdate'], time() ) ); ?> < ?php _e('ago'); ?>
  • < ?php
    }
    echo "

“;
}
?>

and also chmod it to 755. :)

Related Posts: