<?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>Macgrafic - Tutoriales de diseño gráfico, InDesign, Photoshop, Freehand, Illustrator y fotografía &#187; comentarios</title>
	<atom:link href="http://www.macgrafic.com/tag/comentarios/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.macgrafic.com</link>
	<description>MacGrafic - Tutoriales InDesign, Photoshop, Freehand, illustrator y fotografía</description>
	<lastBuildDate>Mon, 09 Aug 2010 16:29:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Combate el spam de tu Wordpress</title>
		<link>http://www.macgrafic.com/combate-el-spam-de-tu-wordpress/</link>
		<comments>http://www.macgrafic.com/combate-el-spam-de-tu-wordpress/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 16:55:53 +0000</pubDate>
		<dc:creator>Macgrafic</dc:creator>
				<category><![CDATA[Funciones]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[comentarios]]></category>
		<category><![CDATA[funciones de wordpress]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://www.macgrafic.com/?p=1953</guid>
		<description><![CDATA[Siempre son pocas las barreras que se tienen instaladas para combatir la gran cantidad de spam que recibimos en Wordpress. [...]]]></description>
			<content:encoded><![CDATA[<p>Siempre son pocas las barreras que se tienen instaladas para combatir la gran cantidad de spam que recibimos en Wordpress. Necesitamos poner todas las barreras posibles para filtrarlos. Desde ayudawordpres nos amplia una manera más, para combatirlo desde nuestro fichero <em><code>functions.php</code></em> en nuestro tema activo.<br />
<span id="more-1953"></span><br />
Añadir este código en el fichero <em><code>functions.php</code></em>:</p>
<pre class="brush: php;">

function in_comment_post_like($string, $array) {
	foreach($array as $ref) { if(strstr($string, $ref)) { return true; } }
	return false;
}
function drop_bad_comments() {
	if (!empty($_POST['comment'])) {
		$post_comment_content = $_POST['comment'];
		$lower_case_comment = strtolower($_POST['comment']);
		$bad_comment_content = array(
			'viagra',
			'hydrocodone',
			'hair loss',
			'[url=http',
			'[link=http',
			'xanax',
			'tramadol',
			'russian girls',
			'russian brides',
			'lorazepam',
			'adderall',
			'dexadrine',
			'no prescription',
			'oxycontin',
			'without a prescription',
			'sex pics',
			'family incest',
			'online casinos',
			'online dating',
			'cialis',
			'best forex',
			'amoxicillin'
		);
		if (in_comment_post_like($lower_case_comment, $bad_comment_content)) {
			$comment_box_text = wordwrap(trim($post_comment_content), 80, &quot;\n  &quot;, true);
			$txtdrop = fopen('/var/log/httpd/wp_post-logger/nullamatix.com-text-area_dropped.txt', 'a');
			fwrite($txtdrop, &quot;  --------------\n  [COMMENT] = &quot; . $post_comment_content . &quot;\n  --------------\n&quot;);
			fwrite($txtdrop, &quot;  [SOURCE_IP] = &quot; . $_SERVER['REMOTE_ADDR'] . &quot; @ &quot; . date(&quot;F j, Y, g:i a&quot;) . &quot;\n&quot;);
			fwrite($txtdrop, &quot;  [USERAGENT] = &quot; . $_SERVER['HTTP_USER_AGENT'] . &quot;\n&quot;);
			fwrite($txtdrop, &quot;  [REFERER  ] = &quot; . $_SERVER['HTTP_REFERER'] . &quot;\n&quot;);
			fwrite($txtdrop, &quot;  [FILE_NAME] = &quot; . $_SERVER['SCRIPT_NAME'] . &quot; - [REQ_URI] = &quot; . $_SERVER['REQUEST_URI'] . &quot;\n&quot;);
			fwrite($txtdrop, '--------------**********------------------'.&quot;\n&quot;);
			header(&quot;HTTP/1.1 406 Not Acceptable&quot;);
			header(&quot;Status: 406 Not Acceptable&quot;);
			header(&quot;Connection: Close&quot;);
			wp_die( __('bang bang.') );
		}
	}
}
add_action('init', 'drop_bad_comments');
</pre>
<p>En el array $bad_comment_content puedes añadir o quitar palabras y/o espresiones, para personalizar y ajustar tu filtrado de comentarios spam.</p>
<p>Fuente: <a title="Ayuda Wordpress" href="http://ayudawordpress.com/" target="_blank">Ayuda Wordpress</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.macgrafic.com/combate-el-spam-de-tu-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	<enclosure url="http://www.macgrafic.com/wp-content/archivos/2010/01/funcion_spam_coment-267x90.jpg" type="image/jpeg" />	</item>
	</channel>
</rss>
