<?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>KADIMI</title>
	<atom:link href="http://www.kadimi.com/en/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kadimi.com/en</link>
	<description>[Web developper, Linux addict, Technical translator...]</description>
	<lastBuildDate>Sun, 15 Jan 2012 10:48:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Drupal Views: Show count</title>
		<link>http://www.kadimi.com/en/views-count-result-964</link>
		<comments>http://www.kadimi.com/en/views-count-result-964#comments</comments>
		<pubDate>Sun, 15 Jan 2012 10:48:29 +0000</pubDate>
		<dc:creator>Nabil</dc:creator>
				<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://www.kadimi.com/en/?p=964</guid>
		<description><![CDATA[The view results count is stored in the view object and you can display it by adding a PHP header or footer to your view. In order to have PHP in views you need the module Views PHP, so install it first then add a header or footer with this code. 1 2 3 4 [...]]]></description>
			<content:encoded><![CDATA[<p>The <strong>view results count</strong> is stored in the view object and you can display it by adding a PHP header or footer to your view. In order to have PHP in views you need the module <a href="drupal.org/project/views_php">Views PHP</a>, so install it first then add a header or footer with this code.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">// Dispaly count</span>
<span style="color: #000088;">$view</span> <span style="color: #339933;">=</span> views_get_current_view<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;h3&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$view</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">total_rows</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' result(s)'</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/h3&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.kadimi.com/en/views-count-result-964/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drupal: Send email</title>
		<link>http://www.kadimi.com/en/drupal-send-email-935</link>
		<comments>http://www.kadimi.com/en/drupal-send-email-935#comments</comments>
		<pubDate>Mon, 09 Jan 2012 13:54:53 +0000</pubDate>
		<dc:creator>Nabil</dc:creator>
				<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://www.kadimi.com/en/?p=935</guid>
		<description><![CDATA[This is a quick and easy solution to send an email from Drupal using PHP, i.e a custom module. you will do it in 2 steps (I assume your module is called &#8220;mod&#8221;): Define mod_mail() (implementing hook_mail() ), this function will prepare the email Send the email using drupal_mail() Define mod_mail() 1 2 3 4 [...]]]></description>
			<content:encoded><![CDATA[<p>This is a quick and easy solution to <strong>send an email from Drupal</strong> using PHP, i.e a custom module. you will do it in 2 steps (I assume your module is called &#8220;mod&#8221;):</p>
<ul>
<li>Define mod_mail() (implementing <code>hook_mail()</code> ), this function will prepare the email</li>
<li>Send the email using drupal_mail()</li>
</ul>
<h2>Define mod_mail()</h2>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
 * Implementation of hook_mail.
 */</span>
<span style="color: #000000; font-weight: bold;">function</span> mod_mail<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span><span style="color: #000088;">$message</span><span style="color: #339933;">,</span> <span style="color: #000088;">$params</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">switch</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'basic'</span><span style="color: #339933;">:</span>
      <span style="color: #000088;">$message</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'subject'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> t<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Greetings'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$message</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'body'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>t<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'I just wanted to say hello!'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'advanced'</span><span style="color: #339933;">:</span>
      <span style="color: #000088;">$message</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'subject'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> t<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Hello @username'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'@username'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$params</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'username'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$message</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'body'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>t<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Thank you for joining @site_name!'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'@site_name'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$params</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'site_name'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">default</span><span style="color: #339933;">:</span>
      <span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">/* Do nothing */</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<h2>Sending the email</h2>
<p>In order to send the email you need to decide on 2 parameters (optionally, a 3rd):</p>
<ol>
<li>The recipent (email address)</li>
<li>The key, in this example this would be &#8216;basic&#8217; or &#8216;advanced&#8217;</li>
<li> The $params to pass to <code>mod_mail()</code>, in our example it&#8217;s only needed if we are using the key &#8216;advanced&#8217;</li>
</ol>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Basic example ($key = 'basic')</span>
<span style="color: #000088;">$email</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;someone@example.com&quot;</span><span style="color: #339933;">;</span>
drupal_mail<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'mod'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'basic'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$email</span><span style="color: #339933;">,</span> language_default<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">// Advanced example ($key = 'advanced')</span>
<span style="color: #000088;">$email</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;someone@example.com&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$params</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
  <span style="color: #0000ff;">'username'</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Someone'</span><span style="color: #339933;">,</span>
  <span style="color: #0000ff;">'site_name'</span> <span style="color: #339933;">=</span> variable_get<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'site_name'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
drupal_mail<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'mod'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'advanced'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$email</span><span style="color: #339933;">,</span> language_default<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$params</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.kadimi.com/en/drupal-send-email-935/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drupal 7: Get files public directory path</title>
		<link>http://www.kadimi.com/en/drupal-files-directory-923</link>
		<comments>http://www.kadimi.com/en/drupal-files-directory-923#comments</comments>
		<pubDate>Sat, 24 Dec 2011 11:30:12 +0000</pubDate>
		<dc:creator>Nabil</dc:creator>
				<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://www.kadimi.com/en/?p=923</guid>
		<description><![CDATA[We used to get the files directory using file_directory_path() in Drupal 5 and 6, the function was removed with Drupal 7 but you can still get the files public directory like this: 1 2 echo variable_get&#40;'file_public_path', conf_path&#40;&#41; . '/files'&#41;; // Output: sites/default/files]]></description>
			<content:encoded><![CDATA[<p>We used to get the files directory using <code>file_directory_path()</code> in Drupal 5 and 6, the function was removed with Drupal 7 but you can still get the files public directory like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> variable_get<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'file_public_path'</span><span style="color: #339933;">,</span> conf_path<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/files'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #666666; font-style: italic;">// Output: sites/default/files</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.kadimi.com/en/drupal-files-directory-923/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drupal : Get path and verify if it&#8217;s an alias</title>
		<link>http://www.kadimi.com/en/drupal-get-path-and-verify-if-its-an-alias-919</link>
		<comments>http://www.kadimi.com/en/drupal-get-path-and-verify-if-its-an-alias-919#comments</comments>
		<pubDate>Fri, 23 Dec 2011 20:48:21 +0000</pubDate>
		<dc:creator>Nabil</dc:creator>
				<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://www.kadimi.com/en/?p=919</guid>
		<description><![CDATA[This is how I get the current path and/or alias in Drupal: After this code has been executed: $path will hold the internal drupal path $alias will hold that path alias if the path in the url is actually an alias, otherwise FALSE; 1 2 3 4 5 6 $path_from_url = isset&#40;$_GET&#91;'q'&#93;&#41; ? $_GET&#91;'q'&#93; : [...]]]></description>
			<content:encoded><![CDATA[<p>This is how I get the current path and/or alias in Drupal:<br />
After this code has been executed:<br />
<code>$path</code> will hold <strong>the internal drupal path</strong><br />
<code>$alias</code> will hold <strong>that path alias</strong> if the path in the url is actually an alias, otherwise FALSE;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$path_from_url</span> <span style="color: #339933;">=</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'q'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'q'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">'&lt;front&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$path</span> <span style="color: #339933;">=</span> drupal_get_normal_path<span style="color: #009900;">&#40;</span><span style="color: #000088;">$path_from_url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$path</span> <span style="color: #339933;">===</span> <span style="color: #000088;">$path_from_url</span><span style="color: #009900;">&#41;</span> 
  <span style="color: #000088;">$alias</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">else</span> 
  <span style="color: #000088;">$alias</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$path_from_url</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.kadimi.com/en/drupal-get-path-and-verify-if-its-an-alias-919/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fix &#8220;xyz.widget is not a function&#8221; when jQuerying in Drupal</title>
		<link>http://www.kadimi.com/en/widget-is-not-a-function-897</link>
		<comments>http://www.kadimi.com/en/widget-is-not-a-function-897#comments</comments>
		<pubDate>Mon, 31 Oct 2011 18:13:50 +0000</pubDate>
		<dc:creator>Nabil</dc:creator>
				<category><![CDATA[Drupal]]></category>
		<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://www.kadimi.com/en/?p=897</guid>
		<description><![CDATA[The error looks like: c.widget is not a function Or: d.widget is not a function I get this error when I do theming or module development for Drupal. Basically this tells you that the file jquery.ui.widget.js is missing. check the code you were writting and add that file to Drupal like this: 1 drupal_add_js&#40;'misc/ui/jquery.ui.widget.min.js'&#41;;]]></description>
			<content:encoded><![CDATA[<p>The error looks like:</p>
<blockquote><p>c.widget is not a function</p></blockquote>
<p>Or:</p>
<blockquote><p>d.widget is not a function</p></blockquote>
<p>I get this error when I do theming or module development for Drupal. Basically this tells you that the file jquery.ui.widget.js is missing. check the code you were writting and add that file to Drupal like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">drupal_add_js<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'misc/ui/jquery.ui.widget.min.js'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.kadimi.com/en/widget-is-not-a-function-897/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Super key / Alt+F2 not working in Ubuntu 11.10</title>
		<link>http://www.kadimi.com/en/ubuntu-alt-f2-2-851</link>
		<comments>http://www.kadimi.com/en/ubuntu-alt-f2-2-851#comments</comments>
		<pubDate>Thu, 20 Oct 2011 12:19:23 +0000</pubDate>
		<dc:creator>Nabil</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.kadimi.com/en/?p=851</guid>
		<description><![CDATA[<a href="http://www.kadimi.com/en/ubuntu-alt-f2-2-851"><img align="left" hspace="5" width="150" src="http://www.kadimi.com/en/wp-content/uploads/compiz-unity-300x194.png" class="alignleft wp-post-image tfe" alt="Compiz &gt; Unity" title="Compiz &gt; Unity" /></a>This happened to me in Ubuntu 11.10 (Oneiric Ocelot) when I was playing with some Compiz settings. To have your shortcuts back, go to the CompizConfig Settings Manager, to do that bring up a terminal window with the shortcut ctrl+alt+t the type ccsm: imame@meta:~$ ccsm If you are using Unity open Desktop > Ubuntu Unity [...]]]></description>
			<content:encoded><![CDATA[<p>This happened to me in Ubuntu 11.10 (Oneiric Ocelot) when I was playing with some Compiz settings. To have your shortcuts back, go to the CompizConfig Settings Manager, to do that bring up a terminal window with the shortcut ctrl+alt+t the type ccsm:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">imame@meta:~$ ccsm</pre></div></div>

<p>If you are using Unity open Desktop > Ubuntu Unity Plugin but if you are using Gnome shell choose General > Gnome Compatibily &#8211; anyways, choose whichever is already checked, one the next window check that the shortcuts are enabled and configured correctly<br />
<div id="attachment_853" class="wp-caption alignnone" style="width: 310px"><a href="http://www.kadimi.com/en/wp-content/uploads/compiz-unity.png"><img src="http://www.kadimi.com/en/wp-content/uploads/compiz-unity-300x194.png" alt="Compiz &gt; Unity" title="Compiz &gt; Unity" width="300" height="194" class="size-medium wp-image-853" /></a><p class="wp-caption-text">Compiz &gt; Unity</p></div> <div id="attachment_852" class="wp-caption alignnone" style="width: 310px"><a href="http://www.kadimi.com/en/wp-content/uploads/compiz-gnome.png"><img src="http://www.kadimi.com/en/wp-content/uploads/compiz-gnome-300x194.png" alt="Compiz &gt; Gnome Compatibility" title="Compiz &gt; Gnome Compatibility" width="300" height="194" class="size-medium wp-image-852" /></a><p class="wp-caption-text">Compiz &gt; Gnome Compatibility</p></div></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kadimi.com/en/ubuntu-alt-f2-2-851/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Classical Gnome in Ubuntu 11.10 (Oneiric Ocelot)</title>
		<link>http://www.kadimi.com/en/ubuntu-oneiric-gnome-837</link>
		<comments>http://www.kadimi.com/en/ubuntu-oneiric-gnome-837#comments</comments>
		<pubDate>Wed, 19 Oct 2011 13:39:13 +0000</pubDate>
		<dc:creator>Nabil</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.kadimi.com/en/?p=837</guid>
		<description><![CDATA[ContentsInstall necessary packagesLog in using Gnome ClassicalTweak with Gnome Tweak ToolWhere is &#8220;Add to panel&#8221; and others? Install necessary packages In order to have Gnome classical appearance on Ubuntu 11.10 you need to install gnome-shell and gnome-panel, a following reboot -from my experience &#8211; is preferable. imame@meta:~$ sudo apt-get install gnome-shell gnome-panel imame@meta:~$ # blabla [...]]]></description>
			<content:encoded><![CDATA[<div id="toc_container" class="toc_wrap_right no_bullets"><p class="toc_title">Contents</p><ul class="toc_list"><li><a href="#Install_necessary_packages">Install necessary packages</a></li><li><a href="#Log_in_using_Gnome_Classical">Log in using Gnome Classical</a></li><li><a href="#Tweak_with_Gnome_Tweak_Tool">Tweak with Gnome Tweak Tool</a></li><li><a href="#Where_is_8220Add_to_panel8221_and_others">Where is &#8220;Add to panel&#8221; and others?</a></li></ul></div>
<h2><span id="Install_necessary_packages">Install necessary packages</span></h2>
<p>In order to have Gnome classical appearance on Ubuntu 11.10 you need to install gnome-shell and gnome-panel, a following reboot -from my experience &#8211; is preferable.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">imame<span style="color: #000000; font-weight: bold;">@</span>meta:~$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> gnome-shell gnome-panel
imame<span style="color: #000000; font-weight: bold;">@</span>meta:~$ <span style="color: #666666; font-style: italic;"># blabla while packages are being installed</span>
imame<span style="color: #000000; font-weight: bold;">@</span>meta:~$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> reboot</pre></div></div>

<h2><span id="Log_in_using_Gnome_Classical">Log in using Gnome Classical</span></h2>
<p>Before opening your session, clear the gear next to your name and choose Gnome Classical.</p>
<h2><span id="Tweak_with_Gnome_Tweak_Tool">Tweak with Gnome Tweak Tool</span></h2>
<p>You can personalize you desktop with the Gnome Tweak Tool:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">imame<span style="color: #000000; font-weight: bold;">@</span>meta:~$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> gnome-tweak-tool</pre></div></div>

<p>The launcher is located here: Applications > Others > Advanced Settings</p>
<h2><span id="Where_is_8220Add_to_panel8221_and_others">Where is &#8220;Add to panel&#8221; and others?</span></h2>
<p>Now in order to have the penel related options a simple right click won&#8217;t work, you need to Alt+ right click</p>
<p>Thanks for reading!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kadimi.com/en/ubuntu-oneiric-gnome-837/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Age from date of birth in Drupal 7</title>
		<link>http://www.kadimi.com/en/age-from-date-of-birth-in-drupal-7-777</link>
		<comments>http://www.kadimi.com/en/age-from-date-of-birth-in-drupal-7-777#comments</comments>
		<pubDate>Mon, 19 Sep 2011 22:46:38 +0000</pubDate>
		<dc:creator>Nabil</dc:creator>
				<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://www.kadimi.com/en/?p=777</guid>
		<description><![CDATA[<a href="http://www.kadimi.com/en/age-from-date-of-birth-in-drupal-7-777"><img align="left" hspace="5" width="150" height="150" src="http://www.kadimi.com/en/wp-content/uploads/date_of_birth_field-150x150.png" class="alignleft wp-post-image tfe" alt="Date of birth field" title="Date of birth field" /></a>In this tutorial I&#8217;m gonna show you how to calculate and display properly the age from a date CCK field the simplest way. The method I&#8217;m about to show you doesn&#8217;t need the Views module and if you use Views you&#8217;ll find that it&#8217;s totally compatible without adding any PHP code. ContentsRequirementsAdd a computed fieldAdd [...]]]></description>
			<content:encoded><![CDATA[<p>In this tutorial I&#8217;m gonna show you how to calculate and display properly the age from a date CCK field the simplest way. The method I&#8217;m about to show you doesn&#8217;t need the Views module and if you use Views you&#8217;ll find that it&#8217;s totally compatible without adding any PHP code.</p>
<div id="toc_container" class="toc_wrap_right no_bullets"><p class="toc_title">Contents</p><ul class="toc_list"><li><a href="#Requirements">Requirements</a></li><li><a href="#Add_a_computed_field">Add a computed field</a></li><li><a href="#Add_content_and_test">Add content and test</a></li><li><a href="#Sorting_with_Views">Sorting with Views</a></li><li><a href="#Update_age">Update age</a></li><li><a href="#Need_help">Need help?</a></li></ul></div>
<h2><span id="Requirements">Requirements</span></h2>
<p>Before starting I want you to meet the following requirements in order to follow this tutorial:</p>
<ul>
<li>Install and enable the <a title="Drupal Computed Field Module" href="http://drupal.org/project/computed_field">Computed_field</a> module</li>
<li>Install and enable the <a title="Drupal Date Module" href="http://drupal.org/project/date">Date</a> module (Date API, Date &amp; Date popup)</li>
<li>Install and enable the <a title="Drupal Rules Module" href="http://www.kadimi.com/en/resume">Rules</a> module</li>
<li>Enable the core PHP filter module</li>
<li>Add a date field to an existing content type (let&#8217;s call it <strong>field_dob</strong>)<code></code></li>
</ul>
<p>For the purpose of this tutorial I created a very simple content type named <strong>Candidate</strong> with only 2 fields:</p>
<ul>
<li>I changed the title from <strong>Title</strong> to <strong>Full name</strong> and removed the <strong>Body</strong> field</li>
<li>I added a Date field and named it <strong>field_dob</strong>
<p><div id="attachment_795" class="wp-caption alignnone" style="width: 310px"><a href="http://www.kadimi.com/en/wp-content/uploads/date_of_birth_field.png"><img class="size-medium wp-image-795" title="Date of birth field" src="http://www.kadimi.com/en/wp-content/uploads/date_of_birth_field-300x69.png" alt="Date of birth field" width="300" height="69" /></a><p class="wp-caption-text">Date of birth field - Click to enlarge</p></div></li>
</ul>
<h2><span id="Add_a_computed_field">Add a computed field</span></h2>
<p>Now let&#8217;s add a new field with <strong>Age</strong> as a label and <strong>field_age</strong> as a name and <strong>Computed</strong> as a field type.<br />
In the next screen we will set the field settings:</p>
<ul>
<li>Computed Code (PHP):

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$entity_field</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'value'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$entity</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_dob</span><span style="color: #009900;">&#91;</span>LANGUAGE_NONE<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'value'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> <span style="color: #cc66cc;">86400</span> <span style="color: #339933;">/</span> <span style="color:#800080;">365.25</span><span style="color: #339933;">;</span></pre></div></div>

</li>
<li>Display Code (PHP):

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$display_output</span> <span style="color: #339933;">=</span> <span style="color: #990000;">floor</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$entity_field_item</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'value'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</li>
<li>Data type:<strong> Decimal</strong></li>
<li>Decimal Scale (decimal): <strong>3</strong></li>
</ul>
<h2><span id="Add_content_and_test">Add content and test</span></h2>
<p>Now let&#8217;s add a few items and see if it works as we expected, I added a couple of entries and tested:</p>
<ul>
<li>Old KADIMI (born on 1 Jan 1990) =&gt; Age computed 21</li>
<li>Young KADIMI (born on 2 Jan 1990) =&gt; Age computed 21</li>
</ul>
<h2><span id="Sorting_with_Views">Sorting with Views</span></h2>
<p>You may want to use the Views module to accommodate the output to your needs, one of the features of the Views module is that it enable you to sort results.</p>
<p>So what if we wanted to sort our candidates by age, Both KADIMI brothers (Old and Young) are 21 years old but Old is 1 day older that Young, for Drupal they have the same age and the result of the sorting may be inaccurate, actually we already fixed this issue by storing the age as a decimal number with 3 decimal points and displaying it as an integer (by using floor), by looking into the database table <strong>field_data_field_age</strong> with phpMyAdmin:</p>
<ul>
<li>Young KADIMI is 21.570 years old</li>
<li>Old KADIMI is 21.573 yeas old</li>
</ul>
<h2><span id="Update_age">Update age</span></h2>
<p>In order to recompute a candidate age we must re-save that candidate node, one way to do this is using Rules and Drupal cron</p>
<ul>
<li>Visit /admin/config/workflow/rules/reaction/add to add a rule, give it a descriptive name like &#8220;Re-save candidates nodes&#8221;<br />
Set React on event to: <strong>Cron maintenance tasks are performed</strong></li>
<li>Add a new action<br />
Set Select the action to add to: <strong>Execute custom PHP code</strong><br />
Set the PHP code to:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$old</span>   <span style="color: #339933;">=</span> <span style="color: #0000ff;">'1 day'</span><span style="color: #339933;">;</span>      <span style="color: #666666; font-style: italic;"># Content is considered outdated if older than {$old}
</span><span style="color: #000088;">$type</span>  <span style="color: #339933;">=</span> <span style="color: #0000ff;">'candidate'</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;"># Apply to nodes of type {$type}
</span><span style="color: #000088;">$count</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">20</span><span style="color: #339933;">;</span>           <span style="color: #666666; font-style: italic;"># Update {$count} nodes per cron
</span> 
<span style="color: #000088;">$old</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;now - <span style="color: #006699; font-weight: bold;">$old</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$nids</span> <span style="color: #339933;">=</span> db_query_range<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'
  SELECT n.nid
  FROM {node} n 
  WHERE n.type = :type AND n.created &lt; :old 
  ORDER BY n.created ASC'</span><span style="color: #339933;">,</span>
  <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$count</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">':old'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$old</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;:type&quot;</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$type</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$nids</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$nid</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
   <span style="color: #000088;">$node</span> <span style="color: #339933;">=</span> node_load<span style="color: #009900;">&#40;</span><span style="color: #000088;">$nid</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   node_save<span style="color: #009900;">&#40;</span><span style="color: #000088;">$node</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Tweak the 3 parameters in a way that suits your needs and that&#8217;s it!</li>
</ul>
<h2><span id="Need_help">Need help?</span></h2>
<p>If  you found this tutorial difficult and couldn&#8217;t follow the instructions you can ask for help on the comments section or you can <a title="Hire Me" href="http://www.kadimi.com/en/hire-me">hire me and I will take care of this for you</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kadimi.com/en/age-from-date-of-birth-in-drupal-7-777/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>HostClear CPU</title>
		<link>http://www.kadimi.com/en/hostclear-cpu-762</link>
		<comments>http://www.kadimi.com/en/hostclear-cpu-762#comments</comments>
		<pubDate>Tue, 01 Feb 2011 03:16:25 +0000</pubDate>
		<dc:creator>Nabil</dc:creator>
				<category><![CDATA[Web Hosting]]></category>

		<guid isPermaLink="false">http://www.kadimi.com/en/?p=762</guid>
		<description><![CDATA[Hostclear CPU for resellers is: Intel(R) Xeon(R) CPU 5110 @ 1.60GHz, this is what I learned from a chat session with a representative at hostclear You are now chatting with &#8216;Paul&#8217; Paul: Welcome to Live Chat support, how may I help you? Nabil: Hello, In the terms of use I found this &#8220;User may not: [...]]]></description>
			<content:encoded><![CDATA[<p>Hostclear CPU for resellers is: Intel(R) Xeon(R) CPU 5110 @ 1.60GHz, this is what I learned from a chat session with a representative at hostclear</p>
<blockquote><p>You are now chatting with &#8216;Paul&#8217;</p>
<div id="chatContentDiv"><strong><span style="color: #993300;">Paul</span></strong>: Welcome to Live Chat support, how may I help you? <span style="color: #008000;"><strong></strong></span></div>
<div><span style="color: #008000;"><strong>Nabil</strong></span>: Hello, In the terms of use I found this &#8220;User may not: Use 25% or more of system resources&#8221; <span style="color: #008000;"><strong></strong></span></div>
<div><span style="color: #008000;"><strong>Nabil</strong></span>: could you please give more more info <span style="color: #008000;"><strong></strong></span></div>
<div><span style="color: #008000;"><strong>Nabil</strong></span>: like what is the CPU speed for resellers?</div>
<div><strong><span style="color: #993300;">Paul</span></strong>: While our shared services are suitable for the bulk of our customers, there comes a time for some websites when they are better suited for a larger plan, which allows for more dedicated CPU and memory resources. We reserve the right, in our sole discretion, to discontinue service to any customer with a website or other hosted data that takes up more than 10% of the server resources and/or 10% of the server&#8217;s CPU. If this becomes necessary, you can either upgrade your hosting package, or request a pro-rated refund of the amounts you have paid in advance for the services. <span style="color: #993300;"><strong></strong></span></div>
<div><span style="color: #993300;"><strong>Paul</strong></span>: Now our policy has changed to 25 % <span style="color: #008000;"><strong></strong></span></div>
<div><span style="color: #008000;"><strong>Nabil</strong></span>: OK &#8211; You say upgade &#8211; Do you mean to a bigger reseller account &#8211; or to a dedi <span style="color: #993300;"><strong></strong></span></div>
<div><span style="color: #993300;"><strong>Paul</strong></span>: Bigger reseller.</div>
<div><strong><span style="color: #993300;">Paul</span></strong>: You can check this : <a id="L5947220195972951427">http://www.hostclear.com/reseller</a> <span style="color: #008000;"><strong></strong></span></div>
<div><span style="color: #008000;"><strong>Nabil</strong></span>: I would like to know the CPU speed so I can calculate what is 25% and know if it suits my needs <span style="color: #993300;"><strong></strong></span></div>
<div><span style="color: #993300;"><strong>Paul</strong></span>: Intel(R) Xeon(R) CPU 5110 @ 1.60GHz</div>
<div><span style="color: #008000;"><strong>Nabil</strong></span>: OK &#8211; thanks <span style="color: #993300;"><strong></strong></span></div>
<div><span style="color: #993300;"><strong>Paul</strong></span>: You are welcome!! <span style="color: #008000;"><strong></strong></span></div>
<div><span style="color: #008000;"><strong>Nabil</strong></span>: one more thing please <span style="color: #008000;"><strong></strong></span></div>
<div><span style="color: #008000;"><strong>Nabil</strong></span>: for which reseller plan is this <span style="color: #993300;"><strong></strong></span></div>
<div><span style="color: #993300;"><strong>Paul</strong></span>: This is for all plans <span style="color: #993300;"><strong></strong></span></div>
<div><span style="color: #993300;"><strong>Paul</strong></span>: <a id="L4758470397661843806">http://www.hostclear.com/reseller</a> <span style="color: #008000;"><strong></strong></span></div>
<div><span style="color: #008000;"><strong>Nabil</strong></span>: Thanks <span style="color: #993300;"><strong></strong></span></div>
<div><span style="color: #993300;"><strong>Paul</strong></span>: You are welcome!! <span style="color: #008000;"><strong></strong></span></div>
<div><span style="color: #008000;"><strong>Nabil</strong></span>: So that limit on the terms of use is for Cpanel accounts not for the hole reseller account <span style="color: #008000;"><strong></strong></span></div>
<div><span style="color: #008000;"><strong>Nabil</strong></span>: Am I right? <span style="color: #993300;"><strong></strong></span></div>
<div><span style="color: #993300;"><strong>Paul</strong></span>: Yes. <span style="color: #008000;"><strong></strong></span></div>
<div><span style="color: #008000;"><strong>Nabil</strong></span>: Thanks again [...]</div>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.kadimi.com/en/hostclear-cpu-762/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HostGator VS. HostClear</title>
		<link>http://www.kadimi.com/en/hostgator-vs-hostclear-753</link>
		<comments>http://www.kadimi.com/en/hostgator-vs-hostclear-753#comments</comments>
		<pubDate>Tue, 01 Feb 2011 01:39:20 +0000</pubDate>
		<dc:creator>Nabil</dc:creator>
				<category><![CDATA[Web Hosting]]></category>

		<guid isPermaLink="false">http://www.kadimi.com/en/?p=753</guid>
		<description><![CDATA[I want to buy a reseller hosting account, this night I was comparing HostGator and HostClear, I visited their websites and talked with them on chat, here are my conclusions (I&#8217;m interested in the smallest reseller packages they offer): ContentsHostGatorLive supportThe Plan: Aluminium PlanHostClearLive supportThe Plan: Standard PlanThe Winner is HostGator of course! HostGator Live [...]]]></description>
			<content:encoded><![CDATA[<p>I want to buy a reseller hosting account, this night I was comparing HostGator and HostClear, I visited their websites and talked with them on chat, here are my conclusions (I&#8217;m interested in the smallest reseller packages they offer):</p>
<div id="toc_container" class="toc_wrap_right no_bullets"><p class="toc_title">Contents</p><ul class="toc_list"><li><a href="#HostGator">HostGator</a><ul><li><ul><li><a href="#Live_support">Live support</a></li><li><a href="#The_Plan_Aluminium_Plan">The Plan: Aluminium Plan</a></li></ul></li></ul></li><li><a href="#HostClear">HostClear</a><ul><li><ul><li><a href="#Live_support-2">Live support</a></li><li><a href="#The_Plan_Standard_Plan">The Plan: Standard Plan</a></li></ul></li></ul></li><li><a href="#The_Winner_is_HostGator_of_course">The Winner is HostGator of course!</a></li></ul></div>
<h2><span id="HostGator">HostGator</span></h2>
<h4><span id="Live_support">Live support</span></h4>
<p>The representatives are the  smartest I ever talked with, they hide nothing, they understand your  questions. The chat interface is easy to understand and use, if the chat  is busy the system tells you how many people are in front of you (like a  queue), it has sound notifications so that  if you minimize the chat  window you know when a representative answers you.</p>
<h4><span id="The_Plan_Aluminium_Plan">The Plan: <a href="http://www.hostgator.com/resellers.shtml">Aluminium Plan</a></span></h4>
<p>Disk space: 50 GB<br />
Bandwidth: 500 GB/month<br />
CPU: Intel® Xeon® Processor E5520 (8M Cache, 2.26 GHz, 5.86 GT/s Intel® QPI) [<a href="http://www.cpubenchmark.net/cpu.php?cpu=Intel+Xeon+L5520+%40+2.27GHz">Benchmark</a>]<br />
RAM: 12 GB<br />
Limits: You may not use 25% or more of system resources for longer than 90 seconds&#8230; There are <a href="http://www.hostgator.com/tos/tos.php">other limits (scroll to 7a.)</a>.<br />
Price monthly: $20, actually it&#8217;s ~$25 but when I checked HG was adding a coupon automatically</p>
<h2><span id="HostClear">HostClear</span></h2>
<h4><span id="Live_support-2">Live support</span></h4>
<p>The representatives are well instructed but lack ambition. The chat interface they are using is provided by LivePerson which IMHO are not very professional, oh! and you wait so loooong with a lame message that appears every few minutes to comfort you.</p>
<h4><span id="The_Plan_Standard_Plan">The Plan: <a href="http://www.hostclear.com/reseller">Standard Plan</a></span></h4>
<p>Disk space: 75 GB<br />
Bandwidth: 600 GB/month<br />
CPU: Intel® Xeon® Processor 5110 (4M Cache, 1.60 GHz, 1066 MHz FSB) [<a href="http://www.cpubenchmark.net/cpu.php?cpu=Intel+Xeon+5110+%40+1.60GHz">Benchmark</a>]<br />
RAM: 8 GB<br />
Limits: You may not use 25% or more of system resources for longer than 90 seconds&#8230; There are <a href="http://www.hostclear.com/terms">other limits</a>.<br />
Price monthly: ~$23 or ~$20 if you pay 12 months or more.</p>
<h2><span id="The_Winner_is_HostGator_of_course">The Winner is HostGator of course!</span></h2>
]]></content:encoded>
			<wfw:commentRss>http://www.kadimi.com/en/hostgator-vs-hostclear-753/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

