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:
- Find, (Download), Open and Edit the “twitter-tools.php” file which resides in the “wp-content/plugins/twitter-tools/” directory
- 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
- The database items that changed are (pre-2.3 –> post 2.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.
60 comments
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?
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?
David Thulin
Wonderful – thanks for clear and correct instructions. This made Twitter Tools work again.
David Thulin
Wonderful – thanks for clear and correct instructions. This made Twitter Tools work again.
Jamie Yates
Thanks very much for this fix! Nice site too :)
Jamie Yates
Thanks very much for this fix! Nice site too :)
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! :)
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! :)
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.
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.
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
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
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.
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.
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
hightechdad
@ 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
Maria
Thanks very much for this fix. It’s great to see someone supporting this plugin!
Perhaps you can help me with another Twitter Tools problem? I’d like the daily archive of Tweets to roll over at midnight LOCAL time, not GMT. This would show a complete day of Tweets starting in the morning (not at 5PM the previous day) and ending at night. Any idea how to fix that?
Maria
Thanks very much for this fix. It’s great to see someone supporting this plugin!
Perhaps you can help me with another Twitter Tools problem? I’d like the daily archive of Tweets to roll over at midnight LOCAL time, not GMT. This would show a complete day of Tweets starting in the morning (not at 5PM the previous day) and ending at night. Any idea how to fix that?
beth
Thank you so much – am so glad I found this fix before I started mindlessly tweaking via myphp
beth
Thank you so much – am so glad I found this fix before I started mindlessly tweaking via myphp
Michael
@ Joshua,
Thanks for the feedback. Glad that it worked. Yes, my standard practice is always to comment out the old code and put in the new one. That way, you can use it for reference and also it allows you to roll back to it easily.
Yes, if you do cut and paste, you will have issues with the quotes. That is why I put in that Warning section.
-HTD
hightechdad
@ Joshua,
Thanks for the feedback. Glad that it worked. Yes, my standard practice is always to comment out the old code and put in the new one. That way, you can use it for reference and also it allows you to roll back to it easily.
Yes, if you do cut and paste, you will have issues with the quotes. That is why I put in that Warning section.
-HTD
Joshua McGinnis
Thanks for the fix. I would advise anyone having issues to make sure that they aren’t just copying and pasting over what’s already in twitter-tools.php. Comment out the existing code and then add in the fixed code. You’ll also want to double check all of your double and single quotes and make sure that they are formatted correctly. When I copied them over, they weren’t the right characters and it broke the script.
Joshua McGinnis
Thanks for the fix. I would advise anyone having issues to make sure that they aren’t just copying and pasting over what’s already in twitter-tools.php. Comment out the existing code and then add in the fixed code. You’ll also want to double check all of your double and single quotes and make sure that they are formatted correctly. When I copied them over, they weren’t the right characters and it broke the script.
Michael
Thanks for all of the updates. I will make an edit to my post to make sure it shows as “term_id” and not “term_ID”.
Glad that my fix is working out!
-HTD
hightechdad
Thanks for all of the updates. I will make an edit to my post to make sure it shows as “term_id” and not “term_ID”.
Glad that my fix is working out!
-HTD
ChrisTHIS
Only issue I’m having now is the daily digests seem to be GMT based (?) so not all of my twits from the day make it to the digest. Nobody seems to have an answer, so if you figure that one out please let me know!
I looked in twitter-tools.php at do_digest_post() but I can’t figure it out. Thanks in advance for any help!
ChrisTHIS
Only issue I’m having now is the daily digests seem to be GMT based (?) so not all of my twits from the day make it to the digest. Nobody seems to have an answer, so if you figure that one out please let me know!
I looked in twitter-tools.php at do_digest_post() but I can’t figure it out. Thanks in advance for any help!
Gio
Thank you this fix worked!
Gio
Thank you this fix worked!
Chris
The fix worked well: thanks.
I chose to make the corrections manually, rather than risk formatting characters from the cut-and-paste. And, like Francois, I was unable to get my term option to save until I changed the term_ID to term_id.
Seems to be all good now. :-)
Chris
The fix worked well: thanks.
I chose to make the corrections manually, rather than risk formatting characters from the cut-and-paste. And, like Francois, I was unable to get my term option to save until I changed the term_ID to term_id.
Seems to be all good now. :-)
ChrisTHIS
Francois, I had the same problem. Change the reference from term_ID to term_id and see if that works. It did for me. The MySQL db is case sensitive.
Also I didn’t understand the selected=selected HTML so I changed that to just $selected = `selected`, but that shouldn’t make a difference.
ChrisTHIS
Francois, I had the same problem. Change the reference from term_ID to term_id and see if that works. It did for me. The MySQL db is case sensitive.
Also I didn’t understand the selected=selected HTML so I changed that to just $selected = `selected`, but that shouldn’t make a difference.
FranÂçois-Xavier Bodin
After having tested, it seems one should ad a filter to get only the terms that are categories. Moreover, I fear the twittertools option form don’t keep the selected term while saving the options.
François-Xavier Bodin
After having tested, it seems one should ad a filter to get only the terms that are categories. Moreover, I fear the twittertools option form don’t keep the selected term while saving the options.
FranÂçois-Xavier Bodin
Thanks for your help. I scanned for the author’s udpdate, but your hack seems to work fine. best regards from Bordeaux, France.
François-Xavier Bodin
Thanks for your help. I scanned for the author’s udpdate, but your hack seems to work fine. best regards from Bordeaux, France.
Michael
@ Wizo,
Thanks for the feedback and I’m glad it works. Sorry for the confusion about the quotation marks. That is part of the reason why I edited the post to try to highlight that a bit more.
-HTD
hightechdad
@ Wizo,
Thanks for the feedback and I’m glad it works. Sorry for the confusion about the quotation marks. That is part of the reason why I edited the post to try to highlight that a bit more.
-HTD
Wizo
Thanks for your great advice!!
At first I couldn’t make it work by cutting and pasting, but then I realized that two single quotation marks placed together appear as a double quotation in the code you posted.
The easiest way for this to work is to just find:
and change every instance manually.
Other than that it works great. Thank you.
Wizo
Thanks for your great advice!!
At first I couldn’t make it work by cutting and pasting, but then I realized that two single quotation marks placed together appear as a double quotation in the code you posted.
The easiest way for this to work is to just find:
and change every instance manually.
Other than that it works great. Thank you.
Michael
@ Jenn,
Thanks for the note back. I have edited my post to really (hopefully) show that you need to change the quotes.
Glad it worked!
-HTD
hightechdad
@ Jenn,
Thanks for the note back. I have edited my post to really (hopefully) show that you need to change the quotes.
Glad it worked!
-HTD
Jenn
Update: it must be some weird formatting issue? Rather than copying and pasting your change, I went through and manually updated the database items/terms. THAT seemed to work.
Thank you! :)
kissmykitty
Update: it must be some weird formatting issue? Rather than copying and pasting your change, I went through and manually updated the database items/terms. THAT seemed to work.
Thank you! :)
Jenn
I am having the same problem as Bernard. :(
kissmykitty
I am having the same problem as Bernard. :(
Karen
Works great for me!
Karen
Works great for me!