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 Responses
Your Twitter Tools fix works great so far. I did have to go ahead and retype the quotation marks, as you stated. The funny thing was that when I went out and changed them en mass the fix did not work. So I started over again and changed the double quotes one line at a time as the WordPress plugin interface reported line errors upon activation. Then I would reactivate the plugin and fix the next line until the plugin successfully activated. The thing is that not all the double quotations were changed before the plugin started working. But the plugins seems to be working now so I will leave it alone.
Thanks for your efforts!
Your Twitter Tools fix works great so far. I did have to go ahead and retype the quotation marks, as you stated. The funny thing was that when I went out and changed them en mass the fix did not work. So I started over again and changed the double quotes one line at a time as the WordPress plugin interface reported line errors upon activation. Then I would reactivate the plugin and fix the next line until the plugin successfully activated. The thing is that not all the double quotations were changed before the plugin started working. But the plugins seems to be working now so I will leave it alone.
Thanks for your efforts!
Fix worked great – thanks so much.
Fix worked great – thanks so much.
Thanks – that worked nicely!
Thanks – that worked nicely!
For some reason, I still can’t get it to work. When trying to activate the plugin, I get the following error: “Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /var/www/html/wp-content/plugins/twitter-tools.php on line 865”
I imagine it has to do with the quotes but I’ve checked all the ones without that block of code.
Any ideas?
For some reason, I still can’t get it to work. When trying to activate the plugin, I get the following error: “Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /var/www/html/wp-content/plugins/twitter-tools.php on line 865”
I imagine it has to do with the quotes but I’ve checked all the ones without that block of code.
Any ideas?
Bernard,
You might want to check to see if Twitter Tools has been updated. I know the author had created a fix and it might be available now. The other thing you could do is redownload it, make the changes and then deactivate what you have, delete from your plugins directory and then put the new one in there.
Hope it works!
-HTD
Bernard,
You might want to check to see if Twitter Tools has been updated. I know the author had created a fix and it might be available now. The other thing you could do is redownload it, make the changes and then deactivate what you have, delete from your plugins directory and then put the new one in there.
Hope it works!
-HTD
Works great for me!
Works great for me!
I am having the same problem as Bernard. :(
I am having the same problem as Bernard. :(
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! :)
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,
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,
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
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.
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 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 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
Thanks for your help. I scanned for the author’s udpdate, but your hack seems to work fine. best regards from Bordeaux, France.
Thanks for your help. I scanned for the author’s udpdate, but your hack seems to work fine. best regards from Bordeaux, France.
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.
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.
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.
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.
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. :-)
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. :-)
Thank you this fix worked!
Thank you this fix worked!
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!
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!
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
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
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.
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,
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,
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
Thank you so much – am so glad I found this fix before I started mindlessly tweaking via myphp
Thank you so much – am so glad I found this fix before I started mindlessly tweaking via myphp
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?
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,
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,
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
@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 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,
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,
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
@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
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.
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! :)
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! :)
Thanks very much for this fix! Nice site too :)
Thanks very much for this fix! Nice site too :)
Wonderful – thanks for clear and correct instructions. This made Twitter Tools work again.
Wonderful – thanks for clear and correct instructions. This made Twitter Tools work again.
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?
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?