<?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>Blackbams Blog</title>
	<atom:link href="http://www.blackbam.at/blackbams-blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.blackbam.at/blackbams-blog</link>
	<description>development - digital arts - internet</description>
	<lastBuildDate>Tue, 07 Feb 2012 19:09:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Basic Ajax Skeleton Code</title>
		<link>http://www.blackbam.at/blackbams-blog/2012/02/07/basic-ajax-skeleton-code/</link>
		<comments>http://www.blackbam.at/blackbams-blog/2012/02/07/basic-ajax-skeleton-code/#comments</comments>
		<pubDate>Tue, 07 Feb 2012 08:26:01 +0000</pubDate>
		<dc:creator>Blackbam</dc:creator>
				<category><![CDATA[JavaScript / Ajax]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[skeleton]]></category>

		<guid isPermaLink="false">http://www.blackbam.at/blackbams-blog/?p=1848</guid>
		<description><![CDATA[Nothing new, nothing special... just the working code of a basic Ajax skeleton, as this has to be copied and pasted that often. This example shows an application similar to Google suggest, which searches related values, whenever a key is pressed.]]></description>
			<content:encoded><![CDATA[<p>Nothing new, nothing special&#8230; just the working code of a basic Ajax skeleton, as this has to be copied and pasted that often. This example shows an application similar to Google suggest, which searches related values, whenever a key is pressed.<br/><br/><br />
Note: Since jQuery is that popular today, it is possibly better to use this (see <a href="http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery#Rate_me:_Using_Ajax" title="JQuery Ajax Tutorial">jQuery Ajax Tutorial</a>).<br/></p>
<div class="code_title">index.html &#8211; function call and result representation</div>
<div class="geshi no html4strict"><span class="sc0">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;</span><br />
<span class="sc2"><span class="kw2">&lt;html</span> xmlns<span class="sy0">=</span><span class="st0">&quot;http://www.w3.org/1999/xhtml&quot;</span><span class="kw2">&gt;</span></span><br />
<span class="sc2"><span class="kw2">&lt;head&gt;</span></span><br />
<span class="sc2"><span class="kw2">&lt;meta</span> <span class="kw3">http-equiv</span><span class="sy0">=</span><span class="st0">&quot;Content-Type&quot;</span> <span class="kw3">content</span><span class="sy0">=</span><span class="st0">&quot;text/html; charset=utf-8&quot;</span> <span class="sy0">/</span><span class="kw2">&gt;</span></span><br />
<span class="sc2"><span class="kw2">&lt;title&gt;</span></span>Ajax test<span class="sc2"><span class="kw2">&lt;/title&gt;</span></span><br />
<span class="sc2"><span class="kw2">&lt;script</span> <span class="kw3">type</span><span class="sy0">=</span><span class="st0">&quot;text/javascript&quot;</span> <span class="kw3">src</span><span class="sy0">=</span><span class="st0">&quot;ajax.js&quot;</span><span class="kw2">&gt;</span></span><span class="sc2"><span class="kw2">&lt;/script&gt;</span></span><br />
<span class="sc2"><span class="kw2">&lt;/head&gt;</span></span></p>
<p><span class="sc2"><span class="kw2">&lt;body&gt;</span></span><br />
<span class="sc2"><span class="kw2">&lt;input</span> <span class="kw3">type</span><span class="sy0">=</span><span class="st0">&quot;text&quot;</span> <span class="kw3">onkeyup</span><span class="sy0">=</span><span class="st0">&quot;AjaxRequest(this.value);&quot;</span> <span class="sy0">/</span><span class="kw2">&gt;</span></span><span class="sc2"><span class="kw2">&lt;br</span><span class="sy0">/</span><span class="kw2">&gt;</span></span><br />
<span class="sc2"><span class="kw2">&lt;p</span> <span class="kw3">id</span><span class="sy0">=</span><span class="st0">&quot;result&quot;</span><span class="kw2">&gt;</span></span><span class="sc2"><span class="kw2">&lt;/p&gt;</span></span><br />
<span class="sc2"><span class="kw2">&lt;/body&gt;</span></span><br />
<span class="sc2"><span class="kw2">&lt;/html&gt;</span></span></div>
<p><br/></p>
<div class="code_title">ajax.js &#8211; request, response and data processing</div>
<div class="geshi no javascript"><span class="kw2">var</span> XMLHTTP = <span class="kw2">null</span>;</p>
<p><span class="kw2">function</span> AjaxRequest<span class="br0">&#40;</span>compString<span class="br0">&#41;</span> <span class="br0">&#123;</span></p>
<p><span class="co1">// XMLHTTP-Request Objekt erzeugen, dabei auf Browserkonformität achten</span><br />
&nbsp;<span class="kw1">if</span><span class="br0">&#40;</span>window.<span class="me1">XMLHttpRequest</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; XMLHTTP = <span class="kw2">new</span> XMLHttpRequest<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp;<span class="br0">&#125;</span> <span class="kw1">else</span> <span class="kw1">if</span><span class="br0">&#40;</span>window.<span class="me1">ActiveXObject</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; <span class="kw1">try</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp;XMLHTTP = <span class="kw2">new</span> ActiveXObject<span class="br0">&#40;</span><span class="st0">&quot;Msxml2.XMLHTTP&quot;</span><span class="br0">&#41;</span>;<br />
&nbsp; <span class="br0">&#125;</span> <span class="kw1">catch</span><span class="br0">&#40;</span>ex<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp;<span class="kw1">try</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; XMLHTTP = <span class="kw2">new</span> ActiveXObject<span class="br0">&#40;</span><span class="st0">&quot;Microsoft.XMLHTTP&quot;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp;<span class="br0">&#125;</span> <span class="kw1">catch</span><span class="br0">&#40;</span>ex<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp;<span class="br0">&#125;</span><br />
&nbsp; <span class="br0">&#125;</span><br />
&nbsp;<span class="br0">&#125;</span><br />
&nbsp;<br />
&nbsp;XMLHTTP.<span class="kw3">open</span><span class="br0">&#40;</span><span class="st0">&quot;GET&quot;</span>,<span class="st0">&quot;test.php?compString=&quot;</span>+compString<span class="br0">&#41;</span>;<br />
&nbsp;XMLHTTP.<span class="me1">onreadystatechange</span> = MyRequestExecute;<br />
&nbsp;XMLHTTP.<span class="me1">send</span><span class="br0">&#40;</span><span class="kw2">null</span><span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span></p>
<p><span class="co1">// wird jedes mal aufgerufen, wenn der XMLHTTP-Request eine neue Stufe erreicht, bei 4 ist die Antwort des Servers eingetroffen</span><br />
<span class="kw2">function</span> MyRequestExecute<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp;<span class="co1">// responseText als Javascript-String, responseXML als Javascript XML-DOM-Element, status Statuscode, statusText des. Beschreibung</span><br />
&nbsp;<span class="kw1">if</span><span class="br0">&#40;</span>XMLHTTP.<span class="me1">readyState</span> == <span class="nu0">4</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; document.<span class="me1">getElementById</span><span class="br0">&#40;</span><span class="st0">&quot;result&quot;</span><span class="br0">&#41;</span>.<span class="me1">innerHTML</span> = XMLHTTP.<span class="me1">responseText</span>;<br />
&nbsp;<span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
<p><br/></p>
<p>The server side</p>
<p><br/></p>
<div class="code_title">test.php</div>
<div class="geshi no php"><span class="kw2">&lt;?php</span><br />
<span class="kw1">require_once</span><span class="br0">&#40;</span><span class="st0">&#39;config.inc.php&#39;</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p><span class="co1">// Datenbankverbindung</span><br />
try <span class="br0">&#123;</span><br />
&nbsp;<span class="re1">$db</span> <span class="sy0">=</span> <span class="kw2">new</span> PDO<span class="br0">&#40;</span><span class="st0">&#39;mysql:host=&#39;</span><span class="sy0">.</span>DB_HOST<span class="sy0">.</span><span class="st0">&#39;;dbname=&#39;</span><span class="sy0">.</span>DB_NAME<span class="sy0">,</span> DB_USER<span class="sy0">,</span> DB_PASSWORD<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<br />
&nbsp;<span class="co1">//mysql-Abfrage</span><br />
&nbsp;<span class="re1">$sql</span> <span class="sy0">=</span> <span class="st0">&quot;SELECT * FROM tags WHERE username = &#39;&quot;</span><span class="sy0">.</span><span class="re1">$_GET</span><span class="br0">&#91;</span><span class="st0">&#39;compString&#39;</span><span class="br0">&#93;</span><span class="sy0">.</span><span class="st0">&quot;&#39;&quot;</span><span class="sy0">;</span> <br />
&nbsp;<br />
&nbsp;<span class="re1">$horst</span> <span class="sy0">=</span> <span class="re1">$db</span><span class="sy0">-&gt;</span><span class="me1">query</span><span class="br0">&#40;</span><span class="re1">$sql</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<br />
<span class="br0">&#125;</span> catch <span class="br0">&#40;</span>Exception <span class="re1">$e</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw3">echo</span> <span class="st0">&#39;Verbindungsaufbau fehlgeschlagen: &#39;</span><span class="sy0">,</span> &nbsp;<span class="re1">$e</span><span class="sy0">-&gt;</span><span class="me1">getMessage</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">,</span> <span class="st0">&quot;<span class="es0">\n</span>&quot;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span></p>
<p><span class="kw3">echo</span> <span class="re1">$_GET</span><span class="br0">&#91;</span><span class="st0">&#39;compString&#39;</span><span class="br0">&#93;</span><span class="sy0">.</span><span class="st0">&quot;&lt; pre &gt;&quot;</span><span class="sy0">.</span><span class="re1">$horst</span><span class="sy0">.</span><span class="st0">&quot;&lt;/ &nbsp;pre &gt;&quot;</span><span class="sy0">;</span><br />
<span class="kw2">?&gt;</span></div>
<div class="code_title">config.inc.php</div>
<div class="geshi no php"><span class="kw2">&lt;?php</span><br />
<span class="co1">// Definition der Konstanten</span><br />
<span class="kw3">define</span><span class="br0">&#40;</span><span class="st0">&#39;DB_USER&#39;</span><span class="sy0">,</span><span class="st0">&#39;****&#39;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="kw3">define</span><span class="br0">&#40;</span><span class="st0">&#39;DB_PASSWORD&#39;</span><span class="sy0">,</span><span class="st0">&#39;****&#39;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="kw3">define</span><span class="br0">&#40;</span><span class="st0">&#39;DB_HOST&#39;</span><span class="sy0">,</span><span class="st0">&#39;****&#39;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="kw3">define</span><span class="br0">&#40;</span><span class="st0">&#39;DB_NAME&#39;</span><span class="sy0">,</span><span class="st0">&#39;****&#39;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="kw2">?&gt;</span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.blackbam.at/blackbams-blog/2012/02/07/basic-ajax-skeleton-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress 3.3 &#8211; TinyMCE Advanced &#8211; qTranslate &#8211; fix style problems</title>
		<link>http://www.blackbam.at/blackbams-blog/2012/01/28/wordpress-3-3-tinymce-advanced-qtranslate-fix-style-problems/</link>
		<comments>http://www.blackbam.at/blackbams-blog/2012/01/28/wordpress-3-3-tinymce-advanced-qtranslate-fix-style-problems/#comments</comments>
		<pubDate>Sat, 28 Jan 2012 18:24:46 +0000</pubDate>
		<dc:creator>Blackbam</dc:creator>
				<category><![CDATA[WP Scripts]]></category>

		<guid isPermaLink="false">http://www.blackbam.at/blackbams-blog/?p=1791</guid>
		<description><![CDATA[Recently I had to fix a bunch of really annoying problems with this combination. Duplicated contents, automatically inserted line breaks and problems with the custom styles for TinyMCE really caused me to hate these Plugins. The reason for most of the problems is qTranslate though. &#160; If you experience similar problems, the following &#8220;library&#8221; will [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I had to fix a bunch of really annoying problems with this combination. Duplicated contents, automatically inserted line breaks and problems with the custom styles for TinyMCE really caused me to hate these Plugins. The reason for most of the problems is qTranslate though.</p>
<p>&nbsp;</p>
<p>If you experience similar problems, the following &#8220;library&#8221; will be helpful for you. It contains a lot of functions to fix problems with this combination and to customize your backend the way you need it. Do not forget to remove the slashes in front of the required filter tags, otherwise the functions are not applied. Improvement ideas are welcome.</p>
<p>&nbsp;</p>
<p><strong>Download the library: <a href='http://www.blackbam.at/blackbams-blog/2012/01/28/wordpress-3-3-tinymce-advanced-qtranslate-fix-style-problems/lib_visual_editor/' rel='attachment wp-att-1830'>lib_visual_editor</a></strong></p>
<p>&nbsp;</p>
<p>Code (<span style="color:#f44;">NOTE: GeSHi prints the code with some little errors here, please download the .zip file. Thanks.</span>)</p>
<p>&nbsp;</p>
<div class="geshi no php"><span class="co1">// usual way, try it out</span><br />
add_editor_style<span class="br0">&#40;</span><span class="st0">&#39;editor-style.css&#39;</span><span class="br0">&#41;</span><span class="sy0">;</span> <br />
 <br />
<span class="co1">// second possibilty &#8211; styles inside editor</span><br />
<span class="co1">//add_filter( &#39;mce_css&#39;, &#39;tinymce_css&#39;,5); </span><br />
 <br />
<span class="kw2">function</span> ses_tinymce_css<span class="br0">&#40;</span><span class="re1">$wp</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
        <span class="re1">$wp</span> <span class="sy0">.=</span> <span class="st0">&#39;,&#39;</span> <span class="sy0">.</span> get_bloginfo<span class="br0">&#40;</span><span class="st0">&#39;stylesheet_url&#39;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
        <span class="kw1">return</span> <span class="re1">$wp</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
 <br />
<span class="coMULTI">/**<br />
 * The hard way &#8211; if other possibilities do not work<br />
 */</span><br />
<span class="co1">//add_filter(&#39;tiny_mce_before_init&#39;, &#39;cisStyles&#39;, 5);</span><br />
<span class="kw2">function</span> cisStyles<span class="br0">&#40;</span><span class="re1">$initialArray</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp;<span class="re1">$modifiedArray</span> <span class="sy0">=</span> <span class="re1">$initialArray</span><span class="sy0">;</span><br />
 <br />
&nbsp;<span class="re1">$modifiedArray</span><span class="br0">&#91;</span><span class="st0">&#39;theme_advanced_styles&#39;</span><span class="br0">&#93;</span> <span class="sy0">.=</span> <span class="st0">&#39;;My Style=mystyle;&#39;</span><span class="sy0">;</span><br />
&nbsp;<span class="co1">//strip first and last character if it matches &quot;;&quot;</span><br />
&nbsp;<span class="re1">$modifiedArray</span><span class="br0">&#91;</span><span class="st0">&#39;theme_advanced_styles&#39;</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="kw3">trim</span><span class="br0">&#40;</span><span class="re1">$modifiedArray</span><span class="br0">&#91;</span><span class="st0">&#39;theme_advanced_styles&#39;</span><span class="br0">&#93;</span><span class="sy0">,</span> <span class="st0">&#39;;&#39;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<span class="kw1">return</span> <span class="re1">$modifiedArray</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
 <br />
<span class="coMULTI">/**<br />
 * Add TinyMCE to multiple Textareas (usually in backend).<br />
 */</span><br />
<span class="co1">//  add_action(&#39;admin_print_footer_scripts&#39;,&#39;my_admin_print_footer_scripts&#39;,99);</span><br />
<span class="kw2">function</span> my_admin_print_footer_scripts<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp;?<span class="sy0">&gt;&lt;</span>script type<span class="sy0">=</span><span class="st0">&quot;text/javascript&quot;</span><span class="sy0">&gt;</span><span class="coMULTI">/* &lt;![CDATA[ */</span><br />
&nbsp; jQuery<span class="br0">&#40;</span><span class="kw2">function</span><span class="br0">&#40;</span>$<span class="br0">&#41;</span><br />
&nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp;<span class="kw2">var</span> i<span class="sy0">=</span><span class="nu0">1</span><span class="sy0">;</span><br />
&nbsp; &nbsp;$<span class="br0">&#40;</span><span class="st0">&#39;.customEditor textarea&#39;</span><span class="br0">&#41;</span><span class="sy0">.</span><span class="kw3">each</span><span class="br0">&#40;</span><span class="kw2">function</span><span class="br0">&#40;</span>e<span class="br0">&#41;</span><br />
&nbsp; &nbsp;<span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw2">var</span> id <span class="sy0">=</span> $<span class="br0">&#40;</span>this<span class="br0">&#41;</span><span class="sy0">.</span>attr<span class="br0">&#40;</span><span class="st0">&#39;id&#39;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
  <br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="sy0">!</span>id<span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp;id <span class="sy0">=</span> <span class="st0">&#39;customEditor-&#39;</span> <span class="sy0">+</span> i<span class="sy0">++;</span><br />
&nbsp; &nbsp; &nbsp;$<span class="br0">&#40;</span>this<span class="br0">&#41;</span><span class="sy0">.</span>attr<span class="br0">&#40;</span><span class="st0">&#39;id&#39;</span><span class="sy0">,</span>id<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
  <br />
&nbsp; &nbsp; tinyMCE<span class="sy0">.</span>execCommand<span class="br0">&#40;</span><span class="st0">&#39;mceAddControl&#39;</span><span class="sy0">,</span> <span class="kw2">false</span><span class="sy0">,</span> id<span class="br0">&#41;</span><span class="sy0">;</span><br />
  <br />
&nbsp; &nbsp;<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<span class="coMULTI">/* ]]&gt; */</span><span class="sy0">&lt;/</span>script<span class="sy0">&gt;&lt;</span>?php<br />
<span class="br0">&#125;</span><br />
 <br />
<span class="coMULTI">/** TinyMCE Advanced and qTranslate &#8211; fix editing bugs */</span><br />
<span class="co1">//add_filter(&#39;htmledit_pre&#39;, &#39;fix_p_around_languagetag&#39;);</span><br />
<span class="co1">//add_filter(&#39;richedit_pre&#39;, &#39;fix_p_around_languagetag&#39;);</span><br />
<span class="kw2">function</span> fix_p_around_languagetag <span class="br0">&#40;</span><span class="re1">$content</span> <span class="sy0">=</span> <span class="st0">&#39;&#39;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp;<span class="re1">$content</span> <span class="sy0">=</span> <span class="kw3">html_entity_decode</span><span class="br0">&#40;</span><span class="re1">$content</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<span class="re1">$content</span> <span class="sy0">=</span> <span class="kw3">str_replace</span><span class="br0">&#40;</span><span class="st0">&quot;&lt;!&#8211;&quot;</span><span class="sy0">,</span> <span class="st0">&quot;&lt;!&#8211;&quot;</span><span class="sy0">,</span> <span class="re1">$content</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<span class="re1">$content</span> <span class="sy0">=</span> <span class="kw3">str_replace</span><span class="br0">&#40;</span><span class="st0">&quot;&#8211;&gt;&quot;</span><span class="sy0">,</span> <span class="st0">&quot;&#8211;&gt;&quot;</span><span class="sy0">,</span> <span class="re1">$content</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<span class="re1">$content</span> <span class="sy0">=</span> <span class="kw3">preg_replace</span><span class="br0">&#40;</span><span class="st0">&quot;/(&#8211;&gt;)(<span class="es0">\s</span>|&amp;nbsp;)*&lt;p&gt;(<span class="es0">\s</span>|&amp;nbsp;)*(&lt;<span class="es0">\/</span>p&gt;)(<span class="es0">\s</span>|&amp;nbsp;)*/&quot;</span><span class="sy0">,</span><span class="st0">&quot;&#8211;&gt;&quot;</span><span class="sy0">,</span><span class="re1">$content</span><span class="br0">&#41;</span><span class="sy0">;</span> <br />
&nbsp;<span class="re1">$content</span> <span class="sy0">=</span> <span class="kw3">htmlentities</span><span class="br0">&#40;</span><span class="re1">$content</span><span class="sy0">,</span>ENT_COMPAT <span class="sy0">|</span> ENT_HTML401<span class="sy0">,</span><span class="st0">&#39;UTF-8&#39;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<span class="kw1">return</span> <span class="re1">$content</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span></div>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.blackbam.at%2Fblackbams-blog%2F2012%2F01%2F28%2Fwordpress-3-3-tinymce-advanced-qtranslate-fix-style-problems%2F&amp;title=WordPress%203.3%20%26%238211%3B%20TinyMCE%20Advanced%20%26%238211%3B%20qTranslate%20%26%238211%3B%20fix%20style%20problems" id="wpa2a_2"><img class="colorbox-1791"  src="http://www.blackbam.at/blackbams-blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.blackbam.at/blackbams-blog/2012/01/28/wordpress-3-3-tinymce-advanced-qtranslate-fix-style-problems/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>(Deutsch) SOPA / PIPA / ACTA und Schutz von Urheberrechten &#8211; eine Grundsatzdiskussion</title>
		<link>http://www.blackbam.at/blackbams-blog/2012/01/28/deutsch-sopa-pipa-acta-und-schutz-von-urheberrechten-eine-grundsatzdiskussion/</link>
		<comments>http://www.blackbam.at/blackbams-blog/2012/01/28/deutsch-sopa-pipa-acta-und-schutz-von-urheberrechten-eine-grundsatzdiskussion/#comments</comments>
		<pubDate>Sat, 28 Jan 2012 16:13:06 +0000</pubDate>
		<dc:creator>Blackbam</dc:creator>
				<category><![CDATA[Netzphilosophie]]></category>
		<category><![CDATA[ACTA]]></category>
		<category><![CDATA[PIPA]]></category>
		<category><![CDATA[SOPA]]></category>

		<guid isPermaLink="false">http://www.blackbam.at/blackbams-blog/?p=1804</guid>
		<description><![CDATA[Sorry, this entry is only available in Deutsch.]]></description>
			<content:encoded><![CDATA[<p>Sorry, this entry is only available in <a href="http://www.blackbam.at/blackbams-blog/de/feed/">Deutsch</a>.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.blackbam.at%2Fblackbams-blog%2F2012%2F01%2F28%2Fdeutsch-sopa-pipa-acta-und-schutz-von-urheberrechten-eine-grundsatzdiskussion%2F&amp;title=%28Deutsch%29%20SOPA%20%2F%20PIPA%20%2F%20ACTA%20und%20Schutz%20von%20Urheberrechten%20%26%238211%3B%20eine%20Grundsatzdiskussion" id="wpa2a_4"><img class="colorbox-1804"  src="http://www.blackbam.at/blackbams-blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.blackbam.at/blackbams-blog/2012/01/28/deutsch-sopa-pipa-acta-und-schutz-von-urheberrechten-eine-grundsatzdiskussion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convert WordPress attachment URLs into file URLs</title>
		<link>http://www.blackbam.at/blackbams-blog/2012/01/10/convert-wordpress-attachment-url-into-file-url-automatically/</link>
		<comments>http://www.blackbam.at/blackbams-blog/2012/01/10/convert-wordpress-attachment-url-into-file-url-automatically/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 20:44:53 +0000</pubDate>
		<dc:creator>Blackbam</dc:creator>
				<category><![CDATA[WP Scripts]]></category>
		<category><![CDATA[url conversion]]></category>

		<guid isPermaLink="false">http://www.blackbam.at/blackbams-blog/?p=1789</guid>
		<description><![CDATA[You do not want to use Attachment-Pages in your WordPress page? Or maybe you installed a gallery Plugin and want to transform all your Attachment URLs into File-URLs now? The following script will do this for you. Just make sure, that all relevant content blocks of your database run through this script. function cis_file_links&#40;$content&#41; &#123; [...]]]></description>
			<content:encoded><![CDATA[<p>You do not want to use Attachment-Pages in your WordPress page? Or maybe you installed a gallery Plugin and want to transform all your Attachment URLs into File-URLs now? The following script will do this for you. Just make sure, that all relevant content blocks of your database run through this script. </p>
<div class="geshi no php"><span class="kw2">function</span> cis_file_links<span class="br0">&#40;</span><span class="re1">$content</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp;<br />
&nbsp;<span class="re1">$content</span> <span class="sy0">=</span> <span class="kw3">stripslashes</span><span class="br0">&#40;</span><span class="re1">$content</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; <br />
&nbsp;<span class="re1">$matches</span> <span class="sy0">=</span> <span class="kw3">array</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<span class="re1">$attachment_urls</span> <span class="sy0">=</span> <span class="kw3">preg_match_all</span><span class="br0">&#40;</span><span class="st0">&quot;/href=<span class="es0">\&quot;</span>([-A-Z0-9+&amp;@#<span class="es0">\/</span>%?=~_|!:,.;]*)<span class="es0">\?</span>attachment_id=([0-9]*)<span class="es0">\&quot;</span>/siU&quot;</span><span class="sy0">,</span><span class="re1">$content</span><span class="sy0">,</span><span class="re1">$matches</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<br />
&nbsp;<span class="re1">$urls</span> <span class="sy0">=</span> <span class="kw3">array</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<span class="kw1">foreach</span><span class="br0">&#40;</span><span class="re1">$matches</span><span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span> <span class="kw1">as</span> <span class="re1">$attachment</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; <span class="kw3">array_push</span><span class="br0">&#40;</span><span class="re1">$urls</span><span class="sy0">,</span>wp_get_attachment_url<span class="br0">&#40;</span><span class="re1">$attachment</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<span class="br0">&#125;</span><br />
&nbsp;<br />
&nbsp;<span class="co1">// something went wrong with geting the attachments</span><br />
&nbsp;<span class="kw1">if</span><span class="br0">&#40;</span><span class="kw3">count</span><span class="br0">&#40;</span><span class="re1">$matches</span><span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">!=</span><span class="kw3">count</span><span class="br0">&#40;</span><span class="re1">$urls</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; <span class="kw1">return</span> <span class="re1">$content</span><span class="sy0">;</span><br />
&nbsp;<span class="br0">&#125;</span><br />
&nbsp;<br />
&nbsp;<span class="kw1">for</span><span class="br0">&#40;</span><span class="re1">$i</span><span class="sy0">=</span><span class="nu0">0</span><span class="sy0">;</span><span class="re1">$i</span><span class="sy0">&lt;</span>count<span class="br0">&#40;</span><span class="re1">$urls</span><span class="br0">&#41;</span><span class="sy0">;</span><span class="re1">$i</span><span class="sy0">++</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; <span class="re1">$repl</span> <span class="sy0">=</span> <span class="st0">&quot;href=<span class="es0">\&quot;</span>&quot;</span><span class="sy0">.</span><span class="re1">$urls</span><span class="br0">&#91;</span><span class="re1">$i</span><span class="br0">&#93;</span><span class="sy0">.</span><span class="st0">&quot;<span class="es0">\&quot;</span>&quot;</span><span class="sy0">;</span><br />
&nbsp; <span class="re1">$content</span> <span class="sy0">=</span> <span class="kw3">preg_replace</span><span class="br0">&#40;</span><span class="st0">&quot;/href=<span class="es0">\&quot;</span>([-A-Z0-9+&amp;@#<span class="es0">\/</span>%?=~_|!:,.;]*)<span class="es0">\?</span>attachment_id=([0-9]*)<span class="es0">\&quot;</span>/siU&quot;</span><span class="sy0">,</span><span class="re1">$repl</span><span class="sy0">,</span><span class="re1">$content</span><span class="sy0">,</span><span class="nu0">1</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<span class="br0">&#125;</span><br />
&nbsp;<br />
&nbsp;<span class="kw1">return</span> <span class="re1">$content</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span></div>
<p>If you want to apply this script to every displayed content, for example, without changing any contents of your database, add this filter to your functions.php:</p>
<div class="geshi no php">add_filter<span class="br0">&#40;</span><span class="st0">&#39;the_content&#39;</span><span class="sy0">,</span><span class="st0">&#39;cis_file_links&#39;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
<p>Improvement ideas are welcome.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.blackbam.at%2Fblackbams-blog%2F2012%2F01%2F10%2Fconvert-wordpress-attachment-url-into-file-url-automatically%2F&amp;title=Convert%20WordPress%20attachment%20URLs%20into%20file%20URLs" id="wpa2a_6"><img class="colorbox-1789"  src="http://www.blackbam.at/blackbams-blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.blackbam.at/blackbams-blog/2012/01/10/convert-wordpress-attachment-url-into-file-url-automatically/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Order WordPress categories by custom meta value</title>
		<link>http://www.blackbam.at/blackbams-blog/2011/10/28/order-categories-by-custom-meta-value/</link>
		<comments>http://www.blackbam.at/blackbams-blog/2011/10/28/order-categories-by-custom-meta-value/#comments</comments>
		<pubDate>Thu, 27 Oct 2011 22:18:15 +0000</pubDate>
		<dc:creator>Blackbam</dc:creator>
				<category><![CDATA[WP Scripts]]></category>
		<category><![CDATA[wordpress categories]]></category>

		<guid isPermaLink="false">http://www.blackbam.at/blackbams-blog/?p=1759</guid>
		<description><![CDATA[This little scripts help ordering WordPress categories by meta values &#8211; a thing which is not integrated into WordPress yet and which costs some time to integrate. 1. Create a meta value (or meta values) for categories to order by To order categories by a meta value the first thing which we have to do [...]]]></description>
			<content:encoded><![CDATA[<p>This little scripts help ordering WordPress categories by meta values &#8211; a thing which is not integrated into WordPress yet and which costs some time to integrate.</p>
<h2>1. Create a meta value (or meta values) for categories to order by</h2>
<p>To order categories by a meta value the first thing which we have to do is to create a custom category meta value to order these (this first script is adapted from <a href="http://en.bainternet.info/2011/wordpress-category-extra-fields">bainternet.com</a>, where it is demonstrated in more detail).</p>
<p>&nbsp;</p>
<div class="geshi no php"><span class="co1">//add extra fields to category edit form hook</span><br />
add_action <span class="br0">&#40;</span> <span class="st0">&#39;add_category_form&#39;</span><span class="sy0">,</span> <span class="st0">&#39;extra_category_fields&#39;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
add_action <span class="br0">&#40;</span> <span class="st0">&#39;edit_category_form_fields&#39;</span><span class="sy0">,</span> <span class="st0">&#39;extra_category_fields&#39;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<br />
<span class="co1">//add extra fields to category edit form callback function</span><br />
<span class="kw2">function</span> extra_category_fields<span class="br0">&#40;</span> <span class="re1">$tag</span> <span class="br0">&#41;</span> <span class="br0">&#123;</span> &nbsp; &nbsp;<span class="co1">//check for existing featured ID</span><br />
&nbsp;<br />
&nbsp; &nbsp; <span class="re1">$t_id</span> <span class="sy0">=</span> <span class="re1">$tag</span><span class="sy0">-&gt;</span><span class="me1">term_id</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="re1">$cat_meta</span> <span class="sy0">=</span> get_option<span class="br0">&#40;</span><span class="st0">&quot;category_$t_id&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="kw2">?&gt;</span><br />
&nbsp;<br />
<span class="sy0">&lt;</span>tr <span class="kw2">class</span><span class="sy0">=</span><span class="st0">&quot;form-field&quot;</span><span class="sy0">&gt;</span><br />
&nbsp;<span class="sy0">&lt;</span>th scope<span class="sy0">=</span><span class="st0">&quot;row&quot;</span> valign<span class="sy0">=</span><span class="st0">&quot;top&quot;</span><span class="sy0">&gt;</span><br />
&nbsp;<span class="sy0">&lt;</span>label <span class="kw1">for</span><span class="sy0">=</span><span class="st0">&quot;cat_order_val&quot;</span><span class="sy0">&gt;&lt;</span>?php _e<span class="br0">&#40;</span><span class="st0">&#39;Category order value&#39;</span><span class="br0">&#41;</span><span class="sy0">;</span> ?<span class="sy0">&gt;&lt;/</span>label<span class="sy0">&gt;&lt;/</span>th<span class="sy0">&gt;</span><br />
&nbsp;<span class="sy0">&lt;</span>td<span class="sy0">&gt;</span><br />
&nbsp; <span class="sy0">&lt;</span>input type<span class="sy0">=</span><span class="st0">&quot;text&quot;</span> name<span class="sy0">=</span><span class="st0">&quot;cat_meta[cat_order_val]&quot;</span> id<span class="sy0">=</span><span class="st0">&quot;cat_order_val&quot;</span> size<span class="sy0">=</span><span class="st0">&quot;3&quot;</span> style<span class="sy0">=</span><span class="st0">&quot;width:20%;&quot;</span> value<span class="sy0">=</span><span class="st0">&quot;&lt;?php echo $cat_meta[&#39;cat_order_val&#39;] ? $cat_meta[&#39;cat_order_val&#39;] : &#39;&#39;; ?&gt;&quot;</span><span class="sy0">&gt;&lt;</span>br <span class="sy0">/&gt;</span><br />
&nbsp; <span class="sy0">&lt;</span>span <span class="kw2">class</span><span class="sy0">=</span><span class="st0">&quot;description&quot;</span><span class="sy0">&gt;&lt;</span>?php _e<span class="br0">&#40;</span><span class="st0">&#39;Enter a numeric value.&#39;</span><span class="br0">&#41;</span><span class="sy0">;</span> ?<span class="sy0">&gt;&lt;/</span>span<span class="sy0">&gt;</span><br />
&nbsp;<span class="sy0">&lt;/</span>td<span class="sy0">&gt;</span><br />
<span class="sy0">&lt;/</span>tr<span class="sy0">&gt;</span><br />
<span class="kw2">&lt;?php</span><br />
&nbsp;<br />
<span class="br0">&#125;</span></p>
<p><span class="co1">// save extra category extra fields hook</span><br />
add_action <span class="br0">&#40;</span> <span class="st0">&#39;edited_category&#39;</span><span class="sy0">,</span> <span class="st0">&#39;save_extra_category_fileds&#39;</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p>&nbsp; &nbsp;<span class="co1">// save extra category extra fields callback function</span><br />
<span class="kw2">function</span> save_extra_category_fileds<span class="br0">&#40;</span> <span class="re1">$term_id</span> <span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp;<br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span> <span class="kw3">isset</span><span class="br0">&#40;</span> <span class="re1">$_POST</span><span class="br0">&#91;</span><span class="st0">&#39;cat_meta&#39;</span><span class="br0">&#93;</span> <span class="br0">&#41;</span> <span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re1">$t_id</span> <span class="sy0">=</span> <span class="re1">$term_id</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re1">$cat_meta</span> <span class="sy0">=</span> get_option<span class="br0">&#40;</span> <span class="st0">&quot;category_$t_id&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re1">$cat_keys</span> <span class="sy0">=</span> <span class="kw3">array_keys</span><span class="br0">&#40;</span><span class="re1">$_POST</span><span class="br0">&#91;</span><span class="st0">&#39;cat_meta&#39;</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">foreach</span> <span class="br0">&#40;</span><span class="re1">$cat_keys</span> <span class="kw1">as</span> <span class="re1">$key</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="kw3">isset</span><span class="br0">&#40;</span><span class="re1">$_POST</span><span class="br0">&#91;</span><span class="st0">&#39;cat_meta&#39;</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="re1">$key</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re1">$cat_meta</span><span class="br0">&#91;</span><span class="re1">$key</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="re1">$_POST</span><span class="br0">&#91;</span><span class="st0">&#39;cat_meta&#39;</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="re1">$key</span><span class="br0">&#93;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//save the option array</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; update_option<span class="br0">&#40;</span> <span class="st0">&quot;category_$t_id&quot;</span><span class="sy0">,</span> <span class="re1">$cat_meta</span> <span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
<h2>2. Order the categories by the created meta value and display these</h2>
<div class="geshi no php"><span class="co1">// get the categories</span><br />
<span class="re1">$categories</span> <span class="sy0">=</span> get_categories<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<br />
<span class="re1">$sortar</span> <span class="sy0">=</span> <span class="kw3">array</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="kw1">foreach</span><span class="br0">&#40;</span><span class="re1">$categories</span> <span class="kw1">as</span> <span class="re1">$ct</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp;<span class="re1">$term_id</span> <span class="sy0">=</span> <span class="re1">$ct</span><span class="sy0">-&gt;</span><span class="me1">term_id</span><span class="sy0">;</span><br />
&nbsp;<span class="re1">$cat_meta</span> <span class="sy0">=</span> get_option<span class="br0">&#40;</span> <span class="st0">&quot;category_$term_id&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<span class="kw3">array_push</span><span class="br0">&#40;</span><span class="re1">$sortar</span><span class="sy0">,</span><span class="kw3">array</span><span class="br0">&#40;</span><span class="kw3">intval</span><span class="br0">&#40;</span><span class="re1">$cat_meta</span><span class="br0">&#91;</span><span class="st0">&#39;cat_order_val&#39;</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">,</span><span class="re1">$ct</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
&nbsp;<br />
<span class="kw3">uasort</span><span class="br0">&#40;</span><span class="re1">$sortar</span><span class="sy0">,</span><span class="kw3">create_function</span><span class="br0">&#40;</span><span class="st0">&#39;$a,$b&#39;</span><span class="sy0">,</span><span class="st0">&#39;return ($a[0]&lt;=$b[0]) ? -1 : 1;&#39;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<br />
<span class="re1">$ordered_categories</span> <span class="sy0">=</span> <span class="kw3">array</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<br />
<span class="kw1">foreach</span><span class="br0">&#40;</span><span class="re1">$sortar</span> <span class="kw1">as</span> <span class="re1">$sor</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp;<span class="kw3">array_push</span><span class="br0">&#40;</span><span class="re1">$ordered_categories</span><span class="sy0">,</span><span class="re1">$sor</span><span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
&nbsp;<br />
<span class="kw1">foreach</span><span class="br0">&#40;</span><span class="re1">$ordered_categories</span> <span class="kw1">as</span> <span class="re1">$oc</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp;<span class="co1">// do whatever you want with your category objects</span><br />
<span class="br0">&#125;</span></div>
<p>Have fun and be free to use these scripts. Improvement ideas are welcome.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.blackbam.at%2Fblackbams-blog%2F2011%2F10%2F28%2Forder-categories-by-custom-meta-value%2F&amp;title=Order%20WordPress%20categories%20by%20custom%20meta%20value" id="wpa2a_8"><img class="colorbox-1759"  src="http://www.blackbam.at/blackbams-blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.blackbam.at/blackbams-blog/2011/10/28/order-categories-by-custom-meta-value/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Determine if a WordPress page or category is in the current ancestor/child tree (inside/outside the loop)</title>
		<link>http://www.blackbam.at/blackbams-blog/2011/10/08/determine-if-a-wordpress-page-or-category-is-in-the-current-ancestorchild-tree-insideoutside-the-loop/</link>
		<comments>http://www.blackbam.at/blackbams-blog/2011/10/08/determine-if-a-wordpress-page-or-category-is-in-the-current-ancestorchild-tree-insideoutside-the-loop/#comments</comments>
		<pubDate>Sat, 08 Oct 2011 20:00:53 +0000</pubDate>
		<dc:creator>Blackbam</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP Scripts]]></category>
		<category><![CDATA[ancestor/child]]></category>
		<category><![CDATA[wordpress categories]]></category>
		<category><![CDATA[wordpress inheritance]]></category>
		<category><![CDATA[wordpress taxonomies]]></category>

		<guid isPermaLink="false">http://www.blackbam.at/blackbams-blog/?p=1722</guid>
		<description><![CDATA[It is a common problem to detect parents or childs of pages and categories in WordPress correctly. The way WordPress stores relationships in hierarchies is not that trivial sometimes, so the results when querying are a bit confusing sometimes. It took some time to determine and optimize functions which do this job good and without faults, and I want to present these. As in this function I prefer working with page IDs, as this is the savest way to identify certain pages. With little changes it should also be possible to use these using e.g. slugs. Both of these functions can be used inside and outside of "the Loop" or loops.]]></description>
			<content:encoded><![CDATA[<p>It is a common problem to detect parents or childs of pages and categories in WordPress correctly. The way WordPress stores relationships in hierarchies is not that trivial sometimes, so the results when querying are a bit confusing sometimes. It took some time to determine and optimize functions which do this job good and without faults, and I want to present these. As in this function I prefer working with page IDs, as this is the savest way to identify certain pages. With little changes it should also be possible to use these using e.g. slugs. Both of these functions can be used inside and outside of &#8220;the Loop&#8221; or loops.</p>
<h2>Check if the current page (or a given page) is in the child tree of a given page</h2>
<p>This function checks if the current page (or a given page, second parameter) is in the child tree of a given page.<br/><br/></p>
<div class="geshi no php"><span class="coMULTI">/* Tests, if a page has got a certain parent anywhere in the ancestor/children tree */</span><br />
<span class="kw2">function</span> is_tree<span class="br0">&#40;</span><span class="re1">$pid</span><span class="sy0">,</span> <span class="re1">$pid2check</span> <span class="sy0">=</span> <span class="nu0">0</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><span class="co1">// $pid = The ID of the page we&#39;re looking for pages underneath</span><br />
&nbsp;<br />
&nbsp;<span class="kw3">global</span> <span class="re1">$post</span><span class="sy0">;</span><br />
&nbsp;<span class="co1">// load details about this page</span><br />
&nbsp;<br />
&nbsp;<span class="co1">// check if we should check two posts independently from the current query</span><br />
&nbsp;<span class="kw1">if</span> <span class="br0">&#40;</span><span class="re1">$pid2check</span> <span class="sy0">&lt;</span> <span class="nu0">1</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; <span class="re1">$pid2check</span> <span class="sy0">=</span> <span class="re1">$post</span> <span class="sy0">-&gt;</span> <span class="me1">ID</span><span class="sy0">;</span><br />
&nbsp;<span class="br0">&#125;</span><br />
&nbsp;<br />
&nbsp;<span class="re1">$anc</span> <span class="sy0">=</span> get_post_ancestors<span class="br0">&#40;</span><span class="re1">$pid2check</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<br />
&nbsp;<span class="kw1">foreach</span> <span class="br0">&#40;</span><span class="re1">$anc</span> <span class="kw1">as</span> <span class="re1">$ancestor</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>is_page<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy0">&amp;&amp;</span> <span class="re1">$ancestor</span> <span class="sy0">==</span> <span class="re1">$pid</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp;<span class="kw1">return</span> <span class="kw2">true</span><span class="sy0">;</span><br />
&nbsp; <span class="br0">&#125;</span><br />
&nbsp;<span class="br0">&#125;</span><br />
&nbsp;<br />
&nbsp;<span class="kw1">if</span> <span class="br0">&#40;</span>is_page<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy0">&amp;&amp;</span> <span class="br0">&#40;</span>is_page<span class="br0">&#40;</span><span class="re1">$pid</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; <span class="kw1">return</span> <span class="kw2">true</span><span class="sy0">;</span><br />
&nbsp; <span class="co1">// we&#39;re at the page or at a sub page</span><br />
&nbsp;<span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span><br />
&nbsp; <span class="kw1">return</span> <span class="kw2">false</span><span class="sy0">;</span><br />
&nbsp; <span class="co1">// we&#39;re elsewhere</span><br />
&nbsp;<span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
<h2>Check if the current post (or a given post) is in the ancestor/child tree of a given category</h2>
<p>This function checks if the current post (or a given post identified by ID, second parameter) is in the ancestor/child tree of a given category.<br/><br/></p>
<div class="geshi no php"><span class="coMULTI">/* Tests, if the given category is the current category, or in the ancestor/child tree of a given post or a child of it */</span><br />
<span class="kw2">function</span> is_category_or_sub<span class="br0">&#40;</span><span class="re1">$cat_id</span> <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">,</span> <span class="re1">$pid</span> <span class="sy0">=</span> <span class="nu0">0</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp;<span class="kw3">global</span> <span class="re1">$post</span><span class="sy0">;</span><br />
&nbsp;<br />
&nbsp;<span class="co1">// check if a custom post id was given or get default (standard)</span><br />
&nbsp;<span class="kw1">if</span><span class="br0">&#40;</span><span class="re1">$pid</span><span class="sy0">&lt;</span><span class="nu0">1</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; <span class="re1">$pid</span><span class="sy0">=</span><span class="re1">$post</span><span class="sy0">-&gt;</span><span class="me1">ID</span><span class="sy0">;</span><br />
&nbsp;<span class="br0">&#125;</span><br />
&nbsp;<br />
&nbsp;<span class="co1">// check it for each category</span><br />
&nbsp; &nbsp; <span class="kw1">foreach</span> <span class="br0">&#40;</span>get_the_category<span class="br0">&#40;</span><span class="re1">$pid</span><span class="br0">&#41;</span> <span class="kw1">as</span> <span class="re1">$cat</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp;<span class="kw1">if</span> <span class="br0">&#40;</span><span class="re1">$cat_id</span> <span class="sy0">==</span> <span class="re1">$cat</span><span class="sy0">-&gt;</span><span class="me1">cat_ID</span> <span class="sy0">||</span> cat_is_ancestor_of<span class="br0">&#40;</span><span class="re1">$cat_id</span><span class="sy0">,</span> <span class="re1">$cat</span><span class="br0">&#41;</span><span class="br0">&#41;</span> &nbsp;<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">true</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">false</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span></div>
<h2>Check if a given category is in the current category tree</h2>
<p>Helpful if you have to determine the current category manually &#8211; checks if a given category is in the tree of another given category.<br/><br/></p>
<div class="geshi no php"><span class="kw2">function</span> in_category_tree<span class="br0">&#40;</span><span class="re1">$parent_cat</span><span class="sy0">,</span><span class="re1">$child_or_equal_cat</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp;<span class="kw1">if</span><span class="br0">&#40;</span><span class="re1">$parent_cat</span> <span class="sy0">==</span><span class="re1">$child_or_equal_cat</span> <span class="sy0">||</span> cat_is_ancestor_of<span class="br0">&#40;</span><span class="re1">$parent_cat</span><span class="sy0">,</span> <span class="re1">$child_or_equal_cat</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; <span class="kw1">return</span> <span class="kw2">true</span><span class="sy0">;</span><br />
&nbsp;<span class="br0">&#125;</span><br />
&nbsp;<span class="kw1">return</span> <span class="kw2">false</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span></div>
<h2>Custom Taxonomy hierarchy check</h2>
<p>Determine the top level taxonomy or check if a taxonomy is in the current taxonomies hirarchical tree.<br/><br/></p>
<div class="geshi no php"><span class="kw2">function</span> is_taxonomy_or_sub<span class="br0">&#40;</span><span class="re1">$child_or_equal_term_id</span><span class="sy0">,</span><span class="re1">$parent_term_id</span><span class="sy0">,</span><span class="re1">$taxonomy_name</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span class="kw1">if</span><span class="br0">&#40;</span><span class="re1">$parent_term_id</span><span class="sy0">==</span><span class="re1">$child_or_equal_term_id</span> <span class="sy0">||</span> <span class="re1">$parent_term_id</span> <span class="sy0">==</span> get_top_level_term<span class="br0">&#40;</span><span class="re1">$child_or_equal_term_id</span><span class="sy0">,</span><span class="re1">$taxonomy_name</span><span class="br0">&#41;</span><span class="br0">&#41;</span> &nbsp;<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">true</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp;<span class="br0">&#125;</span><br />
&nbsp;<br />
<span class="kw2">function</span> get_top_level_term<span class="br0">&#40;</span><span class="re1">$term_id</span><span class="sy0">,</span><span class="re1">$taxonomy_name</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp;<span class="re1">$term</span> <span class="sy0">=</span> get_term_by<span class="br0">&#40;</span><span class="st0">&#39;id&#39;</span><span class="sy0">,</span><span class="re1">$term_id</span><span class="sy0">,</span><span class="re1">$taxonomy_name</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<span class="kw1">if</span><span class="br0">&#40;</span><span class="re1">$term</span><span class="sy0">-&gt;</span><span class="me1">parent</span><span class="sy0">&gt;</span><span class="nu0">0</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; <span class="kw1">return</span> get_top_level_term<span class="br0">&#40;</span><span class="re1">$term</span><span class="sy0">-&gt;</span><span class="me1">parent</span><span class="sy0">,</span><span class="re1">$taxonomy_name</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span><br />
&nbsp; <span class="kw1">return</span> <span class="re1">$term</span><span class="sy0">-&gt;</span><span class="me1">term_id</span><span class="sy0">;</span><br />
&nbsp;<span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
<p>This article is still under construction. Please report bugs, errors or improvement ideas, so we can optimize these scripts.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blackbam.at/blackbams-blog/2011/10/08/determine-if-a-wordpress-page-or-category-is-in-the-current-ancestorchild-tree-insideoutside-the-loop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using HTML line breaks and link sanitizer in WordPress comments</title>
		<link>http://www.blackbam.at/blackbams-blog/2011/09/30/using-html-line-breaks-and-link-sanitizer-in-wordpress-comments/</link>
		<comments>http://www.blackbam.at/blackbams-blog/2011/09/30/using-html-line-breaks-and-link-sanitizer-in-wordpress-comments/#comments</comments>
		<pubDate>Fri, 30 Sep 2011 12:43:20 +0000</pubDate>
		<dc:creator>Blackbam</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP Scripts]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[hyperlink]]></category>
		<category><![CDATA[line break]]></category>
		<category><![CDATA[sanitizer]]></category>

		<guid isPermaLink="false">http://www.blackbam.at/blackbams-blog/?p=1686</guid>
		<description><![CDATA[Recently we had an issue with the line-breaks in WordPress comments &#8211; the comments are saved to the database as they are submitted from the textarea in your theme, and depending on the theme so they are displayed. If your comments are displayed as HTML and there is no mechanism to add line breaks anywhere, [...]]]></description>
			<content:encoded><![CDATA[<p>Recently we had an issue with the line-breaks in WordPress comments &#8211; the comments are saved to the database as they are submitted from the textarea in your theme, and depending on the theme so they are displayed. If your comments are displayed as HTML and there is no mechanism to add line breaks anywhere, then the comments do not have any line-breaks (as HTML line breaks must be created with a br-tag or something similar).</p>
<p>&nbsp;</p>
<p>Another anoying thing is when commenters do not make links to hyperlinks, as these are not linked and clickable afterwards. We have found a solution for these problem &#8211; just copy the following script to your functions.php-file and your comments will be sanitized:</p>
<p>&nbsp;</p>
<div class="geshi no php">add_filter<span class="br0">&#40;</span><span class="st0">&#39;preprocess_comment&#39;</span><span class="sy0">,</span><span class="st0">&#39;format_the_comment_html&#39;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<br />
<span class="kw2">function</span> format_the_comment_html<span class="br0">&#40;</span><span class="re1">$comment_data</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp;<span class="re1">$comment_data</span><span class="br0">&#91;</span><span class="st0">&#39;comment_content&#39;</span><span class="br0">&#93;</span><span class="sy0">=</span><span class="kw3">nl2br</span><span class="br0">&#40;</span>makeClickableLinks<span class="br0">&#40;</span><span class="re1">$comment_data</span><span class="br0">&#91;</span><span class="st0">&#39;comment_content&#39;</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<span class="kw1">return</span> <span class="re1">$comment_data</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
&nbsp;<br />
<span class="kw2">function</span> makeClickableLinks<span class="br0">&#40;</span><span class="re1">$text</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp;<span class="re1">$text</span> <span class="sy0">=</span> <span class="kw3">eregi_replace</span><span class="br0">&#40;</span><span class="st0">&#39;(((f|ht){1}tp://)[-a-zA-Z0-9@:%_<span class="es0">\+</span>.~#?&amp;//=]+)&#39;</span><span class="sy0">,</span><span class="st0">&#39;&lt;a href=&quot;<span class="es0">\\</span>1&quot;&gt;<span class="es0">\\</span>1&lt;/a&gt;&#39;</span><span class="sy0">,</span> <span class="re1">$text</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<span class="re1">$text</span> <span class="sy0">=</span> <span class="kw3">eregi_replace</span><span class="br0">&#40;</span><span class="st0">&#39;([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_<span class="es0">\+</span>.~#?&amp;//=]+)&#39;</span><span class="sy0">,</span><span class="st0">&#39;<span class="es0">\\</span>1&lt;a href=&quot;http://<span class="es0">\\</span>2&quot;&gt;<span class="es0">\\</span>2&lt;/a&gt;&#39;</span><span class="sy0">,</span> <span class="re1">$text</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<span class="re1">$text</span> <span class="sy0">=</span> <span class="kw3">eregi_replace</span><span class="br0">&#40;</span><span class="st0">&#39;([_<span class="es0">\.</span>0-9a-z-]+@([0-9a-z][0-9a-z-]+<span class="es0">\.</span>)+[a-z]{2,3})&#39;</span><span class="sy0">,</span><span class="st0">&#39;&lt;a href=&quot;mailto:<span class="es0">\\</span>1&quot;&gt;<span class="es0">\\</span>1&lt;/a&gt;&#39;</span><span class="sy0">,</span> <span class="re1">$text</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<span class="kw1">return</span> <span class="re1">$text</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span></div>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.blackbam.at%2Fblackbams-blog%2F2011%2F09%2F30%2Fusing-html-line-breaks-and-link-sanitizer-in-wordpress-comments%2F&amp;title=Using%20HTML%20line%20breaks%20and%20link%20sanitizer%20in%20WordPress%20comments" id="wpa2a_10"><img class="colorbox-1686"  src="http://www.blackbam.at/blackbams-blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.blackbam.at/blackbams-blog/2011/09/30/using-html-line-breaks-and-link-sanitizer-in-wordpress-comments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Summary: 7 deadly sins of landing page design (and resolutions)</title>
		<link>http://www.blackbam.at/blackbams-blog/2011/09/09/summary-7-deadly-sins-of-landing-page-design/</link>
		<comments>http://www.blackbam.at/blackbams-blog/2011/09/09/summary-7-deadly-sins-of-landing-page-design/#comments</comments>
		<pubDate>Fri, 09 Sep 2011 20:22:50 +0000</pubDate>
		<dc:creator>Blackbam</dc:creator>
				<category><![CDATA[Usability]]></category>
		<category><![CDATA[landing page]]></category>
		<category><![CDATA[web marketing]]></category>
		<category><![CDATA[website traffic]]></category>

		<guid isPermaLink="false">http://www.blackbam.at/blackbams-blog/?p=1656</guid>
		<description><![CDATA[A landing page (sometimes also called &#8220;marketing page&#8221;), simply spoken, is the first page of a Web-presence that visitors see after klicking an ad or special link, which is intended to attract Web surfers&#8217; attention for a certain offer (e.g. information, products, forms and so on). A key element of landing pages is the &#8220;response&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>A landing page (sometimes also called &#8220;marketing page&#8221;), simply spoken, is the first page of a Web-presence that visitors see after klicking an ad or special link, which is intended to attract Web surfers&#8217; attention for a certain offer (e.g. information, products, forms and so on). A key element of landing pages is the &#8220;response&#8221; element (e.g. link, form, button) to create a first user communication.</p>
<p>&nbsp;</p>
<p>These landing pages are an essential tool of online marketing to <em>improve traffic to a website</em> and make a certain web-presence popular. As a consequence of this, they should be thought-out perfectly, as Web surfers decide within 2-3 seconds if the called page rather satisfies their needs or not. A guy called Tim Ash is talking about this topic for more than an hour in a Webinar called &#8220;The 7 deadly sins of a landing page&#8221;,  from which I want to present the key points with resolutions here as reminder:</p>
<p>&nbsp;</p>
<ol>
<li><strong>Unclear call to action:<br />
</strong></p>
<ul style="padding:9px 0 17px 30px;">
<li>keep the page obvious / simple</li>
<li>clear leading of the eye</li>
<li>make visual competitors less important</li>
</ul>
</li>
<li><strong>Too many choices:<br />
</strong></p>
<ul style="padding:9px 0 17px 30px;">
<li>reduce the number of choices</li>
<li>do not show details in the early time of the process</li>
<li>reduce the number of categories to a well-arranged number</li>
<li>use visual shortcuts (e.g. for categories)</li>
</ul>
</li>
<li><strong>Asking for too much information:</strong>
<ul style="padding:9px 0 17px 30px;">
<li>ask as few information as possible</li>
<li>ask nothing inappropriate / too personal</li>
<li>ask for additional information on a later date</li>
<li>shorten labels / unclutter form</li>
</ul>
</li>
<li><strong>Too much text </strong>(problem: short span of attention)<strong>:</strong>
<ul style="padding:9px 0 17px 30px;">
<li>clear headlines</li>
<li>important stuff first</li>
<li>short bullet lists instead of full text</li>
<li>shorten text</li>
</ul>
</li>
<li><strong>Not keeping promises:</strong>
<ul style="padding:9px 0 17px 30px;">
<li>repeat words from the target page</li>
<li>provide clear access to the information offered</li>
</ul>
</li>
<li><strong>Visual distractions</strong> (visual assault, unrelated to the product, unclear navigation &#8211;&gt; waste of time)<strong>:</strong>
<ul style="padding:9px 0 17px 30px;">
<li>elements must not compete with the call-to-action</li>
<li>remove colors, effects, &#8230;</li>
<li>use only specific relevant images</li>
</ul>
</li>
<li><strong>Lack of credibility:</strong>
<ul style="padding:9px 0 17px 30px;">
<li>strength by positive association</li>
<li>feature well known symbols prominently</li>
<li>show client logos / brands / media as &#8220;badges&#8221; (little signs)</li>
</ul>
</li>
</ol>
<p>When creating a landing page just go through this checklist and make sure you did not make one of these most serious usability mistakes &#8211; and the chances for success will rise significantly.</p>
<p>&nbsp;</p>
<h3>Source</h3>
<p>&nbsp;</p>
<p><iframe src="http://www.youtube.com/embed/erdEZvOq6wo" frameborder="0" width="640" height="510"></iframe></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.blackbam.at%2Fblackbams-blog%2F2011%2F09%2F09%2Fsummary-7-deadly-sins-of-landing-page-design%2F&amp;title=Summary%3A%207%20deadly%20sins%20of%20landing%20page%20design%20%28and%20resolutions%29" id="wpa2a_12"><img class="colorbox-1656"  src="http://www.blackbam.at/blackbams-blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.blackbam.at/blackbams-blog/2011/09/09/summary-7-deadly-sins-of-landing-page-design/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Programming Languages for the Web 2011</title>
		<link>http://www.blackbam.at/blackbams-blog/2011/09/04/programming-languages-for-the-web-2011/</link>
		<comments>http://www.blackbam.at/blackbams-blog/2011/09/04/programming-languages-for-the-web-2011/#comments</comments>
		<pubDate>Sun, 04 Sep 2011 19:04:11 +0000</pubDate>
		<dc:creator>Blackbam</dc:creator>
				<category><![CDATA[Programming languages]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[most used programming languages]]></category>
		<category><![CDATA[programming language comparison]]></category>
		<category><![CDATA[programming languages for the web]]></category>
		<category><![CDATA[web programming languages]]></category>

		<guid isPermaLink="false">http://www.blackbam.at/blackbams-blog/?p=1617</guid>
		<description><![CDATA[This work shows the differences between and the varieties of programming languages for the World Wide Web at present times and also helps understanding these. To reach this aim, the differences between programming languages are analyzed, and the affordances and circumstances of programming for the WWW are determined as well. Furthermore, an analysis of usage statistics is made to show what certain programming languages are in use today. As a result the most important programming languages for the Web 2011 are determined. Furthermore, a detailed programming language comparison sheet is presented, which can be used to compare the suitability of common and uncommon programming languages for Web use in general.]]></description>
			<content:encoded><![CDATA[<p>Recently I finished my second bachelor thesis called &#8220;Programming Languages for the Web 2011&#8243; with the aim of digging deeper into programming language design, structure, usage statistics and affordances of the WWW. It was a matter of interest to know what possibilities web developers have and what programming language they prefer to use.</p>
<p>&nbsp;</p>
<ul>
<li>Have you ever asked if there are still good alternatives to PHP and Java?</li>
<li>Are you sick of reading endless discussions about which programming languages are better, without substantial evidence?</li>
<li>Are you searching for a scientific approach to compare and understand the differences between programming languages to make an important choice?</li>
</ul>
<p>&nbsp;</p>
<p>If any of these points is of interrest for you, then you can download and read the whole work from here, as it might be useful.</p>
<p>&nbsp;</p>
<p style="font-weight:bold; font-size:20px; text-align:center;"><a href="http://www.blackbam.at/blackbams-blog/wp-content/uploads/2011/09/programming_languages_for_the_web_2011.pdf">&gt; Download and read the whole work &lt;</a></p>
<h2>Abstract</h2>
<p>This work shows the differences between and the varieties of programming languages for the World Wide Web at present times and also helps understanding these. To reach this aim, the differences between programming languages are analyzed, and the affordances and circumstances of programming for the WWW are determined as well. Furthermore, an analysis of usage statistics is made to show what certain programming languages are in use today.</p>
<p>&nbsp;</p>
<p>As a result the most important programming languages for the Web 2011 are determined. Furthermore, a detailed programming language comparison sheet is presented, which can be used to compare the suitability of common and uncommon programming languages for Web use in general.</p>
<h2>Results</h2>
<p>&nbsp;</p>
<p><a href="http://www.blackbam.at/blackbams-blog/wp-content/uploads/2011/09/programming_languages_for_the_web.png"><img src="http://www.blackbam.at/blackbams-blog/wp-content/uploads/2011/09/programming_languages_for_the_web-600x450.png" alt="" title="programming_languages_for_the_web" width="600" height="450" class="alignnone size-medium wp-image-1642 colorbox-1617" /></a></p>
<p>&nbsp;</p>
<p>Programming languages have huge differences among themselves. They can be classified among their computational model, hardware abstraction level and programming paradigms. Technically comparable distinctive features are basically the level of compilation/interpretation, storage management, type system, effectiveness and expressiveness. Other distinctive features include popularity and a lot of things associated with popularity, syntactic / semantic rules (which are only difficult to compare technically) and the intended use of a programming language.</p>
<p>Affordances for programming languages on the Web are different and limited. There has to be a distinction between server-side programming, client-side programming and web application programming:</p>
<p>&nbsp;</p>
<ul style="list-style-type: square;">
<li>Server-side programming can be done with every programming language basically (usually using CGI), while specific “Module-/ Plugin-loading mechanisms” or special software solutions usually provide significant advantages.</li>
<li>Client-side programming is limited to the capacity of important Web browsers, so the JavaScript and XSLT-standards as Java Applets are kind of outstanding here, as all other technologies must usually use browser Plugins.</li>
<li>Web Application Programming can be done with every programming language to be compiled for the client system (but there are advantages/disadvantages to consider)</li>
</ul>
<p>&nbsp;</p>
<p>Especially web specific features, frameworks, solutions, techniques and technologies can improve a programming languages‟ qualification for the Web significantly.<br />
As a result of the work we can assume, that programming languages for the Web 2011 are mostly scripting languages that have a tendency to high hardware abstraction. Based on their popularity, we figured out the following candidates to be the most important ones currently, according to statistics (note that the information in brackets only describes primary characteristics):</p>
<p>&nbsp;</p>
<ul style="list-style-type: square;">
<li>Java (general purpose language, especially the applications of Java dedicated to Web programming, server-side / client-side)</li>
<li>C# (general purpose language, especially the applications of C# dedicated to Web programming, server-side, proprietary)</li>
<li>PHP (scripting language, server-side)</li>
<li>Perl (scripting language, server-side)</li>
<li>Python (partly scripting language, server-side)</li>
<li>Ruby (scripting language, server-side)</li>
<li>JavaScript (scripting language, client-side)</li>
</ul>
<p>It stands out that C# is the only “mostly proprietary” language to be widely used for web programming purposes and that 5 out of 7 candidates are scripting languages.</p>
<p>&nbsp;</p>
<p>There are some more programming languages, which are almost equally important, but have one of “not as good in statistics” or “primarily not intended for web programming”, these are:</p>
<p>&nbsp;</p>
<ul style="list-style-type: square;">
<li>CFML/CFScript for ColdFusion (scripting language, server-side, proprietary)</li>
<li>ActionScript (scripting language, clident-side, proprietary)</li>
<li>XSLT (transformation programming language, client-side)</li>
<li>Objective-C (application programming language, client-side)</li>
<li>C (system programming language, client-side / server-side)</li>
<li>C++ (system programming language, client-side / server-side)</li>
<li>Visual Basic (with descendant VBScript, client-side / server-side, proprietary)</li>
</ul>
<p>&nbsp;</p>
<p>There are a lot of domain specific languages which are not included in this comparison as they are no real programming languages; these are HTML, XML, CSS, and SQL in the first place.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blackbam.at/blackbams-blog/2011/09/04/programming-languages-for-the-web-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gallery: Impressions of Greece</title>
		<link>http://www.blackbam.at/blackbams-blog/2011/08/31/gallery-impressions-of-greece/</link>
		<comments>http://www.blackbam.at/blackbams-blog/2011/08/31/gallery-impressions-of-greece/#comments</comments>
		<pubDate>Tue, 30 Aug 2011 22:44:41 +0000</pubDate>
		<dc:creator>Blackbam</dc:creator>
				<category><![CDATA[Gallery]]></category>
		<category><![CDATA[Photography]]></category>

		<guid isPermaLink="false">http://www.blackbam.at/blackbams-blog/?p=1582</guid>
		<description><![CDATA[Just some hobby-photographs from summer-holidays near the eastern coast of greece (Agiokampos and Meteora)&#8230; &#160; &#160;]]></description>
			<content:encoded><![CDATA[<p>Just some hobby-photographs from summer-holidays near the eastern coast of greece (Agiokampos and Meteora)&#8230;</p>
<p>&nbsp;</p>
<p>&nbsp;<br />

<a href='http://www.blackbam.at/blackbams-blog/2011/08/31/gallery-impressions-of-greece/01-3/' title='Meteora'><img width="150" height="150" src="http://www.blackbam.at/blackbams-blog/wp-content/uploads/2011/08/01-150x150.jpg" class="attachment-thumbnail colorbox-1582" alt="Image of Meteora" title="Meteora" /></a>
<a href='http://www.blackbam.at/blackbams-blog/2011/08/31/gallery-impressions-of-greece/02-4/' title='Greek tree'><img width="150" height="150" src="http://www.blackbam.at/blackbams-blog/wp-content/uploads/2011/08/02-150x150.jpg" class="attachment-thumbnail colorbox-1582" alt="Greek tree" title="Greek tree" /></a>
<a href='http://www.blackbam.at/blackbams-blog/2011/08/31/gallery-impressions-of-greece/03-4/' title='Meteora - monastery view'><img width="150" height="150" src="http://www.blackbam.at/blackbams-blog/wp-content/uploads/2011/08/03-150x150.jpg" class="attachment-thumbnail colorbox-1582" alt="Meteora - monastery view" title="Meteora - monastery view" /></a>
<a href='http://www.blackbam.at/blackbams-blog/2011/08/31/gallery-impressions-of-greece/04-3/' title='Eastern seaside of Greece'><img width="150" height="150" src="http://www.blackbam.at/blackbams-blog/wp-content/uploads/2011/08/04-150x150.jpg" class="attachment-thumbnail colorbox-1582" alt="Eastern seaside of Greece" title="Eastern seaside of Greece" /></a>
<a href='http://www.blackbam.at/blackbams-blog/2011/08/31/gallery-impressions-of-greece/05-4/' title='Meteora'><img width="150" height="150" src="http://www.blackbam.at/blackbams-blog/wp-content/uploads/2011/08/05-150x150.jpg" class="attachment-thumbnail colorbox-1582" alt="Meteora" title="Meteora" /></a>
<a href='http://www.blackbam.at/blackbams-blog/2011/08/31/gallery-impressions-of-greece/06-3/' title='Greek woods'><img width="150" height="150" src="http://www.blackbam.at/blackbams-blog/wp-content/uploads/2011/08/06-150x150.jpg" class="attachment-thumbnail colorbox-1582" alt="Greek woods" title="Greek woods" /></a>
<a href='http://www.blackbam.at/blackbams-blog/2011/08/31/gallery-impressions-of-greece/07-2/' title='Meteora'><img width="150" height="150" src="http://www.blackbam.at/blackbams-blog/wp-content/uploads/2011/08/07-150x150.jpg" class="attachment-thumbnail colorbox-1582" alt="Meteora" title="Meteora" /></a>
<a href='http://www.blackbam.at/blackbams-blog/2011/08/31/gallery-impressions-of-greece/08-2/' title='Eastern seaside of Greece'><img width="150" height="150" src="http://www.blackbam.at/blackbams-blog/wp-content/uploads/2011/08/08-150x150.jpg" class="attachment-thumbnail colorbox-1582" alt="Eastern seaside of Greece" title="Eastern seaside of Greece" /></a>
<a href='http://www.blackbam.at/blackbams-blog/2011/08/31/gallery-impressions-of-greece/09-2/' title='Meteora'><img width="150" height="150" src="http://www.blackbam.at/blackbams-blog/wp-content/uploads/2011/08/09-150x150.jpg" class="attachment-thumbnail colorbox-1582" alt="Meteora" title="Meteora" /></a>
<a href='http://www.blackbam.at/blackbams-blog/2011/08/31/gallery-impressions-of-greece/10-2/' title='Rocks and waves'><img width="150" height="150" src="http://www.blackbam.at/blackbams-blog/wp-content/uploads/2011/08/10-150x150.jpg" class="attachment-thumbnail colorbox-1582" alt="Rocks and waves" title="Rocks and waves" /></a>
<a href='http://www.blackbam.at/blackbams-blog/2011/08/31/gallery-impressions-of-greece/11-2/' title='Climbing rocks in Meteora'><img width="150" height="150" src="http://www.blackbam.at/blackbams-blog/wp-content/uploads/2011/08/11-150x150.jpg" class="attachment-thumbnail colorbox-1582" alt="Climbing rocks in Meteora" title="Climbing rocks in Meteora" /></a>
<a href='http://www.blackbam.at/blackbams-blog/2011/08/31/gallery-impressions-of-greece/12-2/' title='...'><img width="150" height="150" src="http://www.blackbam.at/blackbams-blog/wp-content/uploads/2011/08/12-150x150.jpg" class="attachment-thumbnail colorbox-1582" alt="..." title="..." /></a>
</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.blackbam.at%2Fblackbams-blog%2F2011%2F08%2F31%2Fgallery-impressions-of-greece%2F&amp;title=Gallery%3A%20Impressions%20of%20Greece" id="wpa2a_14"><img class="colorbox-1582"  src="http://www.blackbam.at/blackbams-blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.blackbam.at/blackbams-blog/2011/08/31/gallery-impressions-of-greece/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  www.blackbam.at/blackbams-blog/feed/ ) in 2.18820 seconds, on Feb 22nd, 2012 at 10:43 pm UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 23rd, 2012 at 4:43 am UTC -->
