Single Category RSS feed in WordPress

Blogging, PHP coding, Web Authoring 5 Comments »

rssiconSo now having installed WordPress, it turns out that it is infinitely customisable! Oh joy… more to learn about!

The task was to be able to build a single category RSS feed that people can subscribe to if they so chose, rather than have to subscribe to all categories, or all comments. In the theme I am using the sidebar holds the category list and it was here that the code had to go.

The issue was to find the category ID and the category name and only show the link to the RSS *if* the user had opted to view all posts in a single category.

It turns out that WordPress has done most of the hard work for us, in that the functions to get the ID and name are already created. All that had to happen was to find those arguments, wrap them in an ‘If’ tag and post them to the sidebar. Once again, some gentle reading of the Woprdpress documentation got me half way there and able to manually write the code for each category… but it needed automating. And once more, Alex Blanc stepped up to the plate…

To cut a very long story short, here’s the code, entered as a list item in the sidebar.php file for the theme:

<?php if (get_query_var('cat')) { ?>
<li>
<a xhref="/wp-rss2.php?cat=<?php echo get_query_var('cat'); ?>"><?php echo single_cat_title(); ?> (RSS)</a>
</li>
<?php } ?>

This then writes the title of the category in the sidebar as an RSS link, and ensures that only that category’s posts are included in that particular feed. You can see from the code that the link is using RSS2, so you can probably amend this to be any other flavour of feed that you wish.

PHP import or export to CSV

PHP coding, Web Authoring No Comments »

This post seems to have been lost in the move from Drupal to WordPress, so here it is again:

A while ago now I was working on the designmyschool.net website and one of the functions we had to build was the ability for a user to upload accounts in bulk – typically the data would come form a school management system, which meant it would be best to use CSV file formats.

At the time I researched into what tools were available to help with this task, and found only one suitable for a novice PHP coder such as myself – Interakt’s ‘CSV Import/Export extension for Dreamweaver.

The trouble was that I didn’t fully understand it all back then and in truth probably still don’t. However, I have now had a chance to use the other Interakt extensions and really like the way they make complex tasks much, much easier.
Just my luck then… the CSV extension has been pulled! Adobe’s acquisition of Interakt bodes well in so many ways, but sadly it means I couldn’t purchase the extension to test it out. Instead of the wide range of extensions, Interakt are now bundling just one set into a single product – MXKollection. The other extensions may well appear in a future version of Dreamweaver, but there are no guarantees.
So I happened upon an Italian website called Felixone. A quick read through and a short email later I had requested a new extension gets built!
And here it is:
http://www.felixone.it/extensions/prod/mxiecsven.asp

I don’t yet know how this works, but it looks very, very good to me. For €28 it has to be worth a chance! I think I can now confidently complete that part of the admin tools for designmyschool… we do have the csv uploading working well, but we could use a csv download of the results. Sigh… it never ends…

The Fixture Exchange, PHP Coding, Dreamweaver, MX Kollection

Fixex.com, PHP coding, Web Authoring 2 Comments »

For quite a while now I have been helping to run a fixture exchange system for youth rugby clubs. It started off life as a phone based pencil and paper system, but we moved it onto the Internet in about 1993. More recently it has been database driven and we relied on a company to build it using .ASP

All has been well until the host company said they were no longer going to host .ASP and that I should get this converted to PHP.

Now, I am no web coder but for a few years I have been working with some very skilled people. Sadly they haven’t had the time to help build this for me, but have offered loads of suggestions and ideas. I really needed to get this done myself.

So I went to freelancers.com and looked for anyone who could do the conversion. As it turns out there are lots of folk there who thought it would be easy, but I needed to work fast!

I have for some time been using Dreamweaver as my HTML editor, along with BBEdit on a Mac. There are a number of in-built tools to help code PHP, but you need to know what you are doing before you understand when and how to use them. I have also bought a copy of Interakt’s ‘MX Kollection’ This is basically a framework that writes the PHP code from a library of functions. All you need to know is what function you are doing.

The online help system for this is pretty good, and there are dozens of tutorials to help. It handles just about everything you need for a fairly complex site, including registration, sessions, listing information, amending records and so on.

Have a look at http://www.fixex.com to see the site I built (if you are a youth rugby team, sign up!!), and check out http://www.interaktonline.com for the dreamweaver extensions. I notice the company has now been bought by Adobe (who also now own Macromedia) so perhaps even better things are around the corner. All I know is I couldn’t have built this from nothing to a fully working site in less than a week without this set of extensions, so many thanks to Interakt!

PHP

PHP coding No Comments »

Blimey… and there was I thinking I didn’t have time to stop to learn a scripting langauge! How wrong can you be.

Well, it isn’t really about having time is it? It’s all about purpose and whether or not the need is there which drives the desire to learn. In my case it is, since I am part of a team working on a project with the Design Council and the site makes use of PHP (and Flash – but that’s a whole other story for later).

I’m still trying to make sense of it, but thanks to yet another colleague I am beginning to understand it a little bit more. Unlike any other formal learning, where a chunk at a time is taken, tried, repeated, applied, etc, I am having to dive into the deep end and see the entire thing holistically. It’s like reading a book but only knowing a fraction of the words, yet trying to understand the story… tough call.

So, many thanks to Alex for his tireless explanations, loan of books and the like – and big apologies to all who are having to suffer my expletive driven learning style!

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in