Filed under Web Applications | by Samuel Huckins | Date Posted: October 2, 2009 - 7:58 PM
Today I needed to alter the content of a comment made on a Trac ticket. I didn’t anticipate this would be a difficult task, but I wasn’t too familiar with Trac’s DB schema. So to save you a few consternated queries, here’s the spoiler. Comments on tickets aren’t kept within their own table (as you might expect) but are instead stored in the ticket_change table.
In my particular case the Trac DB was MySQL, so the examples I’ll provide will be MySQL queries. If you have an SQLite-backed Trac the operations should be the same, you’ll just need to use SQLite’s syntax.
Say the ticket with the naughty comment is #1234. To see all comments on this ticket:
1 2 3
| SELECT * FROM trac.ticket_change
WHERE FIELD = "comment"
AND ticket = 1234; |
And to update a comment:
1 2 3 4 5
| UPDATE trac.ticket_change
SET newvalue = "New hotness"
WHERE FIELD = "comment"
AND ticket = 1234
AND oldvalue = "Old and busted"; |
Happy revisionizing.
Tags:
MySQL,
Trac
October 2, 2009 - 7:58 PM
Filed under Web Applications | by Samuel Huckins | Date Posted: August 12, 2008 - 12:15 AM
After setting up some Wordpress blogs on my own server, I ran into the problem of wanting a basic contact form that would email myself and users. I in no way wanted to bother setting up my own mail server. I also would prefer not buying SMTP mail service. After a wretched chain of annoying plugins, I came across a salutary trio that met my needs: Cimy Swift SMTP, Contact Form 7, and a Gmail surprise.
Cimy Swift SMTP allows you to setup SMTP settings, which is perfect if you want to use an external service and not use PHP mail() function. Apparently, Google will let you send mail to any address from any domain using SMTP. Handy! So you just install Cimy, go to its Settings page, put in “smtp.gmail.com” as SMTP server, port 465 (it tells you this is for Gmail), your Gmail user and pass, and that you want TLS (it also notes this is for Gmail. Save, put in a test address, and it should just work. At least it did for me, where others failed.
Now you are all dressed up with SMTP, but where to go? I tried a number of contact form plugins that looked great, had lots of features, etc. And none of them bothered using the SMTP settings I put in. Contact Form 7 did, however. It’s simple, and takes a little customization to make it look decent. But still, it is a basic contact form that works, and that is all I needed.
Tags:
email,
web applications,
Wordpress
August 12, 2008 - 12:15 AM