Category: Open Source

For posts about open source software such as Wordpress, Social Web CMS and my own project, Hotaru CMS.

Pointer to my SWCMS Modules Page

I’ve been continuing to develop modules for the Social Web Content Management System, and have listed the ones I’ve made so far on a new page: My SWCMS Modules.

My latest creations are a sin bin for temporarily disabling users, a way to block repeat submissions of deleted stories, a module that builds an RSS feed for comments, and I’ve improved the original private messaging module with bulk message deletion, an outbox and email notification of new messages.

My First SWCMS Modules Released

SWCMS stands for Social Web Content Management System, and it is the social news software that powers JapanSoc.com.

SWCMS is open source, meaning anybody can contribute to its development, and I’ve been busy doing just that. I’m not a professional developer by any means so I usually report bugs and suggest improvements. Recently, I’ve tried my hand at making modules (the equivalent of WordPress plugins) and I’ve come up with two so far:

Smilies Module

The Smilies Module converts smiley text into little faces like this: πŸ™‚ . Smilies are an excellent way to inject some emotion into comments and the occasional πŸ˜‰ is handy to show you’re being sarcastic and prevent any unintended arguments with other users.

RSS Basic Module

Although it started as a simple tool to display an RSS feed on a SWCMS site, the RSS Basic module has grown over successive versions into something quite powerful. The site’s administrator can import multiple feeds, manage them through a control panel and display them anywhere on a page. The best feature, however, is that users can embed an RSS feed into their SWCMS profiles, just as I have done on my JapanSoc profile.

The RSS Basic module really taught me a lot about SWCMS as I had to learn how to create an admin interface and work with the database. I’m hoping that I’ve mastered the basics of module making and will go on to make bigger and better things!

Let me add that I’m enjoying contributing to the open source project so other users can benefit from my modules rather than me selfishly developing for JapanSoc only.

Put Code Snippets in a WordPress Blog

I’ve installed WP-Syntax, a great plugin for WordPress that lets you add code snippets to your blog posts without losing all the formatting.

You can use all manner of languages and even include line numbers if you want. Here’s a snippet from one of my math worksheet makers written in Perl:

5
use List::Util shuffle;    # Use the Shuffle module
166
167
168
169
170
171
# define and populate the arrays
my @girlsnames = ('Erin','Anna','Joanne','Sally', 'Mary');    
my @boysnames = ('Adam','Ken','Tom','Paul','David', 'Sam'); 
 
@girlsnames = shuffle @girlsnames;    # shuffle the girls' array
@boysnames = shuffle @boysnames;    # shuffle the boys' array
377
378
$name1 = pop(@boysnames);    # assign last name in array to $name1;
$name2 = pop(@girlsnames);    # assign last name in array to $name2;

Set Up A JapanBlogger Blogroll in WordPress

JapanBlogger is the perfect complement to JapanSoc. While the latter promotes individual articles and pages from the Japan-related web, JapanBlogger serves to promote entire sites. This is done by a blogger submitting his or her site, and watching people vote for it and leave feedback.

Harnessing the power of JapanBlogger

Since JapanBlogger sorts its database of blogs according to popularity (i.e. the number of votes each site receives), I thought it would be great to provide an rss feed which bloggers could import and use as a blogroll on their own sites.

This serves two purposes. First, it gives the blogger an instant, ready-made blogroll with the best Japan-related sites. Second, by clicking on each link in the blogroll, the visitor passes through JapanBlogger where he or she can vote the site in question up or down and leave a comment. That extra step is what encourages activity and keeps the blogroll fair.

JapanBlogger Feed One – the “best of the month” feed

Site owner, Billy West, had been thinking along the same lines and had already set up what I shall call JapanBlogger Feed One.

JapanBlogger Feed One can be found at http://japanblogger.net/feed/ and is a list of the highest ranked sites, followed by the most ranked sites. This list is maintained manually and updated each month, usually accompanied by an annoucenment to congratulate the “best blogs of the month”.

JapanBlogger Feed Two – the “current highest rated” feed

Unlike Feed One, this second feed is dynamic, meaning it updates automatically and multiple times a day, giving you the most up-to-date list of top ranked sites from JapanBlogger. You can find this feed at http://japanblogger.net/highest_rated.xml.

Both feeds can be subscribed to just like any feed, and can be read with most popular feed readers. However, this tutorial is about how to set up these rss feeds (or any feed for that matter) in a self-hosted WordPress installation, i.e. WordPress.org.

Note: If you have a Typepad, Movable Type, Blogger, Blogspot, WordPress.com, or any other site and are able to import these feeds, please share your knowledge!

Step One: Getting a JapanBlogger Feed

If you are running a browser without RSS support (such as IE6), please copy and paste the links above. Otherwise, you can get to the feeds from the RSS icon at the top of the browser when looking at JapanBlogger, as shown.

Step Two: Getting the url

Clicking on one of those choices brings up the feed in your broswer. From there, copy the url.

Step 3: Putting the feed into WordPress

From your WordPress Dashboard, navigate to “Design”->”Widgets”. If your version of WordPress is old, or your theme doesn’t support widgets, you’ll need to find an rss plugin instead.

Add an RSS widget to your sidebar and paste the url you copied into the first field, as shown in the picture below. Leave the other settings untouched (or change items from 10 to 20 as I did). Click “Change” then “Save Changes”.

Now visit your site and see your new blogroll!

Note: This doesn’t actually affect your current blogroll. This is just an addition to your existing sidebar.

These screenshots show the feed in action on this blog, LongCountdown.com…

… and also on the JapanSoc Community Blog:

Troubleshooting

If the feed shows in the sidebar, but the the links don’t go anywhere, try clicking one of the links (it worked for both me and Billy) or pressing CTRL + F5 to “hard refresh” the page.

If you are using the dynamic, “highest rated” feed but don’t see any changes to the rankings, click here. Congratulations, you’ve updated the feed! Just visiting any page on the JapanBlogger navigation bar forces the feed to update itself. Now refresh your page and you should see the latest changes.

Recent Posts in Category – WordPress Plugin

An example of the Recent Posts in Category plugin in action.Hot on the heels of my If Older Than’ plugin for WordPress, I’ve put together another little script that returns a list of recent posts from a category you specify. So, for example, if you want to show a list of the last 10 posts from your Japan Food category, now you can.

On the right you can see a screenshot of how I’m using it on one of my other websites. It’s especially suited to a newspaper-style blog, or a custom archive page.

If you like to prefer to use WordPress widgets and are afraid of editing theme files, then you might want to avoid this plugin (and all my others come to think of it!).

Otherwise, you can download it from my WordPress plugins page.

If Older Than – WordPress Plugin

It’s been a while since I made a WordPress plugin, but today I had the urge to put some ads on my blog, in places where my regular readers won’t see them. I could have used a plugin such as the Shylock Adsense Plugin, but it has far more options than I need. Instead, I made a little script to do this:

If Older Than WordPress Plugin Example

My plugins are WordPress Old Skool

NO fancy customization options in the admin panel, NO widgets, NO user support! My plugins need you to open your theme editor and paste some PHP into your template. If you can do that, you are old skool, too! πŸ˜›

Download from my WordPress Plugins page

Visit my new WordPress Plugins page to see what I’ve made (most are taken from my old website, Nice4Rice.com).