<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Simon Ottenhaus &#187; HowTo / Anleitung</title>
	<atom:link href="http://familie-ottenhaus.de/simon/blog/category/howto/feed/" rel="self" type="application/rss+xml" />
	<link>http://familie-ottenhaus.de/simon/blog</link>
	<description>Uni &#38; Software</description>
	<lastBuildDate>Fri, 23 Dec 2011 13:15:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>HowTo: Subversion 1.6 unter Debian lenny</title>
		<link>http://familie-ottenhaus.de/simon/blog/2011/10/howto-subversion-1-6-unter-debian-lenny/</link>
		<comments>http://familie-ottenhaus.de/simon/blog/2011/10/howto-subversion-1-6-unter-debian-lenny/#comments</comments>
		<pubDate>Tue, 18 Oct 2011 20:26:27 +0000</pubDate>
		<dc:creator>Simon Ottenhaus</dc:creator>
				<category><![CDATA[HowTo / Anleitung]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Subversion]]></category>

		<guid isPermaLink="false">http://familie-ottenhaus.de/simon/blog/?p=1362</guid>
		<description><![CDATA[Unter Debian lenny wird zur Zeit nur Subversion 1.5.x bereitgestellt. Dies unterstützt allerdings nur Repositories bis zur Version 3. Neuere Repositories werden allerdings in der Version 4 erstellt. Wenn man mit diesen arbeiten möchte benötigt man Subversion 1.6 Vorbereitung Zunächst muss der sources.list eine neue Zeile hinzugefügt werden, damit ein sogenannter Backport von Subversion verwendet [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://familie-ottenhaus.de/simon/blog/wp-content/uploads/2009/04/subversion_logo_hor-468x64.png" alt="subversion_logo_hor-468x64" title="subversion_logo_hor-468x64" width="468" height="64" class="alignnone size-full wp-image-631" /></p>
<p>Unter Debian lenny wird zur Zeit nur Subversion 1.5.x bereitgestellt. Dies unterstützt allerdings nur Repositories bis zur Version 3. Neuere Repositories werden allerdings in der Version 4 erstellt. Wenn man mit diesen arbeiten möchte benötigt man Subversion 1.6</p>
<p><strong>Vorbereitung</strong><br />
Zunächst muss der sources.list eine neue Zeile hinzugefügt werden, damit ein sogenannter Backport von Subversion verwendet werden kann. Dies bedeutet, dass neuere Software für ältere Debain Versionen zur Verfügung gestellt wird.</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1362code5'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p13625"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p1362code5"><pre class="text" style="font-family:monospace;"># diese zeile muss zu &quot;/etc/apt/sources.list&quot; hinzugefügt werden
deb http://backports.debian.org/debian-backports lenny-backports main contrib non-free</pre></td></tr></table></div>

<p>Nun ist es möglich Subversion 1.6 zu installieren. Allerdings muss dazu aptitude mit speziellen Parametern aufgerufen werden</p>
<p><strong>Installation</strong><br />
Zunächst müssen die Paketquellen neu geladen werden. Dies geschieht mit</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1362code6'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p13626"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1362code6"><pre class="text" style="font-family:monospace;">sudo aptitude update</pre></td></tr></table></div>

<p>Nun kann Subversion 1.6 endlich installiert werden:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1362code7'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p13627"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1362code7"><pre class="text" style="font-family:monospace;">sudo aptitude -t lenny-backports install subversion</pre></td></tr></table></div>

<p>Aptitude wird eventuell vor der Installation noch nachfragen. Wenn alles funktioniert hat sollte nun Subversion 1.6 installiert sein:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1362code8'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p13628"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p1362code8"><pre class="text" style="font-family:monospace;">#svn --version
svn, Version 1.6.12 (r955767)
   übersetzt Jun 17 2011, 07:54:11</pre></td></tr></table></div>

<p>Andere Artikel zum <a href="http://familie-ottenhaus.de/simon/blog//tag/subversion/" class="liinternal">Thema Subversion</a></p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://familie-ottenhaus.de/simon/blog/2011/10/howto-subversion-1-6-unter-debian-lenny/" target="_blank" class="liimagelink"><img src="http://familie-ottenhaus.de/simon/blog/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://familie-ottenhaus.de/simon/blog/2011/10/howto-subversion-1-6-unter-debian-lenny/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Datenschutz: Anti Facebook Tracker &#8211; Alle Like-Buttons entfernen</title>
		<link>http://familie-ottenhaus.de/simon/blog/2011/07/datenschutz-anti-facebook-tracker-like-buttons-entfernen/</link>
		<comments>http://familie-ottenhaus.de/simon/blog/2011/07/datenschutz-anti-facebook-tracker-like-buttons-entfernen/#comments</comments>
		<pubDate>Wed, 20 Jul 2011 15:15:18 +0000</pubDate>
		<dc:creator>Simon Ottenhaus</dc:creator>
				<category><![CDATA[HowTo / Anleitung]]></category>
		<category><![CDATA[Datenschutz]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Like-Button]]></category>

		<guid isPermaLink="false">http://familie-ottenhaus.de/simon/blog/?p=1316</guid>
		<description><![CDATA[Facebook kann über die Like-Buttons problemlos Benutzerprofile erstellen &#8211; auch von nicht angemeldeten Nutzern. Jedes Mal, wenn ein Like-Button erscheint wird eine Anfrage an Facebook übermittelt. In dieser befinden sich ausreichend Daten, so dass Facebook nachvollziehen kann wann man welche Webseite aufgerufen hat. Ein effektiver Weg dies zu verhindern ist die Like-Buttons nicht mehr zu [...]]]></description>
			<content:encoded><![CDATA[<p>Facebook kann über die Like-Buttons problemlos Benutzerprofile erstellen &#8211; <strong>auch von nicht angemeldeten Nutzern</strong>.</p>
<p>Jedes Mal, wenn ein Like-Button erscheint wird eine Anfrage an Facebook übermittelt. In dieser befinden sich ausreichend Daten, so dass Facebook nachvollziehen kann wann man welche Webseite aufgerufen hat.</p>
<p>Ein effektiver Weg dies zu verhindern ist die Like-Buttons nicht mehr zu laden. Dazu benötigt man</p>
<ul>
<li><a href="https://addons.mozilla.org/de/firefox/addon/adblock-plus/" target="_blank" class="liexternal">Adblock Plus</a> (kostenlose Erweiterung für Firefox)</li>
<li>spezielle Filterregeln für Adblock Plus:</li>
</ul>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1316code10'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p131610"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p1316code10"><pre class="text" style="font-family:monospace;">||facebook.com^$domain=~facebook.com|~facebook.net|~fbcdn.com|~fbcdn.net
||facebook.net^$domain=~facebook.com|~facebook.net|~fbcdn.com|~fbcdn.net
||fbcdn.com^$domain=~facebook.com|~facebook.net|~fbcdn.com|~fbcdn.net
||fbcdn.net^$domain=~facebook.com|~facebook.net|~fbcdn.com|~fbcdn.net</pre></td></tr></table></div>

<p><em>Die Regeln bedeuten folgendes:</em> Blockiere Inhalte von Facebook, wenn die Seite auf der der Inhalt angezeigt werden soll nicht Facebook ist.<br />
<em>Oder positiv ausgedrückt:</em> Nur auf Facebook können Inhalte von Facebook geladen werden.</p>
<p><strong>Regeln hinzufügen</strong><br />
Die Regeln müssen nach der Installation von Adblock Plus einzeln neu hinzugefügt werden.</p>
<p><strong>Fazit</strong><br />
Alle Like-Buttons sind verschwunden.<br />
Facebook kann das Surfverhalten nicht mehr nachvollziehen.<br />
facebook.com kann trotzdem noch wie gewohnt verwendet werden.<br />
Zeitaufwand: 5-10 Minuten</p>
<p><strong>PS</strong><br />
Der Facebook-Link auf meinem Blog besteht aus einem Bild, das von diesem Server ausgeliefert wird. Erst beim Klick auf das &#8220;f&#8221; wird eine Verbindung zu Facebook hergestellt.</p>
<p><strong>Quelle</strong><br />
<a href="http://lifehacker.com/5542041/block-sites-from-using-your-facebook-login-with-adblock-plus/" target="_blank" class="liexternal">lifehacker.com</a></p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://familie-ottenhaus.de/simon/blog/2011/07/datenschutz-anti-facebook-tracker-like-buttons-entfernen/" target="_blank" class="liimagelink"><img src="http://familie-ottenhaus.de/simon/blog/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://familie-ottenhaus.de/simon/blog/2011/07/datenschutz-anti-facebook-tracker-like-buttons-entfernen/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>&#8220;Filmchen&#8221; zur Rekursion</title>
		<link>http://familie-ottenhaus.de/simon/blog/2011/06/filmchen-zur-rekursion/</link>
		<comments>http://familie-ottenhaus.de/simon/blog/2011/06/filmchen-zur-rekursion/#comments</comments>
		<pubDate>Mon, 20 Jun 2011 20:50:42 +0000</pubDate>
		<dc:creator>Simon Ottenhaus</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[HowTo / Anleitung]]></category>
		<category><![CDATA[Uni Stuttgart]]></category>
		<category><![CDATA[Informatikpraktikum]]></category>
		<category><![CDATA[Rekursion]]></category>

		<guid isPermaLink="false">http://familie-ottenhaus.de/simon/blog/?p=1288</guid>
		<description><![CDATA[Findet sich ab sofort unter InfoP]]></description>
			<content:encoded><![CDATA[<p>Findet sich ab sofort unter <a href="http://familie-ottenhaus.de/simon/blog/infop/" class="liinternal">InfoP</a></p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://familie-ottenhaus.de/simon/blog/2011/06/filmchen-zur-rekursion/" target="_blank" class="liimagelink"><img src="http://familie-ottenhaus.de/simon/blog/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://familie-ottenhaus.de/simon/blog/2011/06/filmchen-zur-rekursion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress: Virtuelle Seiten erstellen &#8211; Von .htaccess zu Hooks</title>
		<link>http://familie-ottenhaus.de/simon/blog/2010/04/wordpress-virtuelle-seiten-erstellen-von-htaccess-zu-hooks/</link>
		<comments>http://familie-ottenhaus.de/simon/blog/2010/04/wordpress-virtuelle-seiten-erstellen-von-htaccess-zu-hooks/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 21:31:35 +0000</pubDate>
		<dc:creator>Simon Ottenhaus</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[HowTo / Anleitung]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[Hooks]]></category>
		<category><![CDATA[Seiten]]></category>
		<category><![CDATA[Virtuelle]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://familie-ottenhaus.de/simon/blog/?p=1057</guid>
		<description><![CDATA[Worpress ist praktisch, wenn man manuell Seiten (Pages) erstellt und diese im Admin Bereich editieren möchte. Allerdings gibt es keine (mitgelieferte) Möglichkeit &#8220;virtuelle Seiten&#8221; unterzubringen. Virtuelle Seiten?! Nun rede ich hier von virtuellen Seiten, aber was verstehe ich darunter? Im Prinzip ist die Idee ganz einfach: Der Webseitenbesucher soll keinen Unterschied zwischen einer virtuellen und [...]]]></description>
			<content:encoded><![CDATA[<p>Worpress ist praktisch, wenn man manuell Seiten (Pages) erstellt und diese im Admin Bereich editieren möchte. Allerdings gibt es keine (mitgelieferte) Möglichkeit &#8220;virtuelle Seiten&#8221; unterzubringen.</p>
<p><strong>Virtuelle Seiten?!</strong><br />
Nun rede ich hier von virtuellen Seiten, aber was verstehe ich darunter?<br />
Im Prinzip ist die Idee ganz einfach: Der Webseitenbesucher soll keinen Unterschied zwischen einer virtuellen und einer &#8220;realen&#8221; Seite sehen &#8211; allerdings ist die virtuelle Seite nicht in der WordPress Datenbank abgelegt.</p>
<p><strong>Die Probleme</strong><br />
Aus dieser Aufgabenstellung ergeben sich folgende Probleme:</p>
<ol>
<li>Umleitung der Anfrage auf ein eigenes php-Skript</li>
<li>Einbinden des WordPress Layouts</li>
<li>Erweitern der Navigation um die Virtuellen Seiten</li>
</ol>
<p><strong>Umleitung der Anfrage auf ein eigenes php-Skript</strong><br />
Auszug aus der .htaccess</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1057code17'); return false;">View Code</a> PLAIN</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p105717"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p1057code17"><pre class="plain" style="font-family:monospace;">RewriteEngine On
RewriteBase /pfad/zu/meinem/blog/
RewriteRule ^uebung/([\w,=;\-]+)\.html$ ce_exercise.php?id=$1 [L]
RewriteRule ^uebung/?$ ce_exercise.php [L]</pre></td></tr></table></div>

<p>In diesem Beispiel werden alle Anfragen auf /uebung, /uebung/, /uebung/xyz-abc-etc.html auf ce_exercise.php umgeleitet. ce_exercise.php bindet dann WordPress ein und lädt die angeforderte Seite aus der (eigenen) Datenbank.</p>
<p><strong>Einbinden des WordPress Layouts</strong><br />
Mit</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1057code18'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p105718"><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code" id="p1057code18"><pre class="php" style="font-family:monospace;"><a href="http://www.php.net/define"><span style="color: #990000;">define</span></a> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'WP_USE_THEMES'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009933; font-style: italic;">/** hier fehlt noch was! Siehe unten */</span>
&nbsp;
<span style="color: #009933; font-style: italic;">/** Loads the WordPress Environment and Template */</span>
<span style="color: #b1b100;">require</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'./wp-blog-header.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>wird WordPress eingebunden (angenommen, dass wp-blog-header.php im selben Verzeichnis liegt).<br />
<em>define ( &#8216;WP_USE_THEMES&#8217;, false );</em> verhindert, dass WordPress selbstständig wird und Theme Dateien lädt &#8211; Das wollen wir ja selbst machen!</p>
<p>Dies alleine reicht allerdings nicht aus, da WordPress die url analysiert und trotzdem versucht den Inhalt der Seite zu laden. Da die angeforderte Seite virtuell ist wird WordPress immer davon ausgehen, dass ein 404 (Seite nicht gefunden) vorliegt. </p>
<p>Dies lässt sich wie folgt lösen:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1057code19'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p105719"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p1057code19"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">/* confuse wordpress: make it think the url is something else */</span>
<a href="http://www.php.net/preg_match"><span style="color: #990000;">preg_match</span></a> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'#(.*)/uebung/#'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_SERVER</span> <span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_URI'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$treffer</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$_SERVER</span> <span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_URI'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$treffer</span> <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;/uebung/&quot;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Ich gebe zu, diese Lösung ist weder schön noch Zukunftssicher &#8211; aber sie funktioniert.</p>
<p><strong>Wichtige Hinweise zu dieser Lösung:</strong></p>
<ul>
<li>Ich verwende &#8220;schöne&#8221; permalinks mit mod_rewrite</li>
<li>Es muss eine Seite angelegt werden, die auf die umgeschriebene url passt. Hier: <em>/uebung/</em></li>
<li>Der Code muss <em>vor</em> <em>require (&#8216;./wp-blog-header.php&#8217;);</em> stehen!</li>
</ul>
<p>Der Anfang des php-Skriptes sieht dann so aus:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1057code20'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p105720"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code" id="p1057code20"><pre class="php" style="font-family:monospace;"><a href="http://www.php.net/error_reporting"><span style="color: #990000;">error_reporting</span></a> <span style="color: #009900;">&#40;</span> <span style="color: #009900; font-weight: bold;">E_ALL</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'WP_USE_THEMES'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/* confuse wordpress: make it think the url is something else */</span>
<a href="http://www.php.net/preg_match"><span style="color: #990000;">preg_match</span></a> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'#(.*)/uebung/#'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_SERVER</span> <span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_URI'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$treffer</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$_SERVER</span> <span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_URI'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$treffer</span> <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;/uebung/&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$requested_page</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$_GET</span> <span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> ? <span style="color: #000088;">$_GET</span> <span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;main&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009933; font-style: italic;">/** Loads the WordPress Environment and Template */</span>
<span style="color: #b1b100;">require</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'./wp-blog-header.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Nun können die WordPress-Funktionen <em>get_header (); get_sidebar ();</em> und <em>get_footer ();</em> aufgerufen werden.</p>
<p>Damit ist das Problem des Layouts gelöst &#8211; bleibt noch:</p>
<p><strong>Erweitern der Navigation um die Virtuellen Seiten</strong><br />
Wordpress stellt viele sogenannter &#8220;hooks&#8221; zur Verfügung, um die Ausgabe von WordPress Funktionen zu beeinflussen. Diese Hooks werden auf den Resultaten der WordPress Funktionen ausgeführt, nachdem die WordPress Funktion fertig ist.</p>
<p>Vereinfacht kann man sich das so vorstellen:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1057code21'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p105721"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p1057code21"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$reslut</span> <span style="color: #339933;">=</span> wp_some_funtion<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> my_hook<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$result</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Die Kunst besteht darin die richtige WordPress Funktion auszuwählen. Ich hab hier auch einen unschönen aber schnellen und effektiven Weg gewhält: Ich modifiziere die Navigation, nachdem diese als HTML generiert wurde. Konkret: Ich verwende einen Hook auf <em>wp_list_pages</em>.</p>
<p>In meinem Fall möchte ich nur die Navigation der Sidebar beeinflussen und nicht die des Headers. Deshalb wird der Hook erst nach Ausgabe des Headers aufgerufen.</p>
<p>Jetzt bleibt nur noch das Hinzufügen der zusätzlichen Navigationselemente im Hook. Ich suche dazu nach dem Navigationseintrag, der &#8220;uebung&#8221; enthält und füge danach die virtuellen Seiten ein.</p>
<p><strong>Der gesamte (auf das Wesentliche reduzierte) Code:</strong></p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1057code22'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p105722"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
</pre></td><td class="code" id="p1057code22"><pre class="php" style="font-family:monospace;">&nbsp;
<a href="http://www.php.net/error_reporting"><span style="color: #990000;">error_reporting</span></a> <span style="color: #009900;">&#40;</span> <span style="color: #009900; font-weight: bold;">E_ALL</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">/* verhindern, dass WP selbständig Themes lädt */</span>
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'WP_USE_THEMES'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/* confuse wordpress: make it think the url is something else */</span>
<a href="http://www.php.net/preg_match"><span style="color: #990000;">preg_match</span></a> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'#(.*)/uebung/#'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_SERVER</span> <span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_URI'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$treffer</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$_SERVER</span> <span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_URI'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$treffer</span> <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;/uebung/&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$requested_page</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$_GET</span> <span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> ? <span style="color: #000088;">$_GET</span> <span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;main&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009933; font-style: italic;">/** Loads the WordPress Environment and Template */</span>
<span style="color: #b1b100;">require</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'./wp-blog-header.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
get_header <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// hier den eigentlichen Seiteninhalt ausgeben</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// hier $added_pages_str mit den virtuellen Seiten füllen</span>
&nbsp;
add_filter <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wp_list_pages'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ce_mod_pages_list'</span><span style="color: #339933;">,</span> 1<span style="color: #339933;">,</span> 2 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
get_sidebar <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
get_footer <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> ce_mod_pages_list<span style="color: #009900;">&#40;</span><span style="color: #000088;">$pages_str</span><span style="color: #339933;">,</span> <span style="color: #000088;">$opt</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$added_pages_str</span><span style="color: #339933;">,</span> <span style="color: #000088;">$requested_page</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$parts</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/preg_split"><span style="color: #990000;">preg_split</span></a> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;#&lt;/li&gt;#&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$pages_str</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$parts</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$value</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/strpos"><span style="color: #990000;">strpos</span></a> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$value</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;uebung&quot;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">!==</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$requested_page</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;main&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000088;">$parts</span> <span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/str_replace"><span style="color: #990000;">str_replace</span></a> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;current_page_item&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$parts</span> <span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #000088;">$parts</span> <span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$added_pages_str</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">return</span> <a href="http://www.php.net/implode"><span style="color: #990000;">implode</span></a> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;&lt;/li&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$parts</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><strong>Schlussbemerkungen</strong></p>
<ul>
<li><em>ce_</em> steht für CompuLearn Englisch</li>
<li>Das Deutsch / Englisch Chaos in Code und Kommentaren ist ärgerlich aber nicht zu vermeiden.</li>
<li>Oje, das ist ja ganz schön viel geworden &#8211; Ich hoffe jemand liest das und findet Anwendung dafür.</li>
<li>Die Resultate können auf <a href="http://compulearnenglisch.de/uebung/" target="_blank" class="liexternal">compulearnenglisch.de/uebung</a> besichtigt werden.</li>
<li>Fragen und Kommentare wie immer erwünscht.</li>
<li>Listen machen alles übersichtlicher <img src='http://familie-ottenhaus.de/simon/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </li>
</ul>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://familie-ottenhaus.de/simon/blog/2010/04/wordpress-virtuelle-seiten-erstellen-von-htaccess-zu-hooks/" target="_blank" class="liimagelink"><img src="http://familie-ottenhaus.de/simon/blog/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://familie-ottenhaus.de/simon/blog/2010/04/wordpress-virtuelle-seiten-erstellen-von-htaccess-zu-hooks/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WordPress: XML-Sitemap: Zusätzliche Seiten hinzufügen</title>
		<link>http://familie-ottenhaus.de/simon/blog/2010/04/wordpress-xml-sitemap-zusatzliche-seiten-hinzufugen/</link>
		<comments>http://familie-ottenhaus.de/simon/blog/2010/04/wordpress-xml-sitemap-zusatzliche-seiten-hinzufugen/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 20:39:29 +0000</pubDate>
		<dc:creator>Simon Ottenhaus</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[HowTo / Anleitung]]></category>
		<category><![CDATA[Seite]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[XML-Sitemap]]></category>

		<guid isPermaLink="false">http://familie-ottenhaus.de/simon/blog/?p=1043</guid>
		<description><![CDATA[Auf compulearnenglisch.de/uebung finden sich viele generierte Seiten, die nicht in der WordPress Datenbank gespeichert sind. Demnach werden diese Seiten nicht automatisch in der Xml-Sitemap aufgenommen. Ein Blick in die Dokumentation genügt allerdings um das Problem zu lösen: Adding other pages to the sitemap via other plugins This plugin uses the action system of WordPress to [...]]]></description>
			<content:encoded><![CDATA[<p>Auf <a href="http://compulearnenglisch.de/uebung/" target="_blank" class="liexternal">compulearnenglisch.de/uebung</a> finden sich viele generierte Seiten, die nicht in der WordPress Datenbank gespeichert sind. Demnach werden diese Seiten nicht automatisch in der Xml-Sitemap aufgenommen.</p>
<p>Ein Blick in die Dokumentation genügt allerdings um das Problem zu lösen:</p>
<blockquote><p> Adding other pages to the sitemap via other plugins</p>
<p>  This plugin uses the action system of WordPress to allow other plugins  to add urls to the sitemap. Simply add your function with add_action to  the list and the plugin will execute yours every time the sitemap is build.  Use the static method &#8220;GetInstance&#8221; to get the generator and AddUrl method   to add your content.
</p></blockquote>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1043code24'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p104324"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p1043code24"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> your_pages<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$generatorObject</span> <span style="color: #339933;">=</span> <span style="color: #339933;">&amp;</span>GoogleSitemapGenerator<span style="color: #339933;">::</span><span style="color: #004000;">GetInstance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Please note the &quot;&amp;&quot; sign for PHP4!</span>
  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$generatorObject</span><span style="color: #339933;">!=</span><span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$generatorObject</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">AddUrl</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://blog.uri/tags/hello/&quot;</span><span style="color: #339933;">,</span><a href="http://www.php.net/time"><span style="color: #990000;">time</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;daily&quot;</span><span style="color: #339933;">,</span>0<span style="color: #339933;">.</span>5<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;sm_buildmap&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;your_pages&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://familie-ottenhaus.de/simon/blog/2010/04/wordpress-xml-sitemap-zusatzliche-seiten-hinzufugen/" target="_blank" class="liimagelink"><img src="http://familie-ottenhaus.de/simon/blog/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://familie-ottenhaus.de/simon/blog/2010/04/wordpress-xml-sitemap-zusatzliche-seiten-hinzufugen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HowTo: Textersetzung in mehreren Dateien mit Perl (preg) unter Windows und Linux</title>
		<link>http://familie-ottenhaus.de/simon/blog/2009/11/howto-textersetzung-in-mehreren-dateien-mit-perl-preg-unter-windows-und-linux/</link>
		<comments>http://familie-ottenhaus.de/simon/blog/2009/11/howto-textersetzung-in-mehreren-dateien-mit-perl-preg-unter-windows-und-linux/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 11:16:47 +0000</pubDate>
		<dc:creator>Simon Ottenhaus</dc:creator>
				<category><![CDATA[HowTo / Anleitung]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Preg]]></category>
		<category><![CDATA[Textersetzung]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://familie-ottenhaus.de/simon/blog/?p=916</guid>
		<description><![CDATA[Neulich stellte sich mir folgendes Problem: Ich hatte viele Dateien, in denen ich Text ersetzen wollte. Mit einem normalen Editor ist dies schlecht möglich. Abhilfe schafft der Perl Interpreter: View Code BASH1 2 3 4 5 6 7 8 perl -pi -w -e 's/search/replace/g;' *.html &#160; -e Argument ausführen &#40;execute&#41; -i &#34;in-place&#34; editieren -w Warnungen [...]]]></description>
			<content:encoded><![CDATA[<p>Neulich stellte sich mir folgendes Problem:<br />
Ich hatte viele Dateien, in denen ich Text ersetzen wollte. Mit einem normalen Editor ist dies schlecht möglich. Abhilfe schafft der Perl Interpreter:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p916code29'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p91629"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code" id="p916code29"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-pi</span> <span style="color: #660033;">-w</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/search/replace/g;'</span> <span style="color: #000000; font-weight: bold;">*</span>.html
&nbsp;
    <span style="color: #660033;">-e</span> Argument ausführen <span style="color: #7a0874; font-weight: bold;">&#40;</span>execute<span style="color: #7a0874; font-weight: bold;">&#41;</span>
    <span style="color: #660033;">-i</span> <span style="color: #ff0000;">&quot;in-place&quot;</span> editieren
    <span style="color: #660033;">-w</span> Warnungen ausgeben
    <span style="color: #660033;">-p</span> <span style="color: #ff0000;">&quot;loop&quot;</span>
&nbsp;
siehe auch <span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-h</span></pre></td></tr></table></div>

<h3>Beispiel Datum 1</h3>
<p>Es soll das Datum von 2008 auf 2009 in allen html-Dateien im aktuellen Verzeichnis aktualisiert werden:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p916code30'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p91630"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p916code30"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-pi</span> <span style="color: #660033;">-w</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/2008/2009/g;'</span> <span style="color: #000000; font-weight: bold;">*</span>.html</pre></td></tr></table></div>

<h3>Beispiel Datum 2</h3>
<p>Es soll das Datum von 200x auf 2009 in allen html-Dateien im aktuellen Verzeichnis aktualisiert werden:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p916code31'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p91631"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p916code31"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-pi</span> <span style="color: #660033;">-w</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/200[0-8]/2009/g;'</span> <span style="color: #000000; font-weight: bold;">*</span>.html</pre></td></tr></table></div>

<h3>Beispiel: Verzeichnisse rekursiv durchsuchen (nur Linux)</h3>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p916code32'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p91632"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p916code32"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-E</span> <span style="color: #ff0000;">&quot;\.html$&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">xargs</span> <span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-pi</span> <span style="color: #660033;">-w</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/search/replace/g;'</span>
&nbsp;
    <span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #000000; font-weight: bold;">*</span> gibt alle Dateien und Verzeichnisse aus
    <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-E</span> <span style="color: #ff0000;">&quot;\.html$&quot;</span> selektiert nur Dateinamen, die auf .html enden
    <span style="color: #c20cb9; font-weight: bold;">xargs</span> gibt die Dateinamen als Parameter an Perl weiter</pre></td></tr></table></div>

<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://familie-ottenhaus.de/simon/blog/2009/11/howto-textersetzung-in-mehreren-dateien-mit-perl-preg-unter-windows-und-linux/" target="_blank" class="liimagelink"><img src="http://familie-ottenhaus.de/simon/blog/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://familie-ottenhaus.de/simon/blog/2009/11/howto-textersetzung-in-mehreren-dateien-mit-perl-preg-unter-windows-und-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mini Howto: Proftpd (inetd) port umstellen</title>
		<link>http://familie-ottenhaus.de/simon/blog/2009/11/mini-howto-proftpd-indetd-port-umstellen/</link>
		<comments>http://familie-ottenhaus.de/simon/blog/2009/11/mini-howto-proftpd-indetd-port-umstellen/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 19:31:42 +0000</pubDate>
		<dc:creator>Simon Ottenhaus</dc:creator>
				<category><![CDATA[HowTo / Anleitung]]></category>
		<category><![CDATA[inetd]]></category>
		<category><![CDATA[port]]></category>
		<category><![CDATA[Proftpd]]></category>

		<guid isPermaLink="false">http://familie-ottenhaus.de/simon/blog/?p=906</guid>
		<description><![CDATA[Dieses HowTo behandelt das umstellen des Standard Ports (21) von Proftpd auf einen hohen Port, um Portscans zu entgehen. Voraussetzungen: Proftpd, über inetd gestartet Was zu tun ist Editiere /etc/proftpd/proftpd.conf View Code TEXT1 2 3 4 5 6 7 8 -- suche -- # Port 21 is the standard FTP port. Port 21 &#160; -- [...]]]></description>
			<content:encoded><![CDATA[<p>Dieses HowTo behandelt das umstellen des Standard Ports (21) von Proftpd auf einen hohen Port, um Portscans zu entgehen.</p>
<p><strong>Voraussetzungen:</strong><br />
Proftpd, über inetd gestartet</p>
<h3>Was zu tun ist</h3>
<p>Editiere /etc/proftpd/proftpd.conf</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p906code36'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p90636"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code" id="p906code36"><pre class="text" style="font-family:monospace;">-- suche  --
# Port 21 is the standard FTP port.
Port                            21
&nbsp;
-- ersetze durch --
# Port 21 is the standard FTP port.
# but i'm using another one
Port                            32132</pre></td></tr></table></div>

<p>Editiere /etc/inetd.conf</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p906code37'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p90637"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p906code37"><pre class="text" style="font-family:monospace;">-- suche  --
ftp   stream  tcp     nowait  root    /usr/sbin/tcpd /usr/sbin/proftpd
&nbsp;
-- ersetze durch --
32132   stream  tcp     nowait  root    /usr/sbin/tcpd /usr/sbin/proftpd</pre></td></tr></table></div>

<p>Nun noch inetd neu starten</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p906code38'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p90638"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p906code38"><pre class="text" style="font-family:monospace;">/etc/init.d/openbsd-inetd restart</pre></td></tr></table></div>

<p>Und zum Schluss eventuell noch das Port-Forwarding im Router aktualisieren, sofern vorhanden.</p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://familie-ottenhaus.de/simon/blog/2009/11/mini-howto-proftpd-indetd-port-umstellen/" target="_blank" class="liimagelink"><img src="http://familie-ottenhaus.de/simon/blog/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://familie-ottenhaus.de/simon/blog/2009/11/mini-howto-proftpd-indetd-port-umstellen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HowTo: Proftpd-lenny unter debian etch 4.0 / Filezilla ECONNABORTED beheben</title>
		<link>http://familie-ottenhaus.de/simon/blog/2009/11/howto-proftpd-lenny-unter-debian-etch-4-0-filezilla-econnaborted-beheben/</link>
		<comments>http://familie-ottenhaus.de/simon/blog/2009/11/howto-proftpd-lenny-unter-debian-etch-4-0-filezilla-econnaborted-beheben/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 19:23:41 +0000</pubDate>
		<dc:creator>Simon Ottenhaus</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[HowTo / Anleitung]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[ECONNABORTED]]></category>
		<category><![CDATA[etch]]></category>
		<category><![CDATA[Filezilla]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[Proftpd]]></category>

		<guid isPermaLink="false">http://familie-ottenhaus.de/simon/blog/?p=889</guid>
		<description><![CDATA[Dieser Artikel richtet sich an &#8220;debian etch 4.0&#8243;-Administratoren, die Proftpd aus den Paketquellen installiert haben und folgendes Problem in Filezilla haben: Status: Server did not properly shut down TLS connection Error: Could not read from transfer socket: ECONNABORTED &#8211; Connection aborted Wie im Filezilla Forum zu lesen ist: ECONNABORTED: It&#8217;s the server&#8217;s fault! leider hilft [...]]]></description>
			<content:encoded><![CDATA[<p>Dieser Artikel richtet sich an &#8220;debian etch 4.0&#8243;-Administratoren, die Proftpd aus den Paketquellen installiert haben und folgendes Problem in Filezilla haben:</p>
<blockquote><p>Status: Server did not properly shut down TLS connection<br />
Error:  Could not read from transfer socket: ECONNABORTED &#8211; Connection aborted</p></blockquote>
<p>Wie im <a href="http://forum.filezilla-project.org/viewtopic.php?f=2&#038;t=7688&#038;start=0" target="_blank" class="liexternal">Filezilla Forum</a> zu lesen ist:</p>
<blockquote><p>ECONNABORTED: It&#8217;s the server&#8217;s fault!</p></blockquote>
<p>leider hilft das nicht wirklich weiter.</p>
<p>Die Lösung ist ganz einfach: Proftpd aus den lenny Paketquellen laden und installieren. Dieses HowTo hilft bei der Erstellung eines Proftpd-Paketes.</p>
<h3>Vorbereiten des Systems</h3>
<p><em>Für einige der nachfolgenden Befehle muss man root sein.</em> Am besten man wird es jetzt schon.</p>
<p>Zum Bauen von Debian-Paketen sind einige Pakete erforderlich.</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p889code47'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p88947"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p889code47"><pre class="text" style="font-family:monospace;">aptitude install devscripts build-essential fakeroot</pre></td></tr></table></div>

<h3>Laden und Vorbereiten der Sourcen</h3>
<p>Die Sourcen gibt es unter <a href="http://packages.debian.org/lenny/proftpd/" target="_blank" class="liexternal">packages.debian.org/lenny/proftpd</a></p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p889code48'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p88948"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p889code48"><pre class="text" style="font-family:monospace;">wget http://security.debian.org/debian-security/pool/updates/main/p/proftpd-dfsg/proftpd-dfsg_1.3.1.orig.tar.gz
wget http://security.debian.org/debian-security/pool/updates/main/p/proftpd-dfsg/proftpd-dfsg_1.3.1-17lenny4.diff.gz</pre></td></tr></table></div>

<p>Auspacken des tar.gz Archives:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p889code49'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p88949"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p889code49"><pre class="text" style="font-family:monospace;">tar -xzf proftpd-dfsg_1.3.1.orig.tar.gz</pre></td></tr></table></div>

<p>Nun werden die debian-spezifischen Patches angewendet</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p889code50'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p88950"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p889code50"><pre class="text" style="font-family:monospace;">cd cd proftpd-dfsg-1.3.1/
zcat ../proftpd-dfsg_1.3.1-17lenny4.diff.gz | patch -p1</pre></td></tr></table></div>

<h3>Bauen der Pakete</h3>
<p>1. Versuch mit debuild</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p889code51'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p88951"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p889code51"><pre class="text" style="font-family:monospace;">debuild</pre></td></tr></table></div>

<p>Dieser 1. Versuch wird aller Voraussicht nach fehlschlagen, da andere Pakete fehlen, um Proftpd zu bauen. Die Fehlermeldung ist allerdings hilfreich und verrät welche Pakete noch zu installieren sind. Diese sollten nun nacheinander installiert werden. Zwischendurch immer wieder debuild probieren. Die Liste der fehlenden Pakete sollte mit jedem installierten Paket kleiner werden.<br />
Schließlich startet debuild das Erstellen der Pakete. <em>Dies kann einige Zeit dauern.</em> Nicht die Geduld verlieren.</p>
<p>Es kann sein, dass debuild einige Fehler am Ende ausgibt, dies soll uns aber nicht weiter stören. Wenn alles geklappt hat sollten am Ende folgende Dateien vorhanden sein (je nach System kann die Liste abweichen)</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p889code52'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p88952"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code" id="p889code52"><pre class="text" style="font-family:monospace;">cd ..
ls -al
&nbsp;
-rw-r--r--  1 root root  195024 2009-11-12 17:19 proftpd_1.3.1-17lenny4_all.deb
-rw-r--r--  1 root root  696556 2009-11-12 17:19 proftpd-basic_1.3.1-17lenny4_i386.deb
drwxr-sr-x 13 root root    4096 2009-11-12 17:19 proftpd-dfsg-1.3.1
-rw-r--r--  1 root root  102934 2009-11-12 17:16 proftpd-dfsg_1.3.1-17lenny4.diff.gz
-rw-r--r--  1 root root     653 2009-11-12 17:16 proftpd-dfsg_1.3.1-17lenny4.dsc
-rw-r--r--  1 root root       0 2009-11-12 17:19 proftpd-dfsg_1.3.1-17lenny4.dsc.asc
-rw-r--r--  1 root root  124074 2009-11-12 17:19 proftpd-dfsg_1.3.1-17lenny4_i386.build
-rw-r--r--  1 root root    1700 2009-11-12 17:19 proftpd-dfsg_1.3.1-17lenny4_i386.changes
-rw-r--r--  1 root root 2662056 2009-02-25 12:55 proftpd-dfsg_1.3.1.orig.tar.gz
-rw-r--r--  1 root root 1254386 2009-11-12 17:19 proftpd-doc_1.3.1-17lenny4_all.deb
-rw-r--r--  1 root root  214058 2009-11-12 17:19 proftpd-mod-ldap_1.3.1-17lenny4_i386.deb
-rw-r--r--  1 root root  203592 2009-11-12 17:19 proftpd-mod-mysql_1.3.1-17lenny4_i386.deb
-rw-r--r--  1 root root  203562 2009-11-12 17:19 proftpd-mod-pgsql_1.3.1-17lenny4_i386.deb</pre></td></tr></table></div>

<h3>Installieren von Proftpd</h3>
<p>Bevor der neue Proftpd installiert wird sollte der alte entfernt werden</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p889code53'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p88953"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p889code53"><pre class="text" style="font-family:monospace;">aptitude remove proftpd</pre></td></tr></table></div>

<p>Schließlich kann der neue Proftpd installiert werden</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p889code54'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p88954"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p889code54"><pre class="text" style="font-family:monospace;">dpkg -i *.deb</pre></td></tr></table></div>

<p>Nun sollte der selbst gebaute Proftpd seinen Dienst verrichten.</p>
<p>Fragen und Anregungen sind in den Kommentaren gerne willkommen!</p>
<p><strong>Links</strong><br />
Rebuilding Debian packages <a href="http://www.debian-administration.org/articles/20/" target="_blank" class="liexternal">debian-administration.org/articles/20</a><br />
Lenny Proftpd Quellen <a href="http://packages.debian.org/lenny/proftpd/" target="_blank" class="liexternal">packages.debian.org/lenny/proftpd</a></p>
<p><strong>Dank</strong><br />
Vielen Dank an <a href="https://trac.aellaweil.de/ideen/blog/" target="_blank" class="liexternal">Matthias</a> für das &#8220;Mini-Papier-HowTo&#8221;</p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://familie-ottenhaus.de/simon/blog/2009/11/howto-proftpd-lenny-unter-debian-etch-4-0-filezilla-econnaborted-beheben/" target="_blank" class="liimagelink"><img src="http://familie-ottenhaus.de/simon/blog/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://familie-ottenhaus.de/simon/blog/2009/11/howto-proftpd-lenny-unter-debian-etch-4-0-filezilla-econnaborted-beheben/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fehler im WordPress Plugin All in &#8220;One SEO Pack 1.6.7&#8243; &#8211; Rollback Anleitung / Wiederherstellung</title>
		<link>http://familie-ottenhaus.de/simon/blog/2009/10/fehler-im-wordpress-plugin-all-in-one-seo-pack-1-6-7-rollback-anleitung-wiederherstellung/</link>
		<comments>http://familie-ottenhaus.de/simon/blog/2009/10/fehler-im-wordpress-plugin-all-in-one-seo-pack-1-6-7-rollback-anleitung-wiederherstellung/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 11:36:30 +0000</pubDate>
		<dc:creator>Simon Ottenhaus</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[HowTo / Anleitung]]></category>
		<category><![CDATA[all-in-one-seo-pack]]></category>
		<category><![CDATA[Fehler]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Rollback]]></category>
		<category><![CDATA[Wiederherstellung]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://familie-ottenhaus.de/simon/blog/?p=822</guid>
		<description><![CDATA[Nach der Installation von All in One SEO Pack 1.6.7 ist es nicht mehr möglich die Konfiguration von &#8220;All in One SEO Pack&#8221; zu speichern. Den zugehörigen Thread gibt es hier Falls die fehlerhafte Version schon installiert wurde empfiehlt sich ein &#8220;Rollback&#8221; auf die Version 1.6.6.2: View Code TEXT1 2 3 4 5 6 cd [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://familie-ottenhaus.de/simon/blog/wp-content/uploads/2009/02/wp-logo.gif" alt="wp-logo" title="wp-logo" width="50" height="50" class="alignright size-full wp-image-443" />Nach der Installation von All in One SEO Pack 1.6.7 ist es nicht mehr möglich die Konfiguration von &#8220;All in One SEO Pack&#8221; zu speichern.<br />
Den zugehörigen Thread gibt es <a href="http://semperfiwebdesign.com/forum/install-upgrade-All-in-One-SEO-Pack/upgrade-1-6-7-its-not-enable/" target="_blank" class="liexternal">hier</a></p>
<p>Falls die fehlerhafte Version schon installiert wurde empfiehlt sich ein &#8220;Rollback&#8221; auf die Version 1.6.6.2:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p822code56'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p82256"><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code" id="p822code56"><pre class="text" style="font-family:monospace;">cd wp-content/plugins
wget http://downloads.wordpress.org/plugin/all-in-one-seo-pack.1.6.6.2.zip
rm -r all-in-one-seo-pack
unzip all-in-one-seo-pack.1.6.6.2.zip
rm all-in-one-seo-pack.1.6.6.2.zip
chown -R www-data:www-data all-in-one-seo-pack</pre></td></tr></table></div>

<p>Wenn man keinen ssh Zugriff hat einfach per ftp den Ordner &#8220;all-in-one-seo-pack&#8221; in &#8220;wp-content/plugins&#8221; löschen. Dann <a href="http://downloads.wordpress.org/plugin/all-in-one-seo-pack.1.6.6.2.zip" target="_blank" class="liwp">downloads.wordpress.org/&#8230;/all-in-one-seo-pack.1.6.6.2.zip</a> lokal entpacken und &#8220;all-in-one-seo-pack&#8221; hochladen.</p>
<p>Nun noch einmal auf die Plugin-Seite und das Plugin aktivieren. Nun sollte es wieder einwandfrei funktionieren.</p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://familie-ottenhaus.de/simon/blog/2009/10/fehler-im-wordpress-plugin-all-in-one-seo-pack-1-6-7-rollback-anleitung-wiederherstellung/" target="_blank" class="liimagelink"><img src="http://familie-ottenhaus.de/simon/blog/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://familie-ottenhaus.de/simon/blog/2009/10/fehler-im-wordpress-plugin-all-in-one-seo-pack-1-6-7-rollback-anleitung-wiederherstellung/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HowTo: Eigenes Steuerelement, Eigene Eigenschaften definieren</title>
		<link>http://familie-ottenhaus.de/simon/blog/2009/06/howto-eigenes-steuerelement-eigene-eigenschaften-definieren/</link>
		<comments>http://familie-ottenhaus.de/simon/blog/2009/06/howto-eigenes-steuerelement-eigene-eigenschaften-definieren/#comments</comments>
		<pubDate>Sun, 28 Jun 2009 16:43:33 +0000</pubDate>
		<dc:creator>Simon Ottenhaus</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[HowTo / Anleitung]]></category>
		<category><![CDATA[Button]]></category>
		<category><![CDATA[definieren]]></category>
		<category><![CDATA[Eigenschaften]]></category>
		<category><![CDATA[Steuerelement]]></category>

		<guid isPermaLink="false">http://familie-ottenhaus.de/simon/blog/?p=800</guid>
		<description><![CDATA[In Visual Studio ist es möglich im Eigenschaftsfenster selbst definierte Eigenschaften anzeigen zu lassen. Ich werde dies am Beispiel eines eigenen Buttons erklären, der eine zusätzliche Eigenschaft (WordWrap) erhält. Legen wir zunächst einen neuen Button an. In diesem Beispiel heißt dieser FlatButton: View Code CSHARP1 2 class FlatButton : Button &#123; &#125; Bislang hat unser [...]]]></description>
			<content:encoded><![CDATA[<p>In Visual Studio ist es möglich im Eigenschaftsfenster selbst definierte Eigenschaften anzeigen zu lassen.</p>
<p>Ich werde dies am Beispiel eines eigenen Buttons erklären, der eine zusätzliche Eigenschaft (WordWrap) erhält.</p>
<p>Legen wir zunächst einen neuen Button an. In diesem Beispiel heißt dieser FlatButton:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p800code59'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p80059"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p800code59"><pre class="csharp" style="font-family:monospace;"><span style="color: #FF0000;">class</span> FlatButton <span style="color: #008000;">:</span> Button <span style="color: #000000;">&#123;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>Bislang hat unser FlatButton alle Eigenschaften eines &#8216;normalen&#8217; Buttons.</p>
<p>Nun fügen wir unsere eigene Eigenschaft hinzu:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p800code60'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p80060"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code" id="p800code60"><pre class="csharp" style="font-family:monospace;"><span style="color: #FF0000;">class</span> FlatButton <span style="color: #008000;">:</span> Button <span style="color: #000000;">&#123;</span>
    <span style="color: #FF0000;">bool</span> wordWrap <span style="color: #008000;">=</span> false<span style="color: #008000;">;</span>
    <span style="color: #000000;">&#91;</span>Browsable<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">true</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
    <span style="color: #000000;">&#91;</span>Category<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Appearance&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
    <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">bool</span> WordWrap
    <span style="color: #000000;">&#123;</span>
        get <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">return</span> wordWrap<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
        set <span style="color: #000000;">&#123;</span> wordWrap <span style="color: #008000;">=</span> value<span style="color: #008000;">;</span> Invalidate<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p><em>[Browsable(true)]</em> gibt an, dass WordWrap im Eigenschaftsfenster angezeigt werden soll.<br />
<em>[Category("Appearance")]</em> lässt WordWrap in der Kategorie Darstellung erscheinen.</p>
<p>Wenn alles geklappt hat sollte nun WordWrap im Eigenschaftsfenster angezeigt werden:<br />
<img src="http://familie-ottenhaus.de/simon/blog/wp-content/uploads/2009/06/FlatButtonProperties.png" alt="FlatButtonProperties" title="FlatButtonProperties" width="391" height="125" class="alignnone size-full wp-image-802" /></p>
<p>FlatButton mit WordWrap=true bei geeigneter Implementierung von OnPaint:<br />
<img src="http://familie-ottenhaus.de/simon/blog/wp-content/uploads/2009/06/FlatButton.png" alt="FlatButton" title="FlatButton" width="106" height="68" class="alignnone size-full wp-image-807" /></p>
<p>Weitergehende Informationen gibt es in der MSDN<br />
<a href="http://msdn.microsoft.com/de-de/library/system.componentmodel.browsableattribute.aspx" target="_blank" class="liexternal">system.componentmodel.browsableattribute</a><br />
<a href="http://msdn.microsoft.com/de-de/library/system.componentmodel.categoryattribute.aspx" target="_blank" class="liexternal">system.componentmodel.categoryattribute</a></p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://familie-ottenhaus.de/simon/blog/2009/06/howto-eigenes-steuerelement-eigene-eigenschaften-definieren/" target="_blank" class="liimagelink"><img src="http://familie-ottenhaus.de/simon/blog/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://familie-ottenhaus.de/simon/blog/2009/06/howto-eigenes-steuerelement-eigene-eigenschaften-definieren/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

