<?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>DasLaboratorium.de &#187; Blog</title>
	<atom:link href="http://www.daslaboratorium.de/category/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.daslaboratorium.de</link>
	<description>Find out, what gets my attention. Philipp’s Blog aus Hamburg.</description>
	<lastBuildDate>Fri, 02 Apr 2010 21:34:34 +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>www.regnets.in/</title>
		<link>http://www.daslaboratorium.de/2010/www-regnets-in-424/</link>
		<comments>http://www.daslaboratorium.de/2010/www-regnets-in-424/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 21:32:12 +0000</pubDate>
		<dc:creator>Philipp</dc:creator>
				<category><![CDATA[Allgemeines]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[regnets.in]]></category>
		<category><![CDATA[regnets?]]></category>

		<guid isPermaLink="false">http://www.daslaboratorium.de/?p=424</guid>
		<description><![CDATA[Simple Frage, simple Antwort: www.regnets.in/passau oder www.regnets.in/hamburg oder etwa www.regnets.in/berlin?

Ja, mir war langweilig. Ja, ich finde das lustig.
]]></description>
			<content:encoded><![CDATA[<p>Simple Frage, simple Antwort: <a href="http://www.regnets.in/passau?" target="_blank">www.regnets.in/passau</a> oder <a href="http://www.regnets.in/hamburg" target="_blank">www.regnets.in/hamburg</a> oder etwa <a href="http://www.regnets.in/berlin?" target="_blank">www.regnets.in/berlin</a>?</p>
<p><img class="aligncenter size-full wp-image-425" title="regnets" src="http://www.daslaboratorium.de/wp-content/uploads/2010/04/regnets.jpg" alt="" width="530" height="353" /></p>
<p>Ja, mir war langweilig. Ja, ich finde das lustig.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.daslaboratorium.de/2010/www-regnets-in-424/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP Skript zum schnellen Umzug von mysql Tabellen</title>
		<link>http://www.daslaboratorium.de/2010/php-skript-zum-schnellen-umzug-von-mysql-tabellen-421/</link>
		<comments>http://www.daslaboratorium.de/2010/php-skript-zum-schnellen-umzug-von-mysql-tabellen-421/#comments</comments>
		<pubDate>Sun, 28 Mar 2010 14:39:22 +0000</pubDate>
		<dc:creator>Philipp</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[mehrere blogs]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Wordpress multidomain]]></category>

		<guid isPermaLink="false">http://www.daslaboratorium.de/?p=421</guid>
		<description><![CDATA[In der vergangenen Zeit habe ich mich damit beschäftigt Wordpress-Installationen multidomain-fähig zu machen. Das heißt: Mehrere Blogs mit nur einer Wordpress-Installation zu betreiben. Dazu habe ich auch ein PHP Skript geschrieben, das Datenbank-Tabellen (mit Prefix) in eine andere Datenbank schnell und einfach umzieht. Es erlaubt es sogar für die neuen Tabellen einen neuen Prefix zu nutzen.]]></description>
			<content:encoded><![CDATA[<p>In der vergangenen Zeit habe ich mich damit beschäftigt Wordpress-Installationen multidomain-fähig zu machen. Das heißt: Mehrere Blogs mit nur einer Wordpress-Installation zu betreiben. Aufgeschrieben habe ich das ganze auch im root-of-all-evil-blog: <a title="Wordpress multidomainfähig machen - schnell und einfach erklärt im Root of all evil Blog" href="http://blog.root-of-all-evil.com/2010/03/wordpress-multidomainfahig-machen-eine-wordpress-installation-fur-mehrere-blogs/" target="_blank">Wordpress multidomainfähig machen</a></p>
<p>Dazu habe ich auch ein PHP Skript geschrieben, das Datenbank-Tabellen (mit Prefix) in eine andere Datenbank schnell und einfach umzieht. Es erlaubt es sogar für die neuen Tabellen einen neuen Prefix zu nutzen. Das Skript möchte ich auch hier veröffentlichen:<span id="more-421"></span></p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">&lt;?php</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">function</span> echoOk<span class="br0">&#40;</span><span class="re0">$msg</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> <a href="http://www.php.net/echo"><span class="kw3">echo</span></a><span class="br0">&#40;</span><span class="st0">&#8216;[OK] &nbsp; &nbsp;&#8217;</span> . <span class="re0">$msg</span> . <span class="st0">&quot;<span class="es0">\n</span>&quot;</span><span class="br0">&#41;</span>; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">?&gt;&lt;html&gt;</div>
</li>
<li class="li1">
<div class="de1">&lt;head&gt;</div>
</li>
<li class="li2">
<div class="de2">&lt;meta http-equiv=<span class="st0">&quot;Content-Type&quot;</span> content=<span class="st0">&quot;text/html; charset=UTF-8&quot;</span> /&gt;</div>
</li>
<li class="li1">
<div class="de1">&lt;title&gt;Datenbank-Umzug&lt;/title&gt;</div>
</li>
<li class="li1">
<div class="de1">&lt;style&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; div.form label, div.form input <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; display: block;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; div.form label <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; margin: 10px <span class="nu0">0</span> 5px <span class="nu0">0</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; div.form input <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; margin: 5px <span class="nu0">0</span> 10px <span class="nu0">0</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&lt;/style&gt;</div>
</li>
<li class="li1">
<div class="de1">&lt;/head&gt;</div>
</li>
<li class="li1">
<div class="de1">&lt;body&gt;</div>
</li>
<li class="li2">
<div class="de2"><span class="kw2">&lt;?php</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="re0">$formElements</span> = <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st0">&#8217;server&#8217;</span>, <span class="st0">&#8216;username&#8217;</span>, <span class="st0">&#8216;password&#8217;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#8216;database&#8217;</span>, <span class="st0">&#8216;newdatabase&#8217;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#8216;tableprefix&#8217;</span>, <span class="st0">&#8216;newtableprefix&#8217;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="re0">$showForm</span> = <span class="kw2">false</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="kw1">foreach</span><span class="br0">&#40;</span><span class="re0">$formElements</span> <span class="kw1">as</span> <span class="re0">$element</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>!<a href="http://www.php.net/isset"><span class="kw3">isset</span></a><span class="br0">&#40;</span><span class="re0">$_POST</span><span class="br0">&#91;</span><span class="re0">$element</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$showForm</span> = <span class="kw2">true</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><span class="re0">$showForm</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">?&gt;</span></div>
</li>
<li class="li1">
<div class="de1">&lt;div <span class="kw2">class</span>=<span class="st0">&quot;form&quot;</span>&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &lt;form action=<span class="st0">&quot;&quot;</span> method=<span class="st0">&quot;post&quot;</span>&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;fieldset&gt;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;label <span class="kw1">for</span>=<span class="st0">&quot;server&quot;</span>&gt;Datenbank-Server&lt;/label&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;input type=<span class="st0">&quot;text&quot;</span> name=<span class="st0">&quot;server&quot;</span> /&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;label <span class="kw1">for</span>=<span class="st0">&quot;username&quot;</span>&gt;Benutzername&lt;/label&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;input type=<span class="st0">&quot;text&quot;</span> name=<span class="st0">&quot;username&quot;</span> /&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;label <span class="kw1">for</span>=<span class="st0">&quot;password&quot;</span>&gt;Passwort&lt;/label&gt;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;input type=<span class="st0">&quot;password&quot;</span> name=<span class="st0">&quot;password&quot;</span> /&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;/fieldset&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;fieldset&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;label <span class="kw1">for</span>=<span class="st0">&quot;database&quot;</span>&gt;Ursprüngliche Datenbank&lt;/label&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;input type=<span class="st0">&quot;text&quot;</span> name=<span class="st0">&quot;database&quot;</span> /&gt;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;label <span class="kw1">for</span>=<span class="st0">&quot;newdatabase&quot;</span>&gt;Neue Datenbank&lt;/label&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;input type=<span class="st0">&quot;text&quot;</span> name=<span class="st0">&quot;newdatabase&quot;</span> /&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;label <span class="kw1">for</span>=<span class="st0">&quot;tableprefix&quot;</span>&gt;Ursprünglicher Table_Prefix&lt;/label&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;input type=<span class="st0">&quot;text&quot;</span> name=<span class="st0">&quot;tableprefix&quot;</span> /&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;label <span class="kw1">for</span>=<span class="st0">&quot;newtableprefix&quot;</span>&gt;Neuer Table_Prefix&lt;/label&gt;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;input type=<span class="st0">&quot;text&quot;</span> name=<span class="st0">&quot;newtableprefix&quot;</span> /&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;/fieldset&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;fieldset&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;p&gt;ACHTUNG: Dieses Skript sendet manche der eingegebenen Daten ungefiltert an <a href="http://www.php.net/die"><span class="kw3">die</span></a> Datenbank und überschreibt bereits existierende Tabellen beim Umzug!&lt;/p&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;input type=<span class="st0">&quot;submit&quot;</span> /&gt;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &lt;/fieldset&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &lt;/form&gt;</div>
</li>
<li class="li1">
<div class="de1">&lt;/div&gt;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">&lt;?php</span> <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a><span class="br0">&#40;</span><span class="st0">&#8216;&lt;pre&gt;&#8217;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; try <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$con</span> = <a href="http://www.php.net/mysql_connect"><span class="kw3">mysql_connect</span></a><span class="br0">&#40;</span><span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st0">&#8217;server&#8217;</span><span class="br0">&#93;</span>, <span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st0">&#8216;username&#8217;</span><span class="br0">&#93;</span>, <span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st0">&#8216;password&#8217;</span><span class="br0">&#93;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>!<span class="re0">$con</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; throw <span class="kw2">new</span> Exception<span class="br0">&#40;</span><span class="st0">&#8216;Verbindung mit Server nicht möglich. &#8216;</span> . <a href="http://www.php.net/mysql_error"><span class="kw3">mysql_error</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echoOk<span class="br0">&#40;</span><span class="st0">&#8216;Mit <span class="es0">\&#8217;</span>&#8216;</span> . <a href="http://www.php.net/htmlentities"><span class="kw3">htmlentities</span></a><span class="br0">&#40;</span><span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st0">&#8217;server&#8217;</span><span class="br0">&#93;</span><span class="br0">&#41;</span> . <span class="st0">&#8216;<span class="es0">\&#8217;</span> verbunden.&#8217;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>!<a href="http://www.php.net/mysql_select_db"><span class="kw3">mysql_select_db</span></a><span class="br0">&#40;</span><span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st0">&#8216;database&#8217;</span><span class="br0">&#93;</span>, <span class="re0">$con</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; throw <span class="kw2">new</span> Exception<span class="br0">&#40;</span><span class="st0">&#8216;Auswahl der Datenbank nicht möglich. &#8216;</span> . <a href="http://www.php.net/mysql_error"><span class="kw3">mysql_error</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echoOk<span class="br0">&#40;</span><span class="st0">&#8216;Aktuelle Datenbank <span class="es0">\&#8217;</span>&#8216;</span> . <a href="http://www.php.net/htmlentities"><span class="kw3">htmlentities</span></a><span class="br0">&#40;</span><span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st0">&#8216;database&#8217;</span><span class="br0">&#93;</span><span class="br0">&#41;</span> . <span class="st0">&#8216;<span class="es0">\&#8217;</span>.&#8217;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$res</span> = <a href="http://www.php.net/mysql_query"><span class="kw3">mysql_query</span></a><span class="br0">&#40;</span><span class="st0">&#8216;SHOW TABLES IN `&#8217;</span> . <span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st0">&#8216;database&#8217;</span><span class="br0">&#93;</span> . <span class="st0">&#8216;` LIKE <span class="es0">\&#8217;</span>&#8216;</span> . <span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st0">&#8216;tableprefix&#8217;</span><span class="br0">&#93;</span> . <span class="st0">&#8216;%<span class="es0">\&#8217;</span>&#8216;</span>, <span class="re0">$con</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>!<span class="re0">$res</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; throw <span class="kw2">new</span> Exception<span class="br0">&#40;</span><span class="st0">&#8216;Fehler bei Datenbankabfrage. &#8216;</span> . <a href="http://www.php.net/mysql_error"><span class="kw3">mysql_error</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">while</span><span class="br0">&#40;</span><span class="re0">$result</span> = <a href="http://www.php.net/mysql_fetch_row"><span class="kw3">mysql_fetch_row</span></a><span class="br0">&#40;</span><span class="re0">$res</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$tables</span><span class="br0">&#91;</span><span class="br0">&#93;</span> = <span class="re0">$result</span><span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$newTables</span><span class="br0">&#91;</span><span class="br0">&#93;</span> = <a href="http://www.php.net/str_replace"><span class="kw3">str_replace</span></a><span class="br0">&#40;</span><span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st0">&#8216;tableprefix&#8217;</span><span class="br0">&#93;</span>, <span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st0">&#8216;newtableprefix&#8217;</span><span class="br0">&#93;</span>, <span class="re0">$result</span><span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$numTables</span> = <a href="http://www.php.net/count"><span class="kw3">count</span></a><span class="br0">&#40;</span><span class="re0">$tables</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><span class="re0">$numTables</span> &gt; <span class="nu0">0</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echoOk<span class="br0">&#40;</span><span class="re0">$numTables</span> . <span class="st0">&#8216; Tabellen mit Table_Prefix <span class="es0">\&#8217;</span>&#8216;</span> . <a href="http://www.php.net/htmlentities"><span class="kw3">htmlentities</span></a><span class="br0">&#40;</span><span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st0">&#8216;tableprefix&#8217;</span><span class="br0">&#93;</span><span class="br0">&#41;</span> . <span class="st0">&#8216;<span class="es0">\&#8217;</span> in Datenbank <span class="es0">\&#8217;</span>&#8216;</span> . <a href="http://www.php.net/htmlentities"><span class="kw3">htmlentities</span></a><span class="br0">&#40;</span><span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st0">&#8216;database&#8217;</span><span class="br0">&#93;</span><span class="br0">&#41;</span> . <span class="st0">&#8216;<span class="es0">\&#8217;</span> gefunden.&#8217;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; throw <span class="kw2">new</span> Exception<span class="br0">&#40;</span><span class="st0">&#8216;Keine Tabellen mit Table_Prefix <span class="es0">\&#8217;</span>&#8216;</span> . <a href="http://www.php.net/htmlentities"><span class="kw3">htmlentities</span></a><span class="br0">&#40;</span><span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st0">&#8216;tableprefix&#8217;</span><span class="br0">&#93;</span><span class="br0">&#41;</span> . <span class="st0">&#8216;<span class="es0">\&#8217;</span> gefunden.&#8217;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">foreach</span><span class="br0">&#40;</span><span class="re0">$tables</span> <span class="kw1">as</span> <span class="re0">$num</span> =&gt; <span class="re0">$table</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$res</span> = <a href="http://www.php.net/mysql_query"><span class="kw3">mysql_query</span></a><span class="br0">&#40;</span><span class="st0">&#8216;DROP TABLE IF EXISTS `&#8217;</span> . <span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st0">&#8216;newdatabase&#8217;</span><span class="br0">&#93;</span> . <span class="st0">&#8216;`.`&#8217;</span> . <span class="re0">$newTables</span><span class="br0">&#91;</span><span class="re0">$num</span><span class="br0">&#93;</span> . <span class="st0">&#8216;`&#8217;</span>, <span class="re0">$con</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>!<span class="re0">$res</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; throw <span class="kw2">new</span> Exception<span class="br0">&#40;</span><span class="st0">&#8216;Fehler bei Datenbankabfrage: &#8216;</span> . <a href="http://www.php.net/mysql_error"><span class="kw3">mysql_error</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$res</span> = <a href="http://www.php.net/mysql_query"><span class="kw3">mysql_query</span></a><span class="br0">&#40;</span><span class="st0">&#8216;CREATE TABLE `&#8217;</span> . <span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st0">&#8216;newdatabase&#8217;</span><span class="br0">&#93;</span> . <span class="st0">&#8216;`.`&#8217;</span> . <span class="re0">$newTables</span><span class="br0">&#91;</span><span class="re0">$num</span><span class="br0">&#93;</span> . <span class="st0">&#8216;` LIKE `&#8217;</span> . <span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st0">&#8216;database&#8217;</span><span class="br0">&#93;</span> . <span class="st0">&#8216;`.`&#8217;</span> . <span class="re0">$table</span> . <span class="st0">&#8216;`&#8217;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>!<span class="re0">$res</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; throw <span class="kw2">new</span> Exception<span class="br0">&#40;</span><span class="st0">&#8216;Fehler bei Datenbankabfrage: &#8216;</span> . <a href="http://www.php.net/mysql_error"><span class="kw3">mysql_error</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$res</span> = <a href="http://www.php.net/mysql_query"><span class="kw3">mysql_query</span></a><span class="br0">&#40;</span><span class="st0">&#8216;INSERT INTO `&#8217;</span> . <span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st0">&#8216;database&#8217;</span><span class="br0">&#93;</span> . <span class="st0">&#8216;`.`&#8217;</span> . <span class="re0">$table</span> . <span class="st0">&#8216;` SELECT * FROM `&#8217;</span> . <span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st0">&#8216;newdatabase&#8217;</span><span class="br0">&#93;</span> . <span class="st0">&#8216;`.`&#8217;</span> . <span class="re0">$newTables</span><span class="br0">&#91;</span><span class="re0">$num</span><span class="br0">&#93;</span> . <span class="st0">&#8216;`&#8217;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>!<span class="re0">$res</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; throw <span class="kw2">new</span> Exception<span class="br0">&#40;</span><span class="st0">&#8216;Fehler bei Datenbankabfrage: &#8216;</span> . <a href="http://www.php.net/mysql_error"><span class="kw3">mysql_error</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$process</span> = <a href="http://www.php.net/round"><span class="kw3">round</span></a><span class="br0">&#40;</span><span class="re0">$num</span> / <span class="re0">$numTables</span> * <span class="nu0">100</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><span class="re0">$process</span> &lt; <span class="nu0">10</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$process</span> = <span class="st0">&#8216; &#8216;</span> . <span class="re0">$process</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><span class="re0">$process</span> &lt; <span class="nu0">100</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$process</span> = <span class="st0">&#8216; &#8216;</span> . <span class="re0">$process</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echoOk<span class="br0">&#40;</span><span class="st0">&#8216;['</span> . <span class="re0">$process</span> . <span class="st0">'%] Tabelle <span class="es0">\&#8217;</span>&#8216;</span> . <a href="http://www.php.net/htmlentities"><span class="kw3">htmlentities</span></a><span class="br0">&#40;</span><span class="re0">$table</span><span class="br0">&#41;</span> . <span class="st0">&#8216;<span class="es0">\&#8217;</span> nach <span class="es0">\&#8217;</span>&#8216;</span> . <a href="http://www.php.net/htmlentities"><span class="kw3">htmlentities</span></a><span class="br0">&#40;</span><span class="re0">$newTables</span><span class="br0">&#91;</span><span class="re0">$num</span><span class="br0">&#93;</span><span class="br0">&#41;</span> . <span class="st0">&#8216;<span class="es0">\&#8217;</span> kopiert.&#8217;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; echoOk<span class="br0">&#40;</span><span class="st0">&#8216;[100%] &#8216;</span> . <span class="re0">$numTables</span> . <span class="st0">&#8216; Tabellen kopiert.&#8217;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>!<a href="http://www.php.net/mysql_close"><span class="kw3">mysql_close</span></a><span class="br0">&#40;</span><span class="re0">$con</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; throw <span class="kw2">new</span> Exception<span class="br0">&#40;</span><span class="st0">&#8216;Verbindung mit Server konnte nicht geschlossen werden.&#8217;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echoOk<span class="br0">&#40;</span><span class="st0">&#8216;Verbindung mit Server geschlossen.&#8217;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span> catch<span class="br0">&#40;</span>Exception <span class="re0">$e</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a><span class="br0">&#40;</span><span class="st0">&#8216;[ERROR] &#8216;</span> . <span class="re0">$e</span>-&gt;<span class="me1">getMessage</span><span class="br0">&#40;</span><span class="br0">&#41;</span> . <span class="st0">&quot;<span class="es0">\n</span>&quot;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a><span class="br0">&#40;</span><span class="st0">&#8216;&lt;/pre&gt;&#8217;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span> <span class="kw2">?&gt;</span></div>
</li>
<li class="li1">
<div class="de1">&lt;/body&gt;</div>
</li>
<li class="li1">
<div class="de1">&lt;/html&gt;</div>
</li>
</ol>
</div>
<p>Das Skript zum schnellen Umzug von mysql Tabellen kann auch hier heruntergeladen werden: <a href="http://blog.root-of-all-evil.com/wp-content/uploads/2010/03/dbUmzug.zip">PHP Skript zum schnellen Umzug von mysql Tabellen</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.daslaboratorium.de/2010/php-skript-zum-schnellen-umzug-von-mysql-tabellen-421/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Root Of All Evil Blog</title>
		<link>http://www.daslaboratorium.de/2010/root-of-all-evil-blog-397/</link>
		<comments>http://www.daslaboratorium.de/2010/root-of-all-evil-blog-397/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 13:34:29 +0000</pubDate>
		<dc:creator>Philipp</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Umzug]]></category>

		<guid isPermaLink="false">http://www.daslaboratorium.de/?p=397</guid>
		<description><![CDATA[Ich schreibe ab sofort als Co-Autor im Root Of All Evil Blog:

]]></description>
			<content:encoded><![CDATA[<p>Ich schreibe ab sofort als Co-Autor im <a href="http://blog.root-of-all-evil.com">Root Of All Evil Blog</a>:</p>
<p style="text-align: center;"><a href="http://blog.root-of-all-evil.com"><img class="aligncenter size-full wp-image-398" title="logo" src="http://www.daslaboratorium.de/wp-content/uploads/2010/01/logo.png" alt="logo" width="410" height="86" style="border: 0;" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.daslaboratorium.de/2010/root-of-all-evil-blog-397/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Technology meets Talents</title>
		<link>http://www.daslaboratorium.de/2009/technology-meets-talents-367/</link>
		<comments>http://www.daslaboratorium.de/2009/technology-meets-talents-367/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 22:04:32 +0000</pubDate>
		<dc:creator>Philipp</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Reallife]]></category>
		<category><![CDATA[telekom]]></category>
		<category><![CDATA[tmt]]></category>

		<guid isPermaLink="false">http://www.daslaboratorium.de/?p=367</guid>
		<description><![CDATA[Ich bin morgen auf der Technology meets Talents in München. Und ich werde darüber bloggen, schließlich muss mein Blog von den Toten auferstehen. Versteht das also als Vorwarnung. Gibt es eigentlich Zogs &#8211; Zombie-Blogs?
]]></description>
			<content:encoded><![CDATA[<p>Ich bin morgen auf der Technology meets Talents in München. Und ich werde darüber bloggen, schließlich muss mein Blog von den Toten auferstehen. Versteht das also als Vorwarnung. Gibt es eigentlich Zogs &#8211; Zombie-Blogs?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.daslaboratorium.de/2009/technology-meets-talents-367/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Agenturfundus &#8211; The power of wordpress</title>
		<link>http://www.daslaboratorium.de/2009/agenturfundus-the-power-of-wordpress-337/</link>
		<comments>http://www.daslaboratorium.de/2009/agenturfundus-the-power-of-wordpress-337/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 09:42:09 +0000</pubDate>
		<dc:creator>Philipp</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Agenturfundus]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.daslaboratorium.de/?p=337</guid>
		<description><![CDATA[Ganz frisch, ganz neu: der Agenturfundus. Und so sieht er aus:

So. entwickelt habe ich das ganze. Der Flash-Header kommt von Nikolai Bockholt. Mike John Otto hat die Photoshop-PSD rausgehauen. Und das tolle ist: Das ganze läuft mit einem Wordpress System.Hassle-Free backend.
Die Problematik, die es dabei zu umschiffen gilt, wird bei der Betrachtung der Artikelseiten klar. [...]]]></description>
			<content:encoded><![CDATA[<p>Ganz frisch, ganz neu: <a href="http://www.agenturfundus.de" target="_blank">der Agenturfundus</a>. Und so sieht er aus:</p>
<p><a href="http://www.agenturfundus.de"><img class="aligncenter size-thumbnail wp-image-338" title="2009-08-20_1018" src="http://www.daslaboratorium.de/wp-content/uploads/2009/08/2009-08-20_1018-526x395.png" alt="2009-08-20_1018" width="526" height="395" /></a></p>
<p>So. entwickelt habe ich das ganze. Der Flash-Header kommt von <a href="http://blog.advanced-users.de" target="_blank">Nikolai Bockholt</a>. <a href="http://www.stereoplastic.com/stereoblog/" target="_blank">Mike John Otto</a> hat die Photoshop-PSD rausgehauen. Und das tolle ist: Das ganze läuft mit einem Wordpress System.Hassle-Free backend.</p>
<p>Die Problematik, die es dabei zu umschiffen gilt, wird bei der Betrachtung der Artikelseiten klar. Es gibt eine Slideshow auf den Artikelseiten. Sie basiert auf einfachem JavaScript in Kombination mit dem mootools  Framework.</p>
<p><span id="more-337"></span></p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="526" height="295" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.daslaboratorium.de/wp-content/uploads/2009/08/Agenturfundus_-_Slideshow.swf" /><embed type="application/x-shockwave-flash" width="526" height="295" src="http://www.daslaboratorium.de/wp-content/uploads/2009/08/Agenturfundus_-_Slideshow.swf"></embed></object></p>
<p>Damit diese Slideshow erstellt werden kann, müssen die Bilder im Artikel aber extrahiert und in eine Liste geschrieben werden. Diese Liste lasse ich einfach bei Klick auf zurück / weiter in der Slideshow hoch und runterfahren. Wordpress stellt eine Funktion zur Verfügung um Medienobjekte aus einem Artikel zu holen. So sieht das zB. bei Agenturfundus aus:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">&lt;?php</span> <span class="re0">$att</span> = get_posts<span class="br0">&#40;</span><a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st0">&#8216;post_type&#8217;</span> =&gt; <span class="st0">&#8216;attachment&#8217;</span>, <span class="st0">&#8216;post_status&#8217;</span> =&gt; <span class="kw2">null</span>, <span class="st0">&#8216;post_parent&#8217;</span> =&gt; <span class="re0">$post</span>-&gt;<span class="me1">ID</span><span class="br0">&#41;</span><span class="br0">&#41;</span>; <span class="re0">$numatt</span> = <a href="http://www.php.net/count"><span class="kw3">count</span></a><span class="br0">&#40;</span><span class="re0">$att</span><span class="br0">&#41;</span>; <span class="kw2">?&gt;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">&lt;?php</span> <span class="kw1">for</span><span class="br0">&#40;</span><span class="re0">$i</span> = <span class="nu0">0</span>; <span class="re0">$i</span>&lt;<span class="re0">$numatt</span>; <span class="re0">$i</span>++<span class="br0">&#41;</span>: <span class="kw2">?&gt;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;&lt;li&gt;&lt;?php <a href="http://www.php.net/echo"><span class="kw3">echo</span></a><span class="br0">&#40;</span>wp_get_attachment_image<span class="br0">&#40;</span><span class="re0">$att</span><span class="br0">&#91;</span><span class="re0">$i</span><span class="br0">&#93;</span>-&gt;<span class="me1">ID</span>, <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st0">&#8216;540&#8242;</span>, <span class="st0">&#8216;310&#8242;</span><span class="br0">&#41;</span>, <span class="kw2">false</span><span class="br0">&#41;</span><span class="br0">&#41;</span>; ?&gt;&lt;/li&gt;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">&lt;?php</span> <span class="kw1">endfor</span>; <span class="kw2">?&gt;</span></div>
</li>
</ol>
</div>
<p>Mit der Funktion <a href="http://codex.wordpress.org/Function_Reference/get_post" target="_blank">get_posts()</a> und dem passenden Argument für &#8220;post-type&#8221; (attachment) zieht er mir nur die Attachment-IDs für die $post-&gt;ID, die ich für post_parent ebenfalls beim Funktionsaufruf mitgebe. Die $post-&gt;ID stammt aus der Wordpress-Loop, in der ich mich ja ohnehin befinde. Beim Schreiben der Liste muss ich nur noch auf <a href="http://codex.wordpress.org/Function_Reference/wp_get_attachment_image" target="_blank">wp_get_attachment_image()</a> auf die Attachment-IDs anwenden um das Bild in der passenden Größe auszugeben. Praktischerweise gibt mir diese Funktion gleich sauberes HTML zurück, dass ich nur noch schreiben muss. Fertig.</p>
<p>Damit die Bilder des Artikels aber nicht zusammen mit dem Text des Artikels rechts neben der Slideshow ausgegeben werden, behelfe ich mich folgenden Tricks: Ich setze beim Erstellen eines Artikels zunächst alle Bilder und dann einen more-Tag (&#8220;Read the rest of this entry &gt;&#8221;). Beim Ausgeben der &#8220;Artikelbeschreibung&#8221; neben der Slideshow schreibe ich also nur den Text, der nach dem more-Tag kommt. So sieht das aus:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&lt;div&gt;</div>
</li>
<li class="li1">
<div class="de1">&lt;h2&gt;&lt;?php the_date<span class="br0">&#40;</span><span class="st0">&#8216;d.m.Y&#8217;</span><span class="br0">&#41;</span>; <span class="kw2">?&gt;</span>: <span class="kw2">&lt;?php</span> the_title<span class="br0">&#40;</span><span class="br0">&#41;</span>; ?&gt;&lt;/h2&gt;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">&lt;?php</span> the_content<span class="br0">&#40;</span><span class="st0">&#8221;</span>, <span class="kw2">true</span><span class="br0">&#41;</span>; <span class="kw2">?&gt;</span></div>
</li>
<li class="li1">
<div class="de1">&lt;/div&gt;</div>
</li>
</ol>
</div>
<p>Das &#8220;true&#8221; im Aufruf von <a href="http://codex.wordpress.org/Template_Tags/the_content" target="_blank">the_content()</a> bewirkt, dass alles vor dem more-Tag versteckt wird. So einfach ist das. Man muss nur erstmal die Lösung finden.</p>
<p>Für die Bilder auf der Startseite, die übrigens eine fixe größe haben, verwende ich folgendes:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&lt;img src=<span class="st0">&quot;&lt;?php $att = get_posts(array(&#8216;post_type&#8217; =&gt; &#8216;attachment&#8217;,'numberposts&#8217; =&gt; 1,&#8217;post_status&#8217; =&gt; null,&#8217;post_parent&#8217; =&gt; $post-&gt;ID)); echo(wp_get_attachment_thumb_url($att[0]-&gt;ID)); ?&gt;&quot;</span> width=<span class="st0">&quot;248px&quot;</span> height=<span class="st0">&quot;104px&quot;</span> alt=<span class="st0">&quot;&lt;?php the_title(); ?&gt;&quot;</span> /&gt;</div>
</li>
</ol>
</div>
<p>Aber das nur als kleines Leckerli.</p>
<p>Verbesserungsvorschlage? Dazu sind die Kommentare da.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.daslaboratorium.de/2009/agenturfundus-the-power-of-wordpress-337/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>#spreadingtherumour</title>
		<link>http://www.daslaboratorium.de/2009/spreadingtherumour-308/</link>
		<comments>http://www.daslaboratorium.de/2009/spreadingtherumour-308/#comments</comments>
		<pubDate>Sat, 01 Aug 2009 21:12:02 +0000</pubDate>
		<dc:creator>Philipp</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Medienwelt]]></category>
		<category><![CDATA[qolors.net]]></category>

		<guid isPermaLink="false">http://www.daslaboratorium.de/?p=308</guid>
		<description><![CDATA[Ich hatte es ja schon einmal angemerkt: Im Moment bin ich fleißig dabei zusammen mit den Jungs vom hundertmarktblog ein etwas größeres Projekt aufzubauen. Und dieses Projekt hat jetzt einen eigenen &#8220;developers Blog&#8220;. Also: vorbei schauen und sich schonmal auf qolors.net freuen.
]]></description>
			<content:encoded><![CDATA[<p>Ich hatte es ja schon einmal angemerkt: Im Moment bin ich fleißig dabei zusammen mit den Jungs vom <a href="http://www.hundertmarkblog.de">hundertmarktblog</a> ein etwas größeres Projekt aufzubauen. Und dieses Projekt hat jetzt einen eigenen &#8220;<a href="http://blog.qolors.net">developers Blog</a>&#8220;. Also: vorbei schauen und sich schonmal auf <a href="http://www.qolors.net">qolors.net</a> freuen.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.daslaboratorium.de/2009/spreadingtherumour-308/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Followfriday für Blogs</title>
		<link>http://www.daslaboratorium.de/2009/followfriday-fur-blogs-304/</link>
		<comments>http://www.daslaboratorium.de/2009/followfriday-fur-blogs-304/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 10:14:01 +0000</pubDate>
		<dc:creator>Philipp</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Medienwelt]]></category>
		<category><![CDATA[netzrecht]]></category>

		<guid isPermaLink="false">http://www.daslaboratorium.de/?p=304</guid>
		<description><![CDATA[Trackbacks und Linksharing sind was feines. Man macht seinen eigenen Blog bekannt und verweist seine Besucher auf empfohlene Blogs. Und umso mehr Links mein Blog von Außerhalb erhält, desto mehr Besucher finden sich. Ich bin ja ein netter Mensch und ich helfe gerne, wo ich helfen kann, insbesondere dann, wenn ich Ideen und Projekte nur [...]]]></description>
			<content:encoded><![CDATA[<p>Trackbacks und Linksharing sind was feines. Man macht seinen eigenen Blog bekannt und verweist seine Besucher auf empfohlene Blogs. Und umso mehr Links mein Blog von Außerhalb erhält, desto mehr Besucher finden sich. Ich bin ja ein netter Mensch und ich helfe gerne, wo ich helfen kann, insbesondere dann, wenn ich Ideen und Projekte nur unterstützen kann. (Stichwort <a href="http://www.qolors.net" target="_blank">qolors.net</a>)</p>
<p>Ein Projekt, dass mir besonders gefällt ist <a href="http://www.netzrecht.org" target="_blank">netzrecht.org</a> &#8211; der Netzrecht Blog von <a href="http://twitter.com/eha" target="_blank">Sebastian Ehrhardt</a>. Und der Typ weiß, wie man Links erhält und auch noch etwas zurück gibt. Zugegeben, Verlosungen unter Retweetern, Followern, Kommentatoren oder Trackbackern (uh, ein Neologismus made by Philipp) ist nicht neu. Aber wir wollen ja mal nicht so sein.</p>
<p>Sebastian verlost drei Exemplare des Films &#8220;Meine Daten und ich&#8221;. Also, hier der Link auf Sebastians Blog: <a href="http://www.netzrecht.org" target="_self">www.netzrecht.org</a> Lesen!</p>
<p><strong>Update: Ich habe gewonnen! <img src='http://www.daslaboratorium.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.daslaboratorium.de/2009/followfriday-fur-blogs-304/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Aktuelles</title>
		<link>http://www.daslaboratorium.de/2009/aktuelles-292/</link>
		<comments>http://www.daslaboratorium.de/2009/aktuelles-292/#comments</comments>
		<pubDate>Sat, 11 Jul 2009 16:44:48 +0000</pubDate>
		<dc:creator>Philipp</dc:creator>
				<category><![CDATA[Allgemeines]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[qolors]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://www.daslaboratorium.de/?p=292</guid>
		<description><![CDATA[Weheartit.com ist wohl tot. Scheiß egal&#8230;. Aber das nur mal so am Rande.
Ich habe gestern meine Domains, Emails, Blogs etc. auf einen neuen schönen vServer umgezogen. Habe ich mir gar nicht so leicht vorgestellt. Aber es war wirklich kinderleicht. Lediglich beim DNS-Server gab es ein paar Probleme. Bis die Einträge aktualisiert waren, war zB. daslaboratorium.de [...]]]></description>
			<content:encoded><![CDATA[<p>Weheartit.com ist wohl tot. Scheiß egal&#8230;. Aber das nur mal so am Rande.</p>
<p>Ich habe gestern meine Domains, Emails, Blogs etc. auf einen neuen schönen vServer umgezogen. Habe ich mir gar nicht so leicht vorgestellt. Aber es war wirklich kinderleicht. Lediglich beim DNS-Server gab es ein paar Probleme. Bis die Einträge aktualisiert waren, war zB. daslaboratorium.de nur unter http://daslaboratorium.de und nicht unter http://www.daslaboratorium.de erreichbar.</p>
<p>Großer Vorteil des neuen Servers: Er ist jetzt auch tauglich für ein etwas größeres Projekt, das demnächst gelaunched wird. Exklusive sneak-peaks gibt es übrigens in unregelmäßigen Abständen unter <a href="http://www.qolors.net" target="_blank">www.qolors.net</a>. Der neue Server bietet mir 30Gig Festplattenspeicher, den ich definitv brauchen werde. Außerdem gibts unlimited Traffic und 1Gig Ram garantiert zu jeder Zeit. Je nach Auslastung der auf der gleichen Hardware laufenden Server sind bis zu vier Gigabyte drin. Und was ich bis jetzt so aus meinen Serverlogs erkennen kann, ist der volle Speicher zu 90% der Zeit verfügbar. Dazu gibts Vollzugriff per SSH, Webstatistiken usw. usf. Unschlagbar günstig für 14,90€/Monat.</p>
<p>So, genug geprotzt. Wie gehts euch so? <img src='http://www.daslaboratorium.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.daslaboratorium.de/2009/aktuelles-292/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Meine Webseite vor fünf Jahren</title>
		<link>http://www.daslaboratorium.de/2009/meine-webseite-vor-funf-jahren-267/</link>
		<comments>http://www.daslaboratorium.de/2009/meine-webseite-vor-funf-jahren-267/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 15:28:07 +0000</pubDate>
		<dc:creator>Philipp</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Medienwelt]]></category>
		<category><![CDATA[Archiv]]></category>
		<category><![CDATA[archive.org]]></category>
		<category><![CDATA[Webseite]]></category>

		<guid isPermaLink="false">http://www.daslaboratorium.de/?p=267</guid>
		<description><![CDATA[Ich bin mal wieder auf archive.org unterwegs gewesen und habe einfach mal meine alte Webseite gesucht: So sah meine Webseite vor fünf Jahren aus: www.ptnplanet.de.vu (die Bilder wurden leider erst in der letzten Version gespeichert: Link).
Eigentlich ganz lustig, was ich damals schon so gebastelt habe. Und irgendwie befremdlich. Damals hatte ich noch mit Visual Basic [...]]]></description>
			<content:encoded><![CDATA[<p>Ich bin mal wieder auf <a href="http://web.archive.org/web/*/http://www.ptnplanet.de.vu" target="_blank">archive.org</a> unterwegs gewesen und habe einfach mal meine alte Webseite gesucht: So sah meine Webseite vor fünf Jahren aus: <a href="http://web.archive.org/web/20041112010453/http://www.ptnplanet.de.vu/" target="_blank">www.ptnplanet.de.vu</a> (die Bilder wurden leider erst in der letzten Version gespeichert: <a href="http://web.archive.org/web/20060108102618/http://www.ptnplanet.de.vu/" target="_blank">Link</a>).</p>
<p>Eigentlich ganz lustig, was ich damals schon so gebastelt habe. Und irgendwie befremdlich. Damals hatte ich noch mit Visual Basic und Netzwerkanwendungen unter Verwendung von Winsock rumgespielt. Einen kleinen Fun-Trojaner gebastelt und meinen Bruder geärgert&#8230; Hachja, das waren noch Zeiten.</p>
<p>Und auch daslaboratorium.de (die Domain besitze ich seit 2007) ist schon auf archive.org <a href="http://web.archive.org/web/*/http://www.daslaboratorium.de" target="_blank">zu finden</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.daslaboratorium.de/2009/meine-webseite-vor-funf-jahren-267/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Leute, ich weiß&#8230;</title>
		<link>http://www.daslaboratorium.de/2009/leute-ich-weis-228/</link>
		<comments>http://www.daslaboratorium.de/2009/leute-ich-weis-228/#comments</comments>
		<pubDate>Tue, 19 May 2009 12:09:53 +0000</pubDate>
		<dc:creator>Philipp</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Medienwelt]]></category>
		<category><![CDATA[LastFM]]></category>
		<category><![CDATA[Musik]]></category>
		<category><![CDATA[Widget]]></category>

		<guid isPermaLink="false">http://www.daslaboratorium.de/?p=228</guid>
		<description><![CDATA[&#8230; ich vernachlässige meinen Blog. Ich gelobe hiermit Besserung. Und bis dahin, vertreibt euch die Zeit mit meiner LastFM-Musiksammlung: www.lastfm.de/ptnplanet
Oder seht euch das hier an:

]]></description>
			<content:encoded><![CDATA[<p>&#8230; ich vernachlässige meinen Blog. Ich gelobe hiermit Besserung. Und bis dahin, vertreibt euch die Zeit mit meiner LastFM-Musiksammlung: www.lastfm.de/ptnplanet</p>
<p>Oder seht euch das hier an:</p>
<p><object width="527" height="351" data="http://vimeo.com/moogaloop.swf?clip_id=2860622&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1" type="application/x-shockwave-flash"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=2860622&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1" /></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.daslaboratorium.de/2009/leute-ich-weis-228/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
