blogging

You are currently browsing articles tagged blogging.

My CDN provider changed services without my noticing, so this site has seemed down for a while

Things should be back to normal now. Thanks to me dear wife (who otherwise never reads this blog) for informing!

(<geek>In fact, it wasn’t the site, but rather that images and CSS files never were delivered. I’ve done the necessary changes on the backline, but it’ll take a while before the DNS updates have propagated around the intertubes, so this blog will have to stand alone until then.</geek>)

Tags: , ,

Navelfluff är en trespråkig blogg. Ibland häller jag ur mej på svenska, ibland på finska och ibland på engelska, lite beroende på vad jag har att säja och till vilken publik jag riktar mej. Språkindelningen annoterar jag med Wordpressens kategorier, vilka jag oxå använder för kategorisering av själva innehållet (geek, Timor-Leste, pynja, osv). Det är en debattfråga huruvida det kan tänkas syntaktiskt korrekt att använda samma slags metadata att annotera både innehållet och språket för inlägget men jag geek och inte lingvist, så jag godkänner mitt beteenede i detta fall.

Wordpress å andra sidan är inte mångspråkig, vilket kanske inte är så konstigt med tanke på att de flesta bloggar skrivs på ett och samma språk. Visst, man kan få WP att tala ett annat språk, men det är fortfarande bara tal om ett annat språk i taget. Vilket jag tyckte var lite trist.

Ända tills lite tidigare idag tyckte nämligen Navelfluff att “please leave a comment” för alla inlägg, oavsett vilket språk inlägget var skrivet på. Och i samband med en kommentar jag fick angående Tarski-temats lite lakoniska “no comments”-statustext i anslutning till inlägg som saknar kommentarer (till skillnad från inlägg som inte önskar kommentarer) så tog jag och gjorde nåt åt saken.

Följande plugin lokaliserar skriv-en-kommentar- eller inga-kommentarer -texten. Pluggaren baserar sej på change_no_comments_text -pluginnen av Tony Trainor. Förklaring följer efter koden.

function change_comments_text($text, $number) {
    global $post;
    $lang = "any" ;

    $cats = wp_get_post_categories( $post->ID );
    $stac = array_flip( $cats );

    if( array_key_exists( 3, $stac )) $lang = "sv";
    if( array_key_exists( 4, $stac )) $lang = "fi";

    $text = Array( "any" => array( 0 => "Please leave a comment! ",
                                  1 => "1 comment ",
                                  2 => "$number comments "),
                  "sv" => array(  0 => "Skriv en kommentar! ",
                                  1 => "1 kommentar ",
                                  2 => "$number kommentarer "),
                  "fi" => array(  0 => "Anna palautetta! ",
                                  1 => "1 palaute ",
                                  2 => "$number palautetta "));
    $num = $number;
    if( $num > 2 ) $num = 2;
    $ret = $text[$lang][$num];

    return $ret;
}

add_filter('comments_number', 'change_comments_text', 10, 2);

Varje postning har ett antal kategorier (noll eller flera) och de representeras som en array vars värden utgör kategori-ID:na. Efter en del reverse-engineering kategori-arrayn (att de facto läsa dokumentationen är tråkigt :) ) insåg jag att mina svenskspråkiga inlägg har en kategori-ID 3 och mina finskspråkiga ID 4. [0] 

I koden används ett lite fult trick, nämligen array_flip samt array_key_exists för att kolla om artikeln har kategori-ID tre eller fyra. Samma sak skulle ja antagligen skrivit elegantare med array_search men av nån orsak fick jag inte den funktionen att funktionera. Men så är jag oxå nybörjare, så jag har en bortförklaring.

Slutligen konstateras att jag har ingen aning vad parametrarna 10 och 2 gör i slutet av alltsammans.

Har du en flerspråkig blogg (hej skrubu! hej nikc!) och språk-kategoriserar dina inlägg så behöver du “bara” gissa fram vilka kategori-ID:n du använder (vink: ersätt return $ret; i koden ovan med return "$ret <!-- $lang $num " . implode( "|", array_values( $cats )) . " -->";), infoga ett kommentarblock i början av koden med de av WP obligerade kommentarfälten, inslut kodsnutten i <?php ... ?>-markering, och slutligen spara hela rasket i ditt wp-content/plugins -direktorat. 

Skulle det mot all vettig förmodan finnas en social beställning på denna pluggare i ett människovänligare format, så … vänligen skriv en kommentar!

[0] Övriga (samt o-språk-kategoriseade) inlägg behandlas som om de vore engelska och de med flera språk-kategoriseringar får den sista lokaliseringen i listan. Det är så sällan jag skriver ett inlägg med flera såpråk att jag inte orkar koda om pluggaren så att den lokaliserar till alla noterade språk.

Tags: , , ,

Communicator waves

Short version: this is a test.
Long version after the fold.

A Nokia Communicator could very well be the ultimate mobile blogging machine. It’s portable, it’s connected and it’s got a keyboard with all relevant characters on it. It’s got a camera and newer models even have gps receivers. I’ve even written the text to a blog post, namely my report from the R.E.M. gig from a month and a half back.

With this posting, i’ve taken things a step further: this one is posted straight from the E90, using the trial (and thus crippled) Wavelog software. The full Wavelog supports editing previous posts and storing images on picasaweb, which is nice.

I don’t think i would like to write lengthy pieces on a platform like this (that is, typing with my thumbs), but the possibility for, say, travel blogging, is exciting — though especially when it comes to travel blogging i would like to have my entries geotagged.

Tags: , , , ,

I just read an article Scott Hanselman wrote about blogging. One of the important things were that he counts the success of his blog in how much of a dialogue he gets with his users.

As i get hardly no feedback at all (even when i’m writing about politics and/or religion), i just thought i’d have a look at my stats. And the stats gave me some comfort.

On average, i’m visited by about twenty human visitors a day. Thank you all! Now i know you’re there even if you are of the silent kind. Now the next step for you is to say hi! Come on! It’s not that hard. There’s a nice big box that you can do so in if you just scroll a few lines down after this posting.

The second rather nice finding is that 27% of these visitors (that’s about six daily) are actually returning visitors! Hello, you unknown friends! I love you! Now come on, don’t be shy, say hello! This is like Vem ska trösta knyttet? but in reverse (actually, it’s a bit from Fish’s Vigil: “If there’s somebody out there, could they thrown me down a line?”)

Last, but not least, i want to send out a big wave to my visitors from countries from which they are the only visitor: Hong Kong, China (uh-huh), Austria, Portugal, South Africa, Australia, Philippines, Syria, Belgium, Morocco, New Zealand, Timor-Leste (the country previously known as East Timor), Iceland, Switzerland, Serbia and Montenegro (aren’t you two different countries these days?), Cambodia, Czech Republic and Slovenia!

Update: Scott Hanselman actually posted a comment to this entry — i’m famous! :)

Tags: , , , ,

Tags: ,

Today’s The Show is way above average, even for Ze Frank. It’s about the reptilian part of your brain, being rational, stuff that could have been and fear.

Fri 23-Feb-2007 | Please leave a comment!

The face of Ze FrankI realize that i haven’t promoed The Show with Ze Frank at all, even though it’s one of the main reasons i fire up my iTunes player daily these days. The Show is one of those things that really shouldn’t be explained, just enjoyed, but hey, why do things like they should.

In The Show, Ze Frank talks with the viewers about politics, art, stupidity, existentialism, observations about all kinds, and duckies.

This one, on how to piss off an art student, is pretty excel… awsome. Add it to your aggregator or iTunes feed today and start your sportsracing path towards the League of Awsomeness.

Tags: , , , ,

Ella arriveth

So, now i too have upgraded to Wordpress 2.1Ella“. It was a remarkably painless operation but i do admit that i was a tad nervous when overwriting my old WP hierarchy with the new one.

I have the WP hierarchy as the root of my html directory, whereas the default WP installation suggests having it in a wordpress directory under the html directory. What i did was to create a foo/ directory under the html/ directory, untar the distribution tarball from there, then from html/foo/, i cp -R wordpress/ ../ and rm -rf foo/ from my html directory.

If the lines above looked like Hebrew to you, either you don’t need to worry, or i’m fluent in Hebrew.

Tags: ,

I learned something new today. Or, something blatantly obvious that i already knew but hadn’t thought of was shoved in my face. Same thing. We had this housewarming party at work today. As this lecturer (Tom, but i forget his surname) mentioned that modern industry folks are now “required” to blog as to show what they’ve learned today, i saw that the parallel to what they call an “oppimispäiväkirja” (“learning diary”) at school (and other schools, i’m sure). And a reason to blog.

It’s not just to show others what nifty stuff you’ve invented, found or thought of, it’s a way of reflecting on what you’ve learned today.

It doesn’t even have to be something wholly remarkable, but it’s a tool for yourself — myself — tell to yourself that this is what i’ve done today and by repeating it, i can learn it, remember it, and find it afterwards when i need the reminder.

So there.

This is what i learned today.

A week back, i learned that MOM, Microsoft Operations Manager, is a nifty tool with which you can keep an eye open on a myriad of things happening on a farm of servers, and that it can draw pretty graphs showing where Active directory has synched, or failed to synch.  Should have written that then, but it just didn’t seem blogworthy.  Heck, for me it was, and i now realize that i write this stuff for me too.

And today it’s UN day.  I salute all the active members of the United Nations, and those i’ve worked with when i did so.  I know a few of them still are in active service.  Kudos to you.

Tags:

Finemang!  Sen jag installerade Bad Behavio(u)r-pluggaren i Wordpressen så har min mängd kommentarspam minskat drastiskt.  Då jag tidigare marrat om hundratals kommentar-spammar i min blogg har Akismet (WP:ns “inbyggda” spamfilter) nu bara sexton spammar i kö.  Kalas!

Tags: ,

« Older entries

Bad Behavior has blocked 648 access attempts in the last 7 days.

Bear