Feeds

integration

PerformancingAds

 Mini Blog II. - Flickr and Textpattern

Submitted by Markus Merz on October 25, 2007 - 6:26pm in

Show Flickr pix with Textpattern as mini blog. This is a follow-up to Publish mini blogs as asides.

How to get a nice Flickr mini blog inside of Textpattern

There exists a nice plugin for Textpattern which fetches pictures directly from your Flickr account. It publishes the pics directly inside the blog, can create a photo gallery from your Flickr sets and also grabs the description or lists your Flickr tags.

For the purpose of creating a mini blog based on filtered Flickr tags most convenient is the ability to hand over the Flickr tags you want to show. The following is a rough concept. For the perfect implementation you must figure out how to create the wanted txp:vdh_flickr tags yourself as there are many different possibilities.

Why not use the Flickr tag feeds?

If all this sounds way too complicated you can still use Flickr RSS feeds for your tags :) But then you won't have the possibility to have internal landing pages which is a nice way of enhancing your content.

The basics from the documentation

vdh_flickr is a full-featured gallery plugin for textpattern, using a classical three-step system: First, you are shown a set (=album) preview page, then a thumbnail page, and an image page afterwards. The Demo shows the default configuration.

But you can leave out any step, so you can for example leave out the set preview or both the set preview and thumbnails to show an individual image.

How to - Use the advanced options

The default sense of that plugin is to create a picture gallery. But of course you can simply call the txp:vdh_flickr tags individually and put them into a div which floats in your article and only shows thumbnails which link back to Flickr (open="self|window|flickr"). More interesting is to link to another internal landing page which shows the single image with description.

Demo1 shows the default gallery Plug'n'Play Style but you can play around with the templates (Textpattern forms) as you like. Make sure to study the default Textpattern forms to get more txp:vdh_flickr tags.

  • vdh_flickr_thumbnails: Specify the needed size for thumbnail images to fit your mini blog template.
  • listmode="img|text": Funny. You can show the Thumbnails as text list
  • txp:vdh_flickr_thumbnails_slideshow: You can also create a link to show a Flickr slideshow pop-up.

If you create landing pages for single pictures:

  • Show image title and description
  • Show a list of tags associated with the current image (local links)

Playing around with the many options you are able to generate a complete picture gallery inside your Textpattern website. More important in our mini blog case, you can create a list of thumbnails for certain tags from your Flickr photostream.

Caution

  • Remember to link back to the single photo pages at Flickr.
  • Double check the performance on your system and how fast Flickr responds.

Examples for a Flickr mini blog with Textpattern? Not yet...


 Integrating Plugins With Your WordPress Themes Using functions.php

Submitted by nathanrice on May 22, 2007 - 8:09pm in

Have you ever been browsing through the theme viewer or checking out the daily theme release announcements over at WeblogToolsCollection.com, and noticed that a certain theme requires a plugin to function correctly (or at least has a feature that requires a plugin to work)? I certainly have, and although I have never required a plugin for any themes I've released, I can see why one would want to include the functionality of a plugin to make that theme even more awesomely cool (and perhaps get more downloads).

But it is generally frowned upon to require the user to download and install a plugin in order for your theme to work properly. So what is a designer to do? Of course, he could just try to figure out what the plugin does by examining the code, but most designers don't have a working knowledge of PHP/MySQL. Another option is to just remove the feature from your theme, but that means you lose that super-cool feature that might have set your theme apart from the others.

Thankfully, there is a solution that is actually quite simple.

A while back, I was working on a custom design for a client, and he requested a very long list of features that were beyond what I could do with a vanilla WordPress install. So naturally, I hit google up for any plugins that would give me the functionality he was looking for. But again, I wanted to deliver a fully functional theme to this client, without having to instruct him to install a list of plugins to get the theme working properly.

After thinking for a while, it hit me: just copy the code from the plugin into the functions.php file of the WordPress theme. I did so, and it worked like a charm! Absolutely no plugins were activated, and I was able to deliver a theme that worked perfectly right out of the box.

A few possible limitations to this method.

I'm not sure about this, but some plugins do add new rows/columns/tables to your database. There is a possibility that a plugin will do this upon activation, and may not work as an integrated function in the functions.php file. Again, I'm not sure about this.

Also, plugins with multiple files, especially plugins that require you place files/folders in multiple locations, probably won't be easily integrated into your theme. Plugins that only require a single file upload are best.

A few extra tips

  1. Be sure to keep the plugin information in tact when copying the content of a plugin file over to your functions.php file. This way you can keep track of which plugins are installed, and where one ends and another begins.
  2. Be sure to copy the entire contents of the plugin file to your functions.php file. If you're missing an opening or closing tag anywhere, it could break your theme.
  3. Use obvious separators when integrating multiple plugins. This is sort of like point 1, but you'll definitely want to use a consistent and obvious marker for when a plugin begins and ends.
  4. Test, Test, TEST!!! Do not just slap the code in last minute and expect it to work. Test it extensively and make sure that your theme doesn't break. Plugins are buggy sometimes, so you need to make sure it's working properly before you release it or make it live.

One Final Tip

If you are comfortable enough with PHP, it should be noted that you can put the plugin files in a folder within your theme folder, and simply use your functions.php file to include those plugin files. I like to keep the php calls to a minimum, but you're certainly welcome to go that route if you are more comfortable with it.

Anyway, I thought that was a cool little tip, and hopefully so will you.

Happy Coding!