<?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>Webdevelopment at huuah.com</title>
	<atom:link href="http://huuah.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://huuah.com</link>
	<description>webdevelopment, cms, php, javascript etc</description>
	<lastBuildDate>Tue, 02 Feb 2010 22:27:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Android development platform on Ubuntu 9.10</title>
		<link>http://huuah.com/android-development-platform-on-ubuntu-9-10/</link>
		<comments>http://huuah.com/android-development-platform-on-ubuntu-9-10/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 22:25:15 +0000</pubDate>
		<dc:creator>js - huuah</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[ide]]></category>

		<guid isPermaLink="false">http://huuah.com/?p=492</guid>
		<description><![CDATA[<p>Here is a quick guide on installing a development environment (using the Eclipse IDE) for Android applications on Ubuntu 9.10.</p>
<p>1. Open the Synaptic package manager and install the <code>sun-java6-jdk</code> and the <code>eclipse</code> package (and of-course accept the depending packages).</p>
<p>2. Verify that you have a working java enviroment by running <code>java --version</code> in a terminal.</p>
<p>3. Download the lasted version of the Android SDK at android.com (<a href="http://developer.android.com/sdk/index.html">http://developer.android.com/sdk/index.html</a>).</p>
<p>4. Unpack the SDK file to your home directory (or somewhere else &#8211; its your choice)</p>
<p>5. Open the newly installed Eclipse IDE.</p>
<p>6. In Eclipse goto the <code>Help</code> menu and select the <code>Install New Software</code></p>
<p>7. Click <code>Add</code> and create a site with&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Here is a quick guide on installing a development environment (using the Eclipse IDE) for Android applications on Ubuntu 9.10.</p>
<p>1. Open the Synaptic package manager and install the <code>sun-java6-jdk</code> and the <code>eclipse</code> package (and of-course accept the depending packages).</p>
<p>2. Verify that you have a working java enviroment by running <code>java --version</code> in a terminal.</p>
<p>3. Download the lasted version of the Android SDK at android.com (<a href="http://developer.android.com/sdk/index.html">http://developer.android.com/sdk/index.html</a>).</p>
<p>4. Unpack the SDK file to your home directory (or somewhere else &#8211; its your choice)</p>
<p>5. Open the newly installed Eclipse IDE.</p>
<p>6. In Eclipse goto the <code>Help</code> menu and select the <code>Install New Software</code></p>
<p>7. Click <code>Add</code> and create a site with this url: <strong>http://download.eclipse.org/releases/galileo/</strong></p>
<p>8. Now search for <code>wst</code> and install the <code>WST Server Adapters</code>.</p>
<p>9. Add another site with this url: <strong>http://dl-ssl.google.com/android/eclipse/</strong> and install the <code>Android Development Tools</code>.</p>
<p>10. Select the <code>Window</code> menu in Eclipse and open the <code>preferences</code>. Select the Android section and set the SDK location to the directory where the SDK in unpacked (in sted 4).</p>
<p>11. Open a terminal/command prompt, go to the tools directory inside the SDK (which we unpacked in step 4) and run the <code>android</code> program. Select the <code>Settings</code> menu and check the <code>Force https ..</code> field. Then go to the <code>Available Packages</code> and select which version(s) that you want to develop to. When done, close the program.</p>
<p>The IDE is now ready to go. </p>
<p>Further reading could be the Hello World tutorial over at android.com (<a href="http://developer.android.com/guide/tutorials/hello-world.html">http://developer.android.com/guide/tutorials/hello-world.html</a>) that also lists how to setup an emulator for testing the applications. (something like <code>android create avd --target 1 --name my_avd</code>)</p>
<p>I hope this can help you get started.</p>
<p>Please post any comments you may have.</p>
]]></content:encoded>
			<wfw:commentRss>http://huuah.com/android-development-platform-on-ubuntu-9-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting position from jQuery UI sortable</title>
		<link>http://huuah.com/getting-position-from-jquery-ui-sortable/</link>
		<comments>http://huuah.com/getting-position-from-jquery-ui-sortable/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 11:07:43 +0000</pubDate>
		<dc:creator>js - huuah</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://huuah.com/?p=461</guid>
		<description><![CDATA[<p>The jQuery UI sortable widget offers a great interface for listing and moving element around. </p>
<p>I have been working on a small project of mine and figured that the sortable widget could be a great feature. I then started to output the list and the element that should be draggable like this:</p>
<p>My HTML list</p>
<pre class="brush: xml;">
&#60;ul id=&#34;sort1&#34;&#62;
  &#60;li&#62;
    &#60;div&#62;box no 1&#60;/div&#62;
  &#60;/li&#62;
  &#60;li&#62;
    &#60;div&#62;box no 2&#60;/div&#62;
  &#60;/li&#62;
  &#60;li&#62;
    &#60;div&#62;box no 3&#60;/div&#62;
  &#60;/li&#62;
&#60;/ul&#62;
</pre>
<p>My jQuery code to enable the sortable widget and for getting a serialized result when an element has been dragged around:</p>
<pre class="brush: jscript;">
$(document).ready(function() {
    $(&#34;#sort1&#34;).sortable({
        opacity: 0.6,
        update: function(event, ui) {&#8230;</pre>]]></description>
			<content:encoded><![CDATA[<p>The jQuery UI sortable widget offers a great interface for listing and moving element around. </p>
<p>I have been working on a small project of mine and figured that the sortable widget could be a great feature. I then started to output the list and the element that should be draggable like this:</p>
<p>My HTML list</p>
<pre class="brush: xml;">
&lt;ul id=&quot;sort1&quot;&gt;
  &lt;li&gt;
    &lt;div&gt;box no 1&lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;div&gt;box no 2&lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;div&gt;box no 3&lt;/div&gt;
  &lt;/li&gt;
&lt;/ul&gt;
</pre>
<p>My jQuery code to enable the sortable widget and for getting a serialized result when an element has been dragged around:</p>
<pre class="brush: jscript;">
$(document).ready(function() {
    $(&quot;#sort1&quot;).sortable({
        opacity: 0.6,
        update: function(event, ui) {
            var info = $(this).sortable(&quot;serialize&quot;);
            $(&quot;#sort1output&quot;).html(info);
        }

    });
});
</pre>
<p>Example (try dragging a box up or down):</p>
<ul id="sort1">
<li>
<div>box no 1</div>
</li>
<li>
<div>box no 2</div>
</li>
<li>
<div>box no 3</div>
</li>
</ul>
<p>Serialized output (updated when a box is dragged):<span id="sort1output"><strong>Output will be shown here</strong></span></p>
<p>So. Nothing. No output what so ever.</p>
<p>I have spend several hour researching this problem, because the documentation on jqueryui.com lists that the serialize and toArray events should return output.</p>
<p>And then. Finaly. I stumpled upon a note regarding the id name of the element that gets dragged. I have seen no documentation about this and was quite puzzled. I digged some more into this id-hint and realized that the element that gets moved around, has to have a unique id tag ending with a number like this: &#8220;element_2&#8243;.</p>
<p>The working code will then be:</p>
<pre class="brush: xml; highlight: [2,5,8];">
&lt;ul id=&quot;sort2&quot;&gt;
  &lt;li id=&quot;element_1&quot;&gt;
    &lt;div&gt;box no 1&lt;/div&gt;
  &lt;/li&gt;
  &lt;li id=&quot;element_2&quot;&gt;
    &lt;div&gt;box no 2&lt;/div&gt;
  &lt;/li&gt;
  &lt;li id=&quot;element_3&quot;&gt;
    &lt;div&gt;box no 3&lt;/div&gt;
  &lt;/li&gt;
&lt;/ul&gt;
</pre>
<ul id="sort2">
<li id="element_1">
<div>box no 1</div>
</li>
<li id="element_2">
<div>box no 2</div>
</li>
<li id="element_3">
<div>box no 3</div>
</li>
</ul>
<p>Serialized output (updated when a box is dragged):<span id="sort2output" style="font-weight: bold"><strong>Output will be shown here</strong></span></p>
<p>I hope this tip is helpfull.</p>
]]></content:encoded>
			<wfw:commentRss>http://huuah.com/getting-position-from-jquery-ui-sortable/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>jQuery and dropdown / select boxes</title>
		<link>http://huuah.com/jquery-and-dropdown-select-boxes/</link>
		<comments>http://huuah.com/jquery-and-dropdown-select-boxes/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 10:54:39 +0000</pubDate>
		<dc:creator>js - huuah</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://huuah.com/?p=434</guid>
		<description><![CDATA[<p>With jQuery it is quick and easy to access and modify elements in a select dropdown box. There are of course several ways of doing thing and I will try to cover most of them here.</p>
<p>Quicklinks:<br />
<a href="http://huuah.com/jquery-and-dropdown-select-boxes/#testsetup">The test setup</a><br />
<a href="http://huuah.com/jquery-and-dropdown-select-boxes/#getthevalue">Get the selected value from the select / dropdown box</a><br />
<a href="http://huuah.com/jquery-and-dropdown-select-boxes/#setthevalue">Set the selected value</a><br />
<a href="http://huuah.com/jquery-and-dropdown-select-boxes/#insertvalue">Insert new options and values in the dropdown box</a><br />
<a href="http://huuah.com/jquery-and-dropdown-select-boxes/#removevalue">Removing an entry from the select box</a><br />
<a href="http://huuah.com/jquery-and-dropdown-select-boxes/#enabledisable">Disable and enable options</a><br />
<a href="http://huuah.com/jquery-and-dropdown-select-boxes/#thecode">The code</a></p>
<p><a name="testsetup"></a></p>
<h1>The test setup.</h1>
<p>For the following examples I will use a dropdown / select box like this:</p>

10 Apples<br />
5 Oranges<br />
12 Bananes<br />

<p>The HTML-code for the dropdown is where basic:</p>
<pre class="brush: xml;">
&#60;select id=&#34;dropdown&#34;&#62;
&#60;option value=&#34;apples&#34;&#62;10 Apples&#60;/option&#62;
&#60;option value=&#34;oranges&#34;&#62;5 Oranges&#60;/option&#62;&#8230;</pre>]]></description>
			<content:encoded><![CDATA[<p>With jQuery it is quick and easy to access and modify elements in a select dropdown box. There are of course several ways of doing thing and I will try to cover most of them here.</p>
<p>Quicklinks:<br />
<a href="http://huuah.com/jquery-and-dropdown-select-boxes/#testsetup">The test setup</a><br />
<a href="http://huuah.com/jquery-and-dropdown-select-boxes/#getthevalue">Get the selected value from the select / dropdown box</a><br />
<a href="http://huuah.com/jquery-and-dropdown-select-boxes/#setthevalue">Set the selected value</a><br />
<a href="http://huuah.com/jquery-and-dropdown-select-boxes/#insertvalue">Insert new options and values in the dropdown box</a><br />
<a href="http://huuah.com/jquery-and-dropdown-select-boxes/#removevalue">Removing an entry from the select box</a><br />
<a href="http://huuah.com/jquery-and-dropdown-select-boxes/#enabledisable">Disable and enable options</a><br />
<a href="http://huuah.com/jquery-and-dropdown-select-boxes/#thecode">The code</a></p>
<p><a name="testsetup"></a></p>
<h1>The test setup.</h1>
<p>For the following examples I will use a dropdown / select box like this:</p>
<select id="dropdowntestsetup">
<option value="apples">10 Apples</option><br />
<option value="oranges">5 Oranges</option><br />
<option value="bananas">12 Bananes</option><br />
</select>
<p>The HTML-code for the dropdown is where basic:</p>
<pre class="brush: xml;">
&lt;select id=&quot;dropdown&quot;&gt;
&lt;option value=&quot;apples&quot;&gt;10 Apples&lt;/option&gt;
&lt;option value=&quot;oranges&quot;&gt;5 Oranges&lt;/option&gt;
&lt;option value=&quot;bananas&quot;&gt;12 Bananes&lt;/option&gt;
&lt;/select&gt;
</pre>
<p><a name="getthevalue"></a></p>
<h1>Get the selected value from the select / dropdown box.</h1>
<p>When a value is selected, it could be nice to use the value for something and the first step to doing this, is to receive the value. This is actually very simple to do:<br />
<strong>dropdown1</strong>:<br />
<select id="dropdown1">
<option value="apples">10 Apples</option><br />
<option value="oranges">5 Oranges</option><br />
<option value="bananas">12 Bananes</option><br />
</select>
<p><strong>button1</strong>: <button id="button1">Fetch value from dropdown</button></p>
<p>Code:</p>
<pre class="brush: jscript;">
    $(&quot;#button1&quot;).click( function() {
        alert(&quot;The selected value is: &quot; + $(&quot;#dropdown1&quot;).val() );
    });
</pre>
<p>Here I have used the val()-function on the dropdown box the receive the value for the selected element and it will output the content of the &#8220;value&#8221;-parameter on the select-box.</p>
<p>If you would rather have the visible text (ie. 10 Apples or 5 Oranges) outputted, you will have to use the html()-function instead. It&#8217;s a bit more tricky, as you should only get the content of the selected value and not the entire select-box.<br />
To do this, we have to do a combination like this:<br />
<strong>button2</strong>: <button id="button2">Fetch content from dropdown</button></p>
<p>Code:</p>
<pre class="brush: jscript;">
    $(&quot;#button2&quot;).click( function() {
        var selectedvalue = $(&quot;#dropdown1&quot;).val();
        alert(&quot;The selected value is: &quot; + $(&quot;#dropdown1 option[value=&quot;+selectedvalue+&quot;]&quot;).html() );
    });
</pre>
<p>Another and more simple way of getting the text from the selected element could be:</p>
<pre class="brush: jscript;">
    $('#dropdown1 :selected').text();
</pre>
<p><a name="setthevalue"></a></p>
<h1>Set the selected value.</h1>
<p>Setting the selected value is very easy. All you have to do, is use the val()-function:<br />
<strong>dropdown2</strong>:<br />
<select id="dropdown2">
<option value="apples">10 Apples</option><br />
<option value="oranges">5 Oranges</option><br />
<option value="bananas">12 Bananes</option><br />
</select>
<p><strong>button3</strong>: <button id="button3">Select &#8216;oranges&#8217;</button><br />
<strong>button4</strong>: <button id="button4">Select &#8216;bananas&#8217;</button></p>
<p>code:</p>
<pre class="brush: jscript;">
    $(&quot;#button3&quot;).click( function() {
        $(&quot;#dropdown2&quot;).val(&quot;oranges&quot;);
    });
    $(&quot;#button4&quot;).click( function() {
        $(&quot;#dropdown2&quot;).val(&quot;bananas&quot;);
    });
</pre>
<p><a name="insertvalue"></a></p>
<h1>Insert new options and values in the dropdown box.</h1>
<p>If the content of the dropdown are depending on other fields, it is often necessary to change or insert new values to a dropdown box.<br />
This can be done by appending new &lt;option&gt;-tags to the &lt;select&gt;-box:<br />
<strong>dropdown3</strong>:<br />
<select id="dropdown3">
<option value="apples">10 Apples</option><br />
<option value="oranges">5 Oranges</option><br />
<option value="bananas">12 Bananes</option><br />
</select>
<p><strong>button5</strong>: <button id="button5">Append a new field named &#8216;20 Grapes&#8217;</button><br />
<strong>button6</strong>: <button id="button6">Prepend a new field named &#8216;20 Melons&#8217;</button></p>
<p>Code:</p>
<pre class="brush: jscript;">
    $(&quot;#button5&quot;).click( function() {
        // insert new option at the bottom of the dropdown box
        $(&quot;#dropdown3&quot;).append('&lt;option selected=selected value=&quot;grapes&quot;&gt;20 Grapes&lt;/option&gt;');
    });
    $(&quot;#button6&quot;).click( function() {
        // insert new option at the top of the dropdown box
        $(&quot;#dropdown3&quot;).prepend('&lt;option selected=selected value=&quot;melons&quot;&gt;20 Melons&lt;/option&gt;');
    });
</pre>
<p><a name="removevalue"></a></p>
<h1>Removing an entry from the select box.</h1>
<p>Remove options is very easy. All you need is knowing which values to remove:<br />
<strong>dropdown4</strong>:<br />
<select id="dropdown4">
<option value="apples">10 Apples</option><br />
<option value="oranges">5 Oranges</option><br />
<option value="bananas">12 Bananes</option><br />
</select>
<p><strong>button7</strong>: <button id="button7">Remove the &#8220;10 Apples&#8221; option</button></p>
<p>Code:</p>
<pre class="brush: jscript;">
    $(&quot;#button7&quot;).click( function() {
        $(&quot;#dropdown4 option[value='apples']&quot;).remove();
    });
</pre>
<p><a name="enabledisable"></a></p>
<h1>Disable and enable options.</h1>
<p>If some of the options in the dropdown is depending on other values, it is sometimes nice to enable and disable entries on the fly.<br />
<strong>dropdown5</strong>:<br />
<select id="dropdown5">
<option value="apples">10 Apples</option><br />
<option value="oranges">5 Oranges</option><br />
<option value="bananas">12 Bananes</option><br />
</select>
<p><strong>button8</strong>: <button id="button8">Disable the&#8221;5 Oranges&#8221; option</button><br />
<strong>button9</strong>: <button id="button9">Enable the &#8220;5 Oranges&#8221; option</button></p>
<p>Code:</p>
<pre class="brush: jscript;">
    $(&quot;#button8&quot;).click( function() {
        $(&quot;#dropdown5 option[value='oranges']&quot;).attr(&quot;disabled&quot;, &quot;disabled&quot;);
    });

    $(&quot;#button9&quot;).click( function() {
        $(&quot;#dropdown5 option[value='oranges']&quot;).removeAttr(&quot;disabled&quot;);
    });
</pre>
<p><a name="thecode"></a></p>
<h1>The code.</h1>
<p>The complete jQuery code with the above examples, can be <a href="/js/dropdown.js">downloaded here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://huuah.com/jquery-and-dropdown-select-boxes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A simple login script with PHP and MySQL</title>
		<link>http://huuah.com/a-simple-login-script-with-php-and-mysql/</link>
		<comments>http://huuah.com/a-simple-login-script-with-php-and-mysql/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 17:45:29 +0000</pubDate>
		<dc:creator>js - huuah</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://huuah.com/?p=417</guid>
		<description><![CDATA[<p>With this guide I will try to go through the very basic techniques of making a simple php script that can handle login authorization of website users.</p>
<p>The guide will be based on common Linux installations of both MySQL and PHP.</p>
<h1>Step 1 &#8211; the database</h1>
<p>Create a table in your MySQL database with 2 fields, <code>username</code> and <code>password</code>. This could be done by running the following code in your MySQL shell or from phpMyAdmin or another interface:</p>
<pre class="brush: plain;">
CREATE TABLE `login` (
`username` TEXT NOT NULL ,
`password` TEXT NOT NULL
)
</pre>
<p>The database table called <code>login</code> is now created with 2 field named <code>username</code> and <code>password</code>.</p>
<h1>Step&#8230;</h1>]]></description>
			<content:encoded><![CDATA[<p>With this guide I will try to go through the very basic techniques of making a simple php script that can handle login authorization of website users.</p>
<p>The guide will be based on common Linux installations of both MySQL and PHP.</p>
<h1>Step 1 &#8211; the database</h1>
<p>Create a table in your MySQL database with 2 fields, <code>username</code> and <code>password</code>. This could be done by running the following code in your MySQL shell or from phpMyAdmin or another interface:</p>
<pre class="brush: plain;">
CREATE TABLE `login` (
`username` TEXT NOT NULL ,
`password` TEXT NOT NULL
)
</pre>
<p>The database table called <code>login</code> is now created with 2 field named <code>username</code> and <code>password</code>.</p>
<h1>Step 2 &#8211; The HTML form</h1>
<p>First we have to create the web formula to show the login function:</p>
<pre class="brush: xml;">
&lt;form action=&quot;login.php&quot; method=&quot;post&quot;&gt;
  &lt;input type=&quot;text&quot; name=&quot;username&quot;&gt;
  &lt;input type=&quot;password&quot; name=&quot;password&quot;&gt;
  &lt;input type=&quot;submit&quot; value=&quot;Login&quot;&gt;
&lt;/form&gt;
</pre>
<p>This will output 3 field like this:</p>
<form action="#" method="post" onsubmit="return false;">
<input type="text" name="username">
<input type="password" name="password">
<input type="submit" value="Login">
</form>
<p>When submitting the form, either by hitting enter or by clicking the Login button, the formula will send the username and password to the login.php file.</p>
<h1>Step 3 &#8211; Getting the information from the website.</h1>
<p>The login information has now been sent to the login.php and we have to receive these value before checking them against the MySQL database.</p>
<p>Login.php:</p>
<pre class="brush: php;">
  &lt;?php
  ...
  // receiveing the login information
  $username = $_GET[&quot;username&quot;];
  $password = $_GET[&quot;password&quot;];
  ?&gt;
</pre>
<h1>Step 4 &#8211; Connecting to the database</h1>
<p>Before checking the login data against the database, we have to open a new connection.</p>
<pre class="brush: php;">
&lt;?php
  ...
  //login information to the MySQL database
  $dbuser = &quot;myUsername&quot;; // change myUsername to your own username
  $dbpass = &quot;myPassword&quot;; //change myPassword to your own password
  $dbhost = &quot;localhost&quot;; // this should work in most cases. Otherwise contact your webhost
  $db = &quot;myDatabase&quot;; // change myDatabase to your the database assigned to your login

  // perform user authentication
  mysql_connect($server, $dbuser, $dbpass);
  // selecting database
  mysql_select_db($db;

  ...
?&gt;
</pre>
<h1>Step 5 &#8211; Comparing the username and password against the database</h1>
<p>We have the login information from the formula and we have opened a connection to the database. Great. All we have to do, is the actually user validation.</p>
<pre class="brush: php;">
&lt;?php
  ..
  // check the content of our $username and $password variable against the login table
  $sql = &quot;SELECT username FROM login WHERE username='$username' AND password='$password'&quot;;
  // perform the query
  $query = mysql_query($sql);
  // check if the request returned 1 or 0 rows from the database
  if (mysql_num_rows($query)) {
    // 1 or more rows matched our request, which means the username and password combo are valid
  } else {
    // 0 rows matched our request. Login is not valid then.
  }
  ..
?&gt;
</pre>
<h1>Step 6 &#8211; All done, final pointer</h1>
<p>This is a very basic type of php login script. There are a lot of other things to have in mind when making database queries, that I have not convert in the above examples:</p>
<ul>
<li>Perhaps the login table should hold more information, like a user id for easier validation later on the the script.</li>
<li>Double checking and validating user input to prevent SQL Injection. This could be done be PHP Magic Quotes or by manually applying addslashes() and stripslashs().</li>
<li>..</li>
</ul>
<p>But then again. Very simple demonstration.</p>
]]></content:encoded>
			<wfw:commentRss>http://huuah.com/a-simple-login-script-with-php-and-mysql/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using website caching for better performance</title>
		<link>http://huuah.com/using-website-caching-for-better-performance/</link>
		<comments>http://huuah.com/using-website-caching-for-better-performance/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 21:20:33 +0000</pubDate>
		<dc:creator>js - huuah</dc:creator>
				<category><![CDATA[TYPO3]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[optimization]]></category>

		<guid isPermaLink="false">http://huuah.com/?p=413</guid>
		<description><![CDATA[<p>I was doing some benchmarking and performance analyzing on servers running Wordpress and TYPO3 websites and the result was not than good actually. My setup could use quite a bit of website optimization to get the pages loaded faster.</p>
<p>So. How do one find extra performance, without buying new expensive hardware. One way could to experiment with caching options. The <a href="http://eaccelerator.net/">eAccelerator</a> software is highly recommend for TYPO3 setup, so I did some testing with this and there was quite a bit of performance hidden here.</p>
<p>The installation was quite simple on my setup. I followed the <a href="http://eaccelerator.net/wiki/InstallFromSource">installlation guide</a> which was more or less a&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>I was doing some benchmarking and performance analyzing on servers running Wordpress and TYPO3 websites and the result was not than good actually. My setup could use quite a bit of website optimization to get the pages loaded faster.</p>
<p>So. How do one find extra performance, without buying new expensive hardware. One way could to experiment with caching options. The <a href="http://eaccelerator.net/">eAccelerator</a> software is highly recommend for TYPO3 setup, so I did some testing with this and there was quite a bit of performance hidden here.</p>
<p>The installation was quite simple on my setup. I followed the <a href="http://eaccelerator.net/wiki/InstallFromSource">installlation guide</a> which was more or less a set of commands. phpize, configure, make, make install and the copy the .ini file to the PHP ini directory. Reload apache/php and that&#8217;s it. All done.</p>
<p>If the website is running TYPO3 and there still are performance issues, then you should check that the configuration of the site and server, uses the internal caching mechanism found in TYPO3. If this is not disable (from an extension or something else) there will most likely be major performance boost waiting here. This is the typical bottle neck in TYPO3 and it should be considered carefully, as this optimized the performance of TYPO3. </p>
]]></content:encoded>
			<wfw:commentRss>http://huuah.com/using-website-caching-for-better-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Including Javascript or CSS in your TYPO3 template</title>
		<link>http://huuah.com/including-javascript-or-css-in-your-typo3-template/</link>
		<comments>http://huuah.com/including-javascript-or-css-in-your-typo3-template/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 20:46:40 +0000</pubDate>
		<dc:creator>js - huuah</dc:creator>
				<category><![CDATA[TYPO3]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://huuah.com/?p=409</guid>
		<description><![CDATA[<p>Have you ever had the need for inserting extra stylesheet or javascript files in your TYPO3 template? I am used to having a TemplaVoila setup, which has the nice feature of mapping part of the header as part of the template, but this is not really that flexible when using extension template and etc.</p>
<p>An easy way of controlling this, is to setup the javascript and css files from the template configuration. There are some different ways of doing this and I will demonstrate two of them here.</p>
<p>The template configuration examples should be self-explainable, so I will not comment them futher:</p>
<p><strong>Javascript&#8230;</strong></p>]]></description>
			<content:encoded><![CDATA[<p>Have you ever had the need for inserting extra stylesheet or javascript files in your TYPO3 template? I am used to having a TemplaVoila setup, which has the nice feature of mapping part of the header as part of the template, but this is not really that flexible when using extension template and etc.</p>
<p>An easy way of controlling this, is to setup the javascript and css files from the template configuration. There are some different ways of doing this and I will demonstrate two of them here.</p>
<p>The template configuration examples should be self-explainable, so I will not comment them futher:</p>
<p><strong>Javascript option 1 &#8211; headerData:</strong></p>
<pre class="brush: plain;">
page.headerData.230 = TEXT
page.headerData.230.value = &lt;script type=&quot;text/javascript&quot; src=&quot;/fileadmin/myjavascript.js&quot;&gt;&lt;/script&gt;
</pre>
<p><strong>Javascript option 2 &#8211; includeJS:</strong></p>
<pre class="brush: plain;">
page.includeJS {
  file1 = fileadmin/myjavascript.js
  file1.type = application/x-javascript
  file2 = fileadmin/myjavascript2.js
}
</pre>
<p><strong>CSS option 1 &#8211; headerData</strong></p>
<pre class="brush: plain;">
page.headerData.231 = TEXT
page.headerData.231.value = &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;/fileadmin/stylesheet.css&quot; /&gt;
</pre>
<p><strong>CSS option 2 &#8211; includeCSS</strong></p>
<pre class="brush: plain;">
page.includeCSS {
  file1 = fileadmin/stylesheet.css
}
</pre>
<p><strong>CSS option 3 &#8211; page.stylesheet</strong></p>
<pre class="brush: plain;">
page.stylesheet = fileadmin/stylesheet.css
</pre>
<p>Hope this tip can be helpful. Please notice that the CSS option 3 only enables you to <strong>set 1 stylesheet</strong>, where the other examples support multiple files.</p>
]]></content:encoded>
			<wfw:commentRss>http://huuah.com/including-javascript-or-css-in-your-typo3-template/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Point in polygon with php</title>
		<link>http://huuah.com/point-in-polygon-with-php/</link>
		<comments>http://huuah.com/point-in-polygon-with-php/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 09:27:36 +0000</pubDate>
		<dc:creator>js - huuah</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[point]]></category>
		<category><![CDATA[polygon]]></category>

		<guid isPermaLink="false">http://huuah.com/?p=395</guid>
		<description><![CDATA[<p>Have you ever had the need to check if a specific coordinate (point) is located inside or outside a polygon shaped area? I never did, so I had to found out how to automate this process, so I didn&#8217;t have to do this by hand. </p>
<p>The problem with this kind of assignment is, that I did not know what to search for on Google. Hadn&#8217;t though of it, as being a point in a polygon shaped area. I tried searching with words like &#8216;coordinate inside area&#8217;, &#8216;longitude latititude in area&#8221; and things like that, without much luck. Then a guy&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Have you ever had the need to check if a specific coordinate (point) is located inside or outside a polygon shaped area? I never did, so I had to found out how to automate this process, so I didn&#8217;t have to do this by hand. </p>
<p>The problem with this kind of assignment is, that I did not know what to search for on Google. Hadn&#8217;t though of it, as being a point in a polygon shaped area. I tried searching with words like &#8216;coordinate inside area&#8217;, &#8216;longitude latititude in area&#8221; and things like that, without much luck. Then a guy on IRC suggested a search for &#8220;point in polygon&#8221; and wuhu. Bingo.</p>
<p>I then found this page: <a href="http://www.assemblysys.com/dataServices/php_pointinpolygon.php">point in polygon</a>, where the author has posted a PHP class that does all the hard work for you. Brilliant.</p>
<p>I have a database table in MySQL containing x and y coordinates for a number of different points. In another table a have coordinates for a number of polygon shapes and I then want to check which point are located inside which polygons.</p>
<p>This is actually pretty simple to do.</p>
<p>Lets say we have a point (2,2) and want to check if this is inside a polygon with these coordinates (1,1), (3,6), (4,0):</p>
<pre class="brush: php;">

  //include the point in the polygon classs
  include_once(&quot;point_in_polygon.php&quot;);

  $point = &quot;2 2&quot;;
  $polygon = array(&quot;1 1&quot;, &quot;3 6&quot;, &quot;4 0&quot;)

  $pointLocation = new pointLocation();
  print &quot;Point in &quot; . $pointLocation-&gt;pointInPolygon($point, $polygon) . &quot; the polygon&quot;;
</pre>
<p>Run the code and it will print:</p>
<pre class="brush: plain;">
$ php polygon.php
Point is inside the polygon
</pre>
<p><strong>So how does this work?</strong> All you have to do, is to &#8220;draw&#8221; a straight line from the point and all the way through the shape and then count have many lines you cross. If you cross an even or zero number of lines the point is outside the shape and if the number the uneven you are inside. </p>
<p><strong>Got it?</strong> Well, there&#8217;s some quick drawings from Gimp to illustrate it:</p>
<p>The example from the above code:<br />
<img src="http://huuah.com/images/2-2-inside.jpg" alt="point in polygon inside" /></p>
<p>Point is inside because of a uneven number of line crosses:<br />
<img src="http://huuah.com/images/1-cross-inside.jpg" alt="point in polygon inside" /></p>
<p>Point is outside because of a even or zero number of line crosses:<br />
<img src="http://huuah.com/images/2-cross-outside.jpg" alt="point in polygon outside" /></p>
<p><strong>There you go.</strong> This is one way to check if a point is inside a polygon shaped area.</p>
]]></content:encoded>
			<wfw:commentRss>http://huuah.com/point-in-polygon-with-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Faster image scaling within TYPO3 extension</title>
		<link>http://huuah.com/faster-image-scaling-within-typo3-extension/</link>
		<comments>http://huuah.com/faster-image-scaling-within-typo3-extension/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 20:28:43 +0000</pubDate>
		<dc:creator>js - huuah</dc:creator>
				<category><![CDATA[TYPO3]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://huuah.com/?p=387</guid>
		<description><![CDATA[<p>During the development of a gallery extension for TYPO3, I was having some performance issues when during the on-the-fly image scaling.</p>
<p>When displaying the images in the frontend, I would scale the images to a size specified in the plugin configuration. I was using the following code:</p>
<pre class="brush: php;">
...
$imageConf['file'] = $row[image];
$imageConf['file.']['maxH'] = $this-&#62;conf[largeMaxH];
$imageConf['file.']['maxW'] = $this-&#62;conf[largeMaxW];
$thumbnailImage = $this-&#62;cObj-&#62;IMG_RESOURCE($imageConf);
...
</pre>
<p>The $row[image] would contain the image file to be displayed and the maxH and maxW is being set to the image sizes from the plugin configuration. When loading the page every image would be resized to the correct size, but when&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>During the development of a gallery extension for TYPO3, I was having some performance issues when during the on-the-fly image scaling.</p>
<p>When displaying the images in the frontend, I would scale the images to a size specified in the plugin configuration. I was using the following code:</p>
<pre class="brush: php;">
...
$imageConf['file'] = $row[image];
$imageConf['file.']['maxH'] = $this-&gt;conf[largeMaxH];
$imageConf['file.']['maxW'] = $this-&gt;conf[largeMaxW];
$thumbnailImage = $this-&gt;cObj-&gt;IMG_RESOURCE($imageConf);
...
</pre>
<p>The $row[image] would contain the image file to be displayed and the maxH and maxW is being set to the image sizes from the plugin configuration. When loading the page every image would be resized to the correct size, but when a single gallery reached about 100+ images this process started to perform very poorly. Actually is was slow &#8211; very slow.</p>
<p>What to do?! </p>
<p>Well, I figured out that I would try to make a function, where the image only would get resized once and then reused. I created an extra database field (a blob-field would be preferred) for storing the cached information.</p>
<p>Generating the images is still done with the above example, but now the filename for the resized image is being saved in the database. I choose a setup using a multidimensional array with keys representing the image height and width like this:</p>
<pre class="brush: php; highlight: [7];">
...
$imageConf['file'] = $row[image];
$imageConf['file.']['maxH'] = $this-&gt;conf[largeMaxH];
$imageConf['file.']['maxW'] = $this-&gt;conf[largeMaxW];
$thumbnailImage = $this-&gt;cObj-&gt;IMG_RESOURCE($imageConf);

$cached[$this-&gt;conf[thumbnailMaxW]][$this-&gt;conf[thumbnailMaxH]] = $thumbnailImage;
...
</pre>
<p>Until now there is no change in the performance as every image still is being resized on the fly. The last piece of the puzzle is to check whether or not there exists a cached image. To do this I am using two check:</p>
<pre class="brush: php; highlight: [1,2,10];">
$thumbnailImage = $cached[$this-&gt;conf[largeMaxW]][$this-&gt;conf[largeMaxH]];
if ($thumbnailImage == &quot;&quot; || ! file_exists($thumbnailImage)) {
  $imageConf['file'] = $row[image];
  $imageConf['file.']['maxH'] = $this-&gt;conf[largeMaxH];
  $imageConf['file.']['maxW'] = $this-&gt;conf[largeMaxW];
  $thumbnailImage = $this-&gt;cObj-&gt;IMG_RESOURCE($imageConf);

  $cached[$this-&gt;conf[thumbnailMaxW]][$this-&gt;conf[thumbnailMaxH]] = $thumbnailImage;

  $updateCache = 1;
}
</pre>
<p>First check is to see if the database contains information about a cached image and the second check is to see if the cache image still exists within the typo3temp directory. If one or both of these check fails, then a new cached image will be generated and the $updateCache is set to 1 indicating that the database should be updated later on in the script.</p>
<p>It&#8217;s a while since I made the actual code and I cannot remember the exact render times, but there was a massive performance boost in my extension.</p>
]]></content:encoded>
			<wfw:commentRss>http://huuah.com/faster-image-scaling-within-typo3-extension/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>jQuery, accessing and modifying form elements</title>
		<link>http://huuah.com/jquery-accessing-and-modifying-form-elements/</link>
		<comments>http://huuah.com/jquery-accessing-and-modifying-form-elements/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 20:43:58 +0000</pubDate>
		<dc:creator>js - huuah</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[elements]]></category>
		<category><![CDATA[form]]></category>

		<guid isPermaLink="false">http://huuah.com/?p=333</guid>
		<description><![CDATA[<p>When working with HTML Forms, it can in some situations improve the usability of the site, if the content of elements can change and reflect the options, that the visitor made in the previous fields.</p>
<p>The most common form element are input, checkbox, radio buttons, textarea and dropdown boxes and I will try to cover them all, even though the code might be the same or very much alike.</p>
<h1>Input boxes</h1>


<p><em>Fetching content is done with</em>:</p>
<pre class="brush: jscript;">
// fetching the value
$(&#34;#inputbox&#34;).val();
</pre>
<p>Try it:<br />
<button id="inputboxbtn1">Make a popup with the contents</button></p>
<p><em>Setting new content is done with</em>:</p>
<pre class="brush: jscript;">
// setting a new value
$(&#34;#inputbox&#34;).val(&#34;We have now changed the text&#34;);
</pre>
<p>Try&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>When working with HTML Forms, it can in some situations improve the usability of the site, if the content of elements can change and reflect the options, that the visitor made in the previous fields.</p>
<p>The most common form element are input, checkbox, radio buttons, textarea and dropdown boxes and I will try to cover them all, even though the code might be the same or very much alike.</p>
<h1>Input boxes</h1>
<input type="text" size="30" value="input box demo text" name="inputbox" id="inputbox" />
</p>
<p><em>Fetching content is done with</em>:</p>
<pre class="brush: jscript;">
// fetching the value
$(&quot;#inputbox&quot;).val();
</pre>
<p>Try it:<br />
<button id="inputboxbtn1">Make a popup with the contents</button></p>
<p><em>Setting new content is done with</em>:</p>
<pre class="brush: jscript;">
// setting a new value
$(&quot;#inputbox&quot;).val(&quot;We have now changed the text&quot;);
</pre>
<p>Try it:<br />
<button id="inputboxbtn2">Change the content to &#8220;We have now changed the text&#8221;</button></p>
<h1>Check boxes / Radio boxes</h1>
<p>Both check boxes and radio boxes works the same way.</p>
<table id="elementID">
<tr>
<td>Field 1</td>
<td>
<input type="checkbox" value="Field 1" name="checkbox"></td>
</tr>
<tr>
<td>Field 2</td>
<td>
<input type="checkbox" value="Field 2" name="checkbox"></td>
</tr>
<tr>
<td>Field 3</td>
<td>
<input type="checkbox" value="Field 3" name="checkbox"></td>
</tr>
</table>
<p><em>Checking all fields:</em></p>
<pre class="brush: jscript;">
// loop through each checkfield
$(&quot;#elementID input:checkbox&quot;).each( function() {
  // set checked=checked
  $(this).attr(&quot;checked&quot;, &quot;checked&quot;);
});
</pre>
<p>Try it:<br />
<button id="checkboxbtn1">Check all boxes</button></p>
<pre class="brush: jscript;">
// loop through each checkfield
$(&quot;#elementID input:checkbox&quot;).each( function() {
  // if field is checked, then uncheck or the other way around
  this.checked ? $(this).attr(&quot;checked&quot;, &quot;&quot;) : $(this).attr(&quot;checked&quot;, &quot;checked&quot;);
});
</pre>
<p><button id="checkboxbtn2">Toggle boxes</button></p>
<p><em>Outputting the checked status for each field:</em></p>
<pre class="brush: jscript;">
// temporary variable for output purposes
var status = &quot;&quot;;
// loop through each fieldfield
$(&quot;#elementID input:checkbox&quot;).each( function() {
  // save field value and checkstate in variable
  status += $(this).val() + &quot; is &quot; + this.checked + &quot;,  &quot;;
});
// make a popup box with the result
alert(status);
</pre>
<p>Try it:<br />
<button id="checkboxbtn3">Output checkbox status</button></p>
<h1>Textarea</h1>
<p><textarea id="textarea">Textarea sample text</textarea><br />
<em>Fetching content is done with</em>:</p>
<pre class="brush: jscript;">
// fetching the value
$(&quot;#textarea&quot;).html();
</pre>
<p>Try it:<br />
<button id="textareabtn1">Make a popup with the contents</button></p>
<p><em>Setting new content is done with</em>:</p>
<pre class="brush: jscript;">
// setting a new value
$(&quot;#textarea&quot;).html(&quot;We have now changed the text&quot;);
</pre>
<p>Try it:<br />
<button id="textareabtn2">Change the content to &#8220;We have now changed the text&#8221;</button></p>
<h1>Dropdown boxes</h1>
<select id="selectbox">
<option value="select1">Select 1</optoin><br />
<option value="select2">Select 2</optoin><br />
<option value="select3">Select 3</optoin><br />
</select>
<p><em>Fetch the value if the dropdown box:</em></p>
<pre class="brush: jscript;">
$(&quot;#selectbox&quot;).val()
</pre>
<p>Try it:<br />
<button id="selectboxbtn1">Output which option is selected</button></p>
<p><em>Selecting option 2 in the downdown box:</em></p>
<pre class="brush: jscript;">
// loop through options
$(&quot;#selectbox option&quot;).each( function() {
  // if the value is equal to 'select2', then select it
  if ($(this).val() == &quot;select2&quot;) {
    $(this).attr(&quot;selected&quot;, &quot;selected&quot;);
  }
});
</pre>
<p>Try it:<br />
<button id="selectboxbtn2">Select option 2</button></p>
<p><em>Selecting option 3 in the downdown box:</em></p>
<pre class="brush: jscript;">
// loop through options
$(&quot;#selectbox option&quot;).each( function() {
  // if the value is equal to 'select3', then select it
  if ($(this).val() == &quot;select3&quot;) {
    $(this).attr(&quot;selected&quot;, &quot;selected&quot;);
  }
});
</pre>
<p>Try it:<br />
<button id="selectboxbtn3">Select option 3</button></p>
<p>There you go. A small demonstration of how to access form elements. There above examples is just one way of doing it. There are other ways as well.</p>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://huuah.com/jquery-accessing-and-modifying-form-elements/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Multi language setup in TYPO3</title>
		<link>http://huuah.com/multi-language-setup-in-typo3/</link>
		<comments>http://huuah.com/multi-language-setup-in-typo3/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 11:07:44 +0000</pubDate>
		<dc:creator>js - huuah</dc:creator>
				<category><![CDATA[TYPO3]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[language]]></category>

		<guid isPermaLink="false">http://huuah.com/?p=320</guid>
		<description><![CDATA[<p>If you are building a site, which should support more than one language, there are two ways of doing this. Okay, perhaps there are more than two, but I will only give two examples.</p>
<p>The two I will cover is:<br />
1. Manually adding language page<br />
2. Integrated TYPO3 language support </p>
<h1>1. Manually adding language page</h1>
<p>This I will only touch briefly, as the solution should be obvious when the layout is presented. It should be very easy. Just create a tree like this and manually do the linking:<br />
<img src="/images/manuallylanguage.png" alt="Manually Language Setup" /><br />
That&#8217;s it. </p>
<h1>2. Integrated TYPO3 language support</h1>
<p>This is quite different compared to the first setup. We will&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>If you are building a site, which should support more than one language, there are two ways of doing this. Okay, perhaps there are more than two, but I will only give two examples.</p>
<p>The two I will cover is:<br />
1. Manually adding language page<br />
2. Integrated TYPO3 language support </p>
<h1>1. Manually adding language page</h1>
<p>This I will only touch briefly, as the solution should be obvious when the layout is presented. It should be very easy. Just create a tree like this and manually do the linking:<br />
<img src="/images/manuallylanguage.png" alt="Manually Language Setup" /><br />
That&#8217;s it. </p>
<h1>2. Integrated TYPO3 language support</h1>
<p>This is quite different compared to the first setup. We will be using the built-in language support in TYPO3, based on a tree structure like this:<br />
<img src="/images/typo3language1.png" alt="Tree structure for a TYPO3 language setup" /></p>
<p><strong>First step</strong> is to create the languages and this is done by selecting <code>list</code>, clicking your <code>site</code> in the tree structure and then adding a <code>website language</code>:<br />
<img src="/images/typo3language2.png" alt="Adding a website language step 1" /><br />
<img src="/images/typo3language3.png" alt="Adding a website language step 2" /></p>
<p>Then create the number of languages needed for the site.<br />
<img src="/images/typo3language4.png" alt="Adding a website language step 3" /></p>
<p><strong>Second step</strong> is the template configuration. Before doing this, we have to check which id numbers the languages has been given. This is done by selecting list on your site (just as when we created the languages) and the hover your mouse above each language:<br />
<img src="/images/typo3language5.png" alt="Adding a website language step 4 - getting the language id" /><br />
When this is done, then go to the template setup field and enter the following:</p>
<pre class="brush: plain;">
config.sys_language_overlay = hideNonTranslated
config.linkVars = L

[globalVar = GP:L=en]
  config.sys_language_uid=2
  config.language = en
[global]

[globalVar = GP:L=dk]
  config.sys_language_uid=1
  config.language = dk
[global]
</pre>
<p>What this does is:<br />
<code>config.sys_language_overlay = hideNonTranslated</code> will hide a page or content element, if is does not have content for the specific site. Remove or outcomment this, if you want all elements displayed.<br />
<code>config.linkVars = L</code> is the parameter used in the url for selecting language. Ie http://domain.tld/index.php?id=2?<code>L=dk</code><br />
<code>[globalVar = GP:L=dk]</code> a section like this, configures the language based on the parameter passed by the linkVars. Here it will trigger on <code>L=dk</code><br />
<code>config.sys_language_uid=1</code> this will join the dk-parameter with the language id 1, which we found earlier.<br />
<code>config.language = dk</code> this will set the page language for <code>dk</code></p>
<p><strong>Third and final step</strong> is to configure a page to use the new languages. This is done by selecting <code>list</code>, clicking <code>the page</code> and adding an <code>Alternative Page Language</code><br />
<img src="/images/typo3language6.png" alt="Adding a website language step 5" /><br />
<img src="/images/typo3language7.png" alt="Adding a website language step 6" /><br />
Then select which language you want to create a page for, type in the page title and save it.<br />
<img src="/images/typo3language8.png" alt="Adding a website language step 7" /><br />
We are now ready for translating the page. When editing an element on the newly configured page, there is now a new option in the top of the page. Select the new language and type in the translation.<br />
<img src="/images/typo3language9.png" alt="Adding a website language step 8" /></p>
<p><strong>That&#8217;s it</strong>. TYPO3 will now display the Danish content when visiting the page with the L=dk parameter in the url.</p>
]]></content:encoded>
			<wfw:commentRss>http://huuah.com/multi-language-setup-in-typo3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
