Archive for December, 2008

Hiding posts in WordPress

Tuesday, December 30th, 2008

Sometimes I want WordPress posts to be easily accessible, but not advertised in public. When I have a story to share with my mother, I just want to send her the direct link - but I don’t want the post to appear on the home page or be reachable via navigation links or feeds.

WordPress has functionality to allow posts to be ‘Private’ or ‘Protected’, but both of these require passwords or logins. This is more than I want to subject my mother to.

So I have created a patch to WordPress 2.7, which adds functionality to hide certain categories and all the posts in those categories. This patch does the following:

  • Allows you to set the ‘hidden’ flag on any category in the Admin GUI.
  • Hides any hidden categories from the category list in the sidebar.
  • Hides ‘previous’ and ‘next’ links to a post in a hidden category (when viewing a single post).
  • Hides the post from the RSS2 feed.
  • Hides the post from your front page (minor theme modification required).

Download the patch here (17KB)

Applying the patch

First, make a backup. This patch is provided in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

If you are applying this patch to an existing WordPress installation, you will need to make a minor database modification:

ALTER TABLE wp_terms ADD COLUMN flags VARCHAR(100) DEFAULT '';

Next, apply the patch. This example assumes the patch is located in your home directory (~).

user@host:~$ cd /path/to/wordpress
user@host:/path/to/wordpress$ patch -p1 < ~/wp2.7-hidden-categories.diff

Finally, change your blog template. Locate the beginning of The Loop and add the line in bold:

<?php while (have_posts()) : the_post(); ?>
<?php if ( is_hidden_category() ) continue; ?>

That’s it! You can now go into the admin GUI and set any category to ‘hidden’ via Posts > Categories.

Alternatives

Would like this functionality but don’t want to patch your WordPress? Have a look at the following plugins:

These are easier to install but do not hide previous/next post links and do not hide the categories from the category listing in the sidebar. I believe this is impossible within the current plugin architecture (but please let me know if I’m mistaken).

WE SAS & BENNY PARTY

Saturday, December 27th, 2008

Yes we love them, you know we do -

And if you knew them you’d love them too!

Merry Christmas

Saturday, December 27th, 2008

pano-cc-small

Cold clean lines and silver smiles

shivers in the morning sky

Tell me winter

dark and grey

will you bring back the sun to-day?

Credibility

Wednesday, December 24th, 2008

pic00008

The sign says: “Watch out! Bikes will really be removed!” (I’ll try to make a better picture when I come around again)

The city is littered with signs like that. It seems to be something that insurance companies require businesses to do in order to qualify for glass insurance. And, well, parked bikes can be a nuisance.

Normally I don’t pay attention to the signs. Few people do judging by the amount of bikes and bike remains littered throughout town. But this one stood out. Because it was attached to a locksmith business. That lends an acute credibility to the threat, and sure enough, no bikes to be found anywhere near the building.

IMG 0412

Then there is stuff like the above, seen in France in 2004. According to the sign, this sad building belongs, or belonged, to Caron Securite. This ostensibly is a company that you can pay to look after you and your property. But for whatever reason, they clearly did not deem it necessary to extend the same service to their own property.

What happened here? Did the company intrude on someone else’s turf? Did an established competitor wish to forcefully express his disagreement with capitalist tenets such as competition and free choice? Or did the company have the electrical wiring installed by cousin Alain, who fell on his head as a child and accepts payment in pallets of wine? …

Alas, reality is less dramatic. This is a training ground used to recreate fires. On the other side of the building, a charred sign proclaims ironically: “Contre le feu!”

IMG 1192 cc

Coffeeshop “Happyness”, 2001.

And sometimes irony descends into vicious cynicism.

What cruel business man hides behind this travesty? Weighed down by sorrow and the daily grind, this is where the hopeless come for a few moments of forgetfulness. Not bliss, mind you. For getting stoned offers no escape, but is itself part of their Sisyphean suffering. They buy their Afghan, stir their tea, and smoke in silence. Then shuffle out the door to sleep a dreamless sleep. And wake to do the whole thing over again.

It is a life, to be sure. To be sure, there is a profit to be made and someone has to make it. But what heartless reptile paints this pit of despair in rainbow colors and calls it “Happyness”?

Nicole

Wednesday, December 24th, 2008

nicole-port-day-2

These billboards have graced our city the past couple of days. It’s impossible not to notice. There must be hundreds of them. Each has an immense portrait of Nicole Kidman. It is a beautiful picture. She looks straight into the camera, her face rising like a sun above the pink cloud of her dress, her hair a mesmerizing golden flame.

She doesn’t smile. Her expression is neutral. She seems to be waiting for something. But for what? It is not clear. This is the riddling Sphinx without even the riddle. Her beauty relieves her from the need to explain. Like the father doesn’t need to explain himself to the child, the beautiful don’t need to explain themselves to the ugly.

Favor flows uphill from the ugly to the beautiful. But why? Is it fair? Does beauty signify anything beyond the naked ambition of natural selection? If not, then what is the moral significance of beauty? By what token can the beautiful lay claim to their privileges, if their beauty is merely a reinforced random adaptation? Should not a fair society work to provide equal opportunities for the ugly?

Perhaps technology can reduce our dependance on physical beauty, in the same way that it reduced our dependance on physical strength. Would this help to emancipate the ugly? Or does it only help to reinforce the tyranny of beauty? Because if studies show that beautiful people live longer and healthier lives, and the technology exists to make even the most wretched person beautiful, then don’t the ugly have an obligation to make themselves more beautiful? And ultimately, wouldn’t then the state have an obligation to round up the ugly and send them to beautification camps?

-

But what if there is more to beauty than evolutionary effort? What if we cannot live without beauty? Beauty ignites our passions, animates our thoughts, informs our intuition. Then we must pursue it relentlessly, worship it whereever we may find it, accept that it divides us.

Send out the ships of war! For so long as there is beauty, there never will be peace.

My first computer

Friday, December 19th, 2008

CanonV20 3

This is an image of my first computer, the Canon V-20, an MSX 1 compatible. My father bought it for me in 1988 or thereabouts, at a Dutch discount store called Kwantum. It came with a small, fosforescent green Philips screen.

Near the top of the machine, to the right of the Canon logo, it had a cartridge slot that you could use to play games. Basically you rammed the cartridges straight into the motherboard. Sometimes it required quite a bit of force. You could hear the printed circuit boards grind and gnash as they joined.

We played lots of Konami games. Nemesis, Hyper Sports, Yie Ar Kung-Fu.

The cartridges were expensive. Later on I got a tape recorder. There were lots of cheap bargain bin games on tape. They took ages to load and often you would have to load them 2 or 3 times before they would work right. The tape recorder wasn’t very good.

At some point the tape recorder started eating tapes. One of the tapes became so tangled up inside the recorder that I had to cut it up to get it out. My father tried splicing the tape back together with transparent duct tape, but of course the game never ran again.