<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Abdelkader ELKALDI - Web Application Developer</title>
	
	<link>http://updel.com</link>
	<description>Just another Web Application Developer</description>
	<lastBuildDate>Mon, 23 May 2011 17:49:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/updel" /><feedburner:info uri="updel" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:browserFriendly></feedburner:browserFriendly><item>
		<title>Automaticly Copy Zend/Symfony Library to Project</title>
		<link>http://updel.com/automaticly-copy-zendsymfony-library-to-project/</link>
		<comments>http://updel.com/automaticly-copy-zendsymfony-library-to-project/#comments</comments>
		<pubDate>Mon, 23 May 2011 15:39:47 +0000</pubDate>
		<dc:creator>UpDeL</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://updel.com/?p=501</guid>
		<description><![CDATA[Zend Framework Batch file @echo off :MENU ECHO Zend will be copied to &#34;%CD%\library&#34; SET /P M=Type PRESS 1 to continue or any key to EXIT: IF %M%==1 ( GOTO IMPORT ) ELSE ( GOTO :EOF ) :IMPORT xcopy /E &#34;ABSOLUTE_PATH_TO_Zend_Library&#34; &#34;%CD%\library&#34; GOTO :EOF Symfony Framework Batch file @echo off :MENU ECHO Symfony will be [...]]]></description>
			<content:encoded><![CDATA[<h3>Zend Framework Batch file</h3>
<pre class="brush: php;">
@echo off
:MENU
ECHO Zend will be copied to &quot;%CD%\library&quot;
SET /P M=Type PRESS 1 to continue or any key to EXIT:
IF %M%==1 (	GOTO IMPORT ) ELSE ( GOTO :EOF )
:IMPORT
xcopy /E &quot;ABSOLUTE_PATH_TO_Zend_Library&quot; &quot;%CD%\library&quot;
GOTO :EOF
</pre>
<h3>Symfony Framework Batch file</h3>
<pre class="brush: php;">
@echo off
:MENU
ECHO Symfony will be copied to &quot;%CD%\lib\vendor&quot;
SET /P M=Type PRESS 1 to continue or any key to EXIT:
IF %M%==1 (	GOTO IMPORT ) ELSE ( GOTO :EOF )
:IMPORT
xcopy /E &quot;ABSOLUTE_PATH_TO_Symfony_Library&quot; &quot;%CD%\lib\vendor\&quot;
GOTO :EOF
</pre>
<p><span id="more-501"></span></p>
<h3>Example :</h3>
<pre class="brush: php;">
@echo off
:MENU
ECHO Zend will be copied to &quot;%CD%\library&quot;
SET /P M=Type PRESS 1 to continue or any key to EXIT:
IF %M%==1 (	GOTO IMPORT ) ELSE ( GOTO :EOF )
:IMPORT
xcopy /E &quot;D:\xampp\ZendFramework\library&quot; &quot;%CD%\library&quot;
GOTO :EOF
</pre>
<h3>How Does It Work ?</h3>
<p><strong>1 . Save batch as what_you_want.bat, example </strong><strong><span style="color: #ff0000;">zendme.bat</span> then add to windows Path .</strong><br />
<a href="http://updel.com/wp-content/uploads/automatic_zendme.jpg"><img class="aligncenter size-full wp-image-527" title="automatic_zendme" src="http://updel.com/wp-content/uploads/automatic_zendme.jpg" alt="" width="592" height="370" /></a></p>
<p><strong>2 . Go to your project &#8220;CD My_project&#8221; and type &#8220;Batch_file_name&#8221;</strong><br />
<a href="http://updel.com/wp-content/uploads/zendme.jpg"><img class="aligncenter size-full wp-image-528" title="zendme" src="http://updel.com/wp-content/uploads/zendme.jpg" alt="" width="374" height="99" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://updel.com/automaticly-copy-zendsymfony-library-to-project/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Zend Framework : Create Modular Application [Part 2]</title>
		<link>http://updel.com/zend-framework-create-modular-application-2/</link>
		<comments>http://updel.com/zend-framework-create-modular-application-2/#comments</comments>
		<pubDate>Mon, 23 May 2011 15:23:29 +0000</pubDate>
		<dc:creator>UpDeL</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://updel.com/?p=489</guid>
		<description><![CDATA[SQL Code CREATE DATABASE `MyApp` ; Then under `MyApp` CREATE TABLE IF NOT EXISTS `guestbook` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(30) NOT NULL, `comment` text NOT NULL, `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; Using Zend_Tool configure Database zf configure db-adapter &#34;adapter=pdo_mysql&#38;host=localhost&#38;username=root&#38;password=&#38;dbname=MyApp&#34; Or add lines [...]]]></description>
			<content:encoded><![CDATA[<h3>SQL Code</h3>
<pre class="brush: sql;">
CREATE  DATABASE  `MyApp` ;
</pre>
<p><strong>Then under `MyApp`</strong></p>
<pre class="brush: sql;">
CREATE TABLE IF NOT EXISTS `guestbook` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(30) NOT NULL,
`comment` text NOT NULL,
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
</pre>
<p><strong>Using Zend_Tool configure Database</strong></p>
<pre class="brush: php;">zf configure db-adapter &quot;adapter=pdo_mysql&amp;host=localhost&amp;username=root&amp;password=&amp;dbname=MyApp&quot;</pre>
<p><strong>Or add lines directly into application.ini</strong></p>
<pre class="brush: php;">resources.db.adapter = &quot;pdo_mysql&quot;
resources.db.params.host = &quot;localhost&quot;
resources.db.params.username = &quot;root&quot;
resources.db.params.password = &quot;&quot;
resources.db.params.dbname = &quot;MyApp&quot;</pre>
<p><strong>Create a table (Model) for &#8216;MyApp.guestbook&#8217; database</strong></p>
<pre class="brush: php;">
zf create db-table Guestbook guestbook Guestbook
/* zf create db-table Model-Name The-Table-Name Module-Name */
</pre>
<h1>To Be continued</h1>
]]></content:encoded>
			<wfw:commentRss>http://updel.com/zend-framework-create-modular-application-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Recaptcha basic php class</title>
		<link>http://updel.com/recaptcha-php-class/</link>
		<comments>http://updel.com/recaptcha-php-class/#comments</comments>
		<pubDate>Sat, 14 May 2011 05:13:51 +0000</pubDate>
		<dc:creator>UpDeL</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Antispam]]></category>
		<category><![CDATA[Captcha]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Recaptcha]]></category>
		<category><![CDATA[Spam]]></category>

		<guid isPermaLink="false">http://updel.com/?p=508</guid>
		<description><![CDATA[See Demo @ PhpClasses.org &#60;?php /* * Easy Recaptcha : Basic class * Abdelkader ELKALIDI &#124; contact@updel.com * More infos : https://www.google.com/recaptcha */ class Recaptcha{ public $theme = 'clean'; public $lang = 'en'; public $publicKey; public $privateKey; public $messages = array( 'invalid-site-private-key' =&#62; 'We weren\'t able to verify the private key.', 'invalid-request-cookie' =&#62; 'The challenge [...]]]></description>
			<content:encoded><![CDATA[<p><a class="demolink" title="Recaptcha basic php class" href="http://updel.com/demos/easy-recaptcha/example.php">See Demo</a><br />
<a class="demolink" title="Recaptcha" href="http://www.phpclasses.org/recaptcha">@ PhpClasses.org</a></p>
<pre class="brush: php;">
&lt;?php
/*
 *	Easy Recaptcha : Basic class
 *	Abdelkader ELKALIDI | contact@updel.com
 *	More infos : https://www.google.com/recaptcha
 */
class Recaptcha{
	public 		$theme		=	'clean';
	public 		$lang		=	'en';
	public		$publicKey;
	public 		$privateKey;
	public 		$messages	=	array(
									'invalid-site-private-key'	=&gt;	'We weren\'t able to verify the private key.',
									'invalid-request-cookie'	=&gt;	'The challenge parameter of the verify script was incorrect.',
									'incorrect-captcha-sol'		=&gt;	'The CAPTCHA solution was incorrect.',
									'recaptcha-not-reachable'	=&gt;	'reCAPTCHA never returns this error code. A plugin should manually return this code in the unlikely event that it is unable to contact the reCAPTCHA verify server.',
								);
	protected 	$error;
	protected 	$recaptchaServer 		= 	'http://www.google.com/recaptcha/api';
	protected 	$recaptchaSslServer 	= 	'https://www.google.com/recaptcha/api';
	protected 	$recaptchaCheckServer 	= 	'http://www.google.com/recaptcha/api/verify';

	/*
	 *	Nothing
	 */
	function __construct(){
	}

	/*
	 *	Debugger
	 */
	public function getError() {
		return !empty($this-&gt;error)	? $this-&gt;messages[$this-&gt;error] : false;
	}

	/*
	 *	Get Recaptcha
	 */
	public function getCaptcha($ssl = 0){
		$server	=	($ssl)	?	$this-&gt;recaptchaSslServer	:	$this-&gt;recaptchaServer;
		$error	=	(!$this-&gt;getError()) ? null : &quot;&amp;amp;error=&quot; . $this-&gt;getError();
		$html	=	'
		&lt;script type= &quot;text/javascript&quot;&gt;
			var RecaptchaOptions = {theme: \''.$this-&gt;theme.'\', lang : \''.$this-&gt;lang.'\'	};
		&lt;/script&gt;
		&lt;script type=&quot;text/javascript&quot; src=&quot;'.$server.'/challenge?k='.$this-&gt;publicKey.$error.'&quot;&gt;&lt;/script&gt;&lt;noscript&gt;&lt;iframe src=&quot;'.$server.'/noscript?k='.$this-&gt;publicKey.$error.'&quot; height=&quot;300&quot; width=&quot;500&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;textarea name=&quot;recaptcha_challenge_field&quot; rows=&quot;3&quot; cols=&quot;40&quot;&gt;&lt;/textarea&gt;&lt;input type=&quot;hidden&quot; name=&quot;recaptcha_response_field&quot; value=&quot;manual_challenge&quot;/&gt;&lt;/noscript&gt;';
		return	$html;
	}

	/*
	 *	Check Recaptcha
	 */
	public function checkCaptcha(){
        $data 	= 	$this-&gt;getBySocket(
								$this-&gt;recaptchaCheckServer,
								array (
									'privatekey'	=&gt; 	$this-&gt;privateKey,
									'remoteip'		=&gt; 	$_SERVER[&quot;REMOTE_ADDR&quot;],
									'challenge'		=&gt; 	$_POST['recaptcha_challenge_field'],
									'response'		=&gt; 	$_POST['recaptcha_response_field'],
								)
							);

        $array 			= 	explode(&quot;\n&quot;, $data);
		$this-&gt;error 	= 	(trim($array[0]) == 'false') ? trim($array[1]) : null;
	}

	/*
	 *	Send Data using Sockets
	 */
	private function getBySocket($url, $data) {
		$data		=	$this-&gt;concatData($data);
		$post	 	= 	curl_init();
		curl_setopt($post, CURLOPT_URL, $url);
		curl_setopt($post, CURLOPT_USERAGENT, $data);
		curl_setopt($post, CURLOPT_POST, 1);
		curl_setopt($post, CURLOPT_POSTFIELDS,$data);
		curl_setopt($post, CURLOPT_RETURNTRANSFER, 1);
		$response = curl_exec($post);
		curl_close($post);
		return $response;
	}

	/*
	 *	Concat Data
	 */
	private function concatData($data) {
		if(is_array($data)){
			foreach ($data as $key =&gt; $value){
				$var[]	= $key.&quot;=&quot;.$value;
			}
			return implode(&quot;&amp;&quot;,$var);
		}
		else{
			return $data;
		}
	}
}
</pre>
<h3>Example :</h3>
<pre class="brush: php;">
&lt;form method=&quot;post&quot; action=&quot;&quot;&gt;
&lt;?php
    require 'recaptcha.class.php';

    $captcha    =    new Recaptcha;
    $captcha-&gt;publicKey        =    'your public API key';
    $captcha-&gt;privateKey    =    'your private API key';

    if(isset($_POST) AND !empty($_POST)){
        $captcha-&gt;checkCaptcha();
        $debug    =    $captcha-&gt;getError();
        if(!$debug){
            echo 'All right';
        }
        else{
            echo $debug;
        }
    }

    echo $captcha-&gt;getCaptcha();
?&gt;
&lt;input type=&quot;submit&quot; value=&quot;Check captcha&quot; /&gt;
&lt;/form&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://updel.com/recaptcha-php-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lost your Dv lottery confirmation number ?</title>
		<link>http://updel.com/lost-dv-lottery-confirmation-number/</link>
		<comments>http://updel.com/lost-dv-lottery-confirmation-number/#comments</comments>
		<pubDate>Sun, 01 May 2011 22:48:37 +0000</pubDate>
		<dc:creator>UpDeL</dc:creator>
				<category><![CDATA[Don't matter]]></category>
		<category><![CDATA[confirmation number]]></category>
		<category><![CDATA[Dv lottery]]></category>
		<category><![CDATA[USA lottery]]></category>

		<guid isPermaLink="false">http://updel.com/?p=502</guid>
		<description><![CDATA[There&#8217;s no way to get your confirmation number after you&#8217;ve lost it. However don&#8217;t worry, you will be sent a notification letter in the mail if you win. This letter will also show what number in line you are, and you can check online]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s no way to get your <strong>confirmation number</strong> after you&#8217;ve lost it.</p>
<p><strong>However don&#8217;t worry</strong>, <span style="color: #ff0000;">you will be sent a notification letter in the mail if you win</span>.<br />
This letter will also show what number in line you are, and you can check online</p>
<p><img class="aligncenter size-full wp-image-503" title="DV-Lottery" src="http://updel.com/wp-content/uploads/DV-Lottery-3.gif" alt="" width="604" /></p>
]]></content:encoded>
			<wfw:commentRss>http://updel.com/lost-dv-lottery-confirmation-number/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Zend Framework : Modular Application [Part 1]</title>
		<link>http://updel.com/zend-framework-modular-application/</link>
		<comments>http://updel.com/zend-framework-modular-application/#comments</comments>
		<pubDate>Mon, 25 Apr 2011 03:21:05 +0000</pubDate>
		<dc:creator>UpDeL</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[1.11]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Zend]]></category>
		<category><![CDATA[Zend Controller]]></category>
		<category><![CDATA[Zend Db-Table]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[Zend Module]]></category>
		<category><![CDATA[Zend_Tool]]></category>
		<category><![CDATA[ZF]]></category>

		<guid isPermaLink="false">http://updel.com/?p=444</guid>
		<description><![CDATA[Project description : A simple guestbook module using Zend Framework 1.11 . Project Create new project using Zend_Tool : zf create project MyApp cd MyApp Create module : zf create module Guestbook Create controller for Guestbook (1 = index action included): zf create controller Index 1 Guestbook Now go to /MyApp/application/configs/application.ini and comment/delete the line [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Project description :</strong> A simple guestbook module using <strong>Zend Framework 1.11</strong> .</p>
<h3>Project</h3>
<p><strong>Create new project using Zend_Tool :</strong></p>
<pre class="brush: php;">
zf create project MyApp
cd MyApp
</pre>
<p><strong>Create module :</strong></p>
<pre class="brush: php;">zf create module Guestbook</pre>
<p><strong>Create controller for Guestbook (1 = index action included):</strong></p>
<pre class="brush: php;">zf create controller Index 1 Guestbook</pre>
<p><strong>Now go to <span style="color: #ff0000;">/MyApp/application/configs/application.ini </span>and comment/delete the line :</strong></p>
<pre class="brush: php;">;resources.frontController.controllerDirectory = APPLICATION_PATH &quot;/controllers&quot;</pre>
<p><strong>Then add the lines</strong></p>
<pre class="brush: php;">;Modular suport
resources.frontController.moduleDirectory = APPLICATION_PATH &quot;/modules&quot;
resources.modules[] =</pre>
<p><strong>And add this lines to set Guestbook as default module</strong></p>
<pre class="brush: php;">resources.frontController.params.prefixDefaultModule = &quot;1&quot;
resources.frontController.defaultModule = &quot;Guestbook&quot;</pre>
<p><span style="color: #ff0000;"><strong>Create php file &#8220;Bootstrap.php&#8221; under folder /MyApp/application/modules/Guestbook and past the code</strong></span></p>
<pre class="brush: php;">&lt;?php
class Guestbook_Bootstrap extends Zend_Application_Module_Bootstrap{}</pre>
<h3>Now test your app</h3>
<p><img class="alignnone size-full wp-image-466" title="Zend modular application" src="http://updel.com/wp-content/uploads/Screen-shot-2011-04-25-at-2.19.jpg" alt="" width="604" height="263" /><span id="more-444"></span></p>
<h1>Video :</h1>
<p><object style="width: 600px; height: 390px;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="600" height="390" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.youtube.com/v/ZQDGksdXyEE" /><embed style="width: 600px; height: 390px;" type="application/x-shockwave-flash" width="600" height="390" src="http://www.youtube.com/v/ZQDGksdXyEE"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://updel.com/zend-framework-modular-application/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Windows plutôt que Mac OS sur votre Laptop</title>
		<link>http://updel.com/windows-vs-mac-os-laptop/</link>
		<comments>http://updel.com/windows-vs-mac-os-laptop/#comments</comments>
		<pubDate>Sun, 12 Dec 2010 17:51:41 +0000</pubDate>
		<dc:creator>UpDeL</dc:creator>
				<category><![CDATA[Don't matter]]></category>
		<category><![CDATA[Windows vs Mac os]]></category>

		<guid isPermaLink="false">http://updel.com/?p=416</guid>
		<description><![CDATA[Billet  de survie ! Microsoft Windows plutôt que Mac OS sur mon Laptop pour la simple raison : C&#8217;est mon ordinateur Portable &#8220;multiple utilisations&#8221;, donc j&#8217;ai besoin d&#8217;un maximum d&#8217;outils, de logiciels et de jeux, et ça seule Windows peut me le garantir ! Ubuntu Desktop sur le PC maison afin de protéger la famille [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Billet  de survie !</strong></p>
<p>Microsoft Windows plutôt que Mac OS sur mon Laptop pour la simple raison : C&#8217;est mon ordinateur Portable &#8220;multiple utilisations&#8221;, donc j&#8217;ai besoin d&#8217;un maximum d&#8217;outils, de logiciels et de jeux, et ça seule Windows peut me le garantir !</p>
<p><a title="Ubuntu desktop" href="http://www.ubuntu.com/desktop" target="_blank"><strong>Ubuntu Desktop</strong></a> sur le PC maison afin de protéger la famille et de garder contact avec cette beauté gratuite, <a title="Ubuntu netbook" href="http://www.ubuntu.com/netbook" target="_blank"><strong>Ubuntu Netbook</strong></a> également sur une partition de mon Laptop.</p>
<p><strong><a title="centos" href="http://www.centos.org/" target="_blank">Centos</a> </strong>sur le serveur.</p>
]]></content:encoded>
			<wfw:commentRss>http://updel.com/windows-vs-mac-os-laptop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drag2Crop mootools plugin : Drag picture inside a box</title>
		<link>http://updel.com/drag2crop/</link>
		<comments>http://updel.com/drag2crop/#comments</comments>
		<pubDate>Thu, 20 May 2010 22:00:00 +0000</pubDate>
		<dc:creator>UpDeL</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Mootools]]></category>

		<guid isPermaLink="false">http://updel.com/?p=395</guid>
		<description><![CDATA[UPDATE 09/06/2010 : Start drag at &#8220;Top&#8221; and &#8220;Left&#8221; values. Drag2Crop : This small mootools plugin extends &#8220;Drag plgin&#8221; allow to drag picture inside a small box to get a thumbnail showing the good part of the picture, and after Drag complete return values [Top, Left, Width, Height] of picture relative to the box (Like [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;"><span style="color: #ff0000;">UPDATE 09/06/2010 :</span> Start drag at &#8220;Top&#8221; and &#8220;Left&#8221; values.</p>
<p style="text-align: center;"><img class="size-full wp-image-25  aligncenter" title="facebook_thumbnail" src="../wp-content/uploads/facebook_thumbnail.jpg" alt="facebook_thumbnail" width="486" height="153" /></p>
<p>Drag2Crop : This small <a title="Mootools" href="http://mootools.net/" target="_blank">mootools</a> plugin extends &#8220;<a title="Drag plugin" href="http://mootools.net/docs/more/Drag/Drag" target="_blank">Drag plgin</a>&#8221; allow to drag picture inside a small box to get a thumbnail showing the good part of the picture, and after Drag complete return values [Top, Left, Width, Height] of picture relative to the box (Like facebook).</p>
<h2>The MooTools 1.2 JavaScript</h2>
<pre class="brush: jscript;">
var Drag2Crop = new Class({
    Extends: Drag,
    Implements:[Options,Events],
    initialize: function(picture, options) {
        this.setOptions({
            relative    :    'relative',
            modifiers   :    { x: 'scrollLeft', y: 'scrollTop' },
            style       :    false,
            invert      :    true,
            top  		:    0,
            left		:    0,
            onComplete  :    this.complete.bind(this),
            debug       :    false
        }, options);
		this.top        =     this.options.top.toInt();
        this.left       =     this.options.left.toInt();
        this.picture    =     $(picture);
        this.relative   =     $(this.options.relative).setStyles({cursor:'move'}).scrollTo(-this.left, -this.top);
 this.parent(this.relative);
 this.__construct();
 },
 __construct	:    function(){
 if(Browser.Engine.trident) document.ondragstart = function (){return false;}; // IE fix
 },
 coordinates	: function(){
 this.getCoordinates	=	this.relative.getScroll();
 this.getSize		=	this.relative.getSize();
 this.width  		=   this.relative.getSize().x.toInt();
 this.height  		=   this.relative.getSize().y.toInt();
 this.left  			=   -this.getCoordinates.x.toInt();
 this.top    		=   -this.getCoordinates.y.toInt();
 },
 complete    :    function(){
 this.coordinates();
 this.fireEvent(&quot;done&quot;,[this.top,this.left,this.width,this.height]);
 }
});
</pre>
<h2>The Usage</h2>
<pre class="brush: jscript;">
window.addEvent('load', function(){
	new Drag2Crop('pictureId', {
		relative 	: 	'relative',
		top			:	-30, // Start at top : -30
		left		:	-60, // Start at left : -60
        onStart		:    function(){
            this.picture.setStyles({opacity:0.5});
        },
        onDone      :    function(top,left){
            this.picture.setStyles({opacity:1});
			$('test').set('text', 'Top : ' + top + ' | Left : ' + left);
        }
    });
});
</pre>
<p><a class="demolink" title="Mootools Drag to Crop plugin" href="http://updel.com/demos/drag2crop/">See Demo</a></p>
<p><a class="demolink" title="Mootools Drag to Crop plugin" href="http://github.com/updel/Drag2Crop/">GitHub Repository</a></p>
<p><a class="demolink" title="Mootools Drag to Crop plugin" href="http://mootools.net/forge/p/drag2crop/">Projet @ Mootools Forge</a></p>
<h2>Events :</h2>
<p><strong>beforeStart</strong> : Executed before the Drag instance attaches the events. Receives the dragged element as an argument.</p>
<p><strong>start</strong> : Executed when the user starts to drag (on mousedown). Receives the dragged element as an argument.</p>
<p><strong>snap</strong> : Executed when the user has dragged past the snap option. Receives the dragged element as an argument.</p>
<p><strong>drag</strong> : Executed on every step of the drag. Receives the dragged element and the event as arguments.</p>
<p><strong>complete</strong> : Executed when the user completes the drag. Receives the dragged element and the event as arguments.</p>
<p><strong>cancel</strong> : Executed when the user has cancelled the drag. Receives the dragged element as an argument.</p>
<p><strong>top</strong>: (number) start drag at top value.</p>
<p><strong>left</strong>: (number) start drag at left value.</p>
<p><strong>done</strong> : Executed when the user completes the drag.Receives the values [Top, Left, Width, Height] of picture relative to the box</p>
]]></content:encoded>
			<wfw:commentRss>http://updel.com/drag2crop/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Cloture d’un compte bancaire : Le service :D</title>
		<link>http://updel.com/cloture-compte-bancaire/</link>
		<comments>http://updel.com/cloture-compte-bancaire/#comments</comments>
		<pubDate>Tue, 18 May 2010 16:36:27 +0000</pubDate>
		<dc:creator>UpDeL</dc:creator>
				<category><![CDATA[Don't matter]]></category>
		<category><![CDATA[BMCE]]></category>
		<category><![CDATA[BMCE CENTRE D'AFFAIRES SAFI]]></category>
		<category><![CDATA[Cloture d'un compte bancaire]]></category>
		<category><![CDATA[Demande Cloture compte bancaire]]></category>

		<guid isPermaLink="false">http://updel.com/?p=387</guid>
		<description><![CDATA[Si vous cherchez un exemple de lettre de clôture d&#8217;un compte bancaire au Maroc essayez ma version téléchargeable ici . Je peux vous dire que j&#8217;ai eu la pire &#8220;bureaucratique réception&#8221; de ma vie !!! Un service qui a rapidement écrasé mes bons vieux souvenirs avec la &#8220;BMCE CENTRE D&#8217;AFFAIRES SAFI&#8221; il y a quelques [...]]]></description>
			<content:encoded><![CDATA[<p>Si vous cherchez un exemple de lettre de clôture d&#8217;un compte bancaire au Maroc essayez <a title="Demande cloture compte bancaire" href="http://updel.com/docs/demande_cloture_compte_bancaire.doc"><strong>ma version téléchargeable ici</strong></a> .</p>
<p>Je peux vous dire que j&#8217;ai eu la pire &#8220;bureaucratique réception&#8221; de ma vie !!! Un service qui a rapidement écrasé mes bons vieux souvenirs avec la <strong>&#8220;BMCE CENTRE D&#8217;AFFAIRES SAFI&#8221;</strong> il y a quelques années déjà, le jour ou j&#8217;ai ouvert mon premier compte bancaire accompagné seulement de ma CIN, mais aussi le jour ou tout le personnel de la banque s&#8217;est échanger mon chèque électronique avant de se décider, c&#8217;était leur première fois !!!</p>
<p>Aujourd&#8217;hui la jeune dame au cheveux court et corps plein nommée <strong>N</strong> (haha) s&#8217;est donné la peine de me montrer combien je suis frivole.</p>
<p>Heureusement que j&#8217;ai pris l&#8217;habitude de s&#8217;en foutre de la façon dont le &#8220;<em>citoyen basique</em>&#8221; comme moi se traite parfois dans différents services par quelques employés, alors dès que j&#8217;ai rentré chez moi : une douche suivi par une sieste et sujet achevé !!</p>
<p>nb : Merci Simo</p>
]]></content:encoded>
			<wfw:commentRss>http://updel.com/cloture-compte-bancaire/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The thrilling potential of SixthSense technology</title>
		<link>http://updel.com/sixthsense-technology/</link>
		<comments>http://updel.com/sixthsense-technology/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 03:50:50 +0000</pubDate>
		<dc:creator>UpDeL</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[6eme sens technology]]></category>
		<category><![CDATA[Panav Mistry]]></category>
		<category><![CDATA[sixth sense technology]]></category>
		<category><![CDATA[TED]]></category>

		<guid isPermaLink="false">http://updel.com/?p=370</guid>
		<description />
			<content:encoded><![CDATA[<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="350" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.youtube.com/v/YrtANPtnhyg" /><embed type="application/x-shockwave-flash" width="425" height="350" src="http://www.youtube.com/v/YrtANPtnhyg"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://updel.com/sixthsense-technology/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Smarty : {capture} to put code in your header page</title>
		<link>http://updel.com/smarty-capture-function/</link>
		<comments>http://updel.com/smarty-capture-function/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 17:43:08 +0000</pubDate>
		<dc:creator>UpDeL</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[put code in page head]]></category>
		<category><![CDATA[Smarty capture]]></category>
		<category><![CDATA[Smarty literal]]></category>
		<category><![CDATA[Smarty template]]></category>

		<guid isPermaLink="false">http://updel.com/?p=346</guid>
		<description><![CDATA[If you are using Smarty to generate your templates, I strongly advice you to take advantage of the function: {capture} This function is used to collect the output of the template between the tags {capture}{/capture} into a variable instead of displaying it. Exemple  : index.tpl {capture name=header} {literal} &#60;script type=&#34;text/javascript&#34;&#62; alert('Javascript in head'); &#60;/script&#62; {/literal} [...]]]></description>
			<content:encoded><![CDATA[<p>If you are using <a title="Smarty Template Engine" href="http://www.smarty.net" target="_blank">Smarty</a> to generate your templates, I strongly advice you to take advantage of the  function: <a title="smarty caption" href="http://www.smarty.net/manual/en/language.builtin.functions.php#language.function.capture" target="_blank">{capture}</a></p>
<p>This function is used to collect the output of the template between the    tags <em>{capture}{/capture}</em> into a  variable instead of displaying it.</p>
<p>Exemple  :</p>
<p><span style="color: #ff0000;"><strong>index.tpl</strong></span></p>
<pre class="brush: xml;">
{capture name=header}
{literal}
&lt;script type=&quot;text/javascript&quot;&gt;
alert('Javascript in head');
&lt;/script&gt;
{/literal}
{/capture}
&lt;!-- Include Page Header using Smarty {include} --&gt;
{include file=&quot;header.tpl&quot;}
My index page content
</pre>
<p><span style="color: #ff0000;"><strong>header.tpl</strong></span></p>
<pre class="brush: xml;">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Page ttle&lt;/title&gt;
{$smarty.capture.header}
&lt;/head&gt;
</pre>
<p><span style="color: #ff0000;">Nb : &#8220;Javascript code&#8221; must be placed between {literal}{/literal}</span></p>
]]></content:encoded>
			<wfw:commentRss>http://updel.com/smarty-capture-function/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

