Posts Tagged “plug-in” (Page 2)

Tuesday, September 25, 2007
  HCSB Verse of the Day 1.0 - WordPress Plug-In

I have used a hack in the theme of my personal site for a while to obtain the “Verse of the Day” in the Holman Christian Standard Bible (HCSB) version. With things that I've learned about plug-ins, I decided to take a stab at creating a plug-in to do this work. That way, if I changed themes, I wouldn't have to hack the new one they way I've hacked the current one.

The fruits of my labor is the new HCSB Verse of the Day plug-in for WordPress. It uses the reference from BibleGateway.com, then gets the text from their regular website. (They do not provide the service, citing copyright restrictions.) How to use the plug-in, along with my justification on copyright grounds, is in the top of the file's comments. If they're not clear, certainly post comments here and I'll address them. (I do plan to submit the plug-in to WordPress.org - but, they require a specific README file format that it will take me a bit to put together.)

votd_hcsb.txt - HCSB Verse of the Day 1.0 (UPDATE: It is in the plugin directory now.)

To install it, download the file, rename it “votd_hcsb.php”, and upload it to your /wp-content/plugins directory. Then, enable it, and add the template tags to your theme - that's it!

Categorized under
Tagged , , ,

Tuesday, August 7, 2007
  Mozilla Now Hosting Lightning 64-bit Plug-In

Just when I get a nice system set up here, lo and behold, Mozilla now has a 64-bit Linux plug-in available. It can be obtained from their FTP site (link for version 0.5). I'll continue to keep the version I have here available, in case this dries up. (UPDATE: It's gone.) But, unless that does, this is probably the last post you'll see here about the 64-bit Lightning plug-in.

Categorized under
Tagged , ,

Saturday, July 21, 2007
  Lightning Calendar Plug-In for Thunderbird AMD64

Mozilla Sunbird is a calendar project that's being designed as a sister program to Thunderbird and Firefox. It's now at the 0.5 version, and there is a plug-in that integrates Sunbird with Thunderbird, called Lightning. It allows you to not only have a calendar, but send and receive meeting requests as well.

I'm running Thunderbird 2 under Ubuntu Feisty Fawn (7.04) on the AMD64 architecture, and could not find a pre-compiled version of this that worked. So, I decided to give it a shot. It was pretty easy, and the result is a plug-in that works with the AMD64 version of Thunderbird! Since I had trouble finding it, I thought I would share it.

Since I have just started using it, I haven't wrung it out, or tested all the options. Use at your own risk, etc.

You can download the plug-in here (UPDATE: See this post.) Happy storming! ;)

Categorized under
Tagged , , , , ,

Wednesday, June 13, 2007
  Posting Source Code in WordPress, Take 2

In my searching, I have found another WordPress source code plugin, called wp-syntax. This one uses GeSHi, the Generic Syntax Highlighter. It features many languages, and is extensible to even more. (If I ever post a COBOL snippet, I'll probably add COBOL support to it, and contribute it to the codebase.)

To use it, you simply put a pre tag, followed by lang=[language]. It will also do line numbering. Of course, with a single “language” parameter, the embedded language will not be highlighted as well. In this case, the previous plug-in works better; although the syntax highlighting has to be done manually, it can handle multiple languages.

(NOTE: The samples have been removed, as this blog is not running under WordPress. However, since the source code from another post was moved here, it is presented below using myWebLog's code highlighting.)

<?php
/**
 * This creates a list of category links that can be used with a category dropdown
 */
$aCategories = get_all_category_ids();
$iMaxCat = 0;
foreach($aCategories as $iThisCat) {
    if ($iMaxCat < $iThisCat) {
        $iMaxCat = $iThisCat;
    }
}
$iMaxCat++;
?>
<div style="text-align:center;">
<form name="categoryform" action="" style="text-align:center;">
    <script type="text/javascript">
        var aLink = new Array(<?php echo($iMaxCat); ?>);
<?php
foreach($aCategories as $iThisCat) {
    echo("aLink[$iThisCat] = \"" . get_category_link($iThisCat) . "\";\n");
} ?>
        function goCat() {
            window.location =
                aLink[document.getElementById('cat')[document.getElementById('cat').selectedIndex].text;
        }
    </script>
    <?php wp_dropdown_categories('class=sidebardropdown&orderby=name&show_count=1&hierarchical=1'); ?>
    <br /><br />
    <button class="sidebarbutton" type="button" style="margin-top:5px;" onclick="goCat();">View Category</button>
    </form>
</div>

This is another option, and is probably what I'll use for single-language posts, or posts where the embedded language may not be crucial.

Categorized under
Tagged , , , ,

Wednesday, May 30, 2007
  Posting Source Code in WordPress

Traditionally, posting source code in a WordPress blog, especially if it were HTML or PHP, was problematic. There are a few reasons for this…

  • WordPress is very good about ensuring that it outputs valid XHTML, so it strips mis-matched and invalid tags. This is usually desirable, but it wreaks havoc with HTML and XML code posts.
  • Since WordPress is coded in PHP, blocks of PHP will attempt to execute.
  • White space is collapsed, which can kill any readability that the user has set out; the “visual editor” (TinyMCE) does its best to create efficient HTML. This can actually break spacing-oriented languages such as Python.

So how do you do it? It's actually pretty easy, using the Code Markup WordPress plugin. You can download the plugin from that link, and upload it to ./wp-content/plugins. The instructions on the website are critical - the “visual” editor will not allow the code to come through unscathed. However, the visual editor only corrupts the code if you actually save it; what I have done is write the post using the visual editor, then disable it and put the code in. It's the best of both worlds! (Make sure that, once you have the code in, you don't edit the post using the visual editor - unless you have a good backup…)

The post below this one (about category lists in WordPress) was done using this plugin. (This isn't running in WordPress any more.) In addition, you can use the span tag to do the color-coding. I created a few CSS classes (“key” for keywords, “func” for functions, “attr” for attributes, “embed” for embedded language), and used them to accomplish the color coding. It seems that it would be pretty easy to write another plugin that used a list of keywords to do this syntax highlighting; maybe that's a challenge for another day.

A big “atta boy” to Bennet McElwee for a fantastic plugin!

Categorized under
Tagged , , ,