Sivel.net  Throwing Hot Coals


Polaroid on the Fly v0.7 Released

In a recent post I said that I wanted to release updates to all of my plugins for WordPress 2.6 compatibility at one time. But I have been busy on some other things and haven’t given my plugins the attention they need. So I’m going to release updates as I get time. To start I am releasing an update to the Polaroid on the Fly WordPress Plugin. See the change log for changes.

Asides Plugins WordPress

Updating WordPress Plugins for 2.6 Compatibility

I’m in the middle of updating all of my WordPress plugins, excluding those that I have previously marked as end of life, for WordPress 2.6 compatibility.

The changes in 2.6 will not affect the large majority of WordPress users so the current versions should work without problem.

I hope to release all updated plugins at the same time. I’m not quite sure when that will happen so keep an eye out. I may have to leave Shadowbox JS off the list and release the update later seeing as though I have to get Shadowbox 2.0 into the this coming release.

Plugins WordPress

Message to WordPress Plugin Developers: Use the WordPress Plugin Repository!

This message is for all of the WordPress plugin developers out there.

Use the WordPress plugin repository dammit!

Reasons to use the WordPress plugin repository:

  1. It is free
  2. It gives your plugin a lot of exposure
  3. It isn’t dependent on your crappy $5.95/month hosting
  4. It provides real download links that can be used with wget and not those annoying download counters
  5. The WordPress software will allow the blog owner to see that there is an update to your plugin
  6. It will work with the WordPress auto updater

Now stop only providing download links on your site and publish your plugins in the WordPress plugins repository!

Let me put it this way…The next time I am looking for a plugin and I find yours, and it is not hosted in the WordPress plugin repository, I am taking your code, publishing it in the WordPress plugin directory and I wont acknowledge you as the author!

I’m tired of using outdated WordPress plugins because it wasn’t hosted where it should be and I wasn’t notified that an update was available, and come to find out that it wasn’t even working!

And yes I am using a lot of exclamation points! It’s because I am pissed!

BullShit Idiots Plugins Rant WordPress

FAQ-Tastic Lite

Knowledge Constructs has released a new version of their FAQ-Tastic plugin dubbed FAQ-Tastic Lite.

The AJAXify FAQ-Tastic WordPress plugin has been tested with this new version and is fully compatible. Enjoy!

Asides Plugins WordPress

Lightview JS WordPress Plugin End of Life

I will no longer be updating the Lightview JS WordPress plugin with new versions of Lightview from Nick Stakenburg as the author has changed the licensing requiring users to purchase Lightview. As I DO NOT purchase software and frown upon authors who distribute their software freely and then decide to require licensing fees; this plugin is now end of life.

Asides BullShit Idiots Plugins WordPress

Shadowbox JS WordPress Plugin v0.4 Released

The Shadowbox JS WordPress Plugin has been updated to version 0.4. New to this update is the ability to add class=“hidden” to hide additonal links when creating an album or gallery and the ability to not include the javascript libraries in the header if you have a theme or other plugin that handles this. See the Change Log for changes. Enjoy!

Asides Plugins WordPress

AJAX-ify the FAQ-Tastic WordPress Plugin

If you came here looking for the plugin click here.

Update: This plugin has been tested with the new FAQ-Tastic Lite plugin and works as expected.

FAQ-Tastic is a wonderful WordPress plugin for maintaining a FAQ on your website. My company recently made a decision for one of its products to run both the blog and FAQ for the product off of WordPress. Using FAQ-Tastic will enable the folks in charge of the FAQ to make changes without having to modify any code.

While the developers of FAQ-Tastic apparently went to great lengths to add AJAX effects to the admin area for this plugin the actual display in the post or page is rather boring in the fact that it does not include any AJAX and simply displays the answer directly under the question. You can additionally list all of the questions which will link to the question and answer lower in the page but that keeps the users scrolling up and down the page. The authors of FAQ-Tastic list in their FAQ that they are planning on AJAXifying the plugin at some future time, but we don’t have time to wait for them to do it.

A simple solution would be to add a small amount of Javascript and CSS code to collapse the answers and only display them once the question has been clicked.

There is one caveat though…Ratings do not collapse with the answer, which causes them to not display correctly, and thus have been hidden using CSS in this plugin.

Now for instructions on implementing it

  1. Open header.php from your WordPress theme in your favorite text editor or the WordPress theme editor.
  2. Add the following code just above the line reading <?php wp_head(); ?>

  3. Add the following code just after the line reading <?php wp_head(); ?>:

  4. You can add some additional styling by adding a open/close indicator next to the question by adding the following into the css styles listed in step 3.

    ol.faq h3 {
        padding-left:20px;
        background: url(/wp-content/themes/YOURTHEME/images/open.gif) top left no-repeat;
    }
    ol.faq h3.active {
        background: url(/wp-content/themes/YOURTHEME/images/close.gif) top left no-repeat;
    }
    

    You can download these sample open/close images here

    These gif images should be extracted/uploaded to ‘wp-content/themes/YOURTHEME/images’

And now that you are saying I’m not going to do this because it is too complicated…Don’t worry I have also written a plugin with the information I have provided above that will automatically implement this just by activating the plugin.

The plugin can be downloaded from WordPress.org repository.

Instructions on using the plugin

  1. Download the plugin from here
  2. Upload the ajaxify-faqtastic directory to wp-content/plugins/
  3. Open the admin section of WordPress, click on Plugins and then Activate this plugin.
  4. Simple as that…you are done.

If you don’t want to go through subscribing to a mailing list to get the FAQ-Tastic plugin, download using the following links:
Plugin
Manual

Change Log

1.4 (2009-02-27):

  • Update to new version numbering
  • enqueue styles and scripts instead of printing directly to the head

0.3 (2008-08-12): * Updated for WordPress 2.6 compatibility

0.2 (2008-03-26): * Initial Public Release

Download
AJAXify FAQTastic version 1.4
Archived Versions

HowTo Plugins WordPress

Lightview JS WordPress Plugin

Update:The Lightview JS WordPress plugin is hereby completely end of life. My plugin was in conflict with the Lightview per domain license and has been removed from the WordPress plugins repository. Users seeking a Lightview WordPress plugin should see the Lightview Plus plugin written by Thorsten Puzich. As an alternative to Lightview please see my Shadowbox JS plugin.

A media viewer application written entirely in JavaScript. Using Lightview, website authors can display pictures, movies, websites, inline content and more in all major browsers without navigating away from the linking page.

This plugin uses Lightview written by Nick Stakenburg.

Javascript libraries supported are: Prototype + Scriptaculous. Prototype + Scriptaculous are included with the plugin as the versions packaged with WordPress are below the minimum requirements.

This plugin support the WordPress [ gallery] shortcode. By simply having this plugin activated and $lvGallery set to true which is the default, Lightview JS will be used to display the images in your gallery.

Screenshots

imageWebsite

Installation

  1. Upload the `lightview-js` folder to the `/wp-content/plugins/` directory
  2. Edit lightview-js.php and modify $lvGallery based on the comments preceeding the variable. Please note that this is an optional step. Lightview JS will function properly without modification.
  3. Activate the plugin through the ‘Plugins’ menu in WordPress

Upgrade

  1. Deactivate the plugin through the ‘Plugins’ menu in WordPress
  2. Delete the previous `lightview-js` folder from the `/wp-content/plugins/` directory
  3. Upload the new `lightview-js` folder to the `/wp-content/plugins/` directory
  4. Edit lightview-js.php and modify $lvGallery based on the comments preceeding the variable. Please note that this is an optional step. Lightview JS will function properly without modification.
  5. Activate the plugin through the ‘Plugins’ menu in WordPress

Usage

  1. If you are using the [ gallery] shortcode the following steps are not required. When using the [ gallery] shortcode this is automatic.
  2. Create a link in your post in the following format:
    <a href="http://domain.tld/directory/to/image.jpg" class="lightview">Image</a>
    The above link can be to pretty much anything including websites, video files, YouTube, Google Video, inline content. This is the minimum code required to use this plugin.

  3. Please see the markup on the Lightview javascript authors usage page for more information such as sizing the media. . Please keep in mind that I did not write the Lightview javascript I only created a WordPress plugin that implements it.

  4. Be sure to include `class=“lightview”` as this activates the plugin.

  5. If `rel=“gallery[album]”` is included the portion listed here as `[album]` will group multiple pictures into an album called album.

NOTE: Do not use the visual editor for doing the above use the code editor. When modifying this post in the future do not use the visual editor; please use the code editor always.

Examples:

<a href="http://domain.tld/directory/to/image.jpg" class="lightview" rel="gallery[album]">Image</a>
<a href="http://domain.tld/directory/to/image.jpg" class="lightview" rel="gallery[album]"><img src="http://domain.tld/directory/to/image.jpg" /></a>
<a href="http://sivel.net/" class="lightview" rel="iframe" title="Sivel.net :: My Site :: fullscreen: true">Sivel.net</a>

Change Log

(2009-03-03):

  • Plugin marked as end of life and removed due to licensing conflicts

1.5 (2009-02-27):

  • enqueue styles and scripts instead of directly printing to the head

1.4 (2008-08-25):

  • Updated version number scheme
  • Updated code for readability
  • added support for [ gallery] shortcode

0.3 (2008-08-12):

  • Update for WordPress 2.6 compatibility

0.2 (2008-03-14):

  • Initial Public Release

Download
REMOVED

Plugins WordPress

Shadowbox JS WordPress Plugin v0.3 Released

The Shadowbox JS WordPress Plugin has been updated to version 0.3. I don’t often update this quickly but I had some time and Michael J. I. Jackson has released version 1.0 final of Shadowbox.js which adds native Lightbox support and a feature request that I asked for. See the Change Log for changes. Enjoy!

Asides Plugins WordPress

Display Most Recent WordPress Posts On Another Site

I was recently had the job of displaying the most recent WordPress posts on a sites main page. The easiest way I could think of doing this is to use the RSS feed.

I’ll give two sample php functions that will do this as one requires some pear packages and the other doesn’t.

Option 1

This option requires the use of several PHP Pear packages. Those packages are XML_RSS, XML_Tree and XML_Parser. This is the preferred option as the code is specific to RSS instead of XML generically.

<?php
require_once "XML/RSS.php";

// read_rss(display_n_items,feed_url)
function read_rss($display=0,$url='') {
    $rss =& new XML_RSS($url);
    $rss->parse();
    $itemArr = array();
    foreach ($rss->getItems() as $item) {
        if ($display == 0) {
            break;
        }

        array_push($itemArr,$item);

        $display--;
    }
    return $itemArr;
}
?>

Option 2

This option does not require any special Pear packages which would be helpful for users who do not have the capability to install them or have their hosting provider install them.

<?php
// read_rss(display_n_items,feed_url)
function read_rss($display=0,$url='') {
    $doc = new DOMDocument();
    $doc->load($url);
    $itemArr = array();
    foreach ($doc->getElementsByTagName('item') as $node) {
        if ($display == 0) {
            break;
        }

        $itemRSS = array (
            'title'       => $node->getElementsByTagName('title')->item(0)->nodeValue,
            'description' => $node->getElementsByTagName('description')->item(0)->nodeValue,
            'link'        => $node->getElementsByTagName('link')->item(0)->nodeValue,
            'pubdate'     => $node->getElementsByTagName('pubDate')->item(0)->nodeValue
        );

        array_push($itemArr, $itemRSS);

        $display--;
    }
    return $itemArr;
}
?>

Now to use either of these functions we would do something similar to the following:

<ul>
<?php
$items = read_rss(2, 'http://sivel.net/feed');
foreach ( $items as $item ) {
    echo '<li><a href="' . $item['link'] . '">' . $item['title'] . '</a>';
}
?>
</ul>
HowTo PHP WordPress