Blog Fix: Twitter Tools plugin and WordPress 2.3

by Michael Sheehan on September 25, 2007

in General, Open Source, Software

I’m going through and reviewing my site after updating it to WordPress 2.3 and it looks like there are still some hidden “issues” stemming from the migration to the new Category/Tagging structure. The latest one that I found is related to the “Twitter Tools” plugin.

Update: Some people were reporting that “term_ID” was not working where “ID” was in capitals so I have changed the code references below to lower-case (e.g., “term_id”). Remember to retype your quotes!

Here is what I did to fix:

  1. Find, (Download), Open and Edit the “twitter-tools.php” file which resides in the “wp-content/plugins/twitter-tools/” directory
  2. Locate the following lines of code (around line 868):

    function aktt_options_form() {
    global $wpdb, $aktt;
    $categories = $wpdb->get_results(”
    SELECT *
    FROM $wpdb->categories
    ORDER BY cat_name
    “);
    $cat_options = ”;
    foreach ($categories as $category) {
    if ($category->cat_id == $aktt->blog_post_category) {
    $selected = ‘selected=”selected”‘;
    }
    else {
    $selected = ”;
    }
    $cat_options .= “\n\t<option value=’$category->cat_id‘ $selected>$category->cat_name</option>”;
    }

    and change it to:

    function aktt_options_form() {
    global $wpdb, $aktt;
    $categories = $wpdb->get_results(”
    SELECT *
    FROM $wpdb->terms
    ORDER BY name
    “);
    $cat_options = ”;
    foreach ($categories as $category) {
    if ($category->term_id == $aktt->blog_post_category) {
    $selected = ‘selected=”selected”‘;
    }
    else {
    $selected = ”;
    }
    $cat_options .= “\n\t<option value=’$category->term_id‘ $selected>$category->name</option>”;
    }

    Note: you may need to change the quotation marks if you cut and paste from this entry. Simply highlight the quote marks and enter them again using your keyboard. (Sorry about the loss of code formatting…there are tabs in there to nest things properly but it shouldn’t affect the code.)

    • The database items that changed are (pre-2.3 –> post 2.3):
      • categories –> terms
      • cat_name –> name
      • cat_id –> term_id
  3. Save your changes to the twitter-tools.php” file and save to the “twitter-tools” plugin directory. That’s it!

HTD Says: More tweaks to themes and plug-ins because of WordPress 2.3 upgrade potentially coming. Stay tuned.

Related posts:

  1. Blog Fix: HemingwayEX and WordPress 2.3
  2. Blog: WordPress version 2.3 scheduled to be released Sept 24, 2007
  3. WARNING: WP-Polls WordPress Poll Plugin Can Be Exploited
  4. I wish a WordPress Developer would make the following plugin
  5. How to Write & Blog Efficiently with Free Tools like Evernote, DropBox, Picasa & Live Writer

  • http://www.hightechdad.com Michael

    @ Maria,

    You would probably have to dig into the guts of the plug-in itself to see that. I haven’t done that but it might be pretty easy to hack it.

    -HTD

  • http://www.marialanger.com/ Maria

    @Michael Thanks for the quick response. I’ve dug in a bit but don’t know enough PHP to figure it out. If you ever dig in and do figure it out, please let me know. It’s unfortunate that the plugin’s author is interested in collecting donations for his work but not providing any support for it.

  • http://www.marialanger.com/ Maria

    @Michael Thanks for the quick response. I’ve dug in a bit but don’t know enough PHP to figure it out. If you ever dig in and do figure it out, please let me know. It’s unfortunate that the plugin’s author is interested in collecting donations for his work but not providing any support for it.

  • http://www.hightechdad.com hightechdad

    @ Maria,

    Well, I briefly scanned the PHP (I don’t know much about PHP either). But then I was thinking. Have you checked the Options part of WordPress to confirm that your Date & Time is set correctly? Check the UTC time and the time differential that you have configured.

    I did find a part in the code that does refer to GMT but didn’t dig into it very far.

    -HTD

  • http://www.hightechdad.com Michael

    @ Maria,

    Well, I briefly scanned the PHP (I don’t know much about PHP either). But then I was thinking. Have you checked the Options part of WordPress to confirm that your Date & Time is set correctly? Check the UTC time and the time differential that you have configured.

    I did find a part in the code that does refer to GMT but didn’t dig into it very far.

    -HTD

  • http://www.marialanger.com/ Maria

    @Michael

    I checked and it’s set fine. It’s weird: the post appears at midnight my time, but the Tweet times begin at 5 PM two days before and end at 5 PM the previous day. As if my tweeting for a day begins at 5 PM. That doesn’t happen to you?

    I’m a GMT-7 in Arizona.

    If you come up with anything, please let me know.Thanks for your help.

  • http://www.marialanger.com/ Maria

    @Michael

    I checked and it’s set fine. It’s weird: the post appears at midnight my time, but the Tweet times begin at 5 PM two days before and end at 5 PM the previous day. As if my tweeting for a day begins at 5 PM. That doesn’t happen to you?

    I’m a GMT-7 in Arizona.

    If you come up with anything, please let me know.Thanks for your help.

  • Pingback: Blogs Of The Day Lister » WordPress Wednesday News: WordPress 2.3.1 Released, Get Your Upgrade, WordPress Podcast Speaks out, WordCamp Israel a Success, Argentina is Next, and WordPress Wins.

  • Pingback: Giannii » (45) sick bleh…… twitter, twitter tools, seesmic, backlogged!, and mm sushi

  • Pingback: Twitter Tools - Update Blog Dengan Twitter : leLabu dot com

  • http://themetamorph.com Michelle

    I’ve used this fix today for 2.3.1, but copying/pasting the code – even though I verified that everything was the same as what you posted – didn’t work. It would cause a fatal error when I would try to activate the plugin after the modification you suggested.

    My fix for that was to go in and manually type in the changed database items.

    Maybe the issue is with the quotation marks? I noticed that you changed a few ‘ ‘ – spaced apostrophes – to quotation marks. I didn’t make the same change when I typed in the new database items and now everything is working fine for me. I should specify that on your code snippets up there, it doesn’t show the spaced apostrophes in either snippett, but I did have the apostrophes in my twitter-tools.php file.

    Anyway, I’ve got it figured out and it’s working fine, so thanks for the fix! :)

  • http://themetamorph.com Michelle

    I’ve used this fix today for 2.3.1, but copying/pasting the code – even though I verified that everything was the same as what you posted – didn’t work. It would cause a fatal error when I would try to activate the plugin after the modification you suggested.

    My fix for that was to go in and manually type in the changed database items.

    Maybe the issue is with the quotation marks? I noticed that you changed a few ‘ ‘ – spaced apostrophes – to quotation marks. I didn’t make the same change when I typed in the new database items and now everything is working fine for me. I should specify that on your code snippets up there, it doesn’t show the spaced apostrophes in either snippett, but I did have the apostrophes in my twitter-tools.php file.

    Anyway, I’ve got it figured out and it’s working fine, so thanks for the fix! :)

  • Jamie Yates

    Thanks very much for this fix! Nice site too :)

  • Jamie Yates

    Thanks very much for this fix! Nice site too :)

  • http://www.davidthulin.com David Thulin

    Wonderful – thanks for clear and correct instructions. This made Twitter Tools work again.

  • http://www.davidthulin.com David Thulin

    Wonderful – thanks for clear and correct instructions. This made Twitter Tools work again.

  • http://www.nunomedia.com Nuno Marques

    I have updated to wordpress 2.3.3 yesterday and installed twitertools to my blog. Now I am trying to tweet via sms, and it works! the problem is that it takes ages to update my tweets, nut if I log on and update manually it will work. can you guys help me?

  • http://www.nunomedia.com Nuno Marques

    I have updated to wordpress 2.3.3 yesterday and installed twitertools to my blog. Now I am trying to tweet via sms, and it works! the problem is that it takes ages to update my tweets, nut if I log on and update manually it will work. can you guys help me?

Previous post:

Next post: