<?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>Davide Caffaratti blog &#187; php</title>
	<atom:link href="http://davidecaffaratti.com/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://davidecaffaratti.com</link>
	<description>My own personal blog and my works</description>
	<lastBuildDate>Fri, 12 Mar 2010 02:40:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Simple class for extract browser info</title>
		<link>http://davidecaffaratti.com/2010/03/11/simple-class-for-extract-browser-info/</link>
		<comments>http://davidecaffaratti.com/2010/03/11/simple-class-for-extract-browser-info/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 02:39:01 +0000</pubDate>
		<dc:creator>Davide</dc:creator>
				<category><![CDATA[Library]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[Classes]]></category>

		<guid isPermaLink="false">http://davidecaffaratti.com/?p=416</guid>
		<description><![CDATA[This is my little class for extract information from the browser with $_SERVER['HTTP_USER_AGENT']. Is very simple to use and can extract the browser name, minor version, and the platform name. Click HERE for see the code of this class]]></description>
			<content:encoded><![CDATA[<p>This is my little class for extract information from the browser with $_SERVER['HTTP_USER_AGENT'].</p>
<p>Is very simple to use and can extract the browser name, minor version, and the platform name.</p>
<p><a title="view class browser info" href="http://davidecaffaratti.com/php-code/cat-browser-info.inc.phps">Click HERE for see the code of this class</a></p>
<a href="http://davidecaffaratti.com/upload/cat-browser-info.inc.zip" title="download Cat_Browser_Info"><img src="http://davidecaffaratti.com/wp-content/plugins/download-monitor/img/download.gif" alt="download" style="float:left;width:300px;" /></a><div style="float:left;width:auto;line-height:25px;margin-top:30px;margin-left:15px;"><b>Size:</b> 1.42 KB<br /><b>Hits :</b> 9</div><br style="clear:both;" />
]]></content:encoded>
			<wfw:commentRss>http://davidecaffaratti.com/2010/03/11/simple-class-for-extract-browser-info/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Class Cat_Cache revision 1</title>
		<link>http://davidecaffaratti.com/2010/01/29/class-cat_cache-revision-1/</link>
		<comments>http://davidecaffaratti.com/2010/01/29/class-cat_cache-revision-1/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 01:26:47 +0000</pubDate>
		<dc:creator>Davide</dc:creator>
				<category><![CDATA[Library]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[Classes]]></category>

		<guid isPermaLink="false">http://davidecaffaratti.com/?p=411</guid>
		<description><![CDATA[I found in my class for cache data an error that return incorrect value if the cache isn&#8217;t in the cache directory. This error return improperly a boolean true value instead of false. I correct the error with a new version of the class. Click HERE for see the code of this class]]></description>
			<content:encoded><![CDATA[<p>I found in my class for cache data an error that return incorrect value if the cache isn&#8217;t in the cache directory. This error return improperly a boolean true value instead of false.</p>
<p>I correct the error with a new version of the class.<br />
<strong><a title="view the class code" href="http://davidecaffaratti.com/php-code/cat-cache.phps">Click HERE for see the code of this class</a></strong></p>
<a href="http://davidecaffaratti.com/upload/cat-cache.inc.zip" title="download cat-cache"><img src="http://davidecaffaratti.com/wp-content/plugins/download-monitor/img/download.gif" alt="download" style="float:left;width:300px;" /></a><div style="float:left;width:auto;line-height:25px;margin-top:30px;margin-left:15px;"><b>Size:</b> 4.9 KB<br /><b>Hits :</b> 21</div><br style="clear:both;" />
]]></content:encoded>
			<wfw:commentRss>http://davidecaffaratti.com/2010/01/29/class-cat_cache-revision-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mootools Edit In Place</title>
		<link>http://davidecaffaratti.com/2009/10/26/mootools-edit-in-place/</link>
		<comments>http://davidecaffaratti.com/2009/10/26/mootools-edit-in-place/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 03:41:58 +0000</pubDate>
		<dc:creator>Davide</dc:creator>
				<category><![CDATA[Library]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Classes]]></category>
		<category><![CDATA[eip]]></category>

		<guid isPermaLink="false">http://davidecaffaratti.com/?p=400</guid>
		<description><![CDATA[Here is my Mootools class that I use for make edit in place text. VIEW THE EXAMPLE FILE Use this class is very simple: First need to have mootools 1.2 javascript library Second download MooEip class The class: var MooEip = new Class({ //implements Implements: [Options,Events], //options options: { elements: '.eip', styleHover: 'eip-hover', styleInput: 'eip-input', [...]]]></description>
			<content:encoded><![CDATA[<p>Here is my <a href="http://mootools.net" target="_blank">Mootools</a> class that I use for make edit in place text.</p>
<p><strong><a href="http://davidecaffaratti.com/mootools/moo-eip/">VIEW THE EXAMPLE FILE</a></strong></p>
<p>Use this class is very simple:</p>
<p>First need to have <a href="http://mootools.net/core" target="_blank">mootools 1.2</a> javascript library<br />
Second download MooEip class</p>
<a href="http://davidecaffaratti.com/upload/moo-eip.zip" title="download mootools Eip"><img src="http://davidecaffaratti.com/wp-content/plugins/download-monitor/img/download.gif" alt="download" style="float:left;width:300px;" /></a><div style="float:left;width:auto;line-height:25px;margin-top:30px;margin-left:15px;"><b>Size:</b> 43.19 KB<br /><b>Hits :</b> 162</div><br style="clear:both;" />
<p><span id="more-400"></span></p>
<h3>The class:</h3>
<pre class="brush: jscript;">
var MooEip = new Class({

    //implements
    Implements: [Options,Events],

    //options
    options: {
        elements: '.eip',
        styleHover: 'eip-hover',
        styleInput: 'eip-input',
        styleTextarea: 'eip-textarea',
        styleLoading: 'eip-loading',
        idPrefix: 'id_',
        inputSave: 'Save',
        inputCanc: 'Cancel',
        saving: 'Saving...',
        empty: 'Click to Edit',
        hoverColor: '#ceffef',
        leaveColor: '#ffffff'
    },

    //initialization
    initialize: function(ajaxUrl, options) {
        // set ajax url
        this.ajaxUrl = ajaxUrl;
        //set options
        this.setOptions(options);

        this.run();
    },

    //a method that does whatever you want
    run: function() {
        //find the editable areas
        $$(this.options.elements).each(function(el) {
            var elId = el.getProperty('id');
            var elValue = el.get('text').trim();

            if (elValue.trim() == ''){
                el.set('text', this.options.empty);
            }

            if (el.getStyle('display') != '') {
                var displayStyle = el.getStyle('display');
            }
            else {
                var displayStyle = el.setStyle('display', 'block');
            }

            var editForm = new Element('form', {
                'name': 'form_' + elId,
                'events': {
                    'submit': function(e) {
                        el.setStyle('display', 'block');
                        //el.fireEvent('mouseleave');
                        e.preventDefault();

                        var request = new Request({
                            url: this.ajaxUrl,
                            data: 'value=' + editForm.fieldValue.value,
                            method: 'post',
                            onRequest: function(){
                                el.addClass(this.options.styleLoading);
                                el.set('text', this.options.saving);
                            }.bind(this),
                            onSuccess: function(){
                                el.removeClass(this.options.styleLoading);
                                el.set('html', (editForm.fieldValue.value.trim() == '' ? this.options.empty : editForm.fieldValue.value.trim().replace(new RegExp('\n', 'gi'), '&lt;br /&gt;')));
                            }.bind(this),
                            onFailure: function(resp){
                                el.removeClass(this.options.styleLoading);
                                alert('ERROR ON THE SERVER !!\nCODE: ' + resp.status + ' - TEXT: ' + resp.statusText + '\nPLEASE SAVE THE TEXT AGAIN !!');
                                el.set('html', (editForm.fieldValue.value.trim() == '' ? this.options.empty : editForm.fieldValue.value.trim().replace(new RegExp('\n', 'gi'), '&lt;br /&gt;')));
                            }.bind(this)
                        });
                        request.send();                        

                        editForm.dispose();

                        // set the new value from submited form value
                        elValue = editForm.fieldValue.value.trim();
                    }.bind(this)
                }
            });

            if(el.hasClass('input')) {
                var editField = new Element('input', {
                    'type': 'text',
                    'name': 'fieldValue',
                    'class': this.options.styleInput
                });
            }
            else {
                var editField = new Element('textarea', {
                    'name': 'fieldValue',
                    'class': this.options.styleTextarea
                });
                if (el.get('style') != '') {
                    editField.set('style', el.get('style'));
                }
            }

            var okButton = new Element('input', {
                'id': 'ok_' + elId,
                'type': 'submit',
                'value': this.options.inputSave,
                'events' : {
                    'click': function() {
                    editForm.dispose();
                    el.setStyle('display', displayStyle);
                    el.fireEvent('mouseleave');
                    }
                }
            });

            var cancelButton = new Element('input', {
                'id': 'cancel_' + elId,
                'type': 'reset',
                'value': this.options.inputCanc,
                'events': {
                    'click': function() {
                    editForm.dispose();
                    el.setStyle('display', displayStyle);
                    el.fireEvent('mouseleave');
                    }
                }
            });

            editField.inject(editForm);
            lb = new Element('br').inject(editField, 'after');
            okButton.inject(editForm);
            cancelButton.inject(editForm);

            var myeffect = new Fx.Tween(el, {duration: 500});

            el.addEvents({
                'mouseenter': function() {
                    el.setStyle('background-color', this.options.hoverColor);
                    el.addClass('eip-hover');
                }.bind(this),

                'mouseleave': function() {
                    myeffect.start('background-color', this.options.hoverColor, this.options.leaveColor);
                    el.removeClass('eip-hover');
                }.bind(this),

                'click': function() {
                    el.setStyle('display', 'none');
                    editField.value = (el.hasClass('input')) ? elValue.trim() : elValue.trim().replace(new RegExp('&lt;br /&gt;', 'gi'),'\n');
                    editForm.inject(el, 'after');
                    editField.focus();
                    el.removeClass('eip-hover');
                }
            });
        }, this);
    }
});
</pre>
<h3>The javascript in the page:</h3>
<pre class="brush: xml;">
&lt;script src=&quot;js/mootools-1.2.3-core.js&quot; type=&quot;text/javascript&quot;  charset=&quot;utf-8&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;js/moo-eip-min.js&quot; type=&quot;text/javascript&quot;  charset=&quot;utf-8&quot;&gt;&lt;/script&gt;

&lt;script type=&quot;text/javascript&quot;  charset=&quot;utf-8&quot;&gt;
//&lt;![CDATA[
window.addEvent('domready', function() {
    var eip = new MooEip('edit.php');
});
//]]&gt;
&lt;/script&gt;

&lt;!-- style for moo-eip --&gt;
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;css/style.css&quot; /&gt;
&lt;!-- /style for moo-eip --&gt;
</pre>
<h3>The html</h3>
<pre class="brush: xml;">
&lt;div class=&quot;eip input&quot; id=&quot;id_0&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;eip&quot; id=&quot;id_1&quot; style=&quot;overflow:hidden;height:100px&quot;&gt;
this is a editable text 1 with overflow of the text hidden and height fixed in 100px.
&lt;/div&gt;
&lt;div class=&quot;eip&quot; id=&quot;id_2&quot;&gt;
this is a editable text 2.
&lt;/div&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://davidecaffaratti.com/2009/10/26/mootools-edit-in-place/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Secure image capcha revisited</title>
		<link>http://davidecaffaratti.com/2009/07/10/secure-image-capcha-revisited/</link>
		<comments>http://davidecaffaratti.com/2009/07/10/secure-image-capcha-revisited/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 04:02:21 +0000</pubDate>
		<dc:creator>Davide</dc:creator>
				<category><![CDATA[Library]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[capcha]]></category>
		<category><![CDATA[Classes]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://davidecaffaratti.com/?p=351</guid>
		<description><![CDATA[I found a nice script http://www.phpcaptcha.org/ for made form capcha named secureimage and add some code for have random background and font for the capcha image Here are the class modification that I made on the class: - Porting the class for use in php5 - Remove the define for images: SI_IMAGE_JPEG, SI_IMAGE_PNG, SI_IMAGE_GIF - [...]]]></description>
			<content:encoded><![CDATA[<p>I found a nice script <a href="http://www.phpcaptcha.org/" target="_blank">http://www.phpcaptcha.org/</a> for made form capcha named secureimage and add some code for have random background and font for the capcha image</p>
<p>Here are the class modification that I made on the class:</p>
<p>- Porting the class for use in php5<br />
- Remove the define for images: SI_IMAGE_JPEG, SI_IMAGE_PNG, SI_IMAGE_GIF<br />
- Add define for ttf font path SI_PATH_TTF_FONTS<br />
- Add define for gd font path SI_PATH_GD_FONTS<br />
- Add define for random background imagess path SI_PATH_BACKGROUND<br />
- Add define for audio path SI_PATH_AUDIO<br />
- Add define for wordlist path SI_PATH_WORDS<br />
- Set static var for $charset<br />
- Add var $automatic_random for enable / disable random font and background image<br />
- Add var $lang_wordlist for have wordlist for any language<br />
- Delete var $wordlist_file: the file now is on SI_PATH_WORDS.&#8217;wordlist-&#8217;.$lang_wordlist.&#8217;.txt&#8217;<br />
- Add var $use_random_bg_image for set random extraction for the background image<br />
- Modify var $gd_font_file: now can set only filename<br />
- Modify var $gd_font_file: now can set only filename<br />
- Modify var $audio_path: now can set only filename<br />
- Add options array to the constructor function: $img = new Securimage(array(&#8216;automatic_random&#8217;=&gt;false,&#8217;lang_wordlist&#8217;=&gt;&#8217;it&#8217;));<br />
- Add generic function for set var in the class: (void)setOption($name, $value);<br />
- Add generic function for set var in the class: (void)setBgImage(&#8216;/path-to-my-bg-image/image-name.jpg&#8217;);<br />
- Modify function show() and added the code for have random background and font in the class<br />
- Added function getRandom() for charge random files</p>
<a href="http://davidecaffaratti.com/upload/captcha.zip" title="download Secureimage capcha"><img src="http://davidecaffaratti.com/wp-content/plugins/download-monitor/img/download.gif" alt="download" style="float:left;width:300px;" /></a><div style="float:left;width:auto;line-height:25px;margin-top:30px;margin-left:15px;"><b>Size:</b> 846.85 KB<br /><b>Hits :</b> 54</div><br style="clear:both;" />
]]></content:encoded>
			<wfw:commentRss>http://davidecaffaratti.com/2009/07/10/secure-image-capcha-revisited/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP pdf invoice</title>
		<link>http://davidecaffaratti.com/2009/06/30/php-pdf-invoice/</link>
		<comments>http://davidecaffaratti.com/2009/06/30/php-pdf-invoice/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 01:58:51 +0000</pubDate>
		<dc:creator>Davide</dc:creator>
				<category><![CDATA[Library]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Classes]]></category>
		<category><![CDATA[invoice]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://davidecaffaratti.com/?p=335</guid>
		<description><![CDATA[I need for my cms a class that can print invoice payment in pdf format. Wel I find a nice script for oscommerce ( http://www.oscommerce.com/community/contributions,5321/category,12/search,pdf_customer_invoice ) that have a nice view of  the pdf invoice; Than I port this script and make a class for use in all indipendent cms &#8230; Here can download the [...]]]></description>
			<content:encoded><![CDATA[<p>I need for my cms a class that can print invoice payment in pdf format.</p>
<p>Wel I find a nice script for oscommerce (<a href="http://www.oscommerce.com/community/contributions,5321/category,12/search,pdf_customer_invoice" target="_blank"> http://www.oscommerce.com/community/contributions,5321/category,12/search,pdf_customer_invoice</a> ) that have a nice view of  the pdf invoice; Than I port this script and make a class for use in all indipendent cms &#8230;<img title="More..." src="http://davidecaffaratti.com/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt="" /></p>
<p>Here can download the example output of the invoice class:</p>
<p><a href="http://davidecaffaratti.com/wp-content/uploads/2009/06/example.pdf">In</a><a href="http://davidecaffaratti.com/wp-content/uploads/2009/06/example.pdf">invoice pdf</a></p>
<a href="http://davidecaffaratti.com/upload/invoice.zip" title="download Cat_Pdf_Invoice - Class for make invoice pdf"><img src="http://davidecaffaratti.com/wp-content/plugins/download-monitor/img/download.gif" alt="download" style="float:left;width:300px;" /></a><div style="float:left;width:auto;line-height:25px;margin-top:30px;margin-left:15px;"><b>Size:</b> 81.96 KB<br /><b>Hits :</b> 124</div><br style="clear:both;" />
<p><span id="more-335"></span>Here is an example of use:</p>
<pre class="brush: php;">&lt;?php
$dir = dirname(__FILE__).'/';
define('FPDF_FONTPATH', $dir.'font/');
include($dir.'fpdf.php');
include($dir.'cat-pdf-invoice.inc.php');

$pdf = new Pdf_Invoice(array('locale'=&gt;false,'lang'=&gt;'en','show_watermark'=&gt;true,'watermark_text'=&gt;'Invoice copy'));
$params = array(
'customer_id'=&gt;1,
'payment_method'=&gt;'Paypal',
'carrier_method'=&gt;'Flat rate',
'carrier_price'=&gt;5.25,
'order_id'=&gt;222,
'order_date'=&gt;'2009/02/11',
'invoice_address'=&gt;&quot;street name\ncity zip\nstate\ncountry\n&quot;,
'delivery_address'=&gt;&quot;street name\ncity zip\nstate\ncountry\n&quot;,
'store_name'=&gt;'My store name',
'store_address'=&gt;&quot;store street name\nstore city zip\nstore state\nstore country\n&quot;,
'store_tel'=&gt;'+39 011222222',
'store_fax'=&gt;'+39 011333333',
'store_email'=&gt;'info@mystore.com',
'store_web'=&gt;'http://mystore.com',
'store_tax_number'=&gt;87039097397390,
'img_logo'=&gt;$dir.'invoice-logo.jpg',
'img_logo_correction'=&gt;0.18,
'invoice_footer'=&gt;'Thank you for your purchase'
);
$pdf-&gt;SetInvoiceParams($params);

$product = array(
'qty'=&gt;2,
'name'=&gt;'product 1 name',
'model'=&gt;'product 1 model',
'attributes'=&gt;'color: red, size: xl',
'price'=&gt;23.00,
'tax'=&gt;20.00
);
$pdf-&gt;SetProduct($product);
$product = array(
'qty'=&gt;10,
'name'=&gt;'product 2 name',
'model'=&gt;'product 2 model',
'attributes'=&gt;'color: blue, size: xxl',
'price'=&gt;13.00,
'tax'=&gt;18.00
);
$pdf-&gt;SetProduct($product);
$product = array(
'qty'=&gt;3,
'name'=&gt;'product 3 name',
'model'=&gt;'product 3 model',
'attributes'=&gt;'color: blue, size: xxl',
'price'=&gt;5.00,
'tax'=&gt;18.00
);
$pdf-&gt;SetProduct($product);
$product = array(
'qty'=&gt;10,
'name'=&gt;'product 4 name',
'model'=&gt;'product 4 model',
'attributes'=&gt;'color: blue, size: xxl',
'price'=&gt;90.00,
'tax'=&gt;18.00
);
$pdf-&gt;SetProduct($product);
$product = array(
'qty'=&gt;10,
'name'=&gt;'product 5 name',
'model'=&gt;'product 5 model',
'attributes'=&gt;'color: blue, size: xxl',
'price'=&gt;43.00,
'tax'=&gt;22.00
);
$pdf-&gt;SetProduct($product);

$pdf-&gt;GetInvoice($dir.'lang/');
?&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://davidecaffaratti.com/2009/06/30/php-pdf-invoice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open inviter front and translation revision 1</title>
		<link>http://davidecaffaratti.com/2009/04/15/open-inviter-front-and-translation-revision-1/</link>
		<comments>http://davidecaffaratti.com/2009/04/15/open-inviter-front-and-translation-revision-1/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 01:00:34 +0000</pubDate>
		<dc:creator>Davide</dc:creator>
				<category><![CDATA[Library]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Classes]]></category>
		<category><![CDATA[openinviter]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://davidecaffaratti.com/?p=255</guid>
		<description><![CDATA[I make some modification in the class and add one forgot translation and correct the dobble error message bug in the class; I&#8217;ve change the css for better present the email  subject. Here is the file that You can download the OpenInviter front class with this features in:]]></description>
			<content:encoded><![CDATA[<p>I make some modification in the class and add one forgot translation and correct the dobble error message bug in the class; I&#8217;ve change the css for better present the email  subject.</p>
<p>Here is the file that You can download  the OpenInviter front class with this features in:</p>
<a href="http://davidecaffaratti.com/upload/new-openinviter.zip" title="download Open inviter front class"><img src="http://davidecaffaratti.com/wp-content/plugins/download-monitor/img/download.gif" alt="download" style="float:left;width:300px;" /></a><div style="float:left;width:auto;line-height:25px;margin-top:30px;margin-left:15px;"><b>Size:</b> 46.36 KB<br /><b>Hits :</b> 208</div><br style="clear:both;" />
]]></content:encoded>
			<wfw:commentRss>http://davidecaffaratti.com/2009/04/15/open-inviter-front-and-translation-revision-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open inviter front and translation</title>
		<link>http://davidecaffaratti.com/2009/04/01/open-inviter-front-and-translation/</link>
		<comments>http://davidecaffaratti.com/2009/04/01/open-inviter-front-and-translation/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 01:39:48 +0000</pubDate>
		<dc:creator>Davide</dc:creator>
				<category><![CDATA[Library]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Classes]]></category>
		<category><![CDATA[openinviter]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://davidecaffaratti.com/?p=245</guid>
		<description><![CDATA[I make a modification to openinviter class ( http://openinviter.com ) for my use because the class don&#8217;t have a public class defined and forget the translation &#8230; So I made it The actual languages disponibles are: Italian English Spanish French]]></description>
			<content:encoded><![CDATA[<p>I make a modification to openinviter class ( <a title="Openinviter" href="http://openinviter.com" target="_blank">http://openinviter.com</a> ) for my use because the class don&#8217;t have a public class defined and forget the translation &#8230; So I made it <img src='http://davidecaffaratti.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The actual languages disponibles are:</p>
<ul>
<li>Italian</li>
<li>English</li>
<li>Spanish</li>
<li>French</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://davidecaffaratti.com/2009/04/01/open-inviter-front-and-translation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cat_Cache</title>
		<link>http://davidecaffaratti.com/2009/02/16/cat_cache/</link>
		<comments>http://davidecaffaratti.com/2009/02/16/cat_cache/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 19:33:47 +0000</pubDate>
		<dc:creator>Davide</dc:creator>
				<category><![CDATA[Library]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Classes]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://davidecaffaratti.com/2009/02/16/cat_cache/</guid>
		<description><![CDATA[Cat Cache My class for caching datas. Click HERE for see the code of this class This is a simple cache system written for php5 used for caching any type of data in files. It use all static method for render quickly the cache. This class is able to manage data to be stored in [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Cat Cache</strong></p>
<p>My class for caching datas.</p>
<p><span style="text-decoration: underline;"><strong><a title="See the code" href="http://davidecaffaratti.com/php-code/cat-cache.phps">Click HERE for see the code of this class</a></strong></span></p>
<p>This is a simple cache system written for php5 used for caching any type of data in files. It use all static method for render quickly the cache.</p>
<p>This class is able to manage data to be stored in cache files in a way that it may be safely stored and retrieved even when there may be many concurrent processes attempting to access the same data.</p>
<p>This is an example of the class uses:</p>
<pre class="brush: php;">&lt; ?php
// Include the cache library
include('cat-cache.inc.php');

// Take te cache if exist
$options = array(
'cache_path' =&gt;'/my-cache-path/',
'cache_lifetime' =&gt;7200,
'cache_group' =&gt;'news',
'cache_prefix' =&gt;'_my_prefix'
);
if (!$content = Cat_Cache_Datas::get('unique id', $options)) {

$content = 'Bla bla bla';

Cat_Cache_Datas::save('unique id', $content, $options);
}
echo $content;

// Delete all group cache if is expired or not
$options = array(
'cache_path' =&gt;'/my-cache-path/'
);
Cat_Cache_Datas::clean('my_group', false, $options);

// Delete all expired cache
$options = array(
'cache_path' =&gt;'/my-cache-path/'
);
Cat_Cache_Datas::clean(false, false, $options);

// Delete all cache if is expired or not
$options = array(
'cache_path' =&gt;'/my-cache-path/'
);
Cat_Cache_Datas::clean(false, true, $options);

// Delete ID cache if is expired or not
$options = array(
'cache_path' =&gt;'/my-cache-path/'
);
Cat_Cache_Datas::del('my-cache-unique-id', $options);

// Take name of the ID cache
$options = array(
'cache_path' =&gt;'/my-cache-path/'
);
Cat_Cache_Datas::get_name('my-cache-unique-id');
?&gt;
</pre>
<a href="http://davidecaffaratti.com/upload/cat-cache.inc.zip" title="download cat-cache"><img src="http://davidecaffaratti.com/wp-content/plugins/download-monitor/img/download.gif" alt="download" style="float:left;width:300px;" /></a><div style="float:left;width:auto;line-height:25px;margin-top:30px;margin-left:15px;"><b>Size:</b> 4.9 KB<br /><b>Hits :</b> 21</div><br style="clear:both;" />
]]></content:encoded>
			<wfw:commentRss>http://davidecaffaratti.com/2009/02/16/cat_cache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cat Sitemap</title>
		<link>http://davidecaffaratti.com/2008/10/18/cat-sitemap/</link>
		<comments>http://davidecaffaratti.com/2008/10/18/cat-sitemap/#comments</comments>
		<pubDate>Sat, 18 Oct 2008 01:31:15 +0000</pubDate>
		<dc:creator>Davide</dc:creator>
				<category><![CDATA[Library]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Classes]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://davidecaffaratti.com/?p=96</guid>
		<description><![CDATA[Cat Sitemap My class for make sitemap. Work fine on my sites and have option for use crontab for create the sitemap. Click HERE for see the code of this class This is an example of the class uses: &#60; ?php // Set the path to webserver root $path = $_SERVER['DOCUMENT_ROOT'].'/'; // Set url to [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Cat Sitemap</strong></p>
<p>My class for make sitemap.</p>
<p>Work fine on my sites and have option for use crontab for create the sitemap.</p>
<p><span style="text-decoration: underline;"><strong><a title="See the code" href="http://davidecaffaratti.com/php-code/cat-sitemap.phps">Click HERE for see the code of this class</a></strong></span></p>
<p>This is an example of the class uses:</p>
<pre class="brush: php;"> &lt; ?php
// Set the path to webserver root
$path = $_SERVER['DOCUMENT_ROOT'].'/';
// Set url to webserver root
$url = 'http://'.$_SERVER['HTTP_HOST'].'/';

// include library
require(cat-sitemap.inc.php');

// inizialize the sitemap class
$map = new Cat_Sitemap($url.'/', $path, array('debug'=&gt;true,'log_path'=&gt;$path.'write/'));

// Make query
$sql = &quot; SELECT page_name, url, lastmodify FROM my_database_table&quot;.
&quot; WHERE 1 ORDER BY lastmodify DESC&quot;;
if (!$results = mysql_query($sql)) {
// No results ...
exit;
}
while($val = mysql_fetch_assoc($results)) {
// Here you need to set frequency and all datas for the url
$map-&gt;add_item($val-&gt;url, 'daily', 1, $val-&gt;lastmodify);
//$map-&gt;add_item($val-&gt;url, 'weekly', 0.6, $val-&gt;lastmodify);
//$map-&gt;add_item($val-&gt;url, 'monthly', 0.8, $val-&gt;lastmodify);
}
// Create sitemap
if (!$map-&gt;create()) {
trigger_error('Can create the sitemap !!', E_USER_WARNING);
}
// Print the log for this sitemap
echo $map-&gt;get_logDatas();
// Destroy the class
$map-&gt;__destruct();
?&gt;</pre>
<a href="http://davidecaffaratti.com/upload/cat-sitemap.inc.zip" title="download cat-sitemap"><img src="http://davidecaffaratti.com/wp-content/plugins/download-monitor/img/download.gif" alt="download" style="float:left;width:300px;" /></a><div style="float:left;width:auto;line-height:25px;margin-top:30px;margin-left:15px;"><b>Size:</b> 8.78 KB<br /><b>Hits :</b> 11</div><br style="clear:both;" />
]]></content:encoded>
			<wfw:commentRss>http://davidecaffaratti.com/2008/10/18/cat-sitemap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cat Prototype Edit Inline</title>
		<link>http://davidecaffaratti.com/2008/10/13/cat-prototype-edit-inline/</link>
		<comments>http://davidecaffaratti.com/2008/10/13/cat-prototype-edit-inline/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 15:40:41 +0000</pubDate>
		<dc:creator>Davide</dc:creator>
				<category><![CDATA[Library]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Classes]]></category>
		<category><![CDATA[prototype]]></category>

		<guid isPermaLink="false">http://davidecaffaratti.com/?p=53</guid>
		<description><![CDATA[Class Cat Prototype Edit Inline Simple class for &#8220;edit in line&#8221; with prototype javascript library. Click HERE for see the code of this class Here is an example to use this class: &#60; ?php // Include the library include(cat-prototype.inc.php'); $eip = new Cat_Edit_Inline('js/', $_SERVER['PHP_SELF'].'?ajax=on'); // Check if there is an ajax request return false if [...]]]></description>
			<content:encoded><![CDATA[<h3>Class Cat Prototype Edit Inline</h3>
<p>Simple class for &#8220;edit in line&#8221; with prototype javascript library.</p>
<p><a title="See the code" href="http://davidecaffaratti.com/php-code/cat-prototype.phps"><span style="text-decoration: underline;"><strong>Click HERE for see the code of this class</strong></span></a></p>
<p>Here is an example to use this class:</p>
<pre class="brush: php;">&lt; ?php
// Include the library
include(cat-prototype.inc.php');

$eip = new Cat_Edit_Inline('js/', $_SERVER['PHP_SELF'].'?ajax=on');

// Check if there is an ajax request return false if there isn't data return false
$request = $eip-&gt;getAjaxDatas();

if ($request &amp;&amp; isset($_GET['ajax'])) {
// set php header
$this-&gt;setHeaderPhp(false, true);

// empty id
if (!isset($request['id']) || !isset($request['option_id'])) {
print(&quot;Incorrected datas - No id sent !&quot;);
}
// continue
else {
// Update the database
/* update_function(); */

// Print text
print ($request['content']);
}
}
// No ajax data sent
else {
// Set default size of textarea
$this-&gt;setInitEditOptions('size', 80);
// Setto default cols of textarea
$this-&gt;setInitEditOptions('cols', 60);
// Set saving_text
$this-&gt;setInitEditOptions('saving_text', 'Saving...');
// Set text field
$this-&gt;setElement(array('id'=&gt;'field_name','ajax_data'=&gt;array('option_id'=&gt;1)));
// Set body text
$bodyOptions = array('html_start'=&gt;&quot;&lt;em&gt;description of the field&lt;/em&gt;&quot;);
// Set body element
$this-&gt;setElementBody('option_name', 'option_value', $bodyOptions);
// Set textarea field
$this-&gt;setElement(array('id'=&gt;'field_name', 'type'=&gt;'textarea', 'ajax_data'=&gt;array('option_id'=&gt;2)));
// Set body textarea
$bodyOptions = array('html_start'=&gt;&quot;&lt;em&gt;description of the field&lt;/em&gt;&quot;);
// Set body element
$this-&gt;setElementBody('option_name', 'option_value', $bodyOptions);
// Select / Option yes / no
$optionsSelect = array('yes'=&gt;'yes', 'no'=&gt;'no');
$this-&gt;setElement(array('id'=&gt;'field_name', 'type'=&gt;'select', 'options'=&gt;$optionsSelect, 'ajax_data'=&gt;array('option_id'=&gt;2)));
// Set body select
$bodyOptions = array('html_start'=&gt;&quot;&lt;em&gt;description of the field&lt;/em&gt;&quot;);
// Set body element
$this-&gt;setElementBody('option_name', 'option_value', $bodyOptions);
// Inizialize class
$eip-&gt;initEditInline();
// Get header havascript e css
$header = $eip-&gt;getJavascript().$eip-&gt;getCss();

echo
&quot;&lt; !DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
Eip demo&quot;.
$header.&quot;
&lt;/head&gt;
&lt;body&gt;

&lt;h1&gt;Eip Demo&lt;/h1&gt;
&lt;div&gt;
&quot;.$eip-&gt;getBody().&quot;
&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;&quot;;
}
?&gt;
</pre>
<a href="http://davidecaffaratti.com/upload/cat-prototype.zip" title="download cat-prototype"><img src="http://davidecaffaratti.com/wp-content/plugins/download-monitor/img/download.gif" alt="download" style="float:left;width:300px;" /></a><div style="float:left;width:auto;line-height:25px;margin-top:30px;margin-left:15px;"><b>Size:</b> 18.96 KB<br /><b>Hits :</b> 12</div><br style="clear:both;" />
]]></content:encoded>
			<wfw:commentRss>http://davidecaffaratti.com/2008/10/13/cat-prototype-edit-inline/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
