<?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>Lecciones Prácticas &#187; wordpress</title>
	<atom:link href="http://www.leccionespracticas.com/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.leccionespracticas.com</link>
	<description>informática y bibliotecas 2.0</description>
	<lastBuildDate>Mon, 06 Feb 2012 13:36:36 +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>Al compartir posts en facebook no salen las imagenes (thumbnails) [SOLUCIONADO]</title>
		<link>http://www.leccionespracticas.com/informatica-web/wordpress/al-compartir-posts-en-facebook-no-salen-las-imagenes-thumbnails-solucionado/</link>
		<comments>http://www.leccionespracticas.com/informatica-web/wordpress/al-compartir-posts-en-facebook-no-salen-las-imagenes-thumbnails-solucionado/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 11:19:10 +0000</pubDate>
		<dc:creator>Miguel</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[thumbnails]]></category>

		<guid isPermaLink="false">http://www.leccionespracticas.com/?p=1964</guid>
		<description><![CDATA[Algo común cuando se usa el theme Twenty eleven de wordpress es que las imagenes de los posts no salen automáticamente al compartirlos en facebook. Vaya, que al poner el link a un post en el estado de facebook, éste no es capaz de leer las imagenes y mostrar el thumbnail. Sin entrar en consideraciones [...]
Related posts:<ol>
<li><a href='http://www.leccionespracticas.com/informatica-web/anadir-boton-de-facebook-dinamico-para-la-pagina-actual-solucionado/' rel='bookmark' title='Añadir botón de facebook dinámico (para la página actual) [SOLUCIONADO]'>Añadir botón de facebook dinámico (para la página actual) [SOLUCIONADO]</a></li>
<li><a href='http://www.leccionespracticas.com/uncategorized/ver-imagenes-de-imageshack-evitar-ranitas-solucionado/' rel='bookmark' title='Ver imágenes de imageshack (evitar ranitas) [solucionado]'>Ver imágenes de imageshack (evitar ranitas) [solucionado]</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/drupal-how-to-add-a-share-in-facebook-link-without-ie8-crashing/' rel='bookmark' title='Drupal: how to add a &#8220;share in facebook&#8221; link without IE8 crashing'>Drupal: how to add a &#8220;share in facebook&#8221; link without IE8 crashing</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Algo común cuando se usa el theme <a href="http://theme.wordpress.com/themes/twentyeleven/">Twenty eleven</a> de <a href="/informatica-web/wordpress/">wordpress</a> es que <b>las imagenes de los posts no salen automáticamente al compartirlos en facebook</b>. Vaya, que al poner el link a un post en el estado de facebook, éste no es capaz de leer las imagenes y mostrar el <b>thumbnail</b>.</p>
<p>Sin entrar en consideraciones técnicas, lo más simple es que instaléis el <a href="http://wordpress.org/extend/plugins/add-facebook-share-thumbnail-meta/">plugin Add Facebook Share Thumbnail Meta</a>, lo activéis y&#8230; problema resuelto, solucionado <img src='http://www.leccionespracticas.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Si queréis leer más sobre este tema, podéis hacerlo, en inglés, <a href="http://ansonalex.com/troubleshooting/fix-articles-linked-on-facebook-dont-display-thumbnails-images/">aqui</a></p>
<p>Related posts:<ol>
<li><a href='http://www.leccionespracticas.com/informatica-web/anadir-boton-de-facebook-dinamico-para-la-pagina-actual-solucionado/' rel='bookmark' title='Añadir botón de facebook dinámico (para la página actual) [SOLUCIONADO]'>Añadir botón de facebook dinámico (para la página actual) [SOLUCIONADO]</a></li>
<li><a href='http://www.leccionespracticas.com/uncategorized/ver-imagenes-de-imageshack-evitar-ranitas-solucionado/' rel='bookmark' title='Ver imágenes de imageshack (evitar ranitas) [solucionado]'>Ver imágenes de imageshack (evitar ranitas) [solucionado]</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/drupal-how-to-add-a-share-in-facebook-link-without-ie8-crashing/' rel='bookmark' title='Drupal: how to add a &#8220;share in facebook&#8221; link without IE8 crashing'>Drupal: how to add a &#8220;share in facebook&#8221; link without IE8 crashing</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leccionespracticas.com/informatica-web/wordpress/al-compartir-posts-en-facebook-no-salen-las-imagenes-thumbnails-solucionado/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WP-COMFY: change post rotation interval [SOLVED]</title>
		<link>http://www.leccionespracticas.com/informatica-web/wordpress/wp-comfy-change-post-rotation-interval-solved/</link>
		<comments>http://www.leccionespracticas.com/informatica-web/wordpress/wp-comfy-change-post-rotation-interval-solved/#comments</comments>
		<pubDate>Mon, 23 May 2011 06:57:28 +0000</pubDate>
		<dc:creator>Miguel</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[interval]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[rotation]]></category>
		<category><![CDATA[tabs.js]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[wp_comfy]]></category>

		<guid isPermaLink="false">http://leccionespracticas.com/?p=1736</guid>
		<description><![CDATA[Those of you who are using WP Comfy (aka Comfy Magazine) theme for wordpress might be wondering how to change post rotation time (interval) so that posts rotate more quickly or slowly. Well, the fix is quite easy. Edit /wp-content/themes/wp_comfy/scripts/tabs.js, look for: if &#40;parseInt&#40;this.automodeperiod&#41;&#62;500 &#38;&#38; this.hottabspositions.length&#62;1&#41;&#123; this.autoruntimer=setInterval&#40;function&#40;&#41;&#123;tabinstance.autorun&#40;&#41;&#125;, this.automodeperiod&#41; More slow rotation: if &#40;parseInt&#40;this.automodeperiod&#41;&#62;1000 &#38;&#38; this.hottabspositions.length&#62;1&#41;&#123; [...]
Related posts:<ol>
<li><a href='http://www.leccionespracticas.com/informatica-web/drupal-informatica-web/drupal-how-to-change-imagecache-temp-directory-solved/' rel='bookmark' title='Drupal: how to change ImageCache Temp Directory [SOLVED]'>Drupal: how to change ImageCache Temp Directory [SOLVED]</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/vbulletin-informatica-web/vbulletin-change-sticky-text-style-solved/' rel='bookmark' title='vBulletin: change sticky text style [SOLVED]'>vBulletin: change sticky text style [SOLVED]</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/wordpress/wordpress-yoast-seo-wp_comfy-theme-category-titles/' rel='bookmark' title='WordPress Yoast SEO + wp_comfy theme + Category titles'>WordPress Yoast SEO + wp_comfy theme + Category titles</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Those of you who are using <a href="http://deluxethemes.com/2010/11/25/comfy/">WP Comfy (aka Comfy Magazine)</a> theme for <a href="http://www.leccionespracticas.com/informatica-web/wordpress/">wordpress</a> might be wondering <b>how to change post rotation time (interval)</b> so that posts rotate more quickly or slowly.</p>
<p>Well, the fix is quite easy. Edit <em>/wp-content/themes/wp_comfy/scripts/tabs.js</em>, look for:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>parseInt<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">automodeperiod</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&gt;</span><span style="color: #CC0000;">500</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">hottabspositions</span>.<span style="color: #660066;">length</span><span style="color: #339933;">&gt;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">autoruntimer</span><span style="color: #339933;">=</span>setInterval<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>tabinstance.<span style="color: #660066;">autorun</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">automodeperiod</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>More slow rotation:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>parseInt<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">automodeperiod</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&gt;</span><span style="color: #CC0000;">1000</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">hottabspositions</span>.<span style="color: #660066;">length</span><span style="color: #339933;">&gt;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">autoruntimer</span><span style="color: #339933;">=</span>setInterval<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>tabinstance.<span style="color: #660066;">autorun</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">automodeperiod</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>Quicker rotation:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>parseInt<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">automodeperiod</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&gt;</span><span style="color: #CC0000;">100</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">hottabspositions</span>.<span style="color: #660066;">length</span><span style="color: #339933;">&gt;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">autoruntimer</span><span style="color: #339933;">=</span>setInterval<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>tabinstance.<span style="color: #660066;">autorun</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">automodeperiod</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>Play with the parameter value to achieve desired result!</p>
<p>Related posts:<ol>
<li><a href='http://www.leccionespracticas.com/informatica-web/drupal-informatica-web/drupal-how-to-change-imagecache-temp-directory-solved/' rel='bookmark' title='Drupal: how to change ImageCache Temp Directory [SOLVED]'>Drupal: how to change ImageCache Temp Directory [SOLVED]</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/vbulletin-informatica-web/vbulletin-change-sticky-text-style-solved/' rel='bookmark' title='vBulletin: change sticky text style [SOLVED]'>vBulletin: change sticky text style [SOLVED]</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/wordpress/wordpress-yoast-seo-wp_comfy-theme-category-titles/' rel='bookmark' title='WordPress Yoast SEO + wp_comfy theme + Category titles'>WordPress Yoast SEO + wp_comfy theme + Category titles</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leccionespracticas.com/informatica-web/wordpress/wp-comfy-change-post-rotation-interval-solved/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wordpress: Ordenar archive.php por fecha con query_posts</title>
		<link>http://www.leccionespracticas.com/informatica-web/wordpress-ordenar-archive-php-por-fecha-con-query_posts/</link>
		<comments>http://www.leccionespracticas.com/informatica-web/wordpress-ordenar-archive-php-por-fecha-con-query_posts/#comments</comments>
		<pubDate>Thu, 12 May 2011 18:49:52 +0000</pubDate>
		<dc:creator>Miguel</dc:creator>
				<category><![CDATA[Informática - web]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[archive.php]]></category>
		<category><![CDATA[astickypostorder]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[fecha]]></category>
		<category><![CDATA[ordenar]]></category>
		<category><![CDATA[order]]></category>
		<category><![CDATA[query_posts]]></category>
		<category><![CDATA[sticky]]></category>

		<guid isPermaLink="false">http://www.leccionespracticas.com/?p=1704</guid>
		<description><![CDATA[Imagina que ya tienes en tu theme de wordpress un archivo llamado archive.php que se encarga de interpretar url&#8217;s del tipo http://www.tusitiowordpress.com/tag/tagX ¿Cómo hacer para que, además de mostrar los posts filtrados por el tag &#8216;tagX&#8217;, los ordene por fecha? (y no por otro criterio, como la categoría) Fácil: Edita tu archive.php y busca: &#60;?php [...]
Related posts:<ol>
<li><a href='http://www.leccionespracticas.com/informatica-web/wordpress/wordpress-in-a-subdirectory-urls-like-it-was-in-root-directory/' rel='bookmark' title='WordPress in a subdirectory, urls like it was in root directory'>WordPress in a subdirectory, urls like it was in root directory</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/wordpress/wordpress-remove-category-and-other-permalinks-changes/' rel='bookmark' title='WordPress: remove /category'>WordPress: remove /category</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/wordpress/wordpress-anti-spam-plugins-captchas-and-more/' rel='bookmark' title='wordpress anti-spam plugins, captchas and more'>wordpress anti-spam plugins, captchas and more</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Imagina que ya tienes en tu theme de <b>wordpress</b> un archivo llamado <b><em>archive.php</em></b> que se encarga de interpretar url&#8217;s del tipo <em>http://www.tusitiowordpress.com/tag/tagX</em></p>
<p>¿Cómo hacer para que, además de mostrar los posts filtrados por el tag <em>&#8216;tagX&#8217;</em>, los ordene por fecha? (y no por otro criterio, como la categoría)</p>
<p>Fácil:<br />
Edita tu <em>archive.php</em> y busca:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Y cámbialo por</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> query_posts<span style="color: #009900;">&#40;</span><span style="color: #000088;">$query_string</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&amp;orderby=date&amp;order=DESC'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Nótese la presencia de la variable <em>$query_string</em> que nos mantiene la query que ya se hacía (filtrar por tag) a la que añadimos los parámetros de ordenación por fecha (<em>orderby=date</em>) y ordenación decreciente (<em>order=DESC</em>).</p>
<p>Para ver la lista de <a href="http://codex.wordpress.org/Function_Reference/WP_Query#Parameters">parámetros que la función <em>query_posts</em> acepta</a>, puedes <a href="http://codex.wordpress.org/Function_Reference/query_posts">consultar el manual de la función query_posts</a>.</p>
<p><b>UPDATE: ordenar y los sticky posts</b><br />
Se pueden producir problemas con los post de tipo <em>sticky</em> (que salgan siempre en primer lugar). Si queremos <b>ignorar los post sticky</b>, procederemos asi en <b>wordpress 3.1 o superior</b> (nótese el parámetro <em>ignore_sticky_posts=1</em>):</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> 
query_posts<span style="color: #009900;">&#40;</span><span style="color: #000088;">$querystring</span><span style="color: #339933;">.</span> <span style="color: #0000ff;">'&amp;orderby=date&amp;order=DESC&amp;ignore_sticky_posts=1'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Y asi en <b>wordpress anterior a 3.1</b>:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
    <span style="color: #0000ff;">'post__not_in'</span> <span style="color: #339933;">=&gt;</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'sticky_posts'</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$queryObject</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> WP_Query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$querystring</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&amp;orderby=date&amp;order=DESC&amp;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Y si tenemos instalado el <a href="http://wordpress.org/extend/plugins/astickypostorderer/">plugin AStickyPostOrder</a> (muy útil para algunos aspectos) y queremos <b>ignorar los settings de AStickyPostOrder en archive.php</b> procederemos asi (nótese el parámetro <em>&#038;aspo=vanilla</em>)</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> query_posts<span style="color: #009900;">&#40;</span><span style="color: #000088;">$query_string</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&amp;orderby=date&amp;order=DESC&amp;aspo=vanilla'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>¿Veis por qué AMO wordpress? Esta gente ha pensado en todo <img src='http://www.leccionespracticas.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Related posts:<ol>
<li><a href='http://www.leccionespracticas.com/informatica-web/wordpress/wordpress-in-a-subdirectory-urls-like-it-was-in-root-directory/' rel='bookmark' title='WordPress in a subdirectory, urls like it was in root directory'>WordPress in a subdirectory, urls like it was in root directory</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/wordpress/wordpress-remove-category-and-other-permalinks-changes/' rel='bookmark' title='WordPress: remove /category'>WordPress: remove /category</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/wordpress/wordpress-anti-spam-plugins-captchas-and-more/' rel='bookmark' title='wordpress anti-spam plugins, captchas and more'>wordpress anti-spam plugins, captchas and more</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leccionespracticas.com/informatica-web/wordpress-ordenar-archive-php-por-fecha-con-query_posts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress: where am I? is it the frontpage? [solved]</title>
		<link>http://www.leccionespracticas.com/informatica-web/wordpress/wordpress-where-am-i-is-it-the-frontpage-solved/</link>
		<comments>http://www.leccionespracticas.com/informatica-web/wordpress/wordpress-where-am-i-is-it-the-frontpage-solved/#comments</comments>
		<pubDate>Fri, 08 Apr 2011 11:03:41 +0000</pubDate>
		<dc:creator>Miguel</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[conditional tags]]></category>
		<category><![CDATA[frontpage]]></category>
		<category><![CDATA[home]]></category>
		<category><![CDATA[mainpage]]></category>
		<category><![CDATA[where i am]]></category>

		<guid isPermaLink="false">http://www.leccionespracticas.com/?p=1698</guid>
		<description><![CDATA[Some days ago I talked about knowing where I am in Drupal and knowing where I am in Jooml. I&#8217;ve received some mails asking how to know where i am in wordpress (am I in the frontpage? am I in a single post view?). You can know this by using wordpress conditional tags. For instance, [...]
Related posts:<ol>
<li><a href='http://www.leccionespracticas.com/informatica-web/joomla-plugin-and-templating-how-to-know-if-you-are-in-the-frontpage/' rel='bookmark' title='Joomla plugin and templating: how to know if you are in the frontpage'>Joomla plugin and templating: how to know if you are in the frontpage</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/drupal-informatica-web/drupal-theming-know-if-you-are-in-homepage-solved/' rel='bookmark' title='Drupal theming: know if you are in homepage [solved]'>Drupal theming: know if you are in homepage [solved]</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/wordpress/wordpress-remove-category-and-other-permalinks-changes/' rel='bookmark' title='WordPress: remove /category'>WordPress: remove /category</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Some days ago I talked about <a href="http://www.leccionespracticas.com/informatica-web/drupal-informatica-web/drupal-theming-know-if-you-are-in-homepage-solved/">knowing where I am in Drupal</a> and <a href="http://www.leccionespracticas.com/php/joomla-templating-know-where-you-are-full-article-view-or-article-listing-solved/">knowing where I am in Jooml</a>. I&#8217;ve received some mails asking how to know where i am in wordpress (am I in the frontpage? am I in a single post view?).</p>
<p>You can know this by using <a href="http://codex.wordpress.org/Conditional_Tags">wordpress conditional tags</a>.</p>
<p>For instance,</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">is_home<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
    When the main blog page is being displayed<span style="color: #339933;">.</span> This is the page which shows the <span style="color: #990000;">time</span> based blog content of your site<span style="color: #339933;">,</span> so <span style="color: #b1b100;">if</span> you<span style="color: #0000ff;">'ve set a static Page for the Front Page (see below), then this will only be true on the Page which you set as the &quot;Posts page&quot; in Administration &gt; Settings &gt; Reading. 
&nbsp;
is_front_page() 
    When the front of the site is displayed, whether it is posts or a Page. Returns true when the main blog page is being displayed and the '</span>Settings <span style="color: #339933;">&gt;</span> Reading <span style="color: #339933;">-&gt;</span><span style="color: #004000;">Front</span> page displays<span style="color: #0000ff;">' is set to &quot;Your latest posts&quot;, or when '</span>Settings <span style="color: #339933;">&gt;</span> Reading <span style="color: #339933;">-&gt;</span><span style="color: #004000;">Front</span> page displays<span style="color: #0000ff;">' is set to &quot;A static page&quot; and the &quot;Front Page&quot; value is the current Page being displayed. Note: this tag was added at Version 2.5. 
&nbsp;
is_single() 
    When any single Post (or attachment, or custom Post Type) page is being displayed. (False for Pages)</span></pre></div></div>

<p>Related posts:<ol>
<li><a href='http://www.leccionespracticas.com/informatica-web/joomla-plugin-and-templating-how-to-know-if-you-are-in-the-frontpage/' rel='bookmark' title='Joomla plugin and templating: how to know if you are in the frontpage'>Joomla plugin and templating: how to know if you are in the frontpage</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/drupal-informatica-web/drupal-theming-know-if-you-are-in-homepage-solved/' rel='bookmark' title='Drupal theming: know if you are in homepage [solved]'>Drupal theming: know if you are in homepage [solved]</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/wordpress/wordpress-remove-category-and-other-permalinks-changes/' rel='bookmark' title='WordPress: remove /category'>WordPress: remove /category</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leccionespracticas.com/informatica-web/wordpress/wordpress-where-am-i-is-it-the-frontpage-solved/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress WP-Postviews en español [RESUELTO]</title>
		<link>http://www.leccionespracticas.com/informatica-web/wordpress/wordpress-wp-postviews-en-espanol-resuelto/</link>
		<comments>http://www.leccionespracticas.com/informatica-web/wordpress/wordpress-wp-postviews-en-espanol-resuelto/#comments</comments>
		<pubDate>Thu, 10 Mar 2011 11:25:17 +0000</pubDate>
		<dc:creator>Miguel</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[español]]></category>
		<category><![CDATA[the_views]]></category>
		<category><![CDATA[views]]></category>
		<category><![CDATA[wp-postviews]]></category>

		<guid isPermaLink="false">http://www.leccionespracticas.com/?p=1637</guid>
		<description><![CDATA[El plugin el plugin wp-postviews de wordpress permite mostrar en tu theme el número de lecturas de un determinado post, utilizando la función the_views();. Si queréis añadir esta información a vuestros posts, podréis hacerlo con una línea del tipo: // OJO! Dentro de 'the loop' (leido &#60;?php if&#40;function_exists&#40;'the_views'&#41;&#41; &#123; the_views&#40;&#41;; &#125; ?&#62;) Y esto mostrará [...]
Related posts:<ol>
<li><a href='http://www.leccionespracticas.com/uncategorized/solved-an-unexpected-http-error-occurred-during-the-api-request-wordpress-3/' rel='bookmark' title='[SOLVED] An Unexpected HTTP Error occurred during the API request &#8211; wordpress 3'>[SOLVED] An Unexpected HTTP Error occurred during the API request &#8211; wordpress 3</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/wordpress/wordpress-remove-category-and-other-permalinks-changes/' rel='bookmark' title='WordPress: remove /category'>WordPress: remove /category</a></li>
<li><a href='http://www.leccionespracticas.com/php/widget-para-wordpress-mostrar-los-twitts-favoritos-de-tu-cuenta-twitter/' rel='bookmark' title='Widget para wordpress: mostrar los twitts favoritos de tu cuenta twitter'>Widget para wordpress: mostrar los twitts favoritos de tu cuenta twitter</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>El plugin <a href="http://wordpress.org/extend/plugins/wp-postviews/">el plugin wp-postviews</a> de <b>wordpress</b> permite mostrar en tu <b>theme</b> el número de lecturas de un determinado post, utilizando la función <em>the_views();</em>.</p>
<p>Si queréis añadir esta información a vuestros posts, podréis hacerlo con una línea del tipo:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">// OJO! Dentro de 'the loop'
(leido <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_views'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> the_views<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>)</pre></div></div>

<p>Y esto mostrará algo del tipo:<br />
<em>Leido 25 views</em></p>
<p>Nosotros queremos que el texto &#8216;views&#8217; se muestre en español.</p>
<p>Para ello editamos <em>/wp-content/plugins/wp-postviews/wp-postviews.php</em> y buscamos este código:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">### Function: Display The Post Views
</span><span style="color: #000000; font-weight: bold;">function</span> the_views<span style="color: #009900;">&#40;</span><span style="color: #000088;">$display</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #000088;">$prefix</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$postfix</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$always</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$post_views</span> <span style="color: #339933;">=</span> <span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span>post_custom<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'views'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$views_options</span> <span style="color: #339933;">=</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'views_options'</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;">$always</span> <span style="color: #339933;">||</span> should_views_be_displayed<span style="color: #009900;">&#40;</span><span style="color: #000088;">$views_options</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$prefix</span><span style="color: #339933;">.</span><span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'%VIEW_COUNT%'</span><span style="color: #339933;">,</span> number_format_i18n<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post_views</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$views_options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'template'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #000088;">$postfix</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$display</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">echo</span> apply_filters<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_views'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$output</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">return</span> apply_filters<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_views'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$output</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$display</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Y lo cambiamos a esto:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">### Function: Display The Post Views
</span><span style="color: #000000; font-weight: bold;">function</span> the_views<span style="color: #009900;">&#40;</span><span style="color: #000088;">$display</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #000088;">$prefix</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$postfix</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$always</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$post_views</span> <span style="color: #339933;">=</span> <span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span>post_custom<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'views'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$views_options</span> <span style="color: #339933;">=</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'views_options'</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;">$always</span> <span style="color: #339933;">||</span> should_views_be_displayed<span style="color: #009900;">&#40;</span><span style="color: #000088;">$views_options</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$prefix</span><span style="color: #339933;">.</span><span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'%VIEW_COUNT%'</span><span style="color: #339933;">,</span> number_format_i18n<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post_views</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$views_options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'template'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #000088;">$postfix</span><span style="color: #339933;">;</span>
		<span style="color: #666666; font-style: italic;">// Added the following line to change from 'views' to 'veces' -----------</span>
		<span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'views'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'veces'</span><span style="color: #339933;">,</span><span style="color: #000088;">$output</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #666666; font-style: italic;">// ------------------------------------------------------------------</span>
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$display</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">echo</span> apply_filters<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_views'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$output</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">return</span> apply_filters<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_views'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$output</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$display</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>¡Y ya está!</p>
<p>Related posts:<ol>
<li><a href='http://www.leccionespracticas.com/uncategorized/solved-an-unexpected-http-error-occurred-during-the-api-request-wordpress-3/' rel='bookmark' title='[SOLVED] An Unexpected HTTP Error occurred during the API request &#8211; wordpress 3'>[SOLVED] An Unexpected HTTP Error occurred during the API request &#8211; wordpress 3</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/wordpress/wordpress-remove-category-and-other-permalinks-changes/' rel='bookmark' title='WordPress: remove /category'>WordPress: remove /category</a></li>
<li><a href='http://www.leccionespracticas.com/php/widget-para-wordpress-mostrar-los-twitts-favoritos-de-tu-cuenta-twitter/' rel='bookmark' title='Widget para wordpress: mostrar los twitts favoritos de tu cuenta twitter'>Widget para wordpress: mostrar los twitts favoritos de tu cuenta twitter</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leccionespracticas.com/informatica-web/wordpress/wordpress-wp-postviews-en-espanol-resuelto/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Autodetectar el idioma del cliente [RESUELTO]</title>
		<link>http://www.leccionespracticas.com/informatica-web/autodetectar-el-idioma-del-cliente-resuelto/</link>
		<comments>http://www.leccionespracticas.com/informatica-web/autodetectar-el-idioma-del-cliente-resuelto/#comments</comments>
		<pubDate>Wed, 23 Feb 2011 09:10:54 +0000</pubDate>
		<dc:creator>Miguel</dc:creator>
				<category><![CDATA[Informática - web]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[auto]]></category>
		<category><![CDATA[automaticamente]]></category>
		<category><![CDATA[cookie]]></category>
		<category><![CDATA[detectar]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[gratis]]></category>
		<category><![CDATA[idioma]]></category>
		<category><![CDATA[multilanguage]]></category>
		<category><![CDATA[multilenguaje]]></category>
		<category><![CDATA[webservice]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.leccionespracticas.com/?p=1615</guid>
		<description><![CDATA[Dos de las cuestiones que se plantean cuando un sitio web empieza a crecer es: ¿Cómo implementar un sitio web multilenguaje? y ¿Cómo detectar automáticamente el idioma del cliente? e incluso ¿Cómo redireccionar a los clientes a una web en su idioma? Hay varias formas de hacerlo. Método 1: Geolocalización Se basa en tracear la [...]
Related posts:<ol>
<li><a href='http://www.leccionespracticas.com/informatica-web/vbulletin-informatica-web/vbulletin-4-1-7-instalar-spanish-language-pack-resuelto/' rel='bookmark' title='vBulletin 4.1.7 &#8211; Instalar spanish language pack [RESUELTO]'>vBulletin 4.1.7 &#8211; Instalar spanish language pack [RESUELTO]</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Dos de las cuestiones que se plantean cuando un sitio web empieza a crecer es: <b>¿Cómo implementar un sitio web multilenguaje?</b> y <b>¿Cómo detectar automáticamente el idioma del cliente?</b> e incluso <b>¿Cómo redireccionar a los clientes a una web en su idioma?</b></p>
<p>Hay varias formas de hacerlo.</p>
<h3>Método 1: Geolocalización</h3>
<p>Se basa en <em>tracear</em> la IP del cliente y determinar a qué pais procede. Existen algunos servicios, como <a href="http://www.geoiptool.com/">geoIPtool</a> que nos permiten conocer la localización de nuestra IP.</p>
<p>Podemos utilizar en nuestro favor <a href="http://www.geoiptool.com/es/webtools/">alguno de los ficheros javascript que ofrecen en su web</a> o <a href="http://geoiptool.com/webapi.php">la API de detección de pais que tienen disponible</a></p>
<p>Hay muchos otros sistemas de <b>geolocalización por ip</b> disponibles online.<br />
Por ejemplo: <a href="http://www.ip2location.com/developers.aspx">ip2location</a> dispone de librerías para detección de localización por IP en varios lenguajes comunes: <a href="http://www.ip2location.com/php.aspx">PHP</a>, <a href="http://www.ip2location.com/python.aspx">python</a>, <a href="">java</a>, etc</p>
<p>Lo malo de estos sistemas es que (1) muchos son de pago y (2) están basados en bases de datos que relacionan rangos de IP&#8217;s con países. Si eres informático ya estarás pensando ¿y quién me garantiza la actualización de esos datos? </p>
<p>Pero los problemas no terminan ahí. Además de los derivados de depender de un servicio web externo (que puede no responder, no estar actualizado, etc) se plantea uno bastante más grave. Imaginemos la siguiente situación:</p>
<p>Peter es inglés y viene con su portátil a España. Llega a la Universidad de Zaragoza y se conecta a la red wifi. La IP externa que tiene es española -> nuestro sistema de geolocalización detecta que está en España -> le redirigimos a nuestra web en español. Pero Peter no entiende mucho español. Él quiere la web en inglés. <em>We just failed</em></p>
<p>Aun asi, si queréis probar, existen varias API&#8217;s gratuitas para jugar un rato, por si sentís curiosidad:<br />
* <a href="http://ip-geo.appspot.com/#example">IP-geo</a><br />
* <a href="http://freegeoip.appspot.com/">FreeGeoIP</a></p>
<h3>Método 2: Detección del idioma del navegador</h3>
<p>Para mi este método es más correcto, pues no depende de dónde estemos, sino de <em>quiénes seamos</em>. Si soy inglés y resido en España, es más que probable que tenga mi navegador configurado en inglés. </p>
<p>¿Cómo cambiar nuestro idioma por defecto en el navegador? En Firefox, se hace desde <em>Herramientas->Opciones->Contenido->Idiomas</em> y allí se selecciona el idioma por defecto (y otros, con orden de preferencia).</p>
<p>En esencia el método consiste en leer el valor de las cabeceras enviadas por el navegador del cliente y determinar el idioma por defecto (variable <em>$_server["http_accept_language"]</em>). Si hacemos un <em>var_dump</em> de la variable en cuestión, veremos algo del tipo:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #ff0000;">'es-es,es;q=0.8,en-us;q=0.5,en;q=0.3'</span></pre></div></div>

<p>Al lado de cada lenguaje está el parámetro <em>q=</em> que indica el grado de preferencia para dicho idioma. Preferencia máxima sería <em>q=1</em> y mínima <em>q=0</em>.</p>
<p>Podéis leer más sobre esta cabecera en el <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html">RFC2616 (en w3.org)</a>.</p>
<p>Veámoslo en código. Primero un ejemplo más simplón en PHP:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> detectarIdioma<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$idiomas</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_ACCEPT_LANGUAGE'</span><span style="color: #009900;">&#93;</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: #990000;">strpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$idiomas</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;es&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!==</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$idioma</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;es&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">elseif</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">strpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$idiomas</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;en&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!==</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$idioma</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;en&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #666666; font-style: italic;">//Ante cualquier otro idioma devolvemos &quot;es&quot;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$idioma</span> <span style="color: #339933;">&lt;&gt;</span> <span style="color: #0000ff;">&quot;es&quot;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$idioma</span> <span style="color: #339933;">&lt;&gt;</span> <span style="color: #0000ff;">&quot;en&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$idioma</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;es&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$idioma</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>O su equivalente en javascript:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> language <span style="color: #339933;">=</span> navigator.<span style="color: #660066;">language</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>language <span style="color: #339933;">==</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	language <span style="color: #339933;">=</span> navigator.<span style="color: #660066;">userLanguage</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>language <span style="color: #339933;">==</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
		language <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;en&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
language <span style="color: #339933;">=</span> language.<span style="color: #660066;">substring</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Y ahora un código un poco más completo. Me he basado en el <a href="http://techpatterns.com/downloads/scripts/php_language_detection.txt">código php de techpatterns</a> y lo he modificado ligeramente:</p>
<p>Archivo de detección/redirección basándonos en el idioma del browser. Lo llamaremos detecta-idiomas.php:</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
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
</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;">/*******************************************
By: Miguel Martin
Based on Harald's script: http://techpatterns.com/downloads/php_language_detection.php
Date: 2011-02-23
*******************************************/</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// choice of redirection header or just getting language data</span>
<span style="color: #666666; font-style: italic;">// to call this you only need to use the $feature parameter</span>
<span style="color: #000000; font-weight: bold;">function</span> get_languages<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$feature</span><span style="color: #339933;">,</span> <span style="color: #000088;">$spare</span><span style="color: #339933;">=</span><span style="color: #0000ff;">''</span> <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #666666; font-style: italic;">// get the languages</span>
	<span style="color: #000088;">$a_languages</span> <span style="color: #339933;">=</span> languages<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$index</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$complete</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$found</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">// set to default value</span>
	<span style="color: #000088;">$user_languages</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">//check to see if language is set</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;HTTP_ACCEPT_LANGUAGE&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$languages</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;HTTP_ACCEPT_LANGUAGE&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #666666; font-style: italic;">// need to remove spaces from strings to avoid error</span>
		<span style="color: #000088;">$languages</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">' '</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$languages</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$languages</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;,&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$languages</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;">$languages</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$language_list</span> <span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #666666; font-style: italic;">// pull out the language, place languages into array of full and primary</span>
			<span style="color: #666666; font-style: italic;">// string structure:</span>
			<span style="color: #000088;">$temp_array</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #666666; font-style: italic;">// slice out the part before ; on first step, the part before - on second, place into array</span>
			<span style="color: #000088;">$temp_array</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$language_list</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #990000;">strcspn</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$language_list</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">';'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//full language</span>
			<span style="color: #000088;">$temp_array</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$language_list</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">// cut out primary language</span>
			<span style="color: #666666; font-style: italic;">//place this array into main $user_languages language array</span>
			<span style="color: #000088;">$user_languages</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$temp_array</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">//start going through each one</span>
		<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">&lt;</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$user_languages</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$a_languages</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$index</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$complete</span> <span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#123;</span>
				<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$index</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$user_languages</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><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;">&#41;</span>
				<span style="color: #009900;">&#123;</span>
					<span style="color: #666666; font-style: italic;">// complete language, like english (canada)</span>
					<span style="color: #000088;">$user_languages</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$complete</span><span style="color: #339933;">;</span>
					<span style="color: #666666; font-style: italic;">// extract working language, like english</span>
					<span style="color: #000088;">$user_languages</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$complete</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #990000;">strcspn</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$complete</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">' ('</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">else</span><span style="color: #666666; font-style: italic;">// if no languages found</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$user_languages</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//return blank array.</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #666666; font-style: italic;">// print_r($user_languages);</span>
	<span style="color: #666666; font-style: italic;">// return parameters</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$feature</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'data'</span> <span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$user_languages</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// this is just a sample, replace target language and file names with your own.</span>
	<span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$feature</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'header'</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;">$user_languages</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: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #666666; font-style: italic;">// get default primary language, the first one in array that is</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'en'</span><span style="color: #339933;">:</span>
				<span style="color: #000088;">$location</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'english.php'</span><span style="color: #339933;">;</span>
				<span style="color: #000088;">$found</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</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;">'es'</span><span style="color: #339933;">:</span>
				<span style="color: #000088;">$location</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'spanish.php'</span><span style="color: #339933;">;</span>
				<span style="color: #000088;">$found</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</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: #b1b100;">break</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$found</span> <span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Location: <span style="color: #006699; font-weight: bold;">$location</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">else</span><span style="color: #666666; font-style: italic;">// make sure you have a default page to send them to</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Location: default.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> languages<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #666666; font-style: italic;">// pack abbreviation/language array</span>
<span style="color: #666666; font-style: italic;">// important note: you must have the default language as the last item in each major language, after all the</span>
<span style="color: #666666; font-style: italic;">// en-ca type entries, so en would be last in that case</span>
	<span style="color: #000088;">$a_languages</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
	<span style="color: #0000ff;">'af'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Afrikaans'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'sq'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Albanian'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'ar-dz'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Arabic (Algeria)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'ar-bh'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Arabic (Bahrain)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'ar-eg'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Arabic (Egypt)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'ar-iq'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Arabic (Iraq)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'ar-jo'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Arabic (Jordan)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'ar-kw'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Arabic (Kuwait)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'ar-lb'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Arabic (Lebanon)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'ar-ly'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Arabic (libya)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'ar-ma'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Arabic (Morocco)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'ar-om'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Arabic (Oman)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'ar-qa'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Arabic (Qatar)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'ar-sa'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Arabic (Saudi Arabia)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'ar-sy'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Arabic (Syria)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'ar-tn'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Arabic (Tunisia)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'ar-ae'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Arabic (U.A.E.)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'ar-ye'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Arabic (Yemen)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'ar'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Arabic'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'hy'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Armenian'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'as'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Assamese'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'az'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Azeri'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'eu'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Basque'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'be'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Belarusian'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'bn'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Bengali'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'bg'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Bulgarian'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'ca'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Catalan'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'zh-cn'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Chinese (China)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'zh-hk'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Chinese (Hong Kong SAR)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'zh-mo'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Chinese (Macau SAR)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'zh-sg'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Chinese (Singapore)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'zh-tw'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Chinese (Taiwan)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'zh'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Chinese'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'hr'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Croatian'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'cs'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Czech'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'da'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Danish'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'div'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Divehi'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'nl-be'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Dutch (Belgium)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'nl'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Dutch (Netherlands)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'en-au'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'English (Australia)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'en-bz'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'English (Belize)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'en-ca'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'English (Canada)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'en-ie'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'English (Ireland)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'en-jm'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'English (Jamaica)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'en-nz'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'English (New Zealand)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'en-ph'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'English (Philippines)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'en-za'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'English (South Africa)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'en-tt'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'English (Trinidad)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'en-gb'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'English (United Kingdom)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'en-us'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'English (United States)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'en-zw'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'English (Zimbabwe)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'en'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'English'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'us'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'English (United States)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'et'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Estonian'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'fo'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Faeroese'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'fa'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Farsi'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'fi'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Finnish'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'fr-be'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'French (Belgium)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'fr-ca'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'French (Canada)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'fr-lu'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'French (Luxembourg)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'fr-mc'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'French (Monaco)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'fr-ch'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'French (Switzerland)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'fr'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'French (France)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'mk'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'FYRO Macedonian'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'gd'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Gaelic'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'ka'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Georgian'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'de-at'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'German (Austria)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'de-li'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'German (Liechtenstein)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'de-lu'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'German (Luxembourg)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'de-ch'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'German (Switzerland)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'de'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'German (Germany)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'el'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Greek'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'gu'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Gujarati'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'he'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Hebrew'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'hi'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Hindi'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'hu'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Hungarian'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'is'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Icelandic'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'id'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Indonesian'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'it-ch'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Italian (Switzerland)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'it'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Italian (Italy)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'ja'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Japanese'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'kn'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Kannada'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'kk'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Kazakh'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'kok'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Konkani'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'ko'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Korean'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'kz'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Kyrgyz'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'lv'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Latvian'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'lt'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Lithuanian'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'ms'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Malay'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'ml'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Malayalam'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'mt'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Maltese'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'mr'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Marathi'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'mn'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Mongolian (Cyrillic)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'ne'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Nepali (India)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'nb-no'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Norwegian (Bokmal)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'nn-no'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Norwegian (Nynorsk)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'no'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Norwegian (Bokmal)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'or'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Oriya'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'pl'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Polish'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'pt-br'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Portuguese (Brazil)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'pt'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Portuguese (Portugal)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'pa'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Punjabi'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'rm'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Rhaeto-Romanic'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'ro-md'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Romanian (Moldova)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'ro'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Romanian'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'ru-md'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Russian (Moldova)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'ru'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Russian'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'sa'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Sanskrit'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'sr'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Serbian'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'sk'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Slovak'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'ls'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Slovenian'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'sb'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Sorbian'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'es-ar'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Spanish (Argentina)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'es-bo'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Spanish (Bolivia)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'es-cl'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Spanish (Chile)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'es-co'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Spanish (Colombia)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'es-cr'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Spanish (Costa Rica)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'es-do'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Spanish (Dominican Republic)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'es-ec'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Spanish (Ecuador)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'es-sv'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Spanish (El Salvador)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'es-gt'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Spanish (Guatemala)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'es-hn'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Spanish (Honduras)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'es-mx'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Spanish (Mexico)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'es-ni'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Spanish (Nicaragua)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'es-pa'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Spanish (Panama)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'es-py'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Spanish (Paraguay)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'es-pe'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Spanish (Peru)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'es-pr'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Spanish (Puerto Rico)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'es-us'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Spanish (United States)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'es-uy'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Spanish (Uruguay)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'es-ve'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Spanish (Venezuela)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'es'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Spanish (Traditional Sort)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'sx'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Sutu'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'sw'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Swahili'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'sv-fi'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Swedish (Finland)'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'sv'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Swedish'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'syr'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Syriac'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'ta'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Tamil'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'tt'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Tatar'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'te'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Telugu'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'th'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Thai'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'ts'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Tsonga'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'tn'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Tswana'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'tr'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Turkish'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'uk'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Ukrainian'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'ur'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Urdu'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'uz'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Uzbek'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'vi'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Vietnamese'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'xh'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Xhosa'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'yi'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Yiddish'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'zu'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Zulu'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$a_languages</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Se puede invocar de dos formas: para obtener información sobre los idiomas, de forma que nos devuelva un vector de idiomas, siendo el primero el idioma por defecto:</p>
<p>Código:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">include_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'detecta-idiomas.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">var_dump</span><span style="color: #009900;">&#40;</span>get_languages<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'data'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Resultado (en mi navegador):</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">array</span>
  <span style="color: #cc66cc;">0</span> <span style="color: #339933;">=&gt;</span> 
    <span style="color: #990000;">array</span>
      <span style="color: #cc66cc;">0</span> <span style="color: #339933;">=&gt;</span> string <span style="color: #0000ff;">'es-es'</span> <span style="color: #009900;">&#40;</span>length<span style="color: #339933;">=</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span>
      <span style="color: #cc66cc;">1</span> <span style="color: #339933;">=&gt;</span> string <span style="color: #0000ff;">'es'</span> <span style="color: #009900;">&#40;</span>length<span style="color: #339933;">=</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span>
  <span style="color: #cc66cc;">1</span> <span style="color: #339933;">=&gt;</span> 
    <span style="color: #990000;">array</span>
      <span style="color: #cc66cc;">0</span> <span style="color: #339933;">=&gt;</span> string <span style="color: #0000ff;">'es'</span> <span style="color: #009900;">&#40;</span>length<span style="color: #339933;">=</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span>
      <span style="color: #cc66cc;">1</span> <span style="color: #339933;">=&gt;</span> string <span style="color: #0000ff;">'es'</span> <span style="color: #009900;">&#40;</span>length<span style="color: #339933;">=</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span>
      <span style="color: #cc66cc;">2</span> <span style="color: #339933;">=&gt;</span> string <span style="color: #0000ff;">'Spanish (Traditional Sort)'</span> <span style="color: #009900;">&#40;</span>length<span style="color: #339933;">=</span><span style="color: #cc66cc;">26</span><span style="color: #009900;">&#41;</span>
      <span style="color: #cc66cc;">3</span> <span style="color: #339933;">=&gt;</span> string <span style="color: #0000ff;">'Spanish'</span> <span style="color: #009900;">&#40;</span>length<span style="color: #339933;">=</span><span style="color: #cc66cc;">7</span><span style="color: #009900;">&#41;</span>
  <span style="color: #cc66cc;">2</span> <span style="color: #339933;">=&gt;</span> 
    <span style="color: #990000;">array</span>
      <span style="color: #cc66cc;">0</span> <span style="color: #339933;">=&gt;</span> string <span style="color: #0000ff;">'en-us'</span> <span style="color: #009900;">&#40;</span>length<span style="color: #339933;">=</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span>
      <span style="color: #cc66cc;">1</span> <span style="color: #339933;">=&gt;</span> string <span style="color: #0000ff;">'en'</span> <span style="color: #009900;">&#40;</span>length<span style="color: #339933;">=</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span>
      <span style="color: #cc66cc;">2</span> <span style="color: #339933;">=&gt;</span> string <span style="color: #0000ff;">'English (United States)'</span> <span style="color: #009900;">&#40;</span>length<span style="color: #339933;">=</span><span style="color: #cc66cc;">23</span><span style="color: #009900;">&#41;</span>
      <span style="color: #cc66cc;">3</span> <span style="color: #339933;">=&gt;</span> string <span style="color: #0000ff;">'English'</span> <span style="color: #009900;">&#40;</span>length<span style="color: #339933;">=</span><span style="color: #cc66cc;">7</span><span style="color: #009900;">&#41;</span>
  <span style="color: #cc66cc;">3</span> <span style="color: #339933;">=&gt;</span> 
    <span style="color: #990000;">array</span>
      <span style="color: #cc66cc;">0</span> <span style="color: #339933;">=&gt;</span> string <span style="color: #0000ff;">'en'</span> <span style="color: #009900;">&#40;</span>length<span style="color: #339933;">=</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span>
      <span style="color: #cc66cc;">1</span> <span style="color: #339933;">=&gt;</span> string <span style="color: #0000ff;">'en'</span> <span style="color: #009900;">&#40;</span>length<span style="color: #339933;">=</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span>
      <span style="color: #cc66cc;">2</span> <span style="color: #339933;">=&gt;</span> string <span style="color: #0000ff;">'English'</span> <span style="color: #009900;">&#40;</span>length<span style="color: #339933;">=</span><span style="color: #cc66cc;">7</span><span style="color: #009900;">&#41;</span>
      <span style="color: #cc66cc;">3</span> <span style="color: #339933;">=&gt;</span> string <span style="color: #0000ff;">'English'</span> <span style="color: #009900;">&#40;</span>length<span style="color: #339933;">=</span><span style="color: #cc66cc;">7</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>O para <b>redirigir al cliente a una web en función del idioma de su browser</b>. Si nos fijamos en la línea 75-76 de nuestro fichero <em>detecta-idiomas.php</em> vemos que la redirección para el idioma &#8216;es&#8217; se hace a &#8216;spanish.php&#8217;. Podemos cambiar esto al gusto.</p>
<p>Código:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">include_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'detecta-idiomas.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">var_dump</span><span style="color: #009900;">&#40;</span>get_languages<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'header'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Resultado: redirige al cliente al recurso &#8216;spanish.php&#8217; (o el indicado en la línea 76 del script), si el browser está en español (<em>es</em>)</p>
<h3>Método 3: añadiendo generación de cookie y posibilidad de cambio MANUAL de idioma</h3>
<p>El método anterior funciona bastante bien, pero podemos encontrar problemas en algunos casos. Por ejemplo: Peter, inglés, viene a la Universidad de Zaragoza y se pone a trabajar en un pc de la biblioteca&#8230; cuyo navegador está en español. Peter se conecta a nuestro sitio web. La secuencia de eventos será:<br />
- Nuestro sitio web detecta que su browser está en castellano<br />
- Le redirige a nuestra web en castellano</p>
<p>Peter desea poder ver la web en inglés, por lo que <b>permitimos que elija de manera explícita y manual el idioma tras la redirección</b>. Pulsa la banderita inglesa y se le redirige al idioma inglés.</p>
<p>Pero queremos que <b>en próximas visitas, recordemos que Peter quiere ver la web en inglés</b>, por lo que <b>hemos de generar una cookie</a></b> que lo recuerde!</p>
<p>¿Y cómo generar cookies? Es muy sencillo, puedes ver ejemplos en <a href="http://boblet.tumblr.com/post/22538036/setting-a-language-preference-cookie">tutorial1</a>, <a href="http://www.ehow.com/how_6636245_set-cookie-changing-language-website.html">tutorial2</a>. O utilizar <a href="http://drupal.org/node/28730">implementaciones existentes para drupal</a> (con <a href="http://drupal.org/project/i18n">i18n</a>)</p>
<p>En próximas entregas os comentaré cómo implementarlo todo en <b>wordpress</b> (usando <a href="http://wordpress.org/extend/plugins/sitepress-multilingual-cms/">WPML</a> y <a href="http://wordpress.org/extend/plugins/xlanguage/">xLanguage</a>) y <b>drupal</b> (<a href="http://drupal.org/project/i18n">i18n</a> + <a href="http://drupal.org/project/pathauto">pathauto</a> + <a href="http://drupal.org/project/languageicons">language icons</a>, de forma similar a como se hace en <a href="http://www.eangkasa.com/content/setting-multilingual-site-drupal-internationalization-i18n.html">éste magnífico tutorial en inglés</a>)</p>
<p>Related posts:<ol>
<li><a href='http://www.leccionespracticas.com/informatica-web/vbulletin-informatica-web/vbulletin-4-1-7-instalar-spanish-language-pack-resuelto/' rel='bookmark' title='vBulletin 4.1.7 &#8211; Instalar spanish language pack [RESUELTO]'>vBulletin 4.1.7 &#8211; Instalar spanish language pack [RESUELTO]</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leccionespracticas.com/informatica-web/autodetectar-el-idioma-del-cliente-resuelto/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress Yoast SEO + wp_comfy theme + Category titles</title>
		<link>http://www.leccionespracticas.com/informatica-web/wordpress/wordpress-yoast-seo-wp_comfy-theme-category-titles/</link>
		<comments>http://www.leccionespracticas.com/informatica-web/wordpress/wordpress-yoast-seo-wp_comfy-theme-category-titles/#comments</comments>
		<pubDate>Tue, 22 Feb 2011 10:54:21 +0000</pubDate>
		<dc:creator>Miguel</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[category]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[title]]></category>
		<category><![CDATA[wp_comfy]]></category>
		<category><![CDATA[yoast seo plugin]]></category>

		<guid isPermaLink="false">http://www.leccionespracticas.com/?p=1612</guid>
		<description><![CDATA[If you are using Yoast SEO plugin for wordpress with WP_Comfy theme you will notice that title&#8217;s (&#60;title> tag) are not working as expected. Despite your settings in Yoast WordPress SEO: Titles the titles are not showing what you want. Follow these steps to make them work: Changes in header.php Edit your /wp-content/themes/wp-comfy/header.php and change: [...]
Related posts:<ol>
<li><a href='http://www.leccionespracticas.com/informatica-web/wordpress/wordpress-remove-category-and-other-permalinks-changes/' rel='bookmark' title='WordPress: remove /category'>WordPress: remove /category</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/wordpress/wordpress-in-a-subdirectory-urls-like-it-was-in-root-directory/' rel='bookmark' title='WordPress in a subdirectory, urls like it was in root directory'>WordPress in a subdirectory, urls like it was in root directory</a></li>
<li><a href='http://www.leccionespracticas.com/php/anadir-meta-informacion-a-wordpress/' rel='bookmark' title='Añadir meta-información a wordpress'>Añadir meta-información a wordpress</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>If you are using <a href="http://yoast.com/wordpress/seo/">Yoast SEO plugin</a> for <a href="http://www.leccionespracticas.com/wordpress/">wordpress</a> with <a href="">WP_Comfy</a> theme you will notice that title&#8217;s (<em>&lt;title></em> tag) are not working as expected. Despite your settings in <em>Yoast WordPress SEO: Titles</em> the titles are not showing what you want.</p>
<p>Follow these steps to make them work:</p>
<h3>Changes in header.php</h3>
<p>Edit your <em>/wp-content/themes/wp-comfy/header.php</em> and change:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">tle&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> seotitles<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/title&gt;</pre></div></div>

<p>To:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">tle&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> wp_title<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/title&gt;</pre></div></div>

<h3>Changes in CATEGORY TITLE&#8217;s</h3>
<p>In my <em>SEO titles</em> settings page, and more precisely in the <em>Taxonomies->Category->title template</em> I set the rule to:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">%%</span>title<span style="color: #000000; font-weight: bold;">%%</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">%%</span>sitename<span style="color: #000000; font-weight: bold;">%%</span> - <span style="color: #000000; font-weight: bold;">%%</span>sitedesc<span style="color: #000000; font-weight: bold;">%%</span></pre></div></div>

<p>But it failed to show the titles like I wanted.</p>
<p>I decided to make a quick (and dirty) fix in order to make it work:<br />
- Edit <em></em>\wp-content\plugins\wordpress-seo\frontend\class-frontend.php</em>. Look for:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> is_category<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> is_tag<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> is_tax<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$term</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$wp_query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_queried_object</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$title</span> <span style="color: #339933;">=</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span> wpseo_get_term_meta<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$term</span><span style="color: #339933;">,</span> <span style="color: #000088;">$term</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">taxonomy</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'title'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>And change it to:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> is_category<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> is_tag<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> is_tax<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$term</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$wp_query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_queried_object</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #666666; font-style: italic;">//$title = trim( wpseo_get_term_meta( $term, $term-&gt;taxonomy, 'title' ) );</span>
			<span style="color: #000088;">$title</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$title</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'  | '</span><span style="color: #339933;">.</span>get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' - '</span><span style="color: #339933;">.</span>get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'description'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>And you are ready to go!</p>
<p>Related posts:<ol>
<li><a href='http://www.leccionespracticas.com/informatica-web/wordpress/wordpress-remove-category-and-other-permalinks-changes/' rel='bookmark' title='WordPress: remove /category'>WordPress: remove /category</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/wordpress/wordpress-in-a-subdirectory-urls-like-it-was-in-root-directory/' rel='bookmark' title='WordPress in a subdirectory, urls like it was in root directory'>WordPress in a subdirectory, urls like it was in root directory</a></li>
<li><a href='http://www.leccionespracticas.com/php/anadir-meta-informacion-a-wordpress/' rel='bookmark' title='Añadir meta-información a wordpress'>Añadir meta-información a wordpress</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leccionespracticas.com/informatica-web/wordpress/wordpress-yoast-seo-wp_comfy-theme-category-titles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Widget para wordpress: mostrar los twitts favoritos de tu cuenta twitter</title>
		<link>http://www.leccionespracticas.com/php/widget-para-wordpress-mostrar-los-twitts-favoritos-de-tu-cuenta-twitter/</link>
		<comments>http://www.leccionespracticas.com/php/widget-para-wordpress-mostrar-los-twitts-favoritos-de-tu-cuenta-twitter/#comments</comments>
		<pubDate>Thu, 03 Feb 2011 09:46:12 +0000</pubDate>
		<dc:creator>Miguel</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[favoritos]]></category>
		<category><![CDATA[favourites]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[widget]]></category>

		<guid isPermaLink="false">http://leccionespracticas.com/?p=1591</guid>
		<description><![CDATA[Basándome en elTwitter Widget para WordPress de Sean Spalding, he modificado ligeramente el código para que muestre únicamente los twitts favoritos de un determinado usuario. El fuente es éste: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 [...]
Related posts:<ol>
<li><a href='http://www.leccionespracticas.com/php/anadir-meta-informacion-a-wordpress/' rel='bookmark' title='Añadir meta-información a wordpress'>Añadir meta-información a wordpress</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/wordpress/wordpress-wp-postviews-en-espanol-resuelto/' rel='bookmark' title='WordPress WP-Postviews en español [RESUELTO]'>WordPress WP-Postviews en español [RESUELTO]</a></li>
<li><a href='http://www.leccionespracticas.com/vufind-2/vufind-mostrar-informacion-de-reservas-en-los-registros/' rel='bookmark' title='vufind: mostrar información de reservas en los registros'>vufind: mostrar información de reservas en los registros</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Basándome en el<a href="http://seanys.com/2007/10/12/twitter-wordpress-widget/">Twitter Widget</a> para WordPress de <a href="http://seanys.com/">Sean Spalding</a>, he modificado ligeramente el código para que muestre únicamente los twitts favoritos de un determinado usuario.</p>
<p>El fuente es éste:</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
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
</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;">/*
Plugin Name: Twitter Widget Favoritos
Plugin URI: http://leccionespracticas.com/php/widget-para-wordpress-mostrar-los-twitts-favoritos-de-tu-cuenta-twitter/
Description: Muestra favoritos de twitter de un usuario (usa Javascript &lt;a href=&quot;http://twitter.com/badges/which_badge&quot;&gt;Twitter 'badge'&lt;/a&gt;)
Version: 1.0.0
Author: Miguel Martin
Author URI: http://www.leccionespracticas.com
License: GPL
Basado en: Twitter Widget by Sean Spalding - http://seanys.com/2007/10/12/twitter-wordpress-widget/
&nbsp;
This software comes without any warranty, express or otherwise, and if it
breaks your blog or results in your cat being shaved, it's not my fault.
&nbsp;
*/</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> widget_Twidget_Favoritos_init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'register_sidebar_widget'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
		<span style="color: #b1b100;">return</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">function</span> widget_Twidget_Favoritos<span style="color: #009900;">&#40;</span><span style="color: #000088;">$args</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// &quot;$args is an array of strings that help widgets to conform to</span>
		<span style="color: #666666; font-style: italic;">// the active theme: before_widget, before_title, after_widget,</span>
		<span style="color: #666666; font-style: italic;">// and after_title are the array keys.&quot; - These are set up by the theme</span>
		<span style="color: #990000;">extract</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$args</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// These are our own options</span>
		<span style="color: #000088;">$options</span> <span style="color: #339933;">=</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'widget_Twidget'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$account</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'account'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// Your Twitter account name</span>
		<span style="color: #000088;">$title</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'title'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// Title in sidebar for widget</span>
		<span style="color: #000088;">$show</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'show'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// # of Updates to show</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">// Output</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$before_widget</span> <span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// start</span>
		<span style="color: #666666; font-style: italic;">//echo '&lt;div id=&quot;twitter_div&quot;&gt;'</span>
        <span style="color: #666666; font-style: italic;">//      .$before_title.$title.$after_title;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$before_title</span><span style="color: #339933;">.</span><span style="color: #000088;">$title</span><span style="color: #339933;">.</span><span style="color: #000088;">$after_title</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;div id=&quot;twitter_div&quot;&gt;'</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;ul id=&quot;twitter_update_list&quot;&gt;&lt;/ul&gt;&lt;/div&gt;
		      &lt;script type=&quot;text/javascript&quot; src=&quot;http://twitter.com/javascripts/blogger.js&quot;&gt;&lt;/script&gt;'</span><span style="color: #339933;">;</span>
		<span style="color: #666666; font-style: italic;">// Con esta linea buscamos TODOS los twitts de el usuario identificado por $account</span>
		<span style="color: #666666; font-style: italic;">/*echo '&lt;script type=&quot;text/javascript&quot; src=&quot;http://twitter.com/statuses/user_timeline/'.$account.'.json?callback=twitterCallback2&amp;amp;count='.$show.'&quot;&gt;&lt;/script&gt;';*/</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// Con esta linea buscamos los favoritos del usuario identificado por $account</span>
		<span style="color: #666666; font-style: italic;">// http://api.twitter.com/1/favorites/bibliouz.json?callback=twitterCallback2&amp;count=5</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;script type=&quot;text/javascript&quot; src=&quot;http://api.twitter.com/1/favorites/'</span><span style="color: #339933;">.</span><span style="color: #000088;">$account</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'.json?callback=twitterCallback2&amp;amp;count='</span><span style="color: #339933;">.</span><span style="color: #000088;">$show</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;&gt;&lt;/script&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// Con esta otra linea se filtra por $account y por $hashtag</span>
		<span style="color: #666666; font-style: italic;">// http://search.twitter.com/search.json?q=%23HASHTAG+from:USERNAME</span>
		<span style="color: #666666; font-style: italic;">// similar a (parámetro rpp final es el número de tweets qse muestran</span>
		<span style="color: #666666; font-style: italic;">// http://search.twitter.com/search?q=&amp;ands=&amp;phrase=&amp;ors=&amp;nots=&amp;tag=bibliotecas&amp;lang=all&amp;from=bibliouz&amp;to=&amp;ref=&amp;near=&amp;within=15&amp;units=mi&amp;since=&amp;until=&amp;rpp=5</span>
        <span style="color: #666666; font-style: italic;">//$hashtag = '%23'.'listado';</span>
		<span style="color: #666666; font-style: italic;">/*echo '&lt;script type=&quot;text/javascript&quot; src=&quot;http://search.twitter.com/search.json?q=listado+from:bibliouz&quot;&gt;&lt;/script&gt;';*/</span>
&nbsp;
&nbsp;
&nbsp;
		<span style="color: #666666; font-style: italic;">// echo widget closing tag</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$after_widget</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Settings form</span>
	<span style="color: #000000; font-weight: bold;">function</span> widget_Twidget_Favoritos_control<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// Get options</span>
		<span style="color: #000088;">$options</span> <span style="color: #339933;">=</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'widget_Twidget_Favoritos'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #666666; font-style: italic;">// options exist? if not set defaults</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #990000;">is_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
			<span style="color: #000088;">$options</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'account'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'seanys'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'title'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Twitter Updates'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'show'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'5'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">// form posted?</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Twitter-submit'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
			<span style="color: #666666; font-style: italic;">// Remember to sanitize and format use input appropriately.</span>
			<span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'account'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strip_tags</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">stripslashes</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Twitter-account'</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;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'title'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strip_tags</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">stripslashes</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Twitter-title'</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;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'show'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strip_tags</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">stripslashes</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Twitter-show'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			update_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'widget_Twidget_Favoritos'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$options</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// Get options for form fields to show</span>
		<span style="color: #000088;">$account</span> <span style="color: #339933;">=</span> <span style="color: #990000;">htmlspecialchars</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'account'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">ENT_QUOTES</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$title</span> <span style="color: #339933;">=</span> <span style="color: #990000;">htmlspecialchars</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'title'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">ENT_QUOTES</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$show</span> <span style="color: #339933;">=</span> <span style="color: #990000;">htmlspecialchars</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'show'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">ENT_QUOTES</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// The form fields</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;p style=&quot;text-align:right;&quot;&gt;
				&lt;label for=&quot;Twitter-account&quot;&gt;'</span> <span style="color: #339933;">.</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Account:'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'
				&lt;input style=&quot;width: 200px;&quot; id=&quot;Twitter-account&quot; name=&quot;Twitter-account&quot; type=&quot;text&quot; value=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$account</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; /&gt;
				&lt;/label&gt;&lt;/p&gt;'</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;p style=&quot;text-align:right;&quot;&gt;
				&lt;label for=&quot;Twitter-title&quot;&gt;'</span> <span style="color: #339933;">.</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Title:'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'
				&lt;input style=&quot;width: 200px;&quot; id=&quot;Twitter-title&quot; name=&quot;Twitter-title&quot; type=&quot;text&quot; value=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$title</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; /&gt;
				&lt;/label&gt;&lt;/p&gt;'</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;p style=&quot;text-align:right;&quot;&gt;
				&lt;label for=&quot;Twitter-show&quot;&gt;'</span> <span style="color: #339933;">.</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Show:'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'
				&lt;input style=&quot;width: 200px;&quot; id=&quot;Twitter-show&quot; name=&quot;Twitter-show&quot; type=&quot;text&quot; value=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$show</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; /&gt;
				&lt;/label&gt;&lt;/p&gt;'</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;input type=&quot;hidden&quot; id=&quot;Twitter-submit&quot; name=&quot;Twitter-submit&quot; value=&quot;1&quot; /&gt;'</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
	<span style="color: #666666; font-style: italic;">// Register widget for use</span>
	register_sidebar_widget<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Twitter-favoritos'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'widgets'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'widget_Twidget_Favoritos'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Register settings for use, 300x200 pixel form</span>
	register_widget_control<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Twitter-favoritos'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'widgets'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'widget_Twidget_control'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">300</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">200</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Run code and init</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'widgets_init'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'widget_Twidget_Favoritos_init'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Las instrucciones de instalación son de lo más simple:</p>
<p>1. Copiar el archivo superior (twitter-widget-favoritos.php) en <em>/wp-content/plugins/widgets</em> (si no existe la carpeta, la crearemos).<br />
2. Activar el plugin en el menú <em>plugins</em> de wordpress<br />
3. Añadir el widget a la barra lateral en el menú <em>widgets</em> de wordpress y rellenar el menú con el id del usuario (por ejemplo, <em>bibliouz</em>).</p>
<p>Lo he testeado y funciona a la perfección con el tema <a href="http://newwpthemes.net/comfy/">WP Comfy</a> en <b>wordpress 3.0.4</em></p>
<p>Podéis consultar <a href="http://apiwiki.twitter.com/w/page/22554703/Twitter-REST-API-Method:-favorites">La API de favoritos de twitter</a> y la del <a href="http://dev.twitter.com/doc/get/statuses/user_timeline">statuses/user_timeline</a> o a <a href="http://search.twitter.com/api/">API de búsquedas</a> para más detalles.</p>
<p>Si queréis saber más sobre la creación de widgets para wordpress podéis hacerlo <a href="http://www.entrecodigos.com/2009/01/como-crear-un-widget-de-wordpress.html">en este sencillo manual</a></p>
<p>Related posts:<ol>
<li><a href='http://www.leccionespracticas.com/php/anadir-meta-informacion-a-wordpress/' rel='bookmark' title='Añadir meta-información a wordpress'>Añadir meta-información a wordpress</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/wordpress/wordpress-wp-postviews-en-espanol-resuelto/' rel='bookmark' title='WordPress WP-Postviews en español [RESUELTO]'>WordPress WP-Postviews en español [RESUELTO]</a></li>
<li><a href='http://www.leccionespracticas.com/vufind-2/vufind-mostrar-informacion-de-reservas-en-los-registros/' rel='bookmark' title='vufind: mostrar información de reservas en los registros'>vufind: mostrar información de reservas en los registros</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leccionespracticas.com/php/widget-para-wordpress-mostrar-los-twitts-favoritos-de-tu-cuenta-twitter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wordpress anti-spam plugins, captchas and more</title>
		<link>http://www.leccionespracticas.com/informatica-web/wordpress/wordpress-anti-spam-plugins-captchas-and-more/</link>
		<comments>http://www.leccionespracticas.com/informatica-web/wordpress/wordpress-anti-spam-plugins-captchas-and-more/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 06:50:40 +0000</pubDate>
		<dc:creator>Miguel</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[anti-spam]]></category>
		<category><![CDATA[captcha]]></category>
		<category><![CDATA[captchas]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[PWNTcha]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[test]]></category>
		<category><![CDATA[top10]]></category>

		<guid isPermaLink="false">http://www.leccionespracticas.com/?p=832</guid>
		<description><![CDATA[My blog (wordpress) is registering a lot of spam comments recently. Therefore I made a small comparision between several wordpress plugins to avoid spam. The test included all of the Top 10 wordpress anti spam plugins and I ended up installing Math Comment Spam Protection. It seems to deal fine with this annoying spam comments [...]
Related posts:<ol>
<li><a href='http://www.leccionespracticas.com/informatica-web/wordpress/wordpress-remove-category-and-other-permalinks-changes/' rel='bookmark' title='WordPress: remove /category'>WordPress: remove /category</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/google-analytics-en-wordpress/' rel='bookmark' title='Google Analytics en WordPress'>Google Analytics en WordPress</a></li>
<li><a href='http://www.leccionespracticas.com/php/widget-para-wordpress-mostrar-los-twitts-favoritos-de-tu-cuenta-twitter/' rel='bookmark' title='Widget para wordpress: mostrar los twitts favoritos de tu cuenta twitter'>Widget para wordpress: mostrar los twitts favoritos de tu cuenta twitter</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>My blog (<b>wordpress</b>) is registering a lot of <b>spam comments</b> recently. Therefore I made a small comparision between several <b>wordpress plugins</b> to avoid spam. </p>
<p>The test included all of the <a href="http://www.net-security.org/article.php?id=987&#038;p=2"><b>Top 10 wordpress anti spam plugins</b></a> and I ended up installing <em><b>Math Comment Spam Protection</b></em>. It seems to deal fine with this annoying spam comments <img src='http://www.leccionespracticas.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>IMHO the <b>image-based anti spam systems</b> (also known as <em>captchas</em>) are not very useful since several projects (like <a href="http://caca.zoy.org/wiki/PWNtcha">PWNtcha</a>) have no difficulties in extracting the text from that images.</p>
<p>So, let&#8217;s go a step further and hope this captcha-generatos will not be able to resolve simple math questions&#8230; for a long time <img src='http://www.leccionespracticas.com/wp-includes/images/smilies/icon_cool.gif' alt='8-)' class='wp-smiley' /> </p>
<p>Related posts:<ol>
<li><a href='http://www.leccionespracticas.com/informatica-web/wordpress/wordpress-remove-category-and-other-permalinks-changes/' rel='bookmark' title='WordPress: remove /category'>WordPress: remove /category</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/google-analytics-en-wordpress/' rel='bookmark' title='Google Analytics en WordPress'>Google Analytics en WordPress</a></li>
<li><a href='http://www.leccionespracticas.com/php/widget-para-wordpress-mostrar-los-twitts-favoritos-de-tu-cuenta-twitter/' rel='bookmark' title='Widget para wordpress: mostrar los twitts favoritos de tu cuenta twitter'>Widget para wordpress: mostrar los twitts favoritos de tu cuenta twitter</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leccionespracticas.com/informatica-web/wordpress/wordpress-anti-spam-plugins-captchas-and-more/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Aumentar el tráfico a tu sitio web: AddThis</title>
		<link>http://www.leccionespracticas.com/informatica-web/wordpress/aumentar-el-trafico-a-tu-sitio-web-addthis/</link>
		<comments>http://www.leccionespracticas.com/informatica-web/wordpress/aumentar-el-trafico-a-tu-sitio-web-addthis/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 10:37:46 +0000</pubDate>
		<dc:creator>Miguel</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[addthis]]></category>
		<category><![CDATA[aumentar trafico]]></category>
		<category><![CDATA[bookmark]]></category>
		<category><![CDATA[favoritos]]></category>
		<category><![CDATA[page rank]]></category>
		<category><![CDATA[SEF]]></category>
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://www.leccionespracticas.com/?p=579</guid>
		<description><![CDATA[Muchos usuarios me preguntan cómo aumentar el tráfico a su sitio web. Para ello, además de tener una página bien construida (DTD&#8217;s validados), usar url&#8217;s SEF, etc, debemos realizar labores de promoción y fidelización del lector. (Te recomiendo la lectura de mi anterior artículo de mejora de posicionamiento) Una buen forma de promoción para tu [...]
Related posts:<ol>
<li><a href='http://www.leccionespracticas.com/informatica-web/joomla-informatica-web/addthis-plugin-for-joomla-1-5/' rel='bookmark' title='AddThis plugin for joomla 1.5'>AddThis plugin for joomla 1.5</a></li>
<li><a href='http://www.leccionespracticas.com/php/widget-para-wordpress-mostrar-los-twitts-favoritos-de-tu-cuenta-twitter/' rel='bookmark' title='Widget para wordpress: mostrar los twitts favoritos de tu cuenta twitter'>Widget para wordpress: mostrar los twitts favoritos de tu cuenta twitter</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/joomla-informatica-web/personalizar-la-pagina-de-el-sitio-esta-desactivado-por-tareas-de-mantenimiento/' rel='bookmark' title='Personalizar la página de &#8220;El sitio está desactivado por tareas de mantenimiento&#8221;'>Personalizar la página de &#8220;El sitio está desactivado por tareas de mantenimiento&#8221;</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Muchos usuarios me preguntan cómo <b>aumentar el tráfico</b> a su sitio web. Para ello, además de tener una página bien construida (DTD&#8217;s validados), usar url&#8217;s SEF, etc, debemos realizar labores de promoción y fidelización del lector. (Te recomiendo la lectura de <a href="http://www.leccionespracticas.com/informatica-utilidades-internet/posicionamiento-en-google-ii/">mi anterior artículo de mejora de posicionamiento</a>)</p>
<p>Una buen forma de promoción para tu sitio web pasa por ofrecer a tus lectores la posibilidad de añadir tu página a favoritos, o compartir las noticias (digg, twitter, etc). Existe un servicio, llamado <a href="http://www.addthis.com">addthis.com</a>, que es idóneo para ello.</p>
<p>Cuando colocas el botón de AddThis en tu sitio web, automáticamente determina la URL de tu página. Cuando los visitantes hacen click en este botón, éste les lleva a una página que permite elegir qué servicio de favoritos prefieren utilizar. </p>
<p>Como veréis, utilizo el botón de AddThis a lo largo de toda mi página. Si ofreces contenidos interesantes, existe un enorme mercado de lectores que querrán añadirte a favoritos, y esto generará miles de enlaces a tu sitio web y aumentará de forma considerable tu ranking. </p>
<h3>Añadiendo este botón a tu blog WordPress</h3>
<p>Puedes añadir AddThis como plugin o como widget.</p>
<p>Como plugin: entra en la sección de plugins &#8211; Add new y busca <i>AddThis</i>. Instálalo y actívalo. Fácil, sencillo y para toda la familia <img src='http://www.leccionespracticas.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Como widget: entra a AddThis y rellena el formulario para darte de alta. Éste te proporcionará un código fuente, que debes copiar (Control+V). Después accede al panel de administración de WordPress, más en concreto a la sección de Apariencia (Appearance) y pulsa sobre Widgets. Crea un nuevo Widget de texto e inserta el código AddThis, que debería ser algo asi:</p>
<p><code></p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;!-- AddThis Button BEGIN --&gt;
&lt;div&gt;&lt;a href=&quot;http://www.addthis.com/bookmark.php?v=250&quot; title=&quot;Bookmark and Share&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://s7.addthis.com/static/btn/lg-bookmark-en.gif&quot; width=&quot;125&quot; height=&quot;16&quot; alt=&quot;Bookmark and Share&quot; style=&quot;border:0&quot;/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;!-- AddThis Button END --&gt;</pre></div></div>

<p></code></p>
<p>¿Te ha parecido interesante el artículo? Añádenos como favorito!<!-- AddThis Button BEGIN --></p>
<div><a href="http://www.addthis.com/bookmark.php?v=250" title="Bookmark and Share" target="_blank"><img src="http://s7.addthis.com/static/btn/lg-bookmark-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a></div>
<p><!-- AddThis Button END --></p>
<p>Related posts:<ol>
<li><a href='http://www.leccionespracticas.com/informatica-web/joomla-informatica-web/addthis-plugin-for-joomla-1-5/' rel='bookmark' title='AddThis plugin for joomla 1.5'>AddThis plugin for joomla 1.5</a></li>
<li><a href='http://www.leccionespracticas.com/php/widget-para-wordpress-mostrar-los-twitts-favoritos-de-tu-cuenta-twitter/' rel='bookmark' title='Widget para wordpress: mostrar los twitts favoritos de tu cuenta twitter'>Widget para wordpress: mostrar los twitts favoritos de tu cuenta twitter</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/joomla-informatica-web/personalizar-la-pagina-de-el-sitio-esta-desactivado-por-tareas-de-mantenimiento/' rel='bookmark' title='Personalizar la página de &#8220;El sitio está desactivado por tareas de mantenimiento&#8221;'>Personalizar la página de &#8220;El sitio está desactivado por tareas de mantenimiento&#8221;</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leccionespracticas.com/informatica-web/wordpress/aumentar-el-trafico-a-tu-sitio-web-addthis/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

