<?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>WeizenSpr.eu &#187; Aufbau</title>
	<atom:link href="http://weizenspr.eu/kategorie/allgemein/aufbau/feed/" rel="self" type="application/rss+xml" />
	<link>http://weizenspr.eu</link>
	<description>trennt Spreu vom Weizen</description>
	<lastBuildDate>Thu, 29 Jul 2010 01:40:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Hetzner und SSL: Was lange währt&#8230;</title>
		<link>http://weizenspr.eu/2010/hetzner-und-ssl-was-lange-wahrt/</link>
		<comments>http://weizenspr.eu/2010/hetzner-und-ssl-was-lange-wahrt/#comments</comments>
		<pubDate>Wed, 26 May 2010 22:03:54 +0000</pubDate>
		<dc:creator>Mea Culpa</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Alltag]]></category>
		<category><![CDATA[Aufbau]]></category>
		<category><![CDATA[Computer]]></category>
		<category><![CDATA[Entwicklung]]></category>
		<category><![CDATA[Weizen]]></category>

		<guid isPermaLink="false">http://weizenspr.eu/?p=5355</guid>
		<description><![CDATA[In den letzten Tagen habe ich viel über den Hoster Hetzner geschimpft. Mehrfach wurde mir von deren Support mitgeteilt, dass einige Mehrkosten auf mich zukommen würden, wenn ich für alle meine Domains SSL einrichten lassen würde. Nicht nur das! Auch für die SSL-Einrichtung für Subdomains sollte ich zahlen, sobald diese nicht auf ein gemeinsames Document [...]]]></description>
			<content:encoded><![CDATA[<!-- RSPEAK_START --><p>In den letzten Tagen habe ich viel über den Hoster Hetzner geschimpft. Mehrfach wurde mir von deren Support mitgeteilt, dass einige Mehrkosten auf mich zukommen würden, wenn ich für alle meine Domains <a href="http://weizenspr.eu/2010/hetzner-und-das-ssl-problem/" target="_blank" class="liinternal">SSL einrichten lassen</a> würde. Nicht nur das! Auch für die SSL-Einrichtung für Subdomains <a href="http://weizenspr.eu/2010/die-spinnen-bei-hetzner/" target="_blank" class="liinternal">sollte ich zahlen</a>, sobald diese nicht auf ein gemeinsames <em>Document Root</em> verweisen. Schlussendlich hatte ich mir eine Lösung überlegt, mit der ich zumindest die Kosten für die <a href="http://weizenspr.eu/2010/losung-fur-hetzners-subdomain-problem/" target="_blank" class="liinternal">Subdomains einsparen</a> könnte.</p>
<p>Nun hatte ich natürlich langsam die Nase voll und wollte endlich sehen, ob die Arbeit irgendetwas genützt hat. Also habe ich gestern SSL für eine meiner Domains einrichten lassen und das fertige Setup heute getestet.<br />
Was soll ich sagen? Die Subdomains werden korrekt geschützt, wenn sie, wie beschrieben, im gleichen Document Root liegen, wie die eigentliche Domain. Mein gezeigter Trick mit der <em>&#8220;.htaccess&#8221;</em>-Datei funktioniert also problemlos.<br />
Es gibt aber noch etwas viel besseres! Solange die Addon-Domains auf das gleiche Rootverzeichnis zeigen, wie die SSL-konfigurierte Domain, werden auch diese mit dem eingespielten Zertfikat versorgt <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  ! Das nenne ich einen Jackpot <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  ! Genau so möchte ich es seit Tagen haben!<br />
Die Domains kann man übrigens über den gleichen Weg behandeln, wie es auch mit den Subdomains gemacht wurde &#8211; einfach per <em>&#8220;.htaccess&#8221;</em>-Datei das tatsächliche Verzeichnis zuordnen. Das klappt wunderbar!</p>
<p>Eine Sache muss man übrigens erledigen, sobald SSL eingerichtet worden ist &#8211; nämlich den DNS-Server so konfigurieren, dass die Domains auf die neue IP-Adresse zeigen, für die SSL konfiguriert worden ist. Bei der DNS-Konfiguration heißt das, dass man die IP für den Eintrag <em>&#8220;@&#8221;</em> und <em>&#8220;www&#8221;</em> korrekt setzen muss.</p>
<div id="attachment_5363" class="wp-caption aligncenter" style="width: 310px"><a href="http://weizenspr.eu/uploads/hetzner_dns.png" target="_blank" class="liimagelink"><img src="http://weizenspr.eu/uploads/hetzner_dns-300x202.png" alt="" title="hetzner_dns" width="300" height="202" class="size-medium wp-image-5363" /></a><p class="wp-caption-text">Hetzner - Erweiterte DNS-Konfiguration</p></div>
<p>Ich habe euch auf dem Bild übrigens gleich noch eine weitere Zeile markiert, die ihr &#8211; je nach Belieben &#8211; zur DNS-Konfiguration hinzufügen könnt. Diese lautet:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">* IN CNAME www</div></td></tr></tbody></table></div>
<p>Die Bedeutung ist schnell erklärt: Jede Subdomain, für kein separater Eintrag existiert, wird auf die IP der www-Subdomain umgelenkt. Dieser Wildcard-Eintrag hat einen <strong>riesigen</strong> Vorteil: Man muss nicht jedes Mal extra eine neue Subdomain über das Webinterface erstellen, wenn man sie benötigt. Man muss sie einfach nur in der <em>&#8220;.htaccess&#8221;</em>-Datei berücksichtigen.</p>
<p>Zudem sind mit diesem Wildcard-Eintrag superlustige Sachen möglich <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  ! Ich habe z.B. unter der Domain <a href="http://test.coltishware.net/" target="_blank" class="liexternal">test.coltishware.net</a> eingerichtet, dass alle darunter liegenden Domänen einfach als Text ausgegeben werden. Probiert z.B. mal mit <a href="http://du.bist.doof.test.coltishware.net" target="_blank" class="liexternal">du.bist.doof.test.coltishware.net</a> aus! <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Im ersten Augenblick mag das nicht so sinnvoll sein, aber stellt euch mal vor, ihr wollt eine Community aufbauen, in der jeder Benutzer seine persönliche Internetpräsenz bekommt. Hier müsstet ihr nun nicht mehr manuell die Subdomains einrichten, sondern könnt diese einfach per Script verwalten lassen.</p>
<p>Ich bin ob dieser gestalterischen Freiheit jedenfalls heute das erste Mal froh, mich für Hetzners Level-19-Paket entschieden zu haben. Ich hoffe, dieser ganze SSL-Wahnsinn war das erste und einzige Mal, dass ich solche großen Probleme mit Hetzner hatte. Und apropos SSL: Der Support hat mir versichert, dass der Austausch des Zertifikats (wenn es z.B. mal ablaufen sollte) vollkommen unentgeldlich stattfindet.<br/><br />
<strong>Gehetzte Grüße, Kenny</strong></p>
<!-- RSPEAK_STOP -->]]></content:encoded>
			<wfw:commentRss>http://weizenspr.eu/2010/hetzner-und-ssl-was-lange-wahrt/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>1 Jahr + 1 Tag WeizenSpr.eu</title>
		<link>http://weizenspr.eu/2010/1-jahr-1-tag-weizenspr-eu/</link>
		<comments>http://weizenspr.eu/2010/1-jahr-1-tag-weizenspr-eu/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 12:48:51 +0000</pubDate>
		<dc:creator>Mea Culpa</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Alltag]]></category>
		<category><![CDATA[Aufbau]]></category>
		<category><![CDATA[Weizen]]></category>

		<guid isPermaLink="false">http://weizenspr.eu/?p=4227</guid>
		<description><![CDATA[Hach, wie ärgerlich! Da kann man schonmal ein Jubiläum feiern und dann verpasst man es auch noch   ! Aber das geht mir bei runden Tweetzahlen bei Twitter ja auch nicht anders   . Deswegen jetzt mit einem Tag Verspätung: WEIZENSPR.EU IST EIN JAHR ALT GEWORDEN!
In dem einen Jahr ist eine Menge passiert. [...]]]></description>
			<content:encoded><![CDATA[<!-- RSPEAK_START --><p>Hach, wie ärgerlich! Da kann man schonmal ein Jubiläum feiern und dann verpasst man es auch noch <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  ! Aber das geht mir bei runden Tweetzahlen bei Twitter ja auch nicht anders <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  . Deswegen jetzt mit einem Tag Verspätung: <strong>WEIZENSPR.EU IST EIN JAHR ALT GEWORDEN!</strong></p>
<p>In dem einen Jahr ist eine Menge passiert. Wir haben gesehen, wie eine <a href="http://weizenspr.eu/archives/zensur-archiv/" target="_blank" class="liinternal">Zensurinfrastruktur</a> aufgebaut werden sollte, ich habe ein paar <a href="http://weizenspr.eu/projects/" target="_blank" class="liinternal">Projekte</a> realisiert und der Öffentlichkeit zugänglich gemacht, ich habe neue Leute in der Blogosphäre und dem Twitterversum kennenlernt, ich habe mein <a href="http://weizenspr.eu/2009/herr-bachelor-of-science/" target="_blank" class="liinternal">Studium erfolgreich abgeschlossen</a> und konnte direkt <a href="http://weizenspr.eu/2009/es-geht-voran/" target="_blank" class="liinternal">ins Berufsleben einsteigen</a>, <a href="http://weizenspr.eu/2009/paulchen-im-web/" target="_blank" class="liinternal">ich bin Onkel geworden</a>, ich bin <a href="http://weizenspr.eu/2009/kenny-in-der-presse-ii/" target="_blank" class="liinternal">in die Politik eingetreten</a> und &#8211; was ich am wenigsten erwartet hätte &#8211; ich habe es geschafft, dass WeizenSpr.eu sich noch im Jahr der Entstehung selbst refinanziert hat (mit, wie ich hoffe, unaufdringlichen Werbeformen). <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Doch auch im zweiten Jahr von WeizenSpr.eu erwarte ich viele interessante, lustige und schlechte Nachrichten. Derzeit habe ich ein paar Projekte, über die ich gerne noch schreiben möchte (z.B. wartet PESD seit fast einem halben Jahr auf seine Veröffentlichung). Doch auch was meinen Alltag angeht, werden noch einige Dinge kommen: So werde ich z.B. im Sommer umziehen, was sicherlich wieder Fragen aufwerfen und neues zutage fördern wird. Man darf also gespannt sein, was da noch kommen wird. <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p><em>Wie habt ihr WeizenSpr.eu bisher erlebt? Was gefällt euch am Blog und was könnte man besser machen? Mögt ihr diesen Mix aus Privatem, Politik und Informatik oder seid ihr eher auf der Suche nach einem typischen Nischenblog?</em><br/><br />
<strong>Nachträgliche Grüße, Kenny</strong></p>
<!-- RSPEAK_STOP -->]]></content:encoded>
			<wfw:commentRss>http://weizenspr.eu/2010/1-jahr-1-tag-weizenspr-eu/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WeizenSpr.eu mit neuem Design!</title>
		<link>http://weizenspr.eu/2010/weizenspr-eu-mit-neuem-design/</link>
		<comments>http://weizenspr.eu/2010/weizenspr-eu-mit-neuem-design/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 17:31:33 +0000</pubDate>
		<dc:creator>Mea Culpa</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Alltag]]></category>
		<category><![CDATA[Aufbau]]></category>
		<category><![CDATA[Computer]]></category>
		<category><![CDATA[Entwicklung]]></category>
		<category><![CDATA[Weizen]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://weizenspr.eu/?p=3963</guid>
		<description><![CDATA[Es ist vollbracht   ! WeizenSpr.eu erblüht im tiefsten Winter mit einem neuen Design. Im Einsatz ist nun das geniale Mainstream-Theme von WooThemes. Diese Gruppe veröffentlicht normalerweise kommerzielle WordPress-Themes, bietet aber hier und da auch ein paar kostenlose an   !
Über die Änderungen, die ich vorgenommen habe, damit Mainstream so aussieht und funktioniert, [...]]]></description>
			<content:encoded><![CDATA[<!-- RSPEAK_START --><p>Es ist vollbracht <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  ! WeizenSpr.eu erblüht im tiefsten Winter mit einem neuen Design. Im Einsatz ist nun das geniale <a href="http://www.woothemes.com/2009/07/mainstream/" target="_blank" class="liexternal">Mainstream</a>-Theme von <a href="http://www.woothemes.com/" target="_blank" class="liexternal">WooThemes</a>. Diese Gruppe veröffentlicht normalerweise kommerzielle WordPress-Themes, bietet aber hier und da auch ein paar kostenlose an <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  !</p>
<p>Über die Änderungen, die ich vorgenommen habe, damit Mainstream so aussieht und funktioniert, wie es das hier tut, werde ich den nächsten Tagen schreiben. Hier und da haben sich nämlich ein paar Bugs eingeschlichen, die man erstmal beseitigen muss, damit das Theme ordentlich arbeitet.<br />
Ich würde mich übrigens sehr über Feedback zum neuen Design freuen. Nette Worte sind gern gesehen, aber vor allem die Kritik würde mich interessieren. Das heißt: Wenn etwas falsch angezeigt wird, etwas von früher fehlt oder etwas schlecht aussieht &#8211; sagt einfach Bescheid! Ich gucke mir das ganze dann an. <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Zwei Sachen habe ich übrigens selbst schon auf dem Schirm:</p>
<ul>
<li>Das WeizenSpr.eu-Logo muss verbessert werden. Der Kontrast zum Weizenfeld im Hintergrund ist zu gering.</li>
<li>Viele Elemente haben derzeit englische Beschriftungen. Ich muss mich also ransetzen und die Language-Datei des Blogs ins Deutsche übersetzen.</li>
</ul>
<p>Falls euch übrigens das alte Design fehlen sollte: Dank meinem WordPress-Plugin <a href="http://weizenspr.eu/2009/seltheme-let-the-user-decide/" target="_blank" class="liinternal">SelTheme</a> habt ihr jederzeit die Möglichkeit, zum alten Design zurück zu kehren <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  . Folgende Möglichkeiten stehen euch zur Verfügung:</p>
<ul id="possthemes">
<li><a href="?theme=#possthemes" class="liinternal"><strong>WeizenSpr.eu?theme=</strong></a> für das aktuelle WeizenSpr.eu-Design</li>
<li><a href="?theme=kubrick#possthemes" class="liinternal"><strong>WeizenSpr.eu?theme=kubrick</strong></a> für das alte WeizenSpr.eu-Design</li>
<li><a href="?theme=classic#possthemes" class="liinternal"><strong>WeizenSpr.eu?theme=classic</strong></a> für das uralte WordPress-Design</li>
</ul>
<p>Und nun viel Spaß mit dem neuen alten WeizenSpr.eu! <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> <br/><br />
<strong>Mainstreamige Grüße, Kenny</strong></p>
<!-- RSPEAK_STOP -->]]></content:encoded>
			<wfw:commentRss>http://weizenspr.eu/2010/weizenspr-eu-mit-neuem-design/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>WordPress-Trash ohne automatische Leerung</title>
		<link>http://weizenspr.eu/2010/wordpress-trash-ohne-automatische-leerung/</link>
		<comments>http://weizenspr.eu/2010/wordpress-trash-ohne-automatische-leerung/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 15:26:17 +0000</pubDate>
		<dc:creator>Mea Culpa</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Alltag]]></category>
		<category><![CDATA[Aufbau]]></category>
		<category><![CDATA[Computer]]></category>
		<category><![CDATA[Entwicklung]]></category>
		<category><![CDATA[Weizen]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://weizenspr.eu/?p=3735</guid>
		<description><![CDATA[Wie ihr evtl. schon mitbekommen habt, enthält WordPress seit der Version 2.9 einen Papierkorb, in den &#8220;gelöschte&#8221; Artikel und Kommentare verschoben werden. Einträge, die im Papierkorb liegen, werden standardmäßig nach 30 Tagen gelöscht.
Die Anzahl der Tage, nach denen der Papierkorb geleert werden soll, kann mit Hilfe des Wertes EMPTY_TRASH_DAYS in der Datei wp-config.php beeinflusst werden. [...]]]></description>
			<content:encoded><![CDATA[<!-- RSPEAK_START --><p>Wie ihr evtl. schon mitbekommen habt, enthält WordPress seit der Version 2.9 einen <a href="http://wordpress.org/extend/ideas/topic.php?id=1503" target="_blank" class="liwp">Papierkorb</a>, in den &#8220;gelöschte&#8221; Artikel und Kommentare verschoben werden. Einträge, die im Papierkorb liegen, werden standardmäßig nach <em>30 Tagen</em> gelöscht.</p>
<p>Die Anzahl der Tage, nach denen der Papierkorb geleert werden soll, kann mit Hilfe des Wertes <a href="http://codex.wordpress.org/Editing_wp-config.php#Empty_Trash" target="_blank" class="liwp"><strong>EMPTY_TRASH_DAYS</strong></a> in der Datei <strong>wp-config.php</strong> beeinflusst werden. Der Wert <em>&#8220;0&#8243;</em> bedeutet in dem Fall, dass der Papierkorb komplett deaktiviert wird (wer den Papierkorb deaktiviert hat, sollte sich übrigens <a href="http://core.trac.wordpress.org/ticket/11673" target="_blank" class="liwp">unbedingt</a> WordPress 2.9.1 ansehen).</p>
<p>Ich persönlich finde den Papierkorb toll, mag es aber nicht, wenn Dinge von mir automatisch gelöscht werden. Deshalb habe ich mich durch den Quelltext der 2.9.1er Version gehangelt und geguckt, was zu tun ist, um dem ganzen Abhilfe zu schaffen. Glücklicherweise wird fast überall auf <em>&#8220;EMPTY_TRASH_DAYS&#8221;</em> bzw. <em>&#8220;!EMPTY_TRASH_DAYS&#8221;</em> geprüft, sodass nur wenige Änderungen nötig sind. <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Fangen wir mit der ersten an. In der Datei <strong>wp-includes/post.php</strong> finden wir in der <strong>Zeile 1178</strong> eine Abfrage, die überprüft, ob statt <em>wp_delete_post()</em> (wo wir uns gerade befinden) nicht lieber <em>wp_trash_post()</em> aufgerufen werden sollte:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #000088;">$force_delete</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_type</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'post'</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_type</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'page'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> get_post_status<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$postid</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">'trash'</span> <span style="color: #339933;">&amp;&amp;</span> EMPTY_TRASH_DAYS <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span></div></td></tr></tbody></table></div>
<p>Diese ändern wir nun so ab, dass sie dann wahr ist, sobald <strong>EMPTY_TRASH_DAYS</strong> gleich <em>true</em> ist &#8211; wir unterscheiden also nicht mehr zwischen <a href="http://php.net/manual/en/language.types.boolean.php" target="_blank" class="liexternal">positiven und negativen</a> Werten:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #000088;">$force_delete</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_type</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'post'</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_type</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'page'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> get_post_status<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$postid</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">'trash'</span> <span style="color: #339933;">&amp;&amp;</span> EMPTY_TRASH_DAYS <span style="color: #009900;">&#41;</span></div></td></tr></tbody></table></div>
<p><br/><br />
Eine ganz ähnliche Zeile gibt es auch in der Datei <strong>wp-includes/comment.php</strong>. Dort wird in <strong>Zeile 821</strong> geprüft, ob statt <em>wp_delete_comment()</em> nicht lieber <em>wp_trash_comment()</em> aufgerufen werden sollte:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>wp_get_comment_status<span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment_id</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">'trash'</span> <span style="color: #339933;">&amp;&amp;</span> wp_get_comment_status<span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment_id</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">'spam'</span> <span style="color: #339933;">&amp;&amp;</span> EMPTY_TRASH_DAYS <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span></div></td></tr></tbody></table></div>
<p>Auch diese ändern wir so ab, dass das Vorzeichen des Wertes <strong>EMPTY_TRASH_DAYS</strong> egal ist:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>wp_get_comment_status<span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment_id</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">'trash'</span> <span style="color: #339933;">&amp;&amp;</span> wp_get_comment_status<span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment_id</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">'spam'</span> <span style="color: #339933;">&amp;&amp;</span> EMPTY_TRASH_DAYS <span style="color: #009900;">&#41;</span></div></td></tr></tbody></table></div>
<p><br/><br />
Nun kommt noch eine Änderung in der Datei <strong>wp-includes/functions.php</strong> an die Reihe. In dieser beginnt ab <strong>Zeile 3531</strong> die Funktion <em>wp_scheduled_delete()</em>. Diese ist dafür zuständig, dass nach der Anzahl der Tage, die in <strong>EMPTY_TRASH_DAYS</strong> angegeben ist, die entsprechenden Einträge im Papierkorb gelöscht werden. Dies können wir dadurch verhindern, indem wir gleich ganz am Anfang der Funktion folgenden Quelltext einfügen:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>EMPTY_TRASH_DAYS <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">return</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>Damit sorgen wir dafür, dass die Funktion garnicht erst durchlaufen wird, wenn der Wert in <strong>EMPTY_TRASH_DAYS</strong> kleiner Null ist.<br />
<br/><br />
Der Wert <strong>EMPTY_TRASH_DAYS</strong> muss jetzt nur noch in der Datei <strong>wp-config.php</strong> entsprechend gesetzt werden:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;EMPTY_TRASH_DAYS&quot;</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p><br/><br />
Herzlichen Glückwunsch! Du hast gerade dein WordPress 2.9.1 so abgeändert, dass dein Papierkorb aktiv ist, dieser jedoch nicht nach einer bestimmten Anzahl an Tagen einfach geleert wird <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  !<br />
Ich hoffe, du wirst mit dieser Änderung genauso viel Spaß haben, wie ich.</p>
<p>Und nicht vergessen: <em>Ich hafte nicht für Schäden an Software, Hardware oder für Vermögensschäden, die durch Anwendung dieser Änderungen entstanden sind oder entstehen könnten.</em> <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /><br />
<br/><br />
<strong>Manuelle Grüße</strong></p>
<!-- RSPEAK_STOP -->]]></content:encoded>
			<wfw:commentRss>http://weizenspr.eu/2010/wordpress-trash-ohne-automatische-leerung/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Alles neu macht das neue Jahr I</title>
		<link>http://weizenspr.eu/2010/alles-neu-macht-das-neue-jahr-i/</link>
		<comments>http://weizenspr.eu/2010/alles-neu-macht-das-neue-jahr-i/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 03:46:17 +0000</pubDate>
		<dc:creator>Mea Culpa</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Alltag]]></category>
		<category><![CDATA[Aufbau]]></category>
		<category><![CDATA[Computer]]></category>
		<category><![CDATA[Entwicklung]]></category>
		<category><![CDATA[Weizen]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://weizenspr.eu/?p=3718</guid>
		<description><![CDATA[Habt ihr etwa nichts davon gemerkt? Umso besser   ! Das bedeutet, dass alle wichtigen Funktionen wieder an Ort und Stelle sind   .
Ich habe mich nämlich erdreistet, in der Nacht spontan den Blog von WordPress 2.7.1 auf WordPress 2.9 zu hieven und bin im Moment noch erstaunt, wie reibungslos das funktioniert hat [...]]]></description>
			<content:encoded><![CDATA[<!-- RSPEAK_START --><p>Habt ihr etwa nichts davon gemerkt? Umso besser <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  ! Das bedeutet, dass alle wichtigen Funktionen wieder an Ort und Stelle sind <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  .</p>
<p>Ich habe mich nämlich erdreistet, in der Nacht spontan den Blog von <em>WordPress 2.7.1</em> auf <em>WordPress 2.9</em> zu hieven und bin im Moment noch erstaunt, wie reibungslos das funktioniert hat <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  !<br />
Dabei muss ich gestehen, dass ich den harten Weg gegangen bin: Im alten Blog alle Artikel, Seiten und Kommentare exportiert und in den neuen Blog importiert. Nunja, fast. Denn vorher musste ich die Exportdatei in mehrere aufteilen, um sie importieren zu können. Die war nämlich zu groß, um sie in den Blog hochzuladen <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  .<br />
Zwischendurch hatte ich noch ein paar kleinere Problemchen mit der Zeichenkodierung (nach einem Umlaut war der restliche Artikeltext weg) und mit einem störrischen Plugin  (<a href="http://wordpress.org/extend/plugins/wp-security-scan/" target="_blank" class="liwp">WP Security Scan</a> hat den Umzug nicht überlebt).</p>
<p>Ich habe noch nicht alle Plugins wieder in Betrieb genommen, aber ich denke, das hole ich in den nächsten Tagen nach <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  . Und dann ist WeizenSpr.eu endlich wieder state-of-the-art <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  ! Apropos: Seit dem Upgrade funktioniert auch das Plugin <a href="http://wordpress.org/extend/plugins/wp-ajax-edit-comments/" target="_blank" class="liwp">WP Ajax Edit Comments</a> wieder. Ihr könnt also nach langer Zeit endlich wieder eure Kommentare korrigieren, falls ihr euch verschrieben haben solltet <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  .</p>
<p>Und da wir gerade bei neu sind: Nachdem er zuerst bei den <a href="http://blogfloeten.de" target="_blank" class="liexternal">Blogflöten</a> mitgemacht hatte (die zur Zeit eine <a href="http://shorte.net/blogfloeten/break.html" target="_blank" class="liexternal">Pause einlegen</a>), hat JHB nun seinen ersten eigenen Blog gestartet: <a href="http://waitfor.it" target="_blank" class="liexternal"><strong>WaitFor.It</strong></a><br />
So, wie ich sein Geschreibsel kenne, kann es nicht schaden, seinen Feed zu abonnieren. Ich habe ihn jedenfalls schon geadded <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  .<br />
<br/><br />
<strong>Neue Grüße, Kenny</strong></p>
<!-- RSPEAK_STOP -->]]></content:encoded>
			<wfw:commentRss>http://weizenspr.eu/2010/alles-neu-macht-das-neue-jahr-i/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>[Update] WordPress mit mehreren Datenbank-Zugängen</title>
		<link>http://weizenspr.eu/2009/wordpress-mit-mehreren-datenbank-zugangen/</link>
		<comments>http://weizenspr.eu/2009/wordpress-mit-mehreren-datenbank-zugangen/#comments</comments>
		<pubDate>Fri, 25 Dec 2009 14:31:23 +0000</pubDate>
		<dc:creator>Mea Culpa</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Alltag]]></category>
		<category><![CDATA[Aufbau]]></category>
		<category><![CDATA[Computer]]></category>
		<category><![CDATA[Entwicklung]]></category>
		<category><![CDATA[Update]]></category>
		<category><![CDATA[Weizen]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://weizenspr.eu/?p=3608</guid>
		<description><![CDATA[Da ich in letzter Zeit einige Probleme mit dem MySQL-Servers meines Hosting-Anbieters habe, habe ich überlegt, was für Alternativen ich habe. Jedes Mal, wenn der Server in die Knie geht, sind alle meine Webseiten nicht erreichbar: Vor allem bei diesem Blog ist das sehr ärgerlich, die Ausfälle der anderen Seiten kann ich noch verschmerzen.
Also habe [...]]]></description>
			<content:encoded><![CDATA[<!-- RSPEAK_START --><p>Da ich in letzter Zeit einige Probleme mit dem MySQL-Servers meines Hosting-Anbieters habe, habe ich überlegt, was für Alternativen ich habe. Jedes Mal, wenn der Server in die Knie geht, sind alle meine Webseiten nicht erreichbar: Vor allem bei diesem Blog ist das sehr ärgerlich, die Ausfälle der anderen Seiten kann ich <strong>noch</strong> verschmerzen.</p>
<p>Also habe ich mich mal drangesetzt, den WordPress-Quelltext analysiert und mir eine Lösung einfallen lassen. Um diese einzusetzen, müssen ein paar Modifikationen am Kern von WordPress vorgenommen werden. Die gezeigten Quelltextausschnitte und Zeilennummern beziehen sich auf <em>WordPress 2.7.1</em>.<br />
Mit den Änderungen ist es übrigens gleichzeitig möglich, WordPress via SSL mit der MySQL-Datenbank sprechen zu lassen. <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Fangen wir mit den Änderungen an der Datei <strong>wp-config.php</strong> an &#8211; diese enthält unter anderem sämtliche Informationen, die WordPress benötigt, um sich zur Datenbank zu verbinden. Normalerweise sieht die Konfiguration der Datenbank in etwa so aus:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">// ** MySQL Einstellungen ** //</span><br />
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_NAME'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'DATENBANKNAME'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Der Name der Datenbank, die du benutzt.</span><br />
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_USER'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'BENUTZERNAME'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Dein MySQL-Datenbank-Benutzername.</span><br />
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_PASSWORD'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'PASSWORT'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Dein MySQL-Passwort.</span><br />
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_HOST'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'SERVER'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// In 99% der Fälle musst du hier nichts ändern.</span><br />
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_CHARSET'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'CHARSET'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_COLLATE'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>Das ganze erweitern wir nun ein bisschen, damit wir die Daten von mehreren verschiedenen Datenbankservern angeben können. Hierfür schreiben wir alle Daten jeweils in ein Array. Jedes Array sollte gleichviele Einträge haben, wobei alle Einträge mit einem bestimmten Index zusammengehörig sind:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">// ** MySQL Einstellungen ** //</span><br />
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'CLIENT_SSL'</span><span style="color: #339933;">,</span> &nbsp; &nbsp; &nbsp; <span style="color: #cc66cc;">2048</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; <span style="color: #666666; font-style: italic;">// Wert für Konstante CLIENT_SSL</span><br />
<span style="color: #666666; font-style: italic;">// define('ENABLE_DB_SELECT', 'true'); // Einkommentieren, um manuelle Wahl der Datenbank zu aktivieren</span><br />
<br />
<span style="color: #000088;">$wpdbname</span> &nbsp; &nbsp; <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DATENBANKNAME1'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'DATENBANKNAME2'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Der Name der Datenbank, die du benutzt.</span><br />
<span style="color: #000088;">$wpdbuser</span> &nbsp; &nbsp; <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'BENUTZERNAME1'</span><span style="color: #339933;">,</span> &nbsp;<span style="color: #0000ff;">'BENUTZERNAME2'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp;<span style="color: #666666; font-style: italic;">// Dein MySQL-Datenbank-Benutzername.</span><br />
<span style="color: #000088;">$wpdbpassword</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'PASSWORT1'</span><span style="color: #339933;">,</span> &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">'PASSWORT2'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp;<span style="color: #666666; font-style: italic;">// Dein MySQL-Passwort.</span><br />
<span style="color: #000088;">$wpdbhost</span> &nbsp; &nbsp; <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'SERVER1'</span><span style="color: #339933;">,</span> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">'SERVER2'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #666666; font-style: italic;">// In 99% der Fälle musst du hier nichts ändern.</span><br />
<span style="color: #000088;">$wpdbssl</span> &nbsp; &nbsp; &nbsp;<span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'SSL1'</span><span style="color: #339933;">,</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'SSL2'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Verbindung via SSL =&gt; 'true'</span><br />
<span style="color: #000088;">$wpdbtimeout</span> &nbsp;<span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">,</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #cc66cc;">60</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Verbindungstimeout in Sekunden</span><br />
<span style="color: #000088;">$wpdbcharset</span> &nbsp;<span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'CHARSET1'</span><span style="color: #339933;">,</span> &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'CHARSET2'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$wpdbcollate</span> &nbsp;<span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_NAME'</span><span style="color: #339933;">,</span> &nbsp; &nbsp; <a href="http://www.php.net/serialize"><span style="color: #990000;">serialize</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wpdbname</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_USER'</span><span style="color: #339933;">,</span> &nbsp; &nbsp; <a href="http://www.php.net/serialize"><span style="color: #990000;">serialize</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wpdbuser</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_PASSWORD'</span><span style="color: #339933;">,</span> <a href="http://www.php.net/serialize"><span style="color: #990000;">serialize</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wpdbpassword</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_HOST'</span><span style="color: #339933;">,</span> &nbsp; &nbsp; <a href="http://www.php.net/serialize"><span style="color: #990000;">serialize</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wpdbhost</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_SSL'</span><span style="color: #339933;">,</span> &nbsp; &nbsp; &nbsp;<a href="http://www.php.net/serialize"><span style="color: #990000;">serialize</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wpdbssl</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #666666; font-style: italic;">// define('DB_TIMEOUT', &nbsp;serialize($wpdbtimeout)); // Einkommentieren, um Timeout-Konfiguration zu aktivieren</span><br />
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_CHARSET'</span><span style="color: #339933;">,</span> &nbsp;<a href="http://www.php.net/serialize"><span style="color: #990000;">serialize</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wpdbcharset</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_COLLATE'</span><span style="color: #339933;">,</span> &nbsp;<a href="http://www.php.net/serialize"><span style="color: #990000;">serialize</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wpdbcollate</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>Ich hoffe, jemandem ist die neue Variable <strong>$wpdbssl</strong> und der neue definierte Wert <strong>DB_SSL</strong> aufgefallen. Über diese ist es später möglich, WordPress dazu zu bewegen, sich via SSL mit der Datenbank zu verbinden &#8211; wenn sie denn entsprechend konfiguriert ist. Der Wert <strong>&#8216;false&#8217;</strong> bedeutet, dass SSL <em>deaktiviert</em> ist &#8211; jeder andere Wert aktiviert die SSL-Verbindung. <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Nachdem die Konfiguration fertig ist, müssen wir nun an WordPress selber herumschrauben. Dazu müssen wir die Datei <strong>wp-includes/wp-db.php</strong> bearbeiten. In dieser wird die initiale Datenbankverbindung hergestellt.</p>
<p>In der Funktion <strong>__construct()</strong>  befindet sich ab <strong>Zeile 312</strong> folgender Quelltext:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <a href="http://www.php.net/defined"><span style="color: #990000;">defined</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_CHARSET'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">charset</span> <span style="color: #339933;">=</span> DB_CHARSET<span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <a href="http://www.php.net/defined"><span style="color: #990000;">defined</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_COLLATE'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">collate</span> <span style="color: #339933;">=</span> DB_COLLATE<span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dbh</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/mysql_connect"><span style="color: #990000;">mysql_connect</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbhost</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dbuser</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dbpassword</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>Diesen ersetzen wir nun durch folgenden Quelltext. Dieser ist für die Verarbeitung der Arrays zuständig &#8211; es werden nacheinander alle Konfigurationen durchprobiert, bis eine Verbindung zu eine der MySQL-Datenbanken hergestellt werden kann. Dabei wird auch berücksichtigt, dass es ja mal passieren kann, dass nicht alle Konfigurations-Arrays gleich lang sind; ebenso wird SSL berücksichtigt und der Timeout der Verbindung gesetzt, falls nötig:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br />89<br />90<br />91<br />92<br />93<br />94<br />95<br />96<br />97<br />98<br />99<br />100<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// which database to select</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$selectedName</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// get array values</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$dbuser</span> &nbsp; &nbsp; <span style="color: #339933;">=</span> <a href="http://www.php.net/unserialize"><span style="color: #990000;">unserialize</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbuser</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$dbpassword</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/unserialize"><span style="color: #990000;">unserialize</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbpassword</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$dbname</span> &nbsp; &nbsp; <span style="color: #339933;">=</span> <a href="http://www.php.net/unserialize"><span style="color: #990000;">unserialize</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbname</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$dbhost</span> &nbsp; &nbsp; <span style="color: #339933;">=</span> <a href="http://www.php.net/unserialize"><span style="color: #990000;">unserialize</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbhost</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$dbssl</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <a href="http://www.php.net/defined"><span style="color: #990000;">defined</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_SSL'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$dbssl</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/unserialize"><span style="color: #990000;">unserialize</span></a><span style="color: #009900;">&#40;</span>DB_SSL<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$dbtimeout</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <a href="http://www.php.net/defined"><span style="color: #990000;">defined</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_TIMEOUT'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$dbtimeout</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/unserialize"><span style="color: #990000;">unserialize</span></a><span style="color: #009900;">&#40;</span>DB_TIMEOUT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$dbcharset</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <a href="http://www.php.net/defined"><span style="color: #990000;">defined</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_CHARSET'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$dbcharset</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/unserialize"><span style="color: #990000;">unserialize</span></a><span style="color: #009900;">&#40;</span>DB_CHARSET<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$dbcollate</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <a href="http://www.php.net/defined"><span style="color: #990000;">defined</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DB_COLLATE'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$dbcollate</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/unserialize"><span style="color: #990000;">unserialize</span></a><span style="color: #009900;">&#40;</span>DB_COLLATE<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dbh</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// get number of available complete config sets</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$minCount</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/count"><span style="color: #990000;">count</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbuser</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/count"><span style="color: #990000;">count</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbpassword</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;</span> <span style="color: #000088;">$minCount</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000088;">$minCount</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/count"><span style="color: #990000;">count</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbpassword</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/count"><span style="color: #990000;">count</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbname</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;</span> <span style="color: #000088;">$minCount</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000088;">$minCount</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/count"><span style="color: #990000;">count</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbname</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/count"><span style="color: #990000;">count</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbhost</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;</span> <span style="color: #000088;">$minCount</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000088;">$minCount</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/count"><span style="color: #990000;">count</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbhost</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbssl</span> <span style="color: #339933;">!=</span> <span style="color: #009900; font-weight: bold;">null</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/count"><span style="color: #990000;">count</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbssl</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;</span> <span style="color: #000088;">$minCount</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000088;">$minCount</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/count"><span style="color: #990000;">count</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbssl</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbtimeout</span> <span style="color: #339933;">!=</span> <span style="color: #009900; font-weight: bold;">null</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/count"><span style="color: #990000;">count</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbtimeout</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;</span> <span style="color: #000088;">$minCount</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000088;">$minCount</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/count"><span style="color: #990000;">count</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbtimeout</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbcharset</span> <span style="color: #339933;">!=</span> <span style="color: #009900; font-weight: bold;">null</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/count"><span style="color: #990000;">count</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbcharset</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;</span> <span style="color: #000088;">$minCount</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000088;">$minCount</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/count"><span style="color: #990000;">count</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbcharset</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbcollate</span> <span style="color: #339933;">!=</span> <span style="color: #009900; font-weight: bold;">null</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/count"><span style="color: #990000;">count</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbcollate</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;</span> <span style="color: #000088;">$minCount</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000088;">$minCount</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/count"><span style="color: #990000;">count</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbcollate</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// find first working config set</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$minCount</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$index</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// allow manual selection of used config set</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/defined"><span style="color: #990000;">defined</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ENABLE_DB_SELECT'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>ENABLE_DB_SELECT <span style="color: #339933;">==</span> <span style="color: #0000ff;">'true'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$dbid</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</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;">'dbid'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$dbid</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dbid'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</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;">$_COOKIE</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dbid'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$dbid</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_COOKIE</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dbid'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbid</span> <span style="color: #339933;">!=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</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;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_HOST'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$domain</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_HOST'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$domain</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'SERVER_NAME'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/strlen"><span style="color: #990000;">strlen</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/trim"><span style="color: #990000;">trim</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbid</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/is_numeric"><span style="color: #990000;">is_numeric</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbid</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$dbid</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/intval"><span style="color: #990000;">intval</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbid</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$minCount</span> <span style="color: #339933;">&gt;</span> <span style="color: #000088;">$dbid</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$index</span> &nbsp; &nbsp;<span style="color: #339933;">=</span> <span style="color: #000088;">$dbid</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$minCount</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$dbid</span> <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/setcookie"><span style="color: #990000;">setcookie</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'dbid'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dbid</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: #cc66cc;">300000</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$domain</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/setcookie"><span style="color: #990000;">setcookie</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'dbid'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</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;">'/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$domain</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">do</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$selectedName</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$dbname</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$index</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbtimeout</span> <span style="color: #339933;">!=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/ini_set"><span style="color: #990000;">ini_set</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'mysql.connect_timeout'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dbtimeout</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$index</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// set connect timeout</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbssl</span> <span style="color: #339933;">!=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbssl</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$index</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'true'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dbh</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/mysql_connect"><span style="color: #990000;">mysql_connect</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbhost</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$index</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dbuser</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$index</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dbpassword</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$index</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span> CLIENT_SSL<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dbh</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/mysql_connect"><span style="color: #990000;">mysql_connect</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbhost</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$index</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dbuser</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$index</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dbpassword</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$index</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbcharset</span> <span style="color: #339933;">!=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">charset</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$dbcharset</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$index</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbcollate</span> <span style="color: #339933;">!=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> &nbsp;<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">collate</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$dbcollate</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$index</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$index</span><span style="color: #339933;">++;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">dbh</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$index</span> <span style="color: #339933;">&lt;</span> <span style="color: #000088;">$minCount</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>Nun folgt nur noch eine kleine Änderung in der <strong>Zeile 435</strong>. Dort müssen wir dafür sorgen, dass die richtige Datenbank ausgewählt. Das bisherige&#8230;</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">select</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbname</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>&#8230;ersetzen wir schnell durch die neue Version:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">select</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$selectedName</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>Herzlichen Glückwunsch! Wenn du alles richtig gemacht hast, sollte dein WordPress nun in der Lage sein, sich via SSL zu einer Datenbank zu verbinden und obendrein auch noch die Fähigkeit besitzen, sich zu einer Ersatzdatenbank zu verbinden, falls die erste(n) Datenbank(en) nicht erreichbar sind! <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Für Tipps, Ideen und Anregungen bin ich jederzeit offen <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  . Die Idee, die Arrays serialisiert zu übergeben, habe ich übrigens bei <a href="http://www.php.net/manual/de/function.define.php#85480" target="_blank" class="liexternal">PHP.net</a> gefunden <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  ! Die Definition der Konstante <em>CLIENT_SSL</em> stammt ebenfalls <a href="http://www.php.net/manual/de/function.mysql-connect.php#77063" target="_blank" class="liexternal">von dort</a>.</p>
<p>Und nicht vergessen: <em>Ich hafte nicht für Schäden an Software, Hardware oder für Vermögensschäden, die durch Anwendung dieser Änderungen entstanden sind oder entstehen könnten.</em> <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /><br />
<br/><br />
<strong>Update:</strong><br />
Es gibt da noch eine kleine Ergänzung, die ich gerne noch loswerden möchte. Zuerst einmal ist es durchaus möglich, den Quelltext so zu erweitern, dass unterschiedliche Anfragen an verschiedene Datenbanken weitergereicht werden &#8211; dadurch ist es möglich <a href="http://de.wikipedia.org/wiki/Lastverteilung" target="_blank" rel="nofollow" class="liwikipedia">Load-Balancing</a> zu implementieren.<br />
Auf der anderen Seite gibt es jedoch auch ein Problem: Man muss es hinkriegen, die verschiedenen Datenbanken möglichst synchron zu halten. Es wäre ärgerlich, wenn ein Artikel in einer Datenbank erstellt wird, dieser aber in der anderen nicht zu sehen ist. Genauso problematisch sind Kommentare und Trackbacks, da diese schnell verloren gehen könnten. Eine funktionierende Synchronisation muss ich deshalb erst noch erstellen. Derzeit gebe ich mich damit zufrieden, dass nur bei der Aktivität einer Datenbank kommentiert werden kann, während dies bei der anderen Datenbank deaktiviert ist.<br />
<br/><br />
<strong>Update:</strong><br />
Ich habe noch einmal den gesamten Quelltext überarbeitet und dabei einige Änderungen überflüssig gemacht. Nun muss nur noch die Funktion <strong>__construct()</strong> in der Datei <strong>wp-db.php</strong> bearbeitet werden.<br />
<br/><br />
<strong>Mehrfache Grüße, Kenny</strong></p>
<!-- RSPEAK_STOP -->]]></content:encoded>
			<wfw:commentRss>http://weizenspr.eu/2009/wordpress-mit-mehreren-datenbank-zugangen/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Eintrittskarten am Fahrkartenautomaten</title>
		<link>http://weizenspr.eu/2009/eintrittskarten-am-fahrkartenautomaten/</link>
		<comments>http://weizenspr.eu/2009/eintrittskarten-am-fahrkartenautomaten/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 06:53:19 +0000</pubDate>
		<dc:creator>Mea Culpa</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Alltag]]></category>
		<category><![CDATA[Aufbau]]></category>
		<category><![CDATA[Computer]]></category>
		<category><![CDATA[Entwicklung]]></category>
		<category><![CDATA[Just Spottet]]></category>
		<category><![CDATA[Spreu]]></category>
		<category><![CDATA[Weizen]]></category>

		<guid isPermaLink="false">http://weizenspr.eu/?p=3504</guid>
		<description><![CDATA[Ich hatte es bereits vor einigen Wochen im Infoblatt der BVG gelesen, doch jetzt habe ich einfach mal geguckt, wie das ganze in natura aussieht.
Seit neustem ist es möglich, an den Fahrkartenautomaten der BVG Eintrittskarten für einige wenige berliner Attraktionen wie Madam Tussaud&#8217;s, dem Aquadome oder dem Legoland zu erwerben. Wie es scheint, handelt es [...]]]></description>
			<content:encoded><![CDATA[<!-- RSPEAK_START --><p>Ich hatte es bereits vor einigen Wochen im Infoblatt der <a href="http://bvg.de" target="_blank" class="liexternal">BVG</a> gelesen, doch jetzt habe ich einfach mal geguckt, wie das ganze in natura aussieht.</p>
<div id="attachment_3505" class="wp-caption aligncenter" style="width: 327px"><a href="http://weizenspr.eu/uploads/dsc00822.jpg" target="_blank" class="liimagelink"><img src="http://weizenspr.eu/uploads/dsc00822-150x150.jpg" alt="Eintrittkarten am Fahrkartenautomaten" title="dsc00822" width="150" height="150" class="size-thumbnail wp-image-3505" /></a> <a href="http://weizenspr.eu/uploads/dsc00823.jpg" target="_blank" class="liimagelink"><img src="http://weizenspr.eu/uploads/dsc00823-150x150.jpg" alt="Eintrittkarten am Fahrkartenautomaten" title="dsc00823" width="150" height="150" class="size-thumbnail wp-image-3506" /></a><p class="wp-caption-text">Eintrittkarten am Fahrkartenautomaten</p></div>
<p>Seit neustem ist es möglich, an den Fahrkartenautomaten der BVG Eintrittskarten für einige wenige berliner Attraktionen wie <em>Madam Tussaud&#8217;s</em>, dem <em>Aquadome</em> oder dem <em>Legoland</em> zu erwerben. Wie es scheint, handelt es sich bisher nur um Eintrittskarten, bei denen keine Reservierung notwendig ist.</p>
<p>Ich persönlich finde die Idee hinter dem ganzen recht gut, spart man sich doch das Anstehen an der Kasse. Wirklich toll würde die Lösung dann werden, wenn eine Anbindung an <a href="http://eventim.de" target="_blank" class="liexternal">eventim</a> möglich wäre, denn dann könnte man am Automaten sogar kompliziertere Buchungen mit Reservierung vornehmen. Das wäre dann ein riesiger Mehrwert, wenn man bereits unterwegs ist und vorher noch schnell ein Ticket ergattern will. <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><em>Gibt es solch ein Automaten-Ticketsystem auch in anderen Städten? Ist es dort möglich auch Sitzplatzreservierungen vorzunehmen? Habt ihr solch ein Angebot schon einmal genutzt?</em><br />
<br/><br />
<strong>Eintretende Grüße, Kenny</strong></p>
<!-- RSPEAK_STOP -->]]></content:encoded>
			<wfw:commentRss>http://weizenspr.eu/2009/eintrittskarten-am-fahrkartenautomaten/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Der Kalender hängt!</title>
		<link>http://weizenspr.eu/2009/der-kalender-hangt/</link>
		<comments>http://weizenspr.eu/2009/der-kalender-hangt/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 19:54:22 +0000</pubDate>
		<dc:creator>Mea Culpa</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Alltag]]></category>
		<category><![CDATA[Aufbau]]></category>
		<category><![CDATA[Weizen]]></category>

		<guid isPermaLink="false">http://weizenspr.eu/?p=3445</guid>
		<description><![CDATA[Seit dem 08.12.2009 ist die Twitter-Kalender-Aktion von Druckerei.de beendet. Statt der versprochenenen drei Kalender haben ganze zehn Kalender den Weg zu mir nach Hause gefunden!  
Heute habe ich nun den ersten Kalender bei mir auf Arbeit im Zimmer aufgehängt. Damit sehen die grauen Wände doch gleich wesentlich wohnlicher aus! 
Und damit der Kalender auch [...]]]></description>
			<content:encoded><![CDATA[<!-- RSPEAK_START --><p>Seit dem 08.12.2009 ist die <a href="http://weizenspr.eu/2009/twitter-wandkalender-den-muss-ich-haben/" target="_blank" class="liinternal">Twitter-Kalender-Aktion</a> von <a href="http://druckerei.de" target="_blank" class="liexternal">Druckerei.de</a> beendet. Statt der versprochenenen drei Kalender haben ganze <strong>zehn</strong> Kalender den Weg zu mir nach Hause gefunden! <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<div id="attachment_3446" class="wp-caption aligncenter" style="width: 310px"><a href="http://weizenspr.eu/uploads/bild372.jpg" target="_blank" class="liimagelink"><img src="http://weizenspr.eu/uploads/bild372-300x240.jpg" alt="Twitter-Kalender" title="bild372" width="300" height="240" class="size-medium wp-image-3446" /></a><p class="wp-caption-text">Twitter-Kalender</p></div>
<p>Heute habe ich nun den ersten Kalender bei mir auf Arbeit im Zimmer aufgehängt. Damit sehen die grauen Wände doch gleich wesentlich wohnlicher aus! <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
Und damit der Kalender auch eine praktische Aufgabe hat, habe ich auch direkt meine Urlaubstage eingetragen. So kann ich die Tage zählen, bis ich endlich wieder ausspannen kann. <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /><br />
<br/><br />
<strong>Hängende Grüße, Kenny</strong></p>
<!-- RSPEAK_STOP -->]]></content:encoded>
			<wfw:commentRss>http://weizenspr.eu/2009/der-kalender-hangt/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Datenbankfehler in WordPress: db-error.php</title>
		<link>http://weizenspr.eu/2009/datenbankfehler-in-wordpress-db-errorphp/</link>
		<comments>http://weizenspr.eu/2009/datenbankfehler-in-wordpress-db-errorphp/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 13:11:50 +0000</pubDate>
		<dc:creator>Mea Culpa</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Alltag]]></category>
		<category><![CDATA[Aufbau]]></category>
		<category><![CDATA[Computer]]></category>
		<category><![CDATA[Entwicklung]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://weizenspr.eu/?p=3355</guid>
		<description><![CDATA[Da ich schon seit mehreren Tagen teilweise massive Probleme mit der Datenbank habe und mein Provider bisher keine zufriedenstellende Lösung gefunden hat, musste ich erstmal nach einer minimalen Alternative suchen.
Hintergrund ist, dass ich auf der Seite ein bisschen (kaum auffallende) Werbung geschaltet habe, um den Blog zu finanzieren. Natürlich wird regelmäßig geprüft, ob diese Werbung [...]]]></description>
			<content:encoded><![CDATA[<!-- RSPEAK_START --><p>Da ich schon <a href="http://twitter.com/weizenspreu/statuses/6240717727" target="_blank" class="liexternal">seit</a> <a href="http://twitter.com/weizenspreu/statuses/6426531671" target="_blank" class="liexternal">mehreren</a> <a href="http://twitter.com/weizenspreu/statuses/6479480388" target="_blank" class="liexternal">Tagen</a> teilweise massive Probleme mit der Datenbank habe und mein Provider bisher keine zufriedenstellende Lösung gefunden hat, musste ich erstmal nach einer minimalen Alternative suchen.</p>
<p>Hintergrund ist, dass ich auf der Seite ein bisschen (kaum auffallende) Werbung geschaltet habe, um den Blog zu finanzieren. Natürlich wird regelmäßig geprüft, ob diese Werbung auch wirklich verfügbar ist: Diese Prüfung ist jedoch nicht möglich, wenn die Datenbank gerade mal wieder streikt.<br />
Deshalb habe ich mich bei der <a href="http://perishablepress.com/press/2009/05/05/important-security-fix-for-wordpress/" target="_blank" class="liexternal">Perishable Press</a> informiert und herausgefunden, dass WordPress einem die Möglichkeit gibt, die Seite zu bearbeiten, die anzeigt wird, wenn ein Datenbankfehler aufgetreten ist.</p>
<p>Dazu muss lediglich die Datei <strong>wp-content/db-error.php</strong> erstellt und mit Inhalt gefüllt werden. Ist diese vorhanden, wird deren Inhalt zur Anzeige des Fehlers genutzt. Im ersten Schritt habe ich nun dort einfach erstmal die Werbung eingetragen, die permanent verfügbar sein sollte.<br />
Im nächsten Schritt werde ich dann wohl auch dazu übergehen, eine Fehlerseite zu erstellen, die dem <a href="http://www.quickonlinetips.com/archives/2007/12/create-custom-wordpress-database-error-pages/#comment-612426" target="_blank" class="liexternal">normalen Seitendesign entspricht</a>.</p>
<p><strong>Am liebsten wäre es mir jedoch, wenn das Datenbankproblem endlich vollständig behoben werden würde!</strong><br />
<br/><br />
<strong>Fehlerhafte Grüße, Kenny</strong></p>
<!-- RSPEAK_STOP -->]]></content:encoded>
			<wfw:commentRss>http://weizenspr.eu/2009/datenbankfehler-in-wordpress-db-errorphp/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WP Mobile Edition, Subdomains UND Kommentare</title>
		<link>http://weizenspr.eu/2009/wp-mobile-edition-subdomains-und-kommentare/</link>
		<comments>http://weizenspr.eu/2009/wp-mobile-edition-subdomains-und-kommentare/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 12:51:37 +0000</pubDate>
		<dc:creator>Mea Culpa</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Aufbau]]></category>
		<category><![CDATA[Computer]]></category>
		<category><![CDATA[Entwicklung]]></category>
		<category><![CDATA[Weizen]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://weizenspr.eu/?p=3335</guid>
		<description><![CDATA[Soderle. Nachdem ich mal wieder ein bisschen gebastelt habe, gab es heute ein Update des Artikels &#8220;WP Mobile Edition und Subdomains&#8220;.
Grund dafür war, dass mir bereits vor einiger Zeit ein Problem mit dem Proxy aufgefallen war, den ich bisher allerdings nicht beheben konnte: Es war bisher nicht möglich, über die Proxylösung Kommentare im WordPress-Blog zu [...]]]></description>
			<content:encoded><![CDATA[<!-- RSPEAK_START --><p>Soderle. Nachdem ich mal wieder ein bisschen gebastelt habe, gab es heute ein Update des Artikels <em>&#8220;<a href="http://weizenspr.eu/2009/wp-mobile-edition-und-subdomains/" target="_blank" class="liinternal">WP Mobile Edition und Subdomains</a>&#8220;</em>.</p>
<p>Grund dafür war, dass mir bereits vor einiger Zeit ein Problem mit dem Proxy aufgefallen war, den ich bisher allerdings nicht beheben konnte: Es war bisher nicht möglich, über die Proxylösung Kommentare im WordPress-Blog zu hinterlassen. In meinen Augen ein großes Manko.</p>
<p>Erst heute ist mir die zündende Idee gekommen: <strong>Parameter!</strong> <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
Das Problem bisher war, dass die Daten, die im Kommentarfeld eingegeben wurden, nicht an die originale Seite weitergereicht worden sind. Dadurch konnte diese natürlich auch nicht die eingegebenen Daten verarbeiten. Durch die neue Version des Proxies gehört dieser Fehler nun der Vergangenheit an. <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Hier übrigens der Grund, weshalb ich mitbekommen habe, dass die Kommentarfunktion immernoch deaktiviert war: Ich musste die Änderungen natürlich auch testen! <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Leider funktioniert der Proxy nun nicht mehr <em>&#8220;out-of-the-Box&#8221;</em>. Stattdessen muss nun eine kleine Änderung an der <strong>wp-comments-post.php</strong> von WordPress vorgenommen werden. Diese versucht nämlich nach dem Hinzufügen des Kommentars auf diesen weiterzuleiten. Diese Weiterleitung schlägt jedoch fehl. Deshalb muss hier durch einen <a href="http://en.wikipedia.org/wiki/Meta_refresh" target="_blank" rel="nofollow" class="liwikipedia">Meta-Refresh</a> ein wenig nachgeholfen werden. Was genau zu tun ist, ist im Ausgangsartikel beschrieben. <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Ich hoffe, euch gefällt die Verbesserung der Proxylösung. <img src='http://weizenspr.eu/weizenspreu_wordpress29_live/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
<br/><br />
<strong>Kommentierende Grüße, Kenny</strong></p>
<!-- RSPEAK_STOP -->]]></content:encoded>
			<wfw:commentRss>http://weizenspr.eu/2009/wp-mobile-edition-subdomains-und-kommentare/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
