<?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>Markus Tenghamn</title>
	<atom:link href="http://markustenghamn.com/feed" rel="self" type="application/rss+xml" />
	<link>http://markustenghamn.com</link>
	<description>Web Designer and Entrepreneur</description>
	<lastBuildDate>Fri, 18 May 2012 21:03:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>How to configure and setup WHMCS Licensing addon</title>
		<link>http://markustenghamn.com/configure-setup-whmcs-licensing-addon</link>
		<comments>http://markustenghamn.com/configure-setup-whmcs-licensing-addon#comments</comments>
		<pubDate>Fri, 18 May 2012 21:00:35 +0000</pubDate>
		<dc:creator>Markus Tenghamn</dc:creator>
				<category><![CDATA[WHMCS]]></category>
		<category><![CDATA[configure]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[license]]></category>
		<category><![CDATA[licensing addon]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[setup]]></category>
		<category><![CDATA[verify]]></category>
		<category><![CDATA[WHMCS Licensing addon]]></category>

		<guid isPermaLink="false">http://markustenghamn.com/?p=181</guid>
		<description><![CDATA[I get a lot of questions in regards to how to use the WHMCS licensing addon which is why I wrote a post a while back which described how to get the code working. That guide is outdated and did not show any code which is why I want to write a new guide with [...]]]></description>
			<content:encoded><![CDATA[<p>I get a lot of questions in regards to how to use the WHMCS licensing addon which is why I wrote a post a while back which described how to get the code working. That guide is outdated and did not show any code which is why I want to write a new guide with a little bit of code, but not enough to disclose how the whmcs licensing addon works.</p>
<p>When you purchase the <a title="WHMCS licensing addon" href="http://www.whmcs.com/addons/licensing-addon/" target="_blank">WHMCS licensing addon</a> you will receive several files but you will only have to worry about one for this guide which is the check_sample_code.php file. This is an example by WHMCS to show you how the code should be implemented in your script, plugin or theme. I will now walk through the example file and show you which parts are important and what they do.</p>
<p>inside the function check_license() we have the following code.</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="php"><pre class="de1"><span class="re0">$whmcsurl</span> <span class="sy0">=</span> <span class="st0">&quot;http://www.yourdomain.com/whmcs/&quot;</span><span class="sy0">;</span>
    <span class="re0">$licensing_secret_key</span> <span class="sy0">=</span> <span class="st0">&quot;abc123&quot;</span><span class="sy0">;</span></pre></div></div></div></div></div></div></div>


<p>These almost explain themselves and WHMCS even has some commenting to explain how to modify them. The first variable $whmcsurl should be equal to your whmcs installation and the other variable $licensing_secret_key is your secret key that you use when creating the product that you will be licensing.</p>
<p>those are all the changes you should make to the check_license() function. You could basically copy the check license function (all of it) and paste it into your script, plugin, or theme. The header file is always a good place to either have the code or include the file which contains the code for the function check_license(). Check <a href="http://php.net/manual/en/function.include.php" title="php include function" target="_blank">php&#8217;s include function</a> for more information on how to do this.</p>
<p>Now, let&#8217;s go past the check_license() function and move down to $licensekey, this is very important and should always be equal to the license you generate in WHMCS. This is the key used to check if a license is valid or not. Next is the local key ($localkey), don&#8217;t worry about this, its a local key used for logging and you could change it up if you would like, but i wouldn&#8217;t touch it.</p>
<p>This line actually calls the function that will talk to your WHMCS and check if the license is valid or not.</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="php"><pre class="de1"><span class="re0">$results</span> <span class="sy0">=</span> check_license<span class="br0">&#40;</span><span class="re0">$licensekey</span><span class="sy0">,</span><span class="re0">$localkey</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div></div></div></div></div></div></div>


<p>You need to include this in your php file after the $licensekey and $localkey are defined. If you do not include this function then your script won&#8217;t check if the license is valid.</p>
<p>Now the results of the function check_license() is stored in the variable $results as an array. The status of the license will be stored in this key.</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="php"><pre class="de1"><span class="re0">$results</span><span class="br0">&#91;</span><span class="st0">&quot;status&quot;</span><span class="br0">&#93;</span></pre></div></div></div></div></div></div></div>


<p>We can now check if the license was valid using the included else if statement WHMCS uses.</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="php"><pre class="de1"><span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$results</span><span class="br0">&#91;</span><span class="st0">&quot;status&quot;</span><span class="br0">&#93;</span><span class="sy0">==</span><span class="st0">&quot;Active&quot;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
    <span class="co2"># Allow Script to Run
</span>    <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$results</span><span class="br0">&#91;</span><span class="st0">&quot;localkey&quot;</span><span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
        <span class="co2"># Save Updated Local Key to DB or File
</span>        <span class="re0">$localkeydata</span> <span class="sy0">=</span> <span class="re0">$results</span><span class="br0">&#91;</span><span class="st0">&quot;localkey&quot;</span><span class="br0">&#93;</span><span class="sy0">;</span>
    <span class="br0">&#125;</span>
<span class="br0">&#125;</span> <span class="kw1">elseif</span> <span class="br0">&#40;</span><span class="re0">$results</span><span class="br0">&#91;</span><span class="st0">&quot;status&quot;</span><span class="br0">&#93;</span><span class="sy0">==</span><span class="st0">&quot;Invalid&quot;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
    <span class="co2"># Show Invalid Message
</span><span class="br0">&#125;</span> <span class="kw1">elseif</span> <span class="br0">&#40;</span><span class="re0">$results</span><span class="br0">&#91;</span><span class="st0">&quot;status&quot;</span><span class="br0">&#93;</span><span class="sy0">==</span><span class="st0">&quot;Expired&quot;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
    <span class="co2"># Show Expired Message
</span><span class="br0">&#125;</span> <span class="kw1">elseif</span> <span class="br0">&#40;</span><span class="re0">$results</span><span class="br0">&#91;</span><span class="st0">&quot;status&quot;</span><span class="br0">&#93;</span><span class="sy0">==</span><span class="st0">&quot;Suspended&quot;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
    <span class="co2"># Show Suspended Message
</span><span class="br0">&#125;</span></pre></div></div></div></div></div></div></div>


<p>This is very simple but can get confusing for some so I will make a quick example of my own script which I want to use the license check on.</p>
<p>So here is my script which I want to license.</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="php"><pre class="de1"><span class="kw2">&lt;?php</span>
<span class="kw1">if</span> <span class="br0">&#40;</span><span class="kw3">isset</span><span class="br0">&#40;</span><span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st_h">'add1'</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
	<span class="re0">$result</span> <span class="sy0">=</span> <span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st_h">'add1'</span><span class="br0">&#93;</span> <span class="sy0">+</span> <span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st_h">'add2'</span><span class="br0">&#93;</span><span class="sy0">;</span>
	<span class="kw1">echo</span> <span class="re0">$result</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
<span class="sy1">?&gt;</span>
&lt;form method=&quot;POST&quot; action=&quot;#&quot;&gt;
&lt;input type=&quot;text&quot; name=&quot;add1&quot;&gt; plus 
&lt;input type=&quot;text&quot; name=&quot;add2&quot;&gt;
 &lt;input type=&quot;submit&quot; value=&quot;Solve&quot;&gt;
&lt;/form&gt;</pre></div></div></div></div></div></div></div>


<p>It simply takes two numbers and adds them. Now I want to show my script only if the license is valid, so I can add an if statement to make this check. I also need to include the check_license() function which I added in a file called licensefunction.php.</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="php"><pre class="de1"><span class="kw2">&lt;?php</span>
<span class="kw1">include</span> <span class="st_h">'licensefunction.php'</span><span class="sy0">;</span>
&nbsp;
<span class="re0">$licensekey</span> <span class="sy0">=</span> <span class="st0">&quot;WHMCS-c5adf50c9a&quot;</span><span class="sy0">;</span>
<span class="re0">$localkey</span> <span class="sy0">=</span> <span class="st_h">'9tjIxIzNwgDMwIjI6gjOztjIlRXYkt2Ylh2YioTO6M3OicmbpNnblNWasx1cyVmdyV2ccNXZsVHZv1GX
zNWbodHXlNmc192czNWbodHXzN2bkRHacBFUNFEWcNHduVWb1N2bExFd0FWTcNnclNXVcpzQioDM4ozc
7ISey9GdjVmcpRGZpxWY2JiO0EjOztjIx4CMuAjL3ITMioTO6M3OiAXaklGbhZnI6cjOztjI0N3boxWY
j9Gbuc3d3xCdz9GasF2YvxmI6MjM6M3Oi4Wah12bkRWasFmdioTMxozc7ISeshGdu9WTiozN6M3OiUGb
jl3Yn5WasxWaiJiOyEjOztjI3ATL4ATL4ADMyIiOwEjOztjIlRXYkVWdkRHel5mI6ETM6M3OicDMtcDM
tgDMwIjI6ATM6M3OiUGdhR2ZlJnI6cjOztjIlNXYlxEI5xGa052bNByUD1ESXJiO5EjOztjIl1WYuR3Y
1R2byBnI6ETM6M3OicjI6EjOztjIklGdjVHZvJHcioTO6M3Oi02bj5ycj1Ga3BEd0FWbioDNxozc7ICb
pFWblJiO1ozc7IyUD1ESXBCd0FWTioDMxozc7ISZtFmbkVmclR3cpdWZyJiO0EjOztjIlZXa0NWQiojN
6M3OiMXd0FGdzJiO2ozc7pjMxoTY8baca0885830a33725148e94e693f3f073294c0558d38e31f844
c5e399e3c16a'</span><span class="sy0">;</span>
&nbsp;
<span class="re0">$results</span> <span class="sy0">=</span> check_license<span class="br0">&#40;</span><span class="re0">$licensekey</span><span class="sy0">,</span><span class="re0">$localkey</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
<span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$results</span><span class="br0">&#91;</span><span class="st0">&quot;status&quot;</span><span class="br0">&#93;</span><span class="sy0">==</span><span class="st0">&quot;Active&quot;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
&nbsp;
<span class="kw1">if</span> <span class="br0">&#40;</span><span class="kw3">isset</span><span class="br0">&#40;</span><span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st_h">'add1'</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
	<span class="re0">$result</span> <span class="sy0">=</span> <span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st_h">'add1'</span><span class="br0">&#93;</span> <span class="sy0">+</span> <span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st_h">'add2'</span><span class="br0">&#93;</span><span class="sy0">;</span>
	<span class="kw1">echo</span> <span class="re0">$result</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
<span class="sy1">?&gt;</span>
&lt;form method=&quot;POST&quot; action=&quot;#&quot;&gt;
&lt;input type=&quot;text&quot; name=&quot;add1&quot;&gt; plus 
&lt;input type=&quot;text&quot; name=&quot;add2&quot;&gt;
 &lt;input type=&quot;submit&quot; value=&quot;Solve&quot;&gt;
&lt;/form&gt;
&nbsp;
<span class="kw2">&lt;?php</span>
&nbsp;
<span class="br0">&#125;</span>
&nbsp;
<span class="sy1">?&gt;</span></pre></div></div></div></div></div></div></div>


<p>Now the script will only show if there is a valid license otherwise the page will be blank, but I want to show an error if the license is invalid so that the user doesn&#8217;t get confused.</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="php"><pre class="de1"><span class="kw2">&lt;?php</span>
<span class="kw1">include</span> <span class="st_h">'licensefunction.php'</span><span class="sy0">;</span>
&nbsp;
<span class="re0">$licensekey</span> <span class="sy0">=</span> <span class="st0">&quot;WHMCS-c5adf50c9a&quot;</span><span class="sy0">;</span>
<span class="re0">$localkey</span> <span class="sy0">=</span> <span class="st_h">'9tjIxIzNwgDMwIjI6gjOztjIlRXYkt2Ylh2YioTO6M3OicmbpNnblNWasx1cyVmdyV2ccNXZsVHZv1GX
zNWbodHXlNmc192czNWbodHXzN2bkRHacBFUNFEWcNHduVWb1N2bExFd0FWTcNnclNXVcpzQioDM4ozc
7ISey9GdjVmcpRGZpxWY2JiO0EjOztjIx4CMuAjL3ITMioTO6M3OiAXaklGbhZnI6cjOztjI0N3boxWY
j9Gbuc3d3xCdz9GasF2YvxmI6MjM6M3Oi4Wah12bkRWasFmdioTMxozc7ISeshGdu9WTiozN6M3OiUGb
jl3Yn5WasxWaiJiOyEjOztjI3ATL4ATL4ADMyIiOwEjOztjIlRXYkVWdkRHel5mI6ETM6M3OicDMtcDM
tgDMwIjI6ATM6M3OiUGdhR2ZlJnI6cjOztjIlNXYlxEI5xGa052bNByUD1ESXJiO5EjOztjIl1WYuR3Y
1R2byBnI6ETM6M3OicjI6EjOztjIklGdjVHZvJHcioTO6M3Oi02bj5ycj1Ga3BEd0FWbioDNxozc7ICb
pFWblJiO1ozc7IyUD1ESXBCd0FWTioDMxozc7ISZtFmbkVmclR3cpdWZyJiO0EjOztjIlZXa0NWQiojN
6M3OiMXd0FGdzJiO2ozc7pjMxoTY8baca0885830a33725148e94e693f3f073294c0558d38e31f844
c5e399e3c16a'</span><span class="sy0">;</span>
&nbsp;
<span class="re0">$results</span> <span class="sy0">=</span> check_license<span class="br0">&#40;</span><span class="re0">$licensekey</span><span class="sy0">,</span><span class="re0">$localkey</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
<span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$results</span><span class="br0">&#91;</span><span class="st0">&quot;status&quot;</span><span class="br0">&#93;</span><span class="sy0">==</span><span class="st0">&quot;Active&quot;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
&nbsp;
<span class="kw1">if</span> <span class="br0">&#40;</span><span class="kw3">isset</span><span class="br0">&#40;</span><span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st_h">'add1'</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
	<span class="re0">$result</span> <span class="sy0">=</span> <span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st_h">'add1'</span><span class="br0">&#93;</span> <span class="sy0">+</span> <span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st_h">'add2'</span><span class="br0">&#93;</span><span class="sy0">;</span>
	<span class="kw1">echo</span> <span class="re0">$result</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
<span class="sy1">?&gt;</span>
&lt;form method=&quot;POST&quot; action=&quot;#&quot;&gt;
&lt;input type=&quot;text&quot; name=&quot;add1&quot;&gt; plus 
&lt;input type=&quot;text&quot; name=&quot;add2&quot;&gt;
 &lt;input type=&quot;submit&quot; value=&quot;Solve&quot;&gt;
&lt;/form&gt;
&nbsp;
<span class="kw2">&lt;?php</span>
&nbsp;
<span class="br0">&#125;</span>
<span class="kw1">else</span> <span class="br0">&#123;</span>
	<span class="kw1">echo</span> <span class="st_h">'License could not be verified'</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
&nbsp;
<span class="sy1">?&gt;</span></pre></div></div></div></div></div></div></div>


<p>This will echo the error if the license was not valid, I could of course add different errors for an invalid, suspended, or expired license but this will be ok for my script, the user will know something is wrong.</p>
<p>For larger scripts I could terminate the loading of a page by simply adding a die() function at the top.</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="php"><pre class="de1"><span class="kw2">&lt;?php</span>
<span class="kw1">include</span> <span class="st_h">'licensefunction.php'</span><span class="sy0">;</span>
&nbsp;
<span class="re0">$licensekey</span> <span class="sy0">=</span> <span class="st0">&quot;WHMCS-c5adf50c9a&quot;</span><span class="sy0">;</span>
<span class="re0">$localkey</span> <span class="sy0">=</span> <span class="st_h">'9tjIxIzNwgDMwIjI6gjOztjIlRXYkt2Ylh2YioTO6M3OicmbpNnblNWasx1cyVmdyV2ccNXZsVHZv1GX
zNWbodHXlNmc192czNWbodHXzN2bkRHacBFUNFEWcNHduVWb1N2bExFd0FWTcNnclNXVcpzQioDM4ozc
7ISey9GdjVmcpRGZpxWY2JiO0EjOztjIx4CMuAjL3ITMioTO6M3OiAXaklGbhZnI6cjOztjI0N3boxWY
j9Gbuc3d3xCdz9GasF2YvxmI6MjM6M3Oi4Wah12bkRWasFmdioTMxozc7ISeshGdu9WTiozN6M3OiUGb
jl3Yn5WasxWaiJiOyEjOztjI3ATL4ATL4ADMyIiOwEjOztjIlRXYkVWdkRHel5mI6ETM6M3OicDMtcDM
tgDMwIjI6ATM6M3OiUGdhR2ZlJnI6cjOztjIlNXYlxEI5xGa052bNByUD1ESXJiO5EjOztjIl1WYuR3Y
1R2byBnI6ETM6M3OicjI6EjOztjIklGdjVHZvJHcioTO6M3Oi02bj5ycj1Ga3BEd0FWbioDNxozc7ICb
pFWblJiO1ozc7IyUD1ESXBCd0FWTioDMxozc7ISZtFmbkVmclR3cpdWZyJiO0EjOztjIlZXa0NWQiojN
6M3OiMXd0FGdzJiO2ozc7pjMxoTY8baca0885830a33725148e94e693f3f073294c0558d38e31f844
c5e399e3c16a'</span><span class="sy0">;</span>
&nbsp;
<span class="re0">$results</span> <span class="sy0">=</span> check_license<span class="br0">&#40;</span><span class="re0">$licensekey</span><span class="sy0">,</span><span class="re0">$localkey</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
<span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$results</span><span class="br0">&#91;</span><span class="st0">&quot;status&quot;</span><span class="br0">&#93;</span> <span class="sy0">!=</span> <span class="st0">&quot;Active&quot;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
	<span class="kw3">die</span><span class="br0">&#40;</span><span class="st_h">'License could not be verified'</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
&nbsp;
<span class="kw1">if</span> <span class="br0">&#40;</span><span class="kw3">isset</span><span class="br0">&#40;</span><span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st_h">'add1'</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
	<span class="re0">$result</span> <span class="sy0">=</span> <span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st_h">'add1'</span><span class="br0">&#93;</span> <span class="sy0">+</span> <span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st_h">'add2'</span><span class="br0">&#93;</span><span class="sy0">;</span>
	<span class="kw1">echo</span> <span class="re0">$result</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
<span class="sy1">?&gt;</span>
&lt;form method=&quot;POST&quot; action=&quot;#&quot;&gt;
&lt;input type=&quot;text&quot; name=&quot;add1&quot;&gt; plus 
&lt;input type=&quot;text&quot; name=&quot;add2&quot;&gt;
 &lt;input type=&quot;submit&quot; value=&quot;Solve&quot;&gt;
&lt;/form&gt;
&nbsp;
?&gt;</pre></div></div></div></div></div></div></div>


<p>Now the script will stop loading at the die() function if the license is not active, so none of the code below the die statement will be presented. If the license is active the die function will never be called and the script will continue to run normally.</p>
<p>To make your licensed script, plugin, or theme even more secure I would recommend using something like IonCube loader which WHMCS uses on their own encrypted files.</p>
]]></content:encoded>
			<wfw:commentRss>http://markustenghamn.com/configure-setup-whmcs-licensing-addon/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Improve the search function in Magento</title>
		<link>http://markustenghamn.com/improve-search-function-magento</link>
		<comments>http://markustenghamn.com/improve-search-function-magento#comments</comments>
		<pubDate>Sat, 21 Apr 2012 21:49:10 +0000</pubDate>
		<dc:creator>Markus Tenghamn</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[Change search]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[improve magento search]]></category>
		<category><![CDATA[Improved Search]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[make magento search better]]></category>
		<category><![CDATA[make search better]]></category>

		<guid isPermaLink="false">http://markustenghamn.com/?p=176</guid>
		<description><![CDATA[Earlier I wrote about how you can change Magento so that all the products that are sold out show up last. Here is another thing that can be improved in Magento. The search function shows by default the most relevant results last. And if you have multiple search terms it tries to find a match [...]]]></description>
			<content:encoded><![CDATA[<p>Earlier I wrote about how you can change Magento so that all the products that are sold out show up last. Here is another thing that can be improved in Magento. The search function shows by default the most relevant results last. And if you have multiple search terms it tries to find a match one at a time. We can change this fairly easily with a small bit of code. </p>
<p>Change the file /catalogsearch/form.mini.phtml in your theme</p>
<p>In that file is a html form. Add the following code anywhere between the form tags</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="html"><pre class="de1">&lt;input type=&quot;hidden&quot; name=&quot;order&quot; value=&quot;relevance&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;dir&quot; value=&quot;desc&quot;&gt;</pre></div></div></div></div></div></div></div>


<p>This changes the search so that our most relevant results show first.</p>
<p>Then make a copy of app/code/core/Mage/CatalogSearch/Model/resource/Fulltext.php</p>
<p>And place it here app/code/local/Mage/CatalogSearch/Model/resource/Fulltext.php</p>
<p>On line 356 is the following code</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="php"><pre class="de1"><span class="re0">$likeCond</span> <span class="sy0">=</span> <span class="st_h">'('</span> <span class="sy0">.</span> <span class="kw3">join</span><span class="br0">&#40;</span><span class="st_h">' OR '</span><span class="sy0">,</span> <span class="re0">$like</span><span class="br0">&#41;</span> <span class="sy0">.</span> <span class="st_h">')'</span><span class="sy0">;</span></pre></div></div></div></div></div></div></div>


<p>Change it to the following</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="php"><pre class="de1"><span class="re0">$likeCond</span> <span class="sy0">=</span> <span class="st_h">'('</span> <span class="sy0">.</span> <span class="kw3">join</span><span class="br0">&#40;</span><span class="st_h">' AND '</span><span class="sy0">,</span> <span class="re0">$like</span><span class="br0">&#41;</span> <span class="sy0">.</span> <span class="st_h">')'</span><span class="sy0">;</span></pre></div></div></div></div></div></div></div>


<p>Then on line 378 find</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="php"><pre class="de1"><span class="re0">$where</span> <span class="sy0">.=</span> <span class="br0">&#40;</span><span class="re0">$where</span> ? <span class="st_h">' OR '</span> <span class="sy0">:</span> <span class="st_h">''</span><span class="br0">&#41;</span> <span class="sy0">.</span> <span class="re0">$likeCond</span><span class="sy0">;</span></pre></div></div></div></div></div></div></div>


<p>And change it to</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="php"><pre class="de1"><span class="re0">$where</span> <span class="sy0">.=</span> <span class="br0">&#40;</span><span class="re0">$where</span> ? <span class="st_h">' AND '</span> <span class="sy0">:</span> <span class="st_h">''</span><span class="br0">&#41;</span> <span class="sy0">.</span> <span class="re0">$likeCond</span><span class="sy0">;</span></pre></div></div></div></div></div></div></div>


<p>That&#8217;s it, now your search results should be much more relevant! Let me know if you have any questions.</p>
]]></content:encoded>
			<wfw:commentRss>http://markustenghamn.com/improve-search-function-magento/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Show products no longer in stock last in Magento</title>
		<link>http://markustenghamn.com/show-products-longer-stock-magento</link>
		<comments>http://markustenghamn.com/show-products-longer-stock-magento#comments</comments>
		<pubDate>Sat, 21 Apr 2012 21:32:58 +0000</pubDate>
		<dc:creator>Markus Tenghamn</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[change product order]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[out of stock]]></category>
		<category><![CDATA[Out of stock last]]></category>
		<category><![CDATA[sold out products last]]></category>

		<guid isPermaLink="false">http://markustenghamn.com/?p=170</guid>
		<description><![CDATA[One big problem with Magento is that when products become out of stock they still show up very high in the product listings and this can get very annoying for some users if there are several products out of stock. This very easy code fix will automatically make products that are out of stock show [...]]]></description>
			<content:encoded><![CDATA[<p>One big problem with Magento is that when products become out of stock they still show up very high in the product listings and this can get very annoying for some users if there are several products out of stock. This very easy code fix will automatically make products that are out of stock show up last in all your categories and search results.</p>
<p>Go to the following folder in Magento where you will find List.php</p>
<p>/app/code/core/Mage/Catalog/Block/Product/</p>
<p>If you don&#8217;t want to change the core files, which is always a bad habbit then copy the file to /app/code/local/Mage/Catalog/Block/Product/</p>
<p>Find the following around line 86.</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="php"><pre class="de1"><span class="re0">$this</span><span class="sy0">-&gt;</span>_productCollection <span class="sy0">=</span> <span class="re0">$layer</span><span class="sy0">-&gt;</span><span class="me1">getProductCollection</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div></div></div></div></div></div></div>


<p>And change it to</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="php"><pre class="de1"><span class="re0">$this</span><span class="sy0">-&gt;</span>_productCollection <span class="sy0">=</span> <span class="re0">$layer</span><span class="sy0">-&gt;</span><span class="me1">getProductCollection</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">-&gt;</span><span class="me1">joinField</span><span class="br0">&#40;</span><span class="st_h">'inventory_in_stock'</span><span class="sy0">,</span> <span class="st_h">'cataloginventory_stock_item'</span><span class="sy0">,</span> <span class="st_h">'is_in_stock'</span><span class="sy0">,</span> <span class="st_h">'product_id=entity_id'</span><span class="sy0">,</span><span class="st_h">'is_in_stock&gt;=0'</span><span class="sy0">,</span> <span class="st_h">'left'</span><span class="br0">&#41;</span><span class="sy0">-&gt;</span><span class="me1">setOrder</span><span class="br0">&#40;</span><span class="st_h">'inventory_in_stock'</span><span class="sy0">,</span><span class="st_h">'desc'</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div></div></div></div></div></div></div>


<p>There you go, now it&#8217;s done, that&#8217;s all you have to do to make it work. Feel free to ask me any questions you may have.</p>
]]></content:encoded>
			<wfw:commentRss>http://markustenghamn.com/show-products-longer-stock-magento/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a Tag Cloud with PHP</title>
		<link>http://markustenghamn.com/creating-tag-cloud-php</link>
		<comments>http://markustenghamn.com/creating-tag-cloud-php#comments</comments>
		<pubDate>Thu, 15 Mar 2012 00:43:56 +0000</pubDate>
		<dc:creator>Markus Tenghamn</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[create]]></category>
		<category><![CDATA[Markus Tenghamn]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[source code]]></category>
		<category><![CDATA[Tag cloud]]></category>

		<guid isPermaLink="false">http://markustenghamn.com/?p=162</guid>
		<description><![CDATA[I have previously uploaded this code to SourceCodeDB.com http://sourcecodedb.com/Create-a-tag-cloud-with-php.html I am using and modifying code originally from Steven York, he has written most of the code in this example. I had to modify pieces of his code due to the fact that the tags stored on sourcecodedb.com are strings like this &#8220;C#, loop, code&#8221; instead [...]]]></description>
			<content:encoded><![CDATA[<p>I have previously uploaded this code to SourceCodeDB.com<br />
<a title="Create a tag cloud with php" href="http://sourcecodedb.com/Create-a-tag-cloud-with-php.html">http://sourcecodedb.com/Create-a-tag-cloud-with-php.html</a></p>
<p>I am using and modifying code originally from <a href="http://stevenyork.com/tutorial/creating_accessible_tag_cloud_in_php_css_mysql">Steven York</a>, he has written most of the code in this example. I had to modify pieces of his code due to the fact that the tags stored on sourcecodedb.com are strings like this &#8220;C#, loop, code&#8221; instead of storing each tag as its own word. Below is the code I am using with plenty of comments to explain what I am doing.</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="php"><pre class="de1"><span class="kw2">&lt;?php</span>
        <span class="kw2">function</span> createTagCloud<span class="br0">&#40;</span><span class="re0">$tags</span><span class="br0">&#41;</span>  
    <span class="br0">&#123;</span>    
        <span class="co1">//I pass through an array of tags  </span>
        <span class="re0">$i</span><span class="sy0">=</span><span class="nu0">0</span><span class="sy0">;</span>  
        <span class="kw1">foreach</span><span class="br0">&#40;</span><span class="re0">$tags</span> <span class="kw1">as</span> <span class="re0">$tag</span><span class="br0">&#41;</span>  
        <span class="br0">&#123;</span>  
            <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$i</span> <span class="sy0">&lt;</span> <span class="nu0">61</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
             <span class="co1">//the tag id, passed through  </span>
            <span class="re0">$name</span> <span class="sy0">=</span> <span class="re0">$tag</span><span class="sy0">;</span> <span class="co1">//the tag name, also passed through in the array</span>
            <span class="co1">// I removed tag id since we dont have any tag ids here</span>
            <span class="co1">//using the mysql count command to sum up the tutorials tagged with that id  </span>
            <span class="re0">$sql</span> <span class="sy0">=</span> <span class="st0">&quot;SELECT COUNT(*) AS totalnum FROM codetable WHERE Tags LIKE '%&quot;</span><span class="sy0">.</span><span class="re0">$name</span><span class="sy0">.</span><span class="st0">&quot;%' AND Moderated = '1'&quot;</span><span class="sy0">;</span>  
&nbsp;
            <span class="co1">//create the resultset and return it  </span>
            <span class="re0">$res</span> <span class="sy0">=</span> <span class="kw3">mysql_query</span><span class="br0">&#40;</span><span class="re0">$sql</span><span class="br0">&#41;</span><span class="sy0">;</span>  
            <span class="re0">$res</span> <span class="sy0">=</span> <span class="kw3">mysql_fetch_assoc</span><span class="br0">&#40;</span><span class="re0">$res</span><span class="br0">&#41;</span><span class="sy0">;</span>  
&nbsp;
            <span class="co1">//check there are results ;)</span>
            <span class="kw1">if</span><span class="br0">&#40;</span><span class="re0">$res</span><span class="br0">&#41;</span>  
            <span class="br0">&#123;</span>  
                <span class="co1">//build an output array, with the tag-name and the number of results  </span>
                <span class="re0">$output</span><span class="br0">&#91;</span><span class="re0">$i</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'tag'</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="re0">$name</span><span class="sy0">;</span>  
                <span class="re0">$output</span><span class="br0">&#91;</span><span class="re0">$i</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'num'</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="re0">$res</span><span class="br0">&#91;</span><span class="st_h">'totalnum'</span><span class="br0">&#93;</span><span class="sy0">;</span>  
            <span class="br0">&#125;</span>  
            <span class="br0">&#125;</span>
            <span class="re0">$i</span><span class="sy0">++;</span>
&nbsp;
        <span class="br0">&#125;</span>  
&nbsp;
        <span class="coMULTI">/*this is just calling another function that does a similar SQL statement, but returns how many pieces of content I have*/</span>  
        <span class="re0">$total_tuts</span> <span class="sy0">=</span> <span class="nu0">50</span><span class="sy0">;</span>  <span class="co1">//I set this to 50 in the example, we could use a sql query to get the actual nummber of codes</span>
&nbsp;
        <span class="co1">//ugh, XHTML in PHP?  Slap my hands - this isnt best practice, but I was obviously feeling lazy  </span>
        <span class="re0">$html</span> <span class="sy0">=</span> <span class="st_h">'&lt;ul class=&quot;tagcloud&quot;&gt;'</span><span class="sy0">;</span>  
        <span class="co1">//iterate through each item in the $output array (created above)  </span>
        <span class="kw1">foreach</span><span class="br0">&#40;</span><span class="re0">$output</span> <span class="kw1">as</span> <span class="re0">$tag</span><span class="br0">&#41;</span>  
        <span class="br0">&#123;</span>  
            <span class="co1">//get the number-of-tag-occurances as a percentage of the overall number  </span>
            <span class="re0">$ratio</span> <span class="sy0">=</span> <span class="br0">&#40;</span><span class="nu0">100</span> <span class="sy0">/</span> <span class="re0">$total_tuts</span><span class="br0">&#41;</span> <span class="sy0">*</span> <span class="re0">$tag</span><span class="br0">&#91;</span><span class="st_h">'num'</span><span class="br0">&#93;</span><span class="sy0">;</span>  
&nbsp;
            <span class="co1">//round the number to the nearest 10  </span>
            <span class="re0">$ratio</span> <span class="sy0">=</span>  <span class="kw3">round</span><span class="br0">&#40;</span><span class="re0">$ratio</span><span class="sy0">,-</span><span class="nu0">1</span><span class="br0">&#41;</span><span class="sy0">;</span>  
&nbsp;
            <span class="coMULTI">/*append that classname onto the list-item, so if the result was 20%, it comes out as cloud-20*/</span>  
            <span class="re0">$html</span><span class="sy0">.=</span> <span class="st_h">'&lt;li class=&quot;cloud-'</span><span class="sy0">.</span><span class="re0">$ratio</span><span class="sy0">.</span><span class="st_h">'&quot;&gt;&lt;a href=&quot;http://sourcecodedb.com/tags.php?tag='</span><span class="sy0">.</span><span class="re0">$tag</span><span class="br0">&#91;</span><span class="st_h">'tag'</span><span class="br0">&#93;</span><span class="sy0">.</span><span class="st_h">'&quot;&gt;'</span><span class="sy0">.</span><span class="re0">$tag</span><span class="br0">&#91;</span><span class="st_h">'tag'</span><span class="br0">&#93;</span><span class="sy0">.</span><span class="st_h">'&lt;/a&gt;&lt;/li&gt;'</span><span class="sy0">;</span>          
        <span class="br0">&#125;</span>  
&nbsp;
        <span class="co1">//close the UL  </span>
        <span class="re0">$html</span><span class="sy0">.=</span> <span class="st_h">'&lt;/ul&gt;'</span><span class="sy0">;</span>  
&nbsp;
        <span class="kw1">return</span> <span class="re0">$html</span><span class="sy0">;</span>  
    <span class="br0">&#125;</span>
&nbsp;
&nbsp;
    <span class="re0">$gettags</span> <span class="sy0">=</span> <span class="kw3">mysql_query</span><span class="br0">&#40;</span><span class="st0">&quot;SELECT Tags FROM codetable WHERE Moderated='1' AND Published='1'&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="co1">//We get the tags which are written like: php, code, at, sourcecodedb</span>
    <span class="kw1">while</span> <span class="br0">&#40;</span><span class="re0">$thetags</span> <span class="sy0">=</span> <span class="kw3">mysql_fetch_array</span><span class="br0">&#40;</span><span class="re0">$gettags</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
      <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$thetags</span><span class="br0">&#91;</span><span class="st_h">'Tags'</span><span class="br0">&#93;</span> <span class="sy0">!=</span> <span class="kw4">null</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> <span class="co1">// We dont want any empty tags of course</span>
        <span class="re0">$newtag</span><span class="br0">&#91;</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="re0">$thetags</span><span class="br0">&#91;</span><span class="st_h">'Tags'</span><span class="br0">&#93;</span><span class="sy0">;</span> <span class="co1">// Each group of tags is put in the array</span>
      <span class="br0">&#125;</span>
    <span class="br0">&#125;</span>
    <span class="kw1">foreach</span> <span class="br0">&#40;</span><span class="re0">$newtag</span> <span class="kw1">as</span> <span class="re0">$thetag</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
        <span class="re0">$tags</span><span class="br0">&#91;</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="kw3">explode</span><span class="br0">&#40;</span><span class="st0">&quot;, &quot;</span><span class="sy0">,</span> <span class="re0">$thetag</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="co1">// Each group is seperated into individual tags and put into a new array</span>
    <span class="br0">&#125;</span>
&nbsp;
    <span class="kw2">function</span> array_flatten_recursive<span class="br0">&#40;</span><span class="re0">$array</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
       <span class="kw1">if</span> <span class="br0">&#40;</span><span class="sy0">!</span><span class="re0">$array</span><span class="br0">&#41;</span> <span class="kw1">return</span> <span class="kw4">false</span><span class="sy0">;</span>
       <span class="re0">$flat</span> <span class="sy0">=</span> <span class="kw3">array</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
       <span class="re0">$RII</span> <span class="sy0">=</span> <span class="kw2">new</span> RecursiveIteratorIterator<span class="br0">&#40;</span><span class="kw2">new</span> RecursiveArrayIterator<span class="br0">&#40;</span><span class="re0">$array</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
       <span class="kw1">foreach</span> <span class="br0">&#40;</span><span class="re0">$RII</span> <span class="kw1">as</span> <span class="re0">$value</span><span class="br0">&#41;</span> <span class="re0">$flat</span><span class="br0">&#91;</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="re0">$value</span><span class="sy0">;</span>
       <span class="kw1">return</span> <span class="re0">$flat</span><span class="sy0">;</span>
    <span class="br0">&#125;</span>
&nbsp;
&nbsp;
    <span class="re0">$finaltag</span> <span class="sy0">=</span> array_flatten_recursive<span class="br0">&#40;</span><span class="re0">$tags</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="co1">//We flatten the array, dont want it to be multidimensional</span>
    <span class="re0">$finaltag2</span> <span class="sy0">=</span> <span class="kw3">array_unique</span><span class="br0">&#40;</span><span class="re0">$finaltag</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="co1">//We remove any duplicate tags we have in our array</span>
    <span class="kw1">echo</span> createTagCloud<span class="br0">&#40;</span><span class="re0">$finaltag2</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="co1">//Then the modified createTagCloud function is called</span>
    <span class="sy1">?&gt;</span></pre></div></div></div></div></div></div></div>


<p>To show the tag cloud in the footer or anywhere else on your php page simply include the file with the code above into your file using PHP&#8217;s include functions.</p>
<p>Feel free to comment if you have any questions!</p>
]]></content:encoded>
			<wfw:commentRss>http://markustenghamn.com/creating-tag-cloud-php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to make a good Facebook Timeline cover / picture</title>
		<link>http://markustenghamn.com/good-facebook-timeline-cover-picture</link>
		<comments>http://markustenghamn.com/good-facebook-timeline-cover-picture#comments</comments>
		<pubDate>Fri, 02 Mar 2012 22:24:00 +0000</pubDate>
		<dc:creator>Markus Tenghamn</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[facebook timeline cover]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[picture]]></category>
		<category><![CDATA[psd]]></category>
		<category><![CDATA[size]]></category>
		<category><![CDATA[source]]></category>

		<guid isPermaLink="false">http://markustenghamn.com/?p=154</guid>
		<description><![CDATA[Download: Facebook Timeline Cover PSD To make a Facebook Timeline picture you really don&#8217;t need a lot, just a good image that you can upload on your timeline page, however if you would like to get a bit more creative and create something more like these inspiring Timeline pictures: http://www.hongkiat.com/blog/creative-facebook-timeline-covers/ I have attached a psd [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://markustenghamn.com/wp-content/uploads/2012/03/fbtut.psd_.zip">Download: Facebook Timeline Cover PSD</a></p>
<p>To make a Facebook Timeline picture you really don&#8217;t need a lot, just a good image that you can upload on your timeline page, however if you would like to get a bit more creative and create something more like these inspiring Timeline pictures: <a href="http://www.hongkiat.com/blog/creative-facebook-timeline-covers/" target="_blank">http://www.hongkiat.com/blog/creative-facebook-timeline-covers/</a></p>
<p>I have attached a psd below to help out with the profile picture and let you create your design around it. The size of the Facebook Timeline Cover is 851px by 315px, this is the best size and will keep Facebook from resizing the photo at all. If you have Photoshop I would definitely suggest using that but if you are looking for a free alternative there is always <a href="http://www.gimp.org/" target="_blank">GIMP</a>.</p>
<p>Here is a sample of how I have the PSD laid out, my complete facebook page is also included so you can see how your image will look with the Facebook layout.</p>
<p><a class="preload" title="" href="http://markustenghamn.com/wp-content/uploads/2012/03/fbtutpsdprev1.png" rel="prettyphoto"><img class="alignnone size-medium wp-image-156" title="fbtutpsdprev" src="http://markustenghamn.com/wp-content/uploads/2012/03/fbtutpsdprev1-300x138.png" alt="" width="300" height="138" /></a></p>
<p><a href="http://markustenghamn.com/wp-content/uploads/2012/03/fbtut.psd_.zip">Download: Facebook Timeline Cover PSD</a></p>
]]></content:encoded>
			<wfw:commentRss>http://markustenghamn.com/good-facebook-timeline-cover-picture/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Learning Cinema 4D</title>
		<link>http://markustenghamn.com/learning-cinema-4d</link>
		<comments>http://markustenghamn.com/learning-cinema-4d#comments</comments>
		<pubDate>Fri, 02 Mar 2012 21:44:12 +0000</pubDate>
		<dc:creator>Markus Tenghamn</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[3d modeling]]></category>
		<category><![CDATA[blocks]]></category>
		<category><![CDATA[cinema 4d]]></category>
		<category><![CDATA[effects]]></category>
		<category><![CDATA[genesis]]></category>
		<category><![CDATA[physics]]></category>
		<category><![CDATA[shapes]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://markustenghamn.com/?p=149</guid>
		<description><![CDATA[I have always been a bit interested in 3d modeling and designing and decided to give Cinema 4D a shot after seeing what Andreas Wannerstedt created with it and some help with Adobe After Effects. I have no plans to make anything as advanced as what he did but playing around with the physics and [...]]]></description>
			<content:encoded><![CDATA[<p>I have always been a bit interested in 3d modeling and designing and decided to give Cinema 4D a shot after seeing what Andreas Wannerstedt created with it and some help with Adobe After Effects. I have no plans to make anything as advanced as what he did but playing around with the physics and such is a lot of fun and very interesting. Here is the link to Andreas&#8217;s video on Vimeo called Genesis: <a title="Genesis" href="http://vimeo.com/33294114" target="_blank">http://vimeo.com/33294114 </a></p>
<p>So what I have done looks nothing like that and I have only been playing around with the program for about 5 hours but this is what I have come up with so far.</p>
<p>My name in 3D with particles that create and destroy it.<a href="http://www.youtube.com/watch?v=S2aNQDS-Y-c&amp;feature=g-upl&amp;context=G26664fcAUAAAAAAABAA" target="_blank"></p>
<p>http://www.youtube.com/watch?v=S2aNQDS-Y-c&#038;feature=g-upl&#038;context=G26664fcAUAAAAAAABAA</a></p>
<p>And then I made several blocks, I believe it comes out to 125 blocks in total and changed the resolution a bit.<a href="http://www.youtube.com/watch?v=Hpx7VwoSBSU&amp;feature=g-upl&amp;context=G2529b24AUAAAAAAAAAA" target="_blank"></p>
<p>http://www.youtube.com/watch?v=Hpx7VwoSBSU&#038;feature=g-upl&#038;context=G2529b24AUAAAAAAAAAA</a></p>
<p>Hopefully I will be able to create a nice looking video one day but it will be a little while until I am ready.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://markustenghamn.com/learning-cinema-4d/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Time to get started with Zend Framework</title>
		<link>http://markustenghamn.com/time-started-zend-framework</link>
		<comments>http://markustenghamn.com/time-started-zend-framework#comments</comments>
		<pubDate>Sat, 18 Feb 2012 14:26:43 +0000</pubDate>
		<dc:creator>Markus Tenghamn</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[Billiga Apan]]></category>
		<category><![CDATA[billigaapan.se]]></category>
		<category><![CDATA[Markus Tenghamn]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[student competitions]]></category>
		<category><![CDATA[Zend]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://markustenghamn.com/?p=141</guid>
		<description><![CDATA[I have been developing with PHP for a while now and as I am learning more and more about OOP with C# I got interested in more OOP based programming with PHP. I picked up a few books on more advanced PHP programming which explains how to use classes and the like with PHP and [...]]]></description>
			<content:encoded><![CDATA[<p>I have been developing with PHP for a while now and as I am learning more and more about OOP with C# I got interested in more OOP based programming with PHP. I picked up a few books on more advanced PHP programming which explains how to use classes and the like with PHP and it seems fairly similar to C# in its most basic form at least. While doing more research on  PHP I stumbled across Zend Framework, I had heard about it before and I sort of knew what it was but I had never considered using it. But upon further reading of the documentation and what others had to say it really got me interested. So since I was learning more advanced PHP i figured why not throw in something like Zend Framework as well? I have not gotten very far but I am making and testing out some initial applications but progress is slow since I am also doing OOP C# and Discrete Mathematics at the same time.</p>
<p>Learning more about Zend got me interested in possibly switching to something better than dreamweaver for my PHP coding, yes I know it&#8217;s bad but I never felt that I needed anything better. At the moment I have started using NetBeans which seems pretty nice. I have yet to take a look at other IDE&#8217;s like something Eclipse based. But switching to NetBeans also got me thinking that I should probably clean up my work environment and get a bit more organized with my projects. Currently my projects are almost all always hosted, yes even during development, I like hosting the actual site in the main directory and then in another private directory I will have a duplicate of the site and database that I work on. I of course keep backups of my projects on external drives I have laying around. Anyways since I already have PHP on my Macs I figured I should just keep most of my projects in my NetBeans project folder and work on them locally, should be easier and faster right? <img src='http://markustenghamn.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  We will see how it works out.</p>
<p>Other than that there is not much going on. Progress is steadily being made with BilligaApan.se, the swedish webshop me and a friend started about 6 months ago. I have a meeting with GoPlus coming up which seems interesting, just got to find time for it. I should also be heading over to PingDom soon, seems like a real interesting company to visit. I also met a new company I hadn&#8217;t heard about before called Diadrom which as far as I could understand the software to control various systems of cars and trucks and probably more, this might be a nice company where I could potentially take my &#8220;Ex-work&#8221; for college.</p>
<p>Another cool company I spoke to was Student Competitions, check them out and let me know what you think <a title="Student Competitions" href="http://studentcompetitions.com" target="_blank">http://studentcompetitions.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://markustenghamn.com/time-started-zend-framework/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spina &#8211; Premium WordPress Admin Template</title>
		<link>http://markustenghamn.com/spina-premium-wordpress-admin-templat</link>
		<comments>http://markustenghamn.com/spina-premium-wordpress-admin-templat#comments</comments>
		<pubDate>Thu, 26 Jan 2012 02:45:31 +0000</pubDate>
		<dc:creator>Markus Tenghamn</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[Admin]]></category>
		<category><![CDATA[Admin Wordpress Theme]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[sleek]]></category>
		<category><![CDATA[stylsih]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://markustenghamn.com/?p=136</guid>
		<description><![CDATA[Recently stumbled across this super sleek admin theme for WordPress. I can see lots of uses for this. Personally it&#8217;s great for my own company blog, where I can make it more stylish and sleek to show off to clients and friends. You basically end up hiding the whole WordPress part and making your site [...]]]></description>
			<content:encoded><![CDATA[<p>Recently stumbled across this super sleek admin theme for WordPress. I can see lots of uses for this. Personally it&#8217;s great for my own company blog, where I can make it more stylish and sleek to show off to clients and friends. You basically end up hiding the whole WordPress part and making your site really unique. This is also the perfect theme for a web host who wants to provide wordpress with a custom look for their users.</p>
<p><a href="http://themeforest.net/item/spina-premium-admin-template-tablet-theme/1301889?WT.ac=weekly_feature&amp;WT.seg_1=weekly_feature&amp;WT.z_author=Interfico&amp;ref=bigideaguy">Get The Theme Here For Only $18</a></p>
]]></content:encoded>
			<wfw:commentRss>http://markustenghamn.com/spina-premium-wordpress-admin-templat/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Anonymous &#8211; Good or Bad?</title>
		<link>http://markustenghamn.com/anonymous-good-bad</link>
		<comments>http://markustenghamn.com/anonymous-good-bad#comments</comments>
		<pubDate>Mon, 23 Jan 2012 20:47:07 +0000</pubDate>
		<dc:creator>Markus Tenghamn</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[Anonymous]]></category>
		<category><![CDATA[bad]]></category>
		<category><![CDATA[cbs.com down]]></category>
		<category><![CDATA[good]]></category>
		<category><![CDATA[Hackers]]></category>
		<category><![CDATA[justice.gov down]]></category>
		<category><![CDATA[MegaUpload]]></category>
		<category><![CDATA[or]]></category>
		<category><![CDATA[PIPA]]></category>
		<category><![CDATA[SOPA]]></category>

		<guid isPermaLink="false">http://markustenghamn.com/?p=131</guid>
		<description><![CDATA[I have been following anonymous for quite a while now and I find what they are and what they are doing pretty interesting. But is it the right thing to do and should they be doing it? There are many different ways to look at it but first let me explain what anonymous is and [...]]]></description>
			<content:encoded><![CDATA[<p>I have been following anonymous for quite a while now and I find what they are and what they are doing pretty interesting. But is it the right thing to do and should they be doing it? There are many different ways to look at it but first let me explain what anonymous is and what they have done.</p>
<p>Anonymous is a group of hackers with no leader who claim they represent the people or the 99%. They are famous for using the V for Vendetta mask in protests. The name anonymous comes from being anonymous when on the internet as in you don&#8217;t really know who is behind the forum komments or the twitter account someone is running. They stand for many things and have been responsible for many hacker related incidents, especially recently. Their goal seems to be to protect free speech and privacy online. However sometimes Anonymous gives out a mixed message and it can be hard to tell what is true and what is false, this is due to the fact that the group has no leader which is a great weakness while still at the same time being one of their greatest strengths.</p>
<p>Recently Anonymous has really gained a lot of support and notice in their retaliation to the FBI and Department of Justice&#8217;s take down of a large file sharing website called MegaUpload.com. They used DDoS attacks on many government and corporate websites temporarily shutting down sites like the DOJ, RIAA, MPAA, Universal Music, US Copyright Office, EMI, HADOPI, and the FBI. The full story can be found here at <a title="Anonymous Goes on Megaupload Revenge Spree: DoJ, RIAA, MPAA, and Universal Music All Offline" href="http://gizmodo.com/5877679/anonymous-kills-department-of-justice-site-in-megaupload-revenge-strike" target="_blank">Gizmodo.com</a>. Later Anonymous also took down CBS.com and claimed to have deleted all files on their servers, however some claim that it was simply DNS poisoning which is still pretty bad. Either way CBS.com was up again in about 20 minutes. At this time UniversalMusic.com also went down once more. Read the full story at <a title="Anonymous Just Deleted CBS.com and Took Down Universal" href="http://gizmodo.com/5878238/anonymous-deleted-cbscom" target="_blank">Gizmodo.com</a>. Reading tweets on twitter further attacks and hacking are happening, as I am writing this post <a title="Justice.gov" href="http://justice.gov" target="_blank">justice.gov</a> is once again down thanks to Anonymous. Anonymous also leaked hacked emails from Stratfor.com, use twitter and search for #Stratfor to find these. More rumors say that Anonymous will try to DDoS or somehow shutdown Facebook on January 28th. I personally believe these rumors to be false, why would Anonymous want to shut down a social network which is against SOPA and PIPA.</p>
<p>Going back to the FBI and DOJ&#8217;s shutdown of MegaUpload.com which seems to have come at the perfect time for the FBI and DOJ to use the expected retaliation of the shutdown to gain support for SOPA and PIPA. Many speculated that the Anonymous attacks were expected and that what Anonymous is doing will only hurt us more, I guess we will see. Personally I believe that the MegaUpload.com shutdown was a very bad thing, it hurt more than it helped. Sure there may have been illegal file sharing going on but MegaUpload was usually fairly quick to deal with this and there was no search function on MegaUpload to make it easy to find these files. But many users used MegaUpload for perfectly legal purposes like backing up data, sharing home videos and pictures with family and friends, sharing school notes, upcoming artist shared their own music here, maybe even stored their music. The loss of data for normal users who were doing nothing illegal was immense and this is why I feel that the shutdown was wrong. Read more about the affects at <a title="Megaupload Shutdown Targets Pirates ... And Legitimate Files" href="http://www.pcmag.com/article2/0,2817,2399134,00.asp" target="_blank">PCMAG</a>.</p>
<p>So if I had to pick sides here I would go with Anonymous.</p>
]]></content:encoded>
			<wfw:commentRss>http://markustenghamn.com/anonymous-good-bad/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beware of MacKeeper &#8211; My Review</title>
		<link>http://markustenghamn.com/beware-mackeeper-review</link>
		<comments>http://markustenghamn.com/beware-mackeeper-review#comments</comments>
		<pubDate>Sun, 22 Jan 2012 04:08:42 +0000</pubDate>
		<dc:creator>Markus Tenghamn</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[antivirus]]></category>
		<category><![CDATA[cleaner]]></category>
		<category><![CDATA[keeper]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[MacCleaner]]></category>
		<category><![CDATA[MacKeeper]]></category>
		<category><![CDATA[removal]]></category>
		<category><![CDATA[zeobit]]></category>

		<guid isPermaLink="false">http://markustenghamn.com/?p=127</guid>
		<description><![CDATA[I downloaded MacKeeper to give it a try, to see if it was as useful as they claimed it to be. I ran a system scan and found some issues, most seemed to be uncleared caches for programs and it seemed fine to let MacKeeper get rid of the almost 1 GB I had stored [...]]]></description>
			<content:encoded><![CDATA[<p>I downloaded MacKeeper to give it a try, to see if it was as useful as they claimed it to be. I ran a system scan and found some issues, most seemed to be uncleared caches for programs and it seemed fine to let MacKeeper get rid of the almost 1 GB I had stored up over time. Right after that is when the problems started. All my fonts, about 500 or so, were gone and all my bookmarks, saved passwords and sessions were also missing. This got me pretty mad but I contacted support and asked them nicely if they could help me with the issue. They told me to restart my computer and that that would fix the issues. I didn&#8217;t see how it would help but I did and nothing changed. I got back with the same support guy and he would not respond now when I asked for more suggestions, a few other support guys seemed to join the session and finally someone gave me a 10 step guide on how I should duplicate the problem and record it with screenshots as well. They also needed a bunch of my log files and system info which I did not feel like sending this company. I checked the log files myself but they didn&#8217;t tell me much more than that my cache had been cleared for a bunch of programs.</p>
<p>At this point I also went ahead and uninstalled MacKeeper which was much easier than I thought it would be. However to my surprise after uninstalling MacKeeper still had 6 or so files still left on my system that I had to delete manually. After doing more research I found others complaining about these files in addition to other issues where MacKeeper would prevent Mail or Skype from even launching. MacKeeper are also very unethical when it comes to their advertising, using popups and pop under ads that alert users to risks on their system, this program almost seems like some kind of malware. I would think twice before even trying this software on your Mac.</p>
<p>So how did I fix my issues? Well I was able to recover a backup profile for my firefox which I create daily so almost nothing was lost there. All my fonts have been reinstalled again but for some reason Photoshop still gives me alerts telling me that the fonts are not available all though I can use them. So thanks to MacKeeper I am still having issues with my fonts.</p>
<p>Don&#8217;t even try MacKeeper!</p>
]]></content:encoded>
			<wfw:commentRss>http://markustenghamn.com/beware-mackeeper-review/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

