WordPress and Facebook – Part 3
I posted previously about the Wordbook plugin for WordPress which links your WordPress blog to your Facebook account. I’d down loaded it and installed it and it worked quite well.
Then I wrote about how it reposted WordPress posts if you edited them. It only did this if they were more than a day old which seemed a bit odd. So I changed the code to stop it doing that.
Also I wanted to have a link back from my blog to my Facebook account so I wrote a very minimal sidebar widget to link the two together.
This morning I’ve been recoding the widget so that its more flexible
So my widget now supports:
- Widget title can be changed by the user, it’s no longer fixed as Facebook Status
- User can override the name displayed – so rather than using the name on Facebook you can display a different one. On Facebook my name is shown as Stephen, but if I want on my widget that could be replaced by “Steve” or Wombat, or anything!
- Different Date Formats. You can now select from a choice of date formats including a Facebook style textual one.
I might add some more formatting options such as changing the style of the status (currently fixed as italic).
To make sure that the widget and the plugin don’t get separated I’d coded my widget into the end of the plugin code and some people on the Wordbook group on Facebook have cut and pasted in to their copies of the plugin and it all seems to work.
But now my widget code is up to 179 or so lines and its getting a bit much to ask people to cut and paste it into their code. So I guess once I’ve got it tidied up a bit I’ll need to contact the developers of the plugin and get my code merged into the code base over on the WordPress plugins site.
Or if you want to try it now then follow these easy steps:
- Download the widget code :wb_widget.php
- Save the file into the wordbook directory under your plugins folder. Ensure you save/rename the file as wb_widget.php
- Edit the main wordbook.php file and add the following line immediately preceding the closing ?> tag at the end of the file: include(“wb_widget.php”);
This also means that when I add features to the widget you just need to grab the latest version from here.