<?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>Bufa Webmaster</title>
	<atom:link href="http://www.bufa.es/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bufa.es</link>
	<description>Recursos web en español</description>
	<lastBuildDate>Tue, 31 Jan 2012 23:47:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>WordPress: cambiar slug permalink &#8220;author&#8221;</title>
		<link>http://www.bufa.es/wordpress-cambiar-slug-author/</link>
		<comments>http://www.bufa.es/wordpress-cambiar-slug-author/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 23:45:26 +0000</pubDate>
		<dc:creator>Jorge Maiden</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[author.php]]></category>

		<guid isPermaLink="false">http://www.bufa.es/?p=1609</guid>
		<description><![CDATA[Es posible que os interese cambiar las url de los autores de wordpress. Los enlaces permanentes (permalink) de las páginas de autor (author.php) son del tipo: http://www.bufa.es/author/NOMBRE_AUTOR Para cambiar el slug de por defecto &#8220;author&#8221; por cualquier otra dirección o ...]]></description>
			<content:encoded><![CDATA[<p>Es posible que os interese cambiar las url de los autores de wordpress. Los enlaces permanentes (permalink) de las páginas de autor (<strong>author.php</strong>) son del tipo:</p>
<p><em>http://www.bufa.es/author/NOMBRE_AUTOR</em></p>
<p>Para cambiar el slug de por defecto &#8220;author&#8221; por cualquier otra dirección o nombre podemos hacerlo de la siguiente manera, en este ejemplo, lo vamos a utilizar para poner el <strong>slug</strong> en español (http://www.bufa.es/usuario/NOMBRE_AUTOR).</p>
<p>Insertar el siguiente código en vuestro archivo &#8220;functions.php&#8221;:</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">function</span> cambia_author_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wp_rewrite</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$wp_rewrite</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">author_base</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'usuario'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$wp_rewrite</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">author_structure</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;/&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$wp_rewrite</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">author_base</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/%author%'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; add_rewrite_rule<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'usuario/([^/]+)/?$'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'index.php?author_name=$matches[1]'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'top'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'init'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'cambia_author_permalink'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>Para cambiar el slug por cualquier otro solo tenéis que sustituir el que yo he puesto (&#8220;usuario&#8221;) en la función anterior por el que os interese.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bufa.es/wordpress-cambiar-slug-author/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress: query de determinados ID post/pages</title>
		<link>http://www.bufa.es/wordpress-query-id-post/</link>
		<comments>http://www.bufa.es/wordpress-query-id-post/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 10:34:17 +0000</pubDate>
		<dc:creator>Jorge Maiden</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[post__in]]></category>

		<guid isPermaLink="false">http://www.bufa.es/?p=1592</guid>
		<description><![CDATA[En WordPress si queremos realizar un query o consulta de uno/s determinado/s post utilizando el &#8220;ID&#8221; de estos podemos utilizar la key &#8220;post__in&#8221; y pasarle como valor un array de los id de los post que queremos listar. Un ejemplo: ...]]></description>
			<content:encoded><![CDATA[<p>En WordPress si queremos realizar un query o consulta de uno/s determinado/s post utilizando el &#8220;ID&#8221; de estos podemos utilizar la key &#8220;post__in&#8221; y pasarle como valor un array de los id de los post que queremos listar.</p>
<p>Un ejemplo:</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000088;">$ids</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1562</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">789</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// en este caso solo listo solo los post de tipo 'page' con 'id': 1562 y 789</span><br />
query_posts<span style="color: #009900;">&#40;</span><a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">'post_type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'page'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">'post__in'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$ids</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">'showposts'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">10</span><br />
<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<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><br />
&nbsp; &nbsp; <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> &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// bla, bla, bla...</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.bufa.es/wordpress-query-id-post/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: Eliminar espacios y tabulaciones entre tags</title>
		<link>http://www.bufa.es/php-eliminar-espacios-tabulaciones-tags/</link>
		<comments>http://www.bufa.es/php-eliminar-espacios-tabulaciones-tags/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 22:38:33 +0000</pubDate>
		<dc:creator>Jorge Maiden</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[cadenas]]></category>

		<guid isPermaLink="false">http://www.bufa.es/?p=1589</guid>
		<description><![CDATA[Es muy probable que en algún momento que necesiteis mostrar un determinado código html sin tabulaciones ni espacioes entre tags (ya sea para comprimir una página web, utilizarlo en javascript, o otras razones). A continuación una simple función que se ...]]></description>
			<content:encoded><![CDATA[<p>Es muy probable que en algún momento que necesiteis mostrar un determinado código html sin tabulaciones ni espacioes entre tags (ya sea para <a href="http://www.bufa.es/comprimir-codigo-html-php/">comprimir una página web</a>, utilizarlo en javascript, o otras razones).</p>
<p>A continuación una simple función que se encarga de buscar y reemplazar espacios en blanco entre etiquetas html:</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">function</span> limpiahtml<span style="color: #009900;">&#40;</span><span style="color: #000088;">$codigo</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$buscar</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/\&gt;[^\S ]+/s'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'/[^\S ]+\&lt;/s'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'/(\s)+/s'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$reemplazar</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&gt;'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'&lt;'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'\\1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$codigo</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$buscar</span><span style="color: #339933;">,</span> reemplazar<span style="color: #339933;">,</span> <span style="color: #000088;">$codigo</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$codigo</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/str_replace"><span style="color: #990000;">str_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&gt; &lt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&gt;&lt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$codigo</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$codigo</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>Un ejemplo de un determinado código html con tabulaciones y espacios entre tags:</p>
<div class="codecolorer-container html4strict railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;estilo1&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/h1.html"><span style="color: #000000; font-weight: bold;">h1</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">span</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; León<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">span</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/h1.html"><span style="color: #000000; font-weight: bold;">h1</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span></div></div>
<p>Un ejemplo de como quedaría el código anterior utilizando la función php &#8220;limpiahtml&#8221;:</p>
<div class="codecolorer-container html4strict railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;estilo1&quot;</span>&gt;&lt;<a href="http://december.com/html/4/element/h1.html"><span style="color: #000000; font-weight: bold;">h1</span></a>&gt;&lt;<a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">span</span></a>&gt;</span>León<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">span</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/h1.html"><span style="color: #000000; font-weight: bold;">h1</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.bufa.es/php-eliminar-espacios-tabulaciones-tags/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Prevenir el CACHE de nuestros CSS</title>
		<link>http://www.bufa.es/prevenir-cache-css/</link>
		<comments>http://www.bufa.es/prevenir-cache-css/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 12:19:34 +0000</pubDate>
		<dc:creator>Jorge Maiden</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[cache]]></category>

		<guid isPermaLink="false">http://www.bufa.es/?p=1580</guid>
		<description><![CDATA[Un truco para prevenir el cache de los archivos CSS de nuestras páginas web montadas en php. Para evitar el problema de tener que REFRESCAR la página basta con introducirle un parámetro al archivo css, en este caso le pasamos ...]]></description>
			<content:encoded><![CDATA[<p>Un truco para prevenir el <strong>cache de los archivos CSS</strong> de nuestras páginas web montadas en <strong>php</strong>. Para evitar el problema de tener que REFRESCAR la página basta con introducirle un parámetro al archivo css, en este caso le pasamos la fecha y hora actuales con minutos y segundos para que el valor siempre sea diferente:</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;link type=&quot;text/css&quot; href=&quot;estilo.css?<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <a href="http://www.php.net/date"><span style="color: #990000;">date</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Y-m-d H:i:s'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; rel=&quot;stylesheet&quot; /&gt;</div></div>
<p>De esta forma cada vez que cargemos la página web el navegador será engañado al pensar que es un estilo nuevo.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bufa.es/prevenir-cache-css/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>CSS: dibujar triángulos</title>
		<link>http://www.bufa.es/css-dibujar-triangulos/</link>
		<comments>http://www.bufa.es/css-dibujar-triangulos/#comments</comments>
		<pubDate>Wed, 28 Dec 2011 13:01:00 +0000</pubDate>
		<dc:creator>Jorge Maiden</dc:creator>
				<category><![CDATA[CSS3]]></category>

		<guid isPermaLink="false">http://www.bufa.es/?p=1561</guid>
		<description><![CDATA[Algunos ejemplos utilizando solo código css para crear formas con aspecto de triángulo: Triangulo CSS (pico superior) .triangulo_sup &#123; &#160; &#160; width: 0; &#160; &#160; height: 0; &#160; &#160; border-left: 50px solid transparent; &#160; &#160; border-right: 50px solid transparent; &#160; ...]]></description>
			<content:encoded><![CDATA[<p>Algunos ejemplos utilizando solo código <strong>css</strong> para crear formas con aspecto de triángulo:</p>
<p>Triangulo CSS (<strong>pico superior</strong>)</p>
<style>.triangulo_sup {
        margin:0 auto 20px auto;
	width: 0;
	height: 0;
	border-left: 50px solid transparent;
	border-right: 50px solid transparent;
	border-bottom: 100px solid #000;
}</style>
<div class="triangulo_sup"></div>
<div class="codecolorer-container css railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6666ff;">.triangulo_sup</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">50px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">50px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></div>
<p>Triangulo CSS (<strong>pico inferior</strong>)</p>
<style>.triangulo_inf {
        margin:0 auto 20px auto;
	width: 0;
	height: 0;
	border-left: 50px solid transparent;
	border-right: 50px solid transparent;
	border-top: 100px solid #000;
}</style>
<div class="triangulo_inf"></div>
<div class="codecolorer-container css railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6666ff;">.triangulo_inf</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">50px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">50px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></div>
<p>Triangulo CSS (<strong>pico izquierda</strong>)</p>
<style>.triangulo_izq {
        margin:0 auto 20px auto;
	width: 0;
	height: 0;
	border-top: 50px solid transparent;
	border-right: 100px solid #000;
	border-bottom: 50px solid transparent;
}</style>
<div class="triangulo_izq"></div>
<div class="codecolorer-container css railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6666ff;">.triangulo_izq</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">50px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">50px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></div>
<p>Triangulo CSS (<strong>pico derecha</strong>)</p>
<style>.triangulo_der {
        margin:0 auto 20px auto;
	width: 0;
	height: 0;
	border-top: 50px solid transparent;
	border-left: 100px solid #000;
	border-bottom: 50px solid transparent;
}</style>
<div class="triangulo_der"></div>
<div class="codecolorer-container css railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6666ff;">.triangulo_der</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">50px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">50px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></div>
<p>Triangulo CSS (<strong>pico superior izquierdo</strong>)</p>
<style>.triangulo_top_left {
        margin:0 auto 20px auto;
	width: 0;
	height: 0;
	border-top: 100px solid #000; 
	border-right: 100px solid transparent;			
}</style>
<div class="triangulo_top_left"></div>
<div class="codecolorer-container css railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6666ff;">.triangulo_top_left</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span> <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
<span style="color: #00AA00;">&#125;</span></div></div>
<p>Triangulo CSS (<strong>pico superior derecho</strong>)</p>
<style>.triangulo_top_right {
        margin:0 auto 20px auto;
	width: 0;
	height: 0;
	border-top: 100px solid #000; 
	border-left: 100px solid transparent;			
}</style>
<div class="triangulo_top_right"></div>
<div class="codecolorer-container css railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6666ff;">.triangulo_top_right</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span> <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
<span style="color: #00AA00;">&#125;</span></div></div>
<p>Triangulo CSS (<strong>pico inferior izquierdo</strong>)</p>
<style>.triangulo_bottom_left {
        margin:0 auto 20px auto;
	width: 0;
	height: 0;
	border-bottom: 100px solid #000; 
	border-right: 100px solid transparent;				
}</style>
<div class="triangulo_bottom_left"></div>
<div class="codecolorer-container css railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6666ff;">.triangulo_bottom_left</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span> <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
<span style="color: #00AA00;">&#125;</span></div></div>
<p>Triangulo CSS (<strong>pico inferior derecho</strong>)</p>
<style>.triangulo_bottom_right {
        margin:0 auto 20px auto;
	width: 0;
	height: 0;
	border-bottom: 100px solid #000; 
	border-left: 100px solid transparent;					
}</style>
<div class="triangulo_bottom_right"></div>
<div class="codecolorer-container css railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6666ff;">.triangulo_bottom_right</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span> <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
<span style="color: #00AA00;">&#125;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.bufa.es/css-dibujar-triangulos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress: retrasar la publicación en los feed</title>
		<link>http://www.bufa.es/wordpress-retrasar-publicacion-feed/</link>
		<comments>http://www.bufa.es/wordpress-retrasar-publicacion-feed/#comments</comments>
		<pubDate>Mon, 12 Dec 2011 20:45:04 +0000</pubDate>
		<dc:creator>Jorge Maiden</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[feed]]></category>

		<guid isPermaLink="false">http://www.bufa.es/?p=1529</guid>
		<description><![CDATA[Función para retrasar unos segundos/minutos/horas la publicación en los feed de nuestras entradas/post una vez estos son publicados en WordPress. De esta manera si retrasamos por ejemplo 5 minutos la publicación (solo en los feed) nos da tiempo a revisar ...]]></description>
			<content:encoded><![CDATA[<p>Función para retrasar unos segundos/minutos/horas la publicación en los feed de nuestras entradas/post una vez estos son publicados en WordPress. De esta manera si retrasamos por ejemplo 5 minutos la publicación (solo en los feed) nos da tiempo a revisar bien si hay algún error, en url, textos&#8230; antes de que se guarde y publique la url en nuestras RSS.</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">function</span> retrasar_feed<span style="color: #009900;">&#40;</span><span style="color: #000088;">$where</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">;</span><br />
&nbsp;<br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>is_feed<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// tiempo actual </span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$ahora</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/gmdate"><span style="color: #990000;">gmdate</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Y-m-d H:i:s'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// valor que deseamos esperar</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$esperar</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'10'</span><span style="color: #339933;">;</span> <br />
&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$unidad</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'MINUTE'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// MINUTE, HOUR, DAY, WEEK, MONTH, YEAR</span><br />
&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// añadir clausala SQL a Where $where</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$where</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot; AND TIMESTAMPDIFF(<span style="color: #006699; font-weight: bold;">$unidad</span>, <span style="color: #006699; font-weight: bold;">$wpdb-&gt;posts</span>.post_date_gmt, '<span style="color: #006699; font-weight: bold;">$ahora</span>') &gt; <span style="color: #006699; font-weight: bold;">$esperar</span> &quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$where</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'posts_where'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'retrasar_feed'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.bufa.es/wordpress-retrasar-publicacion-feed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Paypal: precio total sin tasas o impuestos</title>
		<link>http://www.bufa.es/paypal-precio-total-sin-tasas/</link>
		<comments>http://www.bufa.es/paypal-precio-total-sin-tasas/#comments</comments>
		<pubDate>Thu, 08 Dec 2011 07:00:35 +0000</pubDate>
		<dc:creator>Jorge Maiden</dc:creator>
				<category><![CDATA[Paypal]]></category>

		<guid isPermaLink="false">http://www.bufa.es/?p=1553</guid>
		<description><![CDATA[Si teneis un formulario de compra de paypal en vuestra web, sabeis que paypal por defecto al usuario que realiza una compra le carga una serie de tasas o impuestos cuyo valor varia dependiendo de su pais&#8230; Bueno, si no ...]]></description>
			<content:encoded><![CDATA[<p>Si teneis un formulario de compra de paypal en vuestra web, sabeis que paypal por defecto al usuario que realiza una compra le carga una serie de <strong>tasas o impuestos</strong> cuyo valor varia dependiendo de su pais&#8230; Bueno, si no quereis que sele cobre ninguna tasa, o si quereis que se cobre la misma tasa o impuesto para todos, podeis hacerlo añadiendo el siguiente campo hidden dentro del formulario de paypal:</p>
<div class="codecolorer-container html4strict railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;hidden&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;tax&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;0.00&quot;</span>&gt;</span></div></div>
<p>En este caso le hemos puesto &#8220;0&#8243;, para que no cobre ninguna tasa.</p>
<p>Y un posible ejemplo del formulario completo podria ser el siguiente:</p>
<div class="codecolorer-container html4strict railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/form.html"><span style="color: #000000; font-weight: bold;">form</span></a> <span style="color: #000066;">target</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;paypal&quot;</span> <span style="color: #000066;">action</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;https://www.paypal.com/cgi-bin/webscr&quot;</span> <span style="color: #000066;">method</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;post&quot;</span>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;hidden&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cmd&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;_cart&quot;</span>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;hidden&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;business&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;miemail@midominio.com&quot;</span>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;hidden&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;item_name&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Mi producto&quot;</span></span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;hidden&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;item_number&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;1&quot;</span>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;hidden&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;currency_code&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;USD&quot;</span>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;hidden&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;amount&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;50.00&quot;</span>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;hidden&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;tax&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;0.00&quot;</span>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;image&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;https://www.paypal.com/es_XC/i/btn/x-click-but22.gif&quot;</span> <span style="color: #000066;">border</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Paypal&quot;</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/form.html"><span style="color: #000000; font-weight: bold;">form</span></a>&gt;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.bufa.es/paypal-precio-total-sin-tasas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Función php para decodificar caracteres a UTF-8</title>
		<link>http://www.bufa.es/funcion-php-decodificar-caracteres-utf-8/</link>
		<comments>http://www.bufa.es/funcion-php-decodificar-caracteres-utf-8/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 07:00:03 +0000</pubDate>
		<dc:creator>Jorge Maiden</dc:creator>
				<category><![CDATA[Funciones]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[str_replace]]></category>
		<category><![CDATA[UTF-8]]></category>
		<category><![CDATA[utf_unicode_ci]]></category>

		<guid isPermaLink="false">http://www.bufa.es/?p=1549</guid>
		<description><![CDATA[Si teneis problemas con los caracteres (acentos, eñes, etc&#8230;) de una cadena en php, segurmanente sea por la codificación de esos caracteres esten en latin. La siguiente función php se encarga de buscar y reemplazar (utilizando str_replace()) esos caracteres por ...]]></description>
			<content:encoded><![CDATA[<p>Si teneis problemas con los caracteres (acentos, eñes, etc&#8230;) de una cadena en php, segurmanente sea por la codificación de esos caracteres esten en latin. La siguiente función php se encarga de buscar y reemplazar (utilizando str_replace()) esos caracteres por los mismos ya codificados en UTF8.</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">function</span> decodificar_utf8<span style="color: #009900;">&#40;</span><span style="color: #000088;">$cadena</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000088;">$buscar</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <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: #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: #339933;">,</span> <span style="color: #0000ff;">'Ă'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ą'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <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: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'Ď'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Đ'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <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: #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: #339933;">,</span> <span style="color: #0000ff;">'ă'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ą'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <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: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'ď'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'đ'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <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: #339933;">,</span> <span style="color: #0000ff;">'Ę'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ě'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'Ğ'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <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: #339933;">,</span> <span style="color: #0000ff;">'İ'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <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><br />
&nbsp; &nbsp; &nbsp; &nbsp; <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: #339933;">,</span> <span style="color: #0000ff;">'ę'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ě'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'ğ'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <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: #339933;">,</span> <span style="color: #0000ff;">'ı'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <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><br />
&nbsp; &nbsp; &nbsp; &nbsp; <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><br />
&nbsp; &nbsp; &nbsp; &nbsp; <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: #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: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'Ŕ'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ř'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <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><br />
&nbsp; &nbsp; &nbsp; &nbsp; <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><br />
&nbsp; &nbsp; &nbsp; &nbsp; <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: #339933;">,</span> <span style="color: #0000ff;">'ø'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ő'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'ŕ'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ř'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <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><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'Ţ'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Ť'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <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: #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: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'Ý'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ß'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <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><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'ţ'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ť'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <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: #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: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'ý'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ÿ'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <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><br />
&nbsp; &nbsp; &nbsp; &nbsp; <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: #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: #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: #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: #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: #339933;">,</span> <span style="color: #0000ff;">'П'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Р'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <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: #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: #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: #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: #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: #339933;">,</span> <span style="color: #0000ff;">'р'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <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: #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: #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: #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: #339933;">,</span> <span style="color: #0000ff;">'Ю'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Я'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <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: #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: #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: #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: #339933;">,</span> <span style="color: #0000ff;">'ю'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'я'</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000088;">$remplazar</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'A'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'A'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'A'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'A'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'A'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'A'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'AE'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'A'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'A'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'C'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'C'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'C'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'CE'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'D'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'D'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'a'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'a'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'a'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'a'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'a'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'a'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ae'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'a'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'a'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'c'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'c'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'c'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ce'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'d'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'d'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'E'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'E'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'E'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'E'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'E'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'E'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'G'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'I'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'I'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'I'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'I'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'I'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'L'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'L'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'L'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'e'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'e'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'e'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'e'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'e'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'e'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'g'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'i'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'i'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'i'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'i'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'i'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'l'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'l'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'l'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'N'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'N'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'N'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'O'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'O'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'O'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'O'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'O'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'O'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'O'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'R'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'R'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'S'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'S'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'S'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'n'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'n'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'n'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'o'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'o'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'o'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'o'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'o'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'o'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'r'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'r'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'s'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'s'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'s'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'T'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'T'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'U'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'U'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'U'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'U'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'U'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'U'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'U'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'Y'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Y'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'Z'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Z'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Z'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'t'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'t'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'u'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'u'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'u'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'u'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'u'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'u'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'u'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'y'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'y'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'z'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'z'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'z'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'A'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'B'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'B'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'r'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'A'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'E'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'E'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'X'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'3'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'N'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'N'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'K'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'N'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'M'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'H'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'O'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'N'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'P'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'a'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'b'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'b'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'r'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'a'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'e'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'e'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'x'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'3'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'n'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'n'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'k'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'n'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'m'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'h'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'o'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'p'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'C'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'T'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Y'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'O'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'X'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'U'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'u'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'W'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'W'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'b'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'b'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'b'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'E'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'O'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'R'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'c'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'t'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'y'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'o'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'x'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'u'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'u'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'w'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'w'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'b'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'b'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'b'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'e'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'o'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'r'</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <a href="http://www.php.net/str_replace"><span style="color: #990000;">str_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$buscar</span><span style="color: #339933;">,</span> <span style="color: #000088;">$remplazar</span><span style="color: #339933;">,</span> <span style="color: #000088;">$cadena</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
<span style="color: #009900;">&#125;</span></div></div>
<p>Consejos para evitaros futuros problemas de la <strong>codificación</strong> de caracteres de vuestra base de datos <strong>MySql</strong>:</p>
<p>1. Los campos string y deben estar en utf8_spanish_ci y el cotejamiento de las tablas en utf_unicode_ci</p>
<p>2. Utilizar el siguiente meta en el <head> de vuestras pa´ginas web:</p>
<div class="codecolorer-container html4strict railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/meta.html"><span style="color: #000000; font-weight: bold;">meta</span></a> <span style="color: #000066;">http-equiv</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Content-type&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/html; charset=utf-8&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></div></div>
<p>3. Si utilizais php, insertar el siguiente código justo antes de vuestra query:</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SET NAMES 'utf8'&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.bufa.es/funcion-php-decodificar-caracteres-utf-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery: detectar país del usuario</title>
		<link>http://www.bufa.es/jquery-detectar-pais-usuario/</link>
		<comments>http://www.bufa.es/jquery-detectar-pais-usuario/#comments</comments>
		<pubDate>Mon, 05 Dec 2011 11:06:22 +0000</pubDate>
		<dc:creator>Jorge Maiden</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[wipmania]]></category>

		<guid isPermaLink="false">http://www.bufa.es/?p=1535</guid>
		<description><![CDATA[Un método bastante sencillo de para detectar el país (sin necesidad de utilizar php para averiguar su ip) del usuario que esta entrando en nuestra web es usando la API de wipmania por medio de jQuery. El método de consulta ...]]></description>
			<content:encoded><![CDATA[<p>Un método bastante sencillo de para detectar el <strong>país</strong> (sin necesidad de utilizar php para averiguar su ip) del usuario que esta entrando en nuestra web es usando la <strong>API de wipmania</strong> por medio de jQuery. El método de consulta nos devuelve unas cuantos parámetros como son: latitud, longitud, zoom, dirección, ciudad, país, códido del país, región.</p>
<p>Si introduciomos en nuestro navegador directamente la url &#8220;http://api.wipmania.com/jsonp?callback=?&#8221; ya observamos los datos que nos devuelve. Ya solo hace falta utilizar JSON para recuperarlos con jQuery de la siguiente forma:</p>
<div class="codecolorer-container javascript railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">&lt;</span>script src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;http://code.jquery.com/jquery-latest.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span><br />
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span><br />
$.<span style="color: #660066;">getJSON</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'http://api.wipmania.com/jsonp?callback=?'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'País: '</span> <span style="color: #339933;">+</span> data.<span style="color: #660066;">address</span>.<span style="color: #660066;">country</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.bufa.es/jquery-detectar-pais-usuario/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress: contar el número total de archivos de la Librería Multimedia</title>
		<link>http://www.bufa.es/wordpress-contar-numero-archivos-multimedia/</link>
		<comments>http://www.bufa.es/wordpress-contar-numero-archivos-multimedia/#comments</comments>
		<pubDate>Fri, 02 Dec 2011 06:49:23 +0000</pubDate>
		<dc:creator>Jorge Maiden</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[attachment]]></category>
		<category><![CDATA[post_count]]></category>

		<guid isPermaLink="false">http://www.bufa.es/?p=1542</guid>
		<description><![CDATA[Función para contar el total de lementos que tenemos en nuestrs librería multimedia de WordPress. En este caso voy a filtrar en un array solo las imágenes (jpg, gif, png) pero podeis filtrar por otros tipos de archivosn (pdf, dic, ...]]></description>
			<content:encoded><![CDATA[<p>Función para contar el total de lementos que tenemos en nuestrs librería multimedia de WordPress. En este caso voy a filtrar en un array solo las imágenes (jpg, gif, png) pero podeis filtrar por otros tipos de archivosn (pdf, dic, zip, etc&#8230;). Abrimos el archivo functions.php de nuestro theme y insertamos la siguiente función:</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">function</span> contar_imagenes<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$query_imagenes</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'post_type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'attachment'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'post_mime_type'</span> <span style="color: #339933;">=&gt;</span><a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'jpg|jpeg|jpe'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'image/jpeg'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'gif'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'image/gif'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'png'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'image/png'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'post_status'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'inherit'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'posts_per_page'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$query_img</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;">$query_imagenes</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$query_img</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_count</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>Y para usarla, como siembre, abrimos el archivo php de nuestro theme (index.php, single.php, sidebar.php, etc&#8230;) donde queremos mostrar el resultado y añadimos la línea php:</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span> contar_imagenes<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></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.bufa.es/wordpress-contar-numero-archivos-multimedia/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

