18:53 remaining

Note to self, PHP’s mktime() func­tion breaks when you use lead­ing zeros. Thank­fully, that means I’ve got 18 hours left to cram, and not nine. Bizarre.

p.s. Now’s a good time for the RSS peo­ple to come out from the trees and look at the now fixed hh:mm count­down on my site.
p.p.s. The first post-script will be irrel­e­vant this time tomor­row.
p.p.p.s. Track­back spam­mers, have a heart. I haven’t got time to deal with your crap right now, and really won’t feel like it tomor­row after­noon. Just go away for a while, okay? Thanks.

# by Josh on October 16th, 2005 Tags:
| 2 Comments »

Some numbers from year12.joahua.com

For that photo web­site at that elu­sive domain name.

Time from the idea to a site live:
Six hours
Time from a live site to a func­tional site:
About a day
Lines of code to make it go (markup, CSS, PHP):
2001
Num­ber of unique visitors:
309
Aver­age num­ber of vis­i­tors per day:
85
Vis­i­tors downloaded:
325MB/day, or 2.95GB
Over­all transfers:
3.21GB
Num­ber of albums:
26
Num­ber of (known) contributors:
10
Num­ber of photos:
(Prob­a­bly well) over 1200 (hard to count, because of source and thumb­nails being stored as they are)
Total size of site:
498MB
Total size of photos:
345MB (over­head is mostly in upload archives I haven’t deleted yet)
Shell scripts rewrit­ten to do lit­tle things from the con­sole that I’d taken for granted on the desktop:
Too many. But it made me learn some­thing, so that’s cool.

And now for the impor­tant sta­tis­tics! (Because I’m a pessimist ;-))

Num­ber of pho­tos that would still fit:
At least 4 times as many as there cur­rently are!
Amount of extra band­width that could have been transferred:
At least 8 times as much, but we didn’t do too badly see­ing as that was nine days, and the quo­tas are done monthly.

So… this means if you still haven’t uploaded pho­tos, do so!

On another note, I’m think­ing about imple­ment­ing that upload thing Michael blogged about (or rather, linked to ;-) That doesn’t actu­ally qual­ify as post­ing: you’ve still got a way to go before you redeem your­self for lack of that of late!) on the form to make life eas­ier for peo­ple who don’t seem to be able to fol­low my pretty straight­for­ward (I even made pretty screen­shots!) “How to make a ZIP file” guide. Ah, technology.

# by Josh on October 1st, 2005 Tags: ,
| No Comments »

A more usable WordPress Upload

As a user, the Word­Press admin­is­tra­tion panel Upload facil­ity always frus­trated me. It was use­ful, and quicker to use than FTP in most cases, but the paths it gen­er­ated for images auto­mat­i­cally always needed to be edited before use.

This was, pri­mar­ily, my own fault — but I’d set things up that way based on the advice of the Word­Press admin­is­tra­tion panel. On the Mis­cel­la­neous Options page (/wp-admin/options-misc.php in a typ­i­cal setup), it pro­poses two “rec­om­mended” paths for both the Des­ti­na­tion direc­tory and the URI of this direc­tory, typ­i­cally your Word­Press installation’s wp-content folder and its cor­re­spond­ing absolute URI.

This is sim­ply manip­u­lated into a new string when files are uploaded to gen­er­ate a tag you can copy and paste into a post — a real­i­sa­tion that should have hit me long ago.

On this site, for exam­ple, the rec­om­mended URI string is “http://www.joahua.com/blog/wp-content” — note the lack of trail­ing slash and absolute nature of the path. I only just realised that this was the basis of the string, and so got rid of my trail­ing slash (I insist on hav­ing such things!) and trimmed off the “http://www.joahua.com” — this means the Upload-generated tag now gives a rel­a­tive URI. No more chop­ping and chang­ing the gen­er­ated tags for me!

CurlyEnc 0.1

This is a sim­ple Word­Press plu­gin that allows you to copy and paste from word-processing soft­ware that automag­i­cally does smart quotes con­ver­sion (curly quotes). You can do this with­out using this plu­gin — but the char­ac­ters aren’t proper HTML enti­ties and it’s dirty. CurlyEnc con­verts curly quote char­ac­ters to their proper HTML entity codes — some­thing Word­Press does per­fectly fine with nor­mal quo­ta­tion marks, but not with these ones.

Sim­ply upload CurlyEnc into your plugins direc­tory and enable it from the Plu­g­ins sec­tion of your Word­Press admin­is­tra­tion panel, and it should* work.

* No guar­an­tees, no promises. If your weblog sprouts furry ears and starts chas­ing your mouse, so to speak, I accept no respon­si­bil­ity. Yada yada. Happy to try and help. More seri­ously, I don’t know that much about char­ac­ter encod­ing, so I wouldn’t be entirely sur­prised if my mag­i­cal char­ac­ter is some­thing of a dud on some instal­la­tions. I know it’s a good con­cept, and this is my best imple­men­ta­tion of it — if any­one else has a bet­ter idea as to how it should be done, please share!

On a related note, it’s released under the GNU GPL — you can have that five lines of code for free! Sorry, no steak knives.

View the PHP source, or down­load a plain text ver­sion.

DashLite 1.1 — The “I-don’t-read-long-posts” edition

I announced this at the bot­tom of the post A response to Dash­Lite crit­i­cism, but fig­ured not many peo­ple would actu­ally read that far… so I’m announc­ing it separately.

Essen­tially, ver­sion 1.1 re-introduces one only very spe­cific feed, which pulls the “Releases” cat­e­gory from the Word­Press devel­op­ment blog. This cat­e­gory is only used for post­ing updates to soft­ware — there is no announce­ment of com­mu­nity events, mile­stones, etc. To view exactly what’s being syn­di­cated, visit the Releases cat­e­gory page.

Basi­cally, this syn­di­cates new release infor­ma­tion and dis­plays it in the “Do Stuff” side­bar, as shown in the screenshot.

Get it

PHP source file, rich for­mat­ting (HTML)
Plain text ver­sion of the same, save this as-is

To install the update, sim­ply over­write the wp-admin/index.php file in your Word­Press instal­la­tion — it is advis­able you backup your old index.php file first, in case prob­lems arise (none noted in the changes made, but it’s pos­si­ble you’ll dis­cover some­thing, as always).

# by Josh on April 8th, 2005 Tags: , ,
| 3 Comments »

A response to DashLite criticism

Navid Azimi posted the fol­low­ing in a com­ment on the ini­tial Dash­lite announce­ment post:

This seems like a good imple­men­ta­tion and def­i­nitely has it’s uses but for most admin­is­tra­tors this could actu­ally be more detri­men­tal in the long run than ini­tially expected. The pri­mary idea behind the Dash­board was to allow all Word­Press Admin­is­tra­tors to stay informed regard­ing devel­op­ments in the community.

Many WP users (or any com­mu­nity for that mat­ter) install and sit. Often times being obliv­i­ous to new ver­sions and (most impor­tantly) secu­rity updates. This sort of unpatched soft­ware can be detri­men­tal not only to your web­host, and your web­site, but also to the entire web com­mu­nity itself.

For exam­ple, when phpBB was exploited with a major secu­rity flaw — there was a major defi­ciency in con­tact­ing all admin­is­tra­tors regard­ing the secu­rity hole. The prob­lem is twofold. The more you pro­mote the secu­rity hole, the eas­ier it becomes for mali­cious users to exploit unpatched instal­la­tions. You see where I am going here.

Of course — right now — in the prime heat of your blog you feel that you are check­ing wordpress.org every­day and you’re prob­a­bly skim­ming the forums daily too. There is no way you’ll miss any updates. But as time goes on and you have tweaked, retweaked and redesigned your web­site five times you’ll real­ize that its time for your blog to push bet­ter con­tent and not just look pret­tier. And its then when you sim­ply stop keep­ing up with every nightly or read­ing the forums daily.

Then again, I could be com­pletely wrong.

I kind of felt that this required a response more pub­licly than the con­tin­u­a­tion of the com­ment thread would per­mit, hence this post­ing. Read the rest of this entry »

Ubuntu, Sendmail and PHP

Sur­pris­ingly, I hadn’t noticed until just yes­ter­day when I was test­ing out a con­tact form for a web­site under devel­op­ment that my PHP mail() wasn’t work­ing prop­erly. I really should have — Word­Press sends out mod­er­a­tion emails for com­ments, and the absence of those in test­ing should have made me think twice, but it didn’t.

So, PHP and Send­mail weren’t play­ing nice. The default com­mand is sendmail -t -i, if you don’t man­u­ally set sendmail_path in your php.ini con­fig­u­ra­tion, but this wasn’t working.

Unfor­tu­nately, due to some degree of stu­pid­ity in the way things are run, you need to use an absolute path for PHP to find where it is (even if just the com­mand “send­mail” works fine from a ter­mi­nal… like I said, stu­pid), so if you want mail, you have to play by its rules. For no appar­ent reason.

This is all with stock Ubuntu ver­sions of Apache2 and PHP, by the way — the stu­pid­ity may go away if you do-it-yourself, but I’m kind of doubt­ing it.

Any­way, assum­ing you’ve got send­mail (or an MTA which pro­vides send­mail hooks — I’m actu­ally using post­fix here) installed, you can sim­ply set this in your php.ini, restart Apache (using apache2ctl restart from a root account), and all should be working:

sendmail_path = /usr/sbin/sendmail -i -t

Bingo!

# by Josh on March 28th, 2005 Tags: ,
| 16 Comments »