<?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>Web Design - css/php/seo &#187; copy&amp;paste</title>
	<atom:link href="http://www.claudiocugia.com/web_design/category/copypaste-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.claudiocugia.com/web_design</link>
	<description>Articles, code, tips&#38;tricks about web design and seo</description>
	<lastBuildDate>Fri, 14 Oct 2011 14:30:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>File .htaccess su Register.it</title>
		<link>http://www.claudiocugia.com/web_design/file-htaccess-register/</link>
		<comments>http://www.claudiocugia.com/web_design/file-htaccess-register/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 09:28:41 +0000</pubDate>
		<dc:creator>claudio</dc:creator>
				<category><![CDATA[copy&paste]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tips&tricks]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[.htaccess register]]></category>
		<category><![CDATA[htaccess register.it]]></category>
		<category><![CDATA[Joomla]]></category>
		<category><![CDATA[mod rewrite]]></category>
		<category><![CDATA[register.it]]></category>
		<category><![CDATA[register.it and htaccess]]></category>
		<category><![CDATA[url rewriting register.it]]></category>

		<guid isPermaLink="false">http://www.claudiocugia.com/web_design/?p=416</guid>
		<description><![CDATA[Capita sempre più spesso di utlizzare la tecnica denominata URL Rewriting che permette la riscrittura di URL &#8216;SEO friendly&#8217;. Affinchè questa tecnica possa funzionare, come ben sappiamo, è necessario che nella root del nostro sito sia presente il file .htaccess. &#8230; <a href="http://www.claudiocugia.com/web_design/file-htaccess-register/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Capita sempre più spesso di utlizzare la tecnica denominata URL Rewriting che permette la riscrittura di URL &#8216;SEO friendly&#8217;. Affinchè questa tecnica possa funzionare, come ben sappiamo, è necessario che nella root del nostro sito sia presente il file <a href="http://en.wikipedia.org/wiki/Htaccess">.htaccess</a>.<br />
Recentemente ho avuto modo di lavorare per un cliente il cui sito era ospitato su un server di <a href="http://we.register.it">register.it</a>; con grande sorpresa ho scoperto però che non è sufficiente caricare via FTP il file in questione perchè l&#8217;URL Rewriting abbia effetto.<br />
Di seguito vi illustro  la procedura che mi è sembrata più corretta.<br />
<span id="more-416"></span><br />
Per settare correttamente il file .htaccess su <a href="http://we.register.it">register.it</a>:</p>
<ul>
<li>andare su >Gestione Hosting;</li>
<li>configurazioni avanzate > Impostazioni;</li>
<li>in Options cliccare su &#8216;Aggiungi&#8217;;</li>
<li>dal menù a tendina scegliere &#8216;+SymLinksIfOwnerMatch&#8217; e cliccare su avanti;</li>
<li>viene aggiunto il valore &#8216;SymLinksIfOwnerMatch&#8217; che ci permetterà di eseguire il rewrite.</li>
</ul>
<p>Per quanto riguarda il pannello di controllo abbiamo finito.<br />
Ora aprite il vostro .htaccess e aggiungete all&#8217;inizio del documento:</p>
<pre class="brush: php; title: ; notranslate">
Options +FollowSymLinks
RewriteBase / </pre>
<p>Caricate tutto via FTP e testate.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.claudiocugia.com/web_design/file-htaccess-register/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>Useful JQuery methods and events for web designers p.1</title>
		<link>http://www.claudiocugia.com/web_design/useful-jquery-methods-events-web-designers/</link>
		<comments>http://www.claudiocugia.com/web_design/useful-jquery-methods-events-web-designers/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 21:42:37 +0000</pubDate>
		<dc:creator>claudio</dc:creator>
				<category><![CDATA[copy&paste]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.claudiocugia.com/web_design/?p=343</guid>
		<description><![CDATA[I am almost finished reading Learning jQuery 1.3 by Karl Swedberg, Jonathan Chaffer ; I&#8217;d like to share some useful methods and code snippets that may come handy to web designers when it is time to handcoding our beautiful layouts. &#8230; <a href="http://www.claudiocugia.com/web_design/useful-jquery-methods-events-web-designers/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I am almost finished reading <a href="http://http://www.packtpub.com/learning-jquery-1.3/book">Learning jQuery 1.3</a> <em>by Karl Swedberg, Jonathan Chaffer </em>;  I&#8217;d like to share some useful methods and code snippets that may come handy to web designers when it is time to handcoding our beautiful layouts.<br />
Reference: <a href="http://jquery.com/">jquery.com</a><br />
<span id="more-343"></span> </p>
<p>First of all let&#8217;s add JQuery to our page:</p>
<pre class="brush: jscript; title: ; notranslate">
   &lt;script type=&quot;text/javascript&quot; src=&quot;jquery.js&quot;&gt;&lt;/script&gt;
</pre>
<p>Launching code:</p>
<pre class="brush: jscript; title: ; notranslate">
 $(document).ready(function(){
   // Your code here
 });
</pre>
<p><strong>These are the methods I find more useful:</strong></p>
<ol>
<li>the .noConflict() method enables the use of multiple JS libraries (like Prototype)</li>
<li>the .addClass and .removeClass
<pre class="brush: jscript; title: ; notranslate">
 $(document).ready(function(){
     $('#your_id').addClass('your_class');

 });
</pre>
</li>
<li>the negation pseudo-class:
<pre class="brush: jscript; title: ; notranslate">$('#your_id li:not(.your_class)').addClass('your_class');</pre>
</li>
<li>the :eq custom selector &#8211; selects the third item from a matched set of div selectors with a &#8216;my_class&#8217; class
<pre class="brush: jscript; title: ; notranslate"> $('div.my_class:eq(2)')</pre>
</li>
<li>the :nth-child custom selector &#8211; matches elements which are the indexth child of their parent element
<pre class="brush: jscript; title: ; notranslate">$('tr:nth-child(index)').addClass('your_class');</pre>
</li>
<li>the :odd and :even custom selectors:
<pre class="brush: jscript; title: ; notranslate"> $('tr:odd').addClass('your_class');</pre>
</li>
<li>the :contains() selector:
<pre class="brush: jscript; title: ; notranslate"> $('td:contains(name)').addClass('your_class');</pre>
</li>
<li>form selectors: :text, :checkbox, :radio, :button, :enabled, :checked, :selected</li>
</ol>
<p><strong>Shorthand events:</strong></p>
<ol>
<li>.click()</li>
<li>.toggle and .toggleClass()
<pre class="brush: jscript; title: ; notranslate">
 $(document).ready(function() {
   $('#my_id').click(function() {
     $('#my_id .button').toggleClass('my_class');
   });
 });
</pre>
</li>
<p>This in particular is very useful as it can perform actions in alternation.</p>
<li>.hover
<pre class="brush: jscript; title: ; notranslate">
$(document).ready(function() {
  $('#my_id .button').hover(function() {
   $(this).addClass('my_class');
  }, function() {
    $(this).removeClass('my_class');
   });
 });
</pre>
</li>
<li>.css
<pre class="brush: jscript; title: ; notranslate">
$(document).ready(function() {
    $('#my_id').css('border', '1px solid #000')
 });
</pre>
</li>
<li>
.hide and .show</p>
<pre class="brush: jscript; title: ; notranslate">
$(document).ready(function() {
    $('p').hide();
 });
</pre>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.claudiocugia.com/web_design/useful-jquery-methods-events-web-designers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A custom 404 page</title>
		<link>http://www.claudiocugia.com/web_design/a-custom-404-page/</link>
		<comments>http://www.claudiocugia.com/web_design/a-custom-404-page/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 21:12:13 +0000</pubDate>
		<dc:creator>claudio</dc:creator>
				<category><![CDATA[copy&paste]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[tips&tricks]]></category>
		<category><![CDATA[404]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://www.claudiocugia.com/web_design/?p=243</guid>
		<description><![CDATA[Let&#8217;s see how to create a custom 404 page in two simple steps. You need to have access to your webserver and upload to its root the .htaccess file. This is a simple file which tells the server to show &#8230; <a href="http://www.claudiocugia.com/web_design/a-custom-404-page/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s see how to create a custom <a href="http://en.wikipedia.org/wiki/404_error" title="404 page - wikipedia">404 page</a> in two simple steps.</p>
<ol>
<li>You need to have access to your webserver and upload to its root the <strong>.htaccess file</strong>. This is a simple file which tells the server to show a default page in case the one we are trying to access cannot be found. The file looks like this:
<pre class="brush: xml; title: ; notranslate">
ErrorDocument 404 http://www.yoursite.com/404.html
</pre>
</li>
<p><span id="more-243"></span></p>
<li>Upload to your webserver a file called <strong>404.html</strong> previously edited; you may write custom sentences like &#8216;Sorry, but the page you are trying to reach does not exist&#8217;. If you like, you may add a custom search box: just browse to google webmaster tool in your google account and choose &#8216;optimize your 404 page&#8217;.</li>
</ol>
<p>More on this topic:</p>
<ul>
<li>404 on <a href="http://www.smashingmagazine.com/2009/01/29/404-error-pages-one-more-time/" title="404 on Smashing Magazine">Smashing Magazine</a></li>
<li>More about 404 on <a href="http://www.smashingmagazine.com/2007/07/25/wanted-your-404-error-pages/" title="more about 404 on Smashing Magazine">Smashing Magazine</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.claudiocugia.com/web_design/a-custom-404-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Canonical Tag</title>
		<link>http://www.claudiocugia.com/web_design/the-canonical-tag/</link>
		<comments>http://www.claudiocugia.com/web_design/the-canonical-tag/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 21:03:54 +0000</pubDate>
		<dc:creator>claudio</dc:creator>
				<category><![CDATA[copy&paste]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[tips&tricks]]></category>
		<category><![CDATA[canonical tag]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://www.claudiocugia.com/web_design/?p=233</guid>
		<description><![CDATA[Matt Cutts explains the new &#8216;canonical tag&#8217; in a video. This tag (whose syntax is: ) helps webmaster to clean up duplicate urls on sites and is very useful when working with CMS such as wordpress for instance. Check out &#8230; <a href="http://www.claudiocugia.com/web_design/the-canonical-tag/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Matt Cutts explains the new &#8216;canonical tag&#8217; in a <a href="http://videos.webpronews.com/2009/02/13/breaking-news-matt-cutts-explains-canonical-tag-from-google-yahoo-microsoft/" title="The Canonical Tag">video</a>.</p>
<p>This tag (whose syntax is:
<pre class="brush: xml; title: ; notranslate">&lt;link rel=”canonical” value=”http://example.com/page.html”/&gt;</pre>
<p>) helps webmaster to clean up duplicate urls on sites and is very useful when working with CMS such as wordpress for instance.<br />
<span id="more-233"></span><br />
Check out the <a href="http://videos.webpronews.com/2009/02/13/breaking-news-matt-cutts-explains-canonical-tag-from-google-yahoo-microsoft/" title="The Canonical Tag">self-explanatory video</a> or the page at <a href="http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html" title="googlewebmastercentral">googlewebmastercentral</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.claudiocugia.com/web_design/the-canonical-tag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash and PNGs</title>
		<link>http://www.claudiocugia.com/web_design/flash-and-pngs/</link>
		<comments>http://www.claudiocugia.com/web_design/flash-and-pngs/#comments</comments>
		<pubDate>Sun, 15 Feb 2009 23:12:58 +0000</pubDate>
		<dc:creator>claudio</dc:creator>
				<category><![CDATA[copy&paste]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[png]]></category>

		<guid isPermaLink="false">http://www.claudiocugia.com/web_design/?p=215</guid>
		<description><![CDATA[Today I am going to show you another way of using flash in your pages. I do not use flash that often but for my latest website (www.sirenamurano.com) I really needed a solution to manage big sized PNGs. Let&#8217;s take &#8230; <a href="http://www.claudiocugia.com/web_design/flash-and-pngs/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Today I am going to show you another way of using flash in your pages.<br />
I do not use flash that often but for my latest website (www.sirenamurano.com) I really needed a solution to manage big sized PNGs.<br />
<span id="more-215"></span><br />
Let&#8217;s take the girl image for example: it&#8217;s a 271.31 kB PNG image, definitely too big, keeping in mind that it is always wise to keep the whole size of the website small for faster browsing.<br />
So I came up with this solution: I used flash to optimize the PNG and produce a SWF file that is nearly six times smaller than the original. Then I implemented the SWF in the page via the <a href="http://www.claudiocugia.com/web_design/the-swfobject-21-in-a-nutshell/">SWFobject</a>; if the browser has not the flash player installed the original PNG is shown as an alternative content. In this case the pngfix for IE6 is needed of course.</p>
<p>So this could be a good method to get a crossbrowser compatibility as well, a kind of &#8216;the progressive enhancement&#8217; concept;<br />
the browser has the flash player &#8211;> show the content with flash;<br />
the browser has not the flash player &#8211;> show the alternative content;<br />
the browser has not the flash player and is IE6 &#8211;> show the alternative content.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.claudiocugia.com/web_design/flash-and-pngs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The SWFObject 2.1 in a nutshell</title>
		<link>http://www.claudiocugia.com/web_design/the-swfobject-21-in-a-nutshell/</link>
		<comments>http://www.claudiocugia.com/web_design/the-swfobject-21-in-a-nutshell/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 21:38:28 +0000</pubDate>
		<dc:creator>claudio</dc:creator>
				<category><![CDATA[copy&paste]]></category>
		<category><![CDATA[tips&tricks]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[swfobject]]></category>

		<guid isPermaLink="false">http://www.claudiocugia.com/web_design/?p=165</guid>
		<description><![CDATA[We all know the SWFObject and how it works; let&#8217;s see how to implement it in our webpages in just few seconds. This syntax only applies to the SWFObject v. 2.1 available at googlecode. Browse to code.google.com/p/swfobject/ and download the &#8230; <a href="http://www.claudiocugia.com/web_design/the-swfobject-21-in-a-nutshell/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>We all know the SWFObject and how it works; let&#8217;s see how to implement it in our webpages in just few seconds.<br />
This syntax only applies to the SWFObject v. 2.1 available at <a title="googlecode" href="http://code.google.com/p/swfobject/">googlecode</a>.<br />
<span id="more-165"></span></p>
<ul>
<li>Browse to <a title="swfobject - googlecode" href="http://code.google.com/p/swfobject/">code.google.com/p/swfobject/</a> and download the latest release;</li>
<li>unzip the files to your swfobject folder;</li>
<li>between the &#8216;head&#8217; tags of your document just put the following:
<pre class="brush: xml; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot; src=&quot;/folder/swfobject.js&quot; language=&quot;javascript&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; language=&quot;javascript&quot;&gt;
        var flashvars = {};
        var params = {};
        params.wmode = &quot;transparent&quot;;
	params.menu = &quot;hidden&quot;;
        var attributes = {};
        attributes.id = &quot;your_id&quot;;
        swfobject.embedSWF(&quot;/swf/your.swf&quot;, &quot;your_id&quot;, &quot;your_width&quot;, &quot;your_height&quot;, &quot;9.0.0&quot;,
 &quot;expressInstall.swf&quot;, flashvars, params, attributes);
&lt;/script&gt;
</pre>
</li>
<li>between the &#8216;body&#8217; tags of your document just put this:
<pre class="brush: xml; title: ; notranslate">
&lt;div id=&quot;your_id&quot;&gt;
&lt;img src=&quot;/images/alternative_image.png&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;</pre>
</li>
</ul>
<p>I always use an alternative image in case the user&#8217;s browser has not the flash plugin installed, so he may see an alternative content. Otherwise you can always put some text between the &#8216;div&#8217; tags .<br />
This is it, just test your page and see it at work; should you need more parameters just browse to the <a title="sfwobject documentation" href="http://code.google.com/p/swfobject/wiki/documentation">sfwobject documentation</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.claudiocugia.com/web_design/the-swfobject-21-in-a-nutshell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Useful php snippet for web designers</title>
		<link>http://www.claudiocugia.com/web_design/useful-php-snippet-for-webdesigners/</link>
		<comments>http://www.claudiocugia.com/web_design/useful-php-snippet-for-webdesigners/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 13:13:28 +0000</pubDate>
		<dc:creator>claudio</dc:creator>
				<category><![CDATA[copy&paste]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[dreamweaver]]></category>
		<category><![CDATA[snippets]]></category>

		<guid isPermaLink="false">http://www.claudiocugia.com/web_design/?p=26</guid>
		<description><![CDATA[I&#8217;d like to share some useful php snippets I often use while developing my websites. I just save them in my snippet folder in Dreamweaver. Quick variable retrieving (string): Quick variable retrieving (number): A &#8216;for&#8217; cycle: A &#8216;switch&#8217; statement: Antispam &#8230; <a href="http://www.claudiocugia.com/web_design/useful-php-snippet-for-webdesigners/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;d like to share some useful php snippets I often use while developing my websites. I just save them in my snippet folder in Dreamweaver.</p>
<ol>
<li>Quick variable retrieving (string):
<pre class="brush: php; title: ; notranslate">$page= $_GET[&quot;page&quot;];
  if (!$page)   $page = &quot;page name here&quot;;</pre>
</li>
<p><span id="more-26"></span></p>
<li>Quick variable retrieving (number):
<pre class="brush: php; title: ; notranslate">$id= (int)$_GET[&quot;id&quot;];
  if (!$id)   $id = 1;</pre>
</li>
<li>A &#8216;for&#8217; cycle:
<pre class="brush: php; title: ; notranslate">for($i=1950; $i&lt;=2007; $i++) {
echo &quot;$i&quot;;
}</pre>
</li>
<li>A &#8216;switch&#8217; statement:
<pre class="brush: php; title: ; notranslate">switch ($lang){
            case &quot;&quot; :
	      echo &quot;&quot;;
	      break;
	}</pre>
</li>
<li>
Antispam email:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
function InsertMail($mail)
    {
    if ($mail=='') return '';
    $mail = str_replace(array('@',':','.'), array('&amp;amp;#064;','&amp;amp;#058;','&amp;amp;#046;'), $mail);
    $mail = '&lt;a href=mailto&amp;amp;#058;'.$mail.'&gt;'.$mail.'&lt;/a&gt;';
    $len = strlen($mail);
    $i=0;
    while($i&lt;$len)
        {
        $c = mt_rand(1,4);
        $par[] = (substr($mail, $i, $c));
        $i += $c;
        }
    $join = implode('&quot;+ &quot;', $par);

    return '&lt;script type=&quot;text/javascript&quot; language=&quot;javascript&quot;&gt;
    &lt;!--
    document.write(&quot;'.$join.'&quot;)
    //--&gt;
    &lt;/script&gt;';
    }
echo InsertMail ('user@example.com');
?&gt;
</pre>
</li>
<li>Replace accents in a query results
<pre class="brush: php; title: ; notranslate">
function replace_accents($str) {
$str = htmlentities($str, ENT_COMPAT, &quot;UTF-8&quot;);
$str = preg_replace('/&amp;amp;amp;amp;amp;amp;([a-zA-Z])(uml|acute|grave|circ|tilde);/','$1',$str);
return html_entity_decode($str);}
</pre>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.claudiocugia.com/web_design/useful-php-snippet-for-webdesigners/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

