Categories
Software and Programming

PHP: Pain, Hate, Programming

An apparently recent upgrade of PHP on this server lead me to update a mediawiki and debug Tom Sella‘s venerable post directionality wordpress plugin, which was working fine on my box (PHP 5.3.3-1ubuntu9.3) but not on the server (PHP 5.3.6-8), apparently because \w in regular expressions now matches Hebrew characters. My fix was to replace this line:

$c_eng = $this->count_it($text, '/\w+/u');

with this one:

$c_eng = $this->count_it($text, '/[\p{Latin}\d\_]+/u');

Not sure if it will work everywhere, but seems to fix the problem here.

OK, so now I can start doing $WORK…

Categories
Blather Software and Programming

WordPress 3.0

Just did a clean upgrade to WordPress version 3 (as opposed to overwriting my existing install) and switched to the new default theme. The only plugins I use are Livejournal CrossPoster and WP Hashcash (for blocking automated spam comments), and I need to write a post and get no spam on it to see if they work, so…

Update: I also moved the root of my blog to http://corky.net/dotan instead of http://corky.net/dotan/log; you may need to adjust your feed links (although I’ve got rewrite rules to handle that, I think).

Categories
Software and Programming

Silly WordPress Plugin: Editor Directionality Button

Here’s a simple (trivial, in fact) plugin for WordPress that adds a button to the visual editor for setting the text direction of a paragraph.

This button is already enabled in versions of WordPress localized to a bidi language, like Hebrew. You only need to install my plugin if you’re using (say) an English version of WordPress, but still want to include blocks of right-to-left ordered text in your posts.

To Install, download this file: editor directionality button version 0.1 (zip), unzip its contents  (a single PHP file called editor-dir-button.php), upload it to your plugins directory, and enable via the plugins control panel.

Tested in WordPress 2.6.3, WordPress 2.7

Add the TinyMCE editor directionality control
Add the TinyMCE editor directionality control

הינה פלאגין פשוט (טריוויאלי, למעשה) לוורדפרס, שמוסיף כפתור כיווניות לעורך הויזואלי.

כפתור הכיווניות מוצג בגירסאות של וורדפרס שעברו התאמה לשפות דו-כיווניות (כמו עברית). את הפלאגין הזה אתם צריכים רק אם אתם עובדים עם וורדפרס לועזי אבל רוצים להכניס לפוסטים בלוקים של טקסט שמאורגן מימין לשמאל.

בכדי להתקין: הורידו את קובץ ה-ZIP הזה, editor directionality button version 0.1, והעלו את תוכנו (קובץ PHP בודד בשם editor-dir-button.php) לתיקיית ה-plugins שבהתקנת הוורדפרס שלכם. הפעילו אותו בעמוד ניהול ה-plugins.

נבדק ב: וורדפרס 2.6.3, וורדפרס 2.7

Categories
BlogTalk Oddities

End of March Link Roundup

  • WordPress 2.5 is out, and it is very pretty on the inside. Some plugins break, in particular the livejournal crossposter, but I read there is a fix, so I’m posting to try it (PS: works for me). To make this more than a test, test post, I stick in some links what I have already tagged in my shared items or scuttle, but which I haven’t put in this feed.
  • Here’s a picture essay about the Oz books and subsequent derivative works and how, they kept getting darker until perhaps due to the success of Wicked, the dark adult deconstruction of Oz became practically its own genre. Sort of like Postmodern superheroes, except with ruby slippers.
  • Here’s a slew (that’s like a flotilla, except of stuff) of proposed and rejected ideas for Star Wars merchandise. Bantha slippers, anyone? Jabba the Hutt beanbag? Death Star Grill?
  • The Wikihistory link has been making the rounds everywhere, but, yeah.
  • Literary Divination, A Parlour Game is about creating Tarot readings for fictional or real characters using books instead of cards.
  • Yossi Gurvitz on Prof. Shlomo Zand’s book on the manufactured nature of Jewish history and the Zionist narrative (Hebrew). Though-provoking and some further exploration (or culture archeology axe-grinding) of the history of early Judaism, which Yossi has been ranting about recently.
  • Anders Sandberg is discussing the usefulness of love-potions, or as he calls it the neuropharmacological enhancement of love and why it is likely a good idea.
  • Kenneth Hite complains that theater isn’t bloody enough anymore, mentioning Titus Andronicus and the plays of Seneca, which I just recently read him mentioning in White Wolf’s Requiem for Rome book.
  • Finally, apropos “Earth Hour” (was that the blackening of Google you were on about?), here is Peter Watts all full of bleak and brilliant fury:

    Why, I’ll bet the reduced environmental impact from turning off those lights might even recoup a small fraction of the resources consumed to drive the massive multimedia extravaganza advertising Earth Hour.

    Oh, wait. There isn’t going to be any reduction in environmental impact. Not unless the world’s power-generating utilities decide to scale back the fossil fuels they’re burning to reflect a one-time, one-hour tick in the time series.

    Yes, I know. It’s only supposed to make “a statement”. It’s supposed to be a symbol. And what does it symbolize, exactly? It symbolizes “hope” — which is to say, our infinite capacity for denial

Categories
BlogTalk

Excuse the RSS spam

I was quite happy to aggregate my two bookmarks feeds (google reader shared items and my local scuttle) into one widget on my blog, except that it was rightly pointed out that nobody goes to the web page, they just read the RSS.

So I looked for one of those WordPress plugins that can periodically create a post automatically from updates to a feed. WP-o-Matic looked like a good thing to use, except that (it turns out that) it converts every RSS item to a seperate post. The result: I click a link and spam my feed with 35 new posts, each a single link. Even worse, they all get automatically posted on Livejournal, and when I delete them from the blog, they don’t get deleted there – I had to go and delete them manually using the even suckier (for deleting) interface of LJ.

So, if your feed reader just got stuffed with 35 new posts from me, I apologize.