After getting bored on working on my final year project I decided to take a look at creating widgets word my blog. There are SVN hooks on my repositories that store the commit details in a SQL database. I thought I would create a widget that would pull out the last message and display it.
/*
Plugin Name: LastCommit
Plugin URI: http://blog.yeticode.co.uk/
Description: Gets Last Commit Message
Author: John Tindell
Version: 1
Author URI: http://blog.yeticode.co.uk/
*/
function lastCommit_widget() {
$server = 'localhost';
$link = mssql_connect($server, 'username', '************');
echo '
';
echo "
Last Commit
";
if($link)
{
mssql_select_db('svnyeti', $link);
$query = mssql_query('select top 1 * from SVNLog order by liLogEntryPk desc', $link);
$row = mssql_fetch_array($query);
print '
' . $row['lszLogEntry'] . '
';
}
echo '
';
}
function init_lastCommit(){
register_sidebar_widget("LastCommit", "lastCommit_widget");
}
add_action("plugins_loaded", "init_lastCommit");
When I get more time I will develop this a bit more.
Li-An 9:40 pm on September 17, 2009 Permalink |
Too bad it does not work in french…
BigAl 2:42 am on September 18, 2009 Permalink |
I was checking out your plug-in on wordpress, and while trying to check out the link to the yahoo thing it uses, the link leads to a 404 page. Is this going to still work or not?
John 9:57 am on September 18, 2009 Permalink |
Yer for some reason I forgot to escape the url correctly in the plugin readme.txt file. Heres the link
http://developer.yahoo.net/blog/archives/2009/09/ahoy_mates_conv.html
Admiral Piratepants 9:55 am on September 18, 2009 Permalink |
Yar! This be a piratetastic site, avast!
http://www.play-and-stay.co.uk/
Some translation (though not the whole site), games and general piratical shenanigans.
JArrrrrrr 6:33 pm on September 18, 2009 Permalink |
I installed the WordPress plugin and activated it, but it doesn’t seem to be working. Is there some trick I’m missing?