Surf Radio
The summer is coming to an end but there’s a solution to keep the spirit alive:
Surf Radio!
WordPress: pagebar 2.54
pagebar 2.54 removes a problem with the „Break comments into pages“ setting which could not be deselected. Unfortunately I had to remove the „show all comments“ feature since I have not found a different method to code this feature.
Additionally there are two more fixes:
- Settings where not correctly inherited by multipagebar and commentbar.
- Commentbar was displayed if only one page was present.
Download:
Hope I didn‘t break anything else ![]()
The Inner Chapters Part I
The Inner Chapters journal my own quest to improve in the craft of programming. Each chapter reflects on a specific practice or principle through the lens of my own experiences both as a professional and an enthusiast. The name refers to the Chinese classic of philosophy, the Chuang Tzu. Divided into two sections, the Inner Chapters make up the first part attributed to the philosopher Chuang Tzu himself. The commentaries on the first section, written by his students and others, are known as the Outer Chapters. I hope you will contribute to my Outer Chapters by sharing your own thoughts and experiences on growing as a programmer.
The Inner Chapters Audio-Promo :
Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.
Links:
Hello Dolly 2010
Since 2 weeks there’s a voting on Digging into WordPress whether to keep the Hello Dolly plugin in the standard distribution or to chuck it out the house.
One of the most heard reasons for the existence of Hello Dolly that it should be used as a pattern for novice plugin developers. In my mind the problem with this argumentation is that the plugin hasn‘t changed essentially since WordPress v1.21 (the version which introduced plugins in May 2004).
Since then the environment for plugins has changed a lot. The main difference is that there are typically ten or more plugins installed on a blog. Therefore it’s mor important than ever that the plugins don‘t interfere with each other. This can most easily be achieved by encapsulation and this leads inevitable to object-oriented programming. Here’s my attempt to take Hello Dolly to the next decade:
< ?php /** * @package Hello_Dolly * @author Matt Mullenweg * @version 1.5.1 */ /* Plugin Name: Hello Dolly Plugin URI: http://wordpress.org/# Description: This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong: Hello, Dolly. When activated you will randomly see a lyric from <cite>Hello, Dolly in the upper right of your admin screen on every page. Author: Matt Mullenweg Version: 1.5.1 Author URI: http://ma.tt/ */ if (! class_exists('Hello Dolly')) { class HelloDolly { function hello_dolly_get_lyric() { /** These are the lyrics to Hello Dolly */ $lyrics = "Hello, Dolly Well, hello, Dolly [...] It's so nice to have you back where you belong You're lookin' swell, Dolly Dolly'll never go away Dolly'll never go away again"; // Here we split it into lines $lyrics = explode("\n", $lyrics); // And then randomly choose a line return wptexturize( $lyrics[ mt_rand(0, count($lyrics) - 1) ] ); } // This just echoes the chosen line, we'll position it later function hello_dolly() { $chosen = $this->hello_dolly_get_lyric(); echo "<p id='dolly'>$chosen</p>"; } // We need some CSS to position the paragraph function dolly_css() { // This makes sure that the posinioning is also good for right-to-left languages $x = ( 'rtl' == get_bloginfo( 'text_direction' ) ) ? 'left' : 'right'; echo " <style type='text/css'> #dolly { position: absolute; top: 4.5em; margin: 0; padding: 0; $x: 215px; font-size: 11px; } </style> "; } //dolly_css() } //class }//if class_exists() $HelloDolly = new HelloDolly; if (isset($HelloDolly)) { add_action('admin_head', array(&$HelloDolly, 'dolly_css')); // Now we set that function up to execute when the admin_footer action is called add_action('admin_footer', array(&$HelloDolly, 'hello_dolly')); } ?>
As you can see all the code is encapsuled in the HelloDolly class and the only variable names visible to the rest of the system are class HelloDolly and $HelloDolly. It’s not very likely that there will be another plugin using the variables.
This may not be too important in this small plugin but it gives the user a good and up-to-date prototype for more complex code. Maybe this code will convince the 76% that this new Dolly is a cow that is not only sacred but also meaty.
WordPress: Überschriften mit Untertiteln
In vielen Zeitungen ist es üblich, unter die eigentliche Überschrift noch einen Untertitel zu setzen, um den folgenden Titel näher zu erläutern:

Durch diese Untertitel kann man den eigentlichen Titel etwas kreativer gestalten und anschließend erläutern. Leider bietet WordPress von Haus aus diese Funktion nicht an und so muss sie nachgerüstet werden. Als ersten Reflex würde der geneigte Programmierer eine Lösung per Plugin versuchen, allerdings gibt s auch eine Lösungmit Bordmitteln. Die Zauberworte lauten „Benutzerdefinierte Felder“ (engl. „custom fields“).
xnation.fm
Nachdem Michael Jackson gestern das Zeitliche gesegnet hat werden uns die etablierten Radiosender wohl Wochen oder vielmehr Monate mit Titel wie „Billie Jean“. „Bad“ oder „Dirty Diana“ zumüllen. Solange man allerdings an einem Rechner mit Internetanschluss und Soundkarte sitzt kann man diesem Terror entkommen.
Mein augenblicklicher Zufluchtsort nennt xnation.fm. Hier die letzten fünf Lieder die gerade gespielt wurden:
- Pepper – Your Face
- Hoobastank – I think I love you
- The Ataris – In this diary
- New Found Glory – Listen to your friends
- The Red Jumpsuit Apparatus – Pen and Paper
Hört sich nach einer guten Alternative an!
Sehr schön ist auch die begleitende Webseite, die sich nicht auf bunte blinkende Bilder beschränkt, sondern eine Liveticker mit den zuletzt gespielten Liedern inklusive Links auf die Bio der Band und die Texte des aktuellen Liedes anbietet. Vorbildlich.
Die Tim und Holgi Show
Tim Pritlove und Holger Klein im vollkommen ungeplanten Podcast: Not Safe for Work 001. Erinnert ein wenig an die alten Spreeblick-Podcasts.
Wordpress: Überprüfen, ob ein Beitrag das more-Tag enthält
Manchmal möchte man einen Beitrag abhängig davon gestalten, ob er ein <!–more–>-Tag enthält oder nicht. Leider verfügt WordPress nicht über eine Funktion, um diese Prüfung vorzunehmen. Befindet sich der Beitrag innerhalb des Loops, so kann man aber folgende Funktion benutzen:
function hasMoreLink() { global $post; return strpos($post->post_content, '<!--nore-->'); }
(Bitte „nore“ mit „more“ ersetzen, konnte ich aber nicht eingeben, weil sonst WordPress das Tag auswertet.)
Danke an MichaelH aus dem englischen WordPress Forum



