<?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>Pursuing the PhD &#187; Google</title>
	<atom:link href="http://diegocaro.com/category/google/feed/" rel="self" type="application/rss+xml" />
	<link>http://diegocaro.com</link>
	<description>thinking big, like the biggest</description>
	<lastBuildDate>Sat, 31 Dec 2011 20:44:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>First report for MPTT on WordPress</title>
		<link>http://diegocaro.com/first-report-for-mptt-on-wordpress/</link>
		<comments>http://diegocaro.com/first-report-for-mptt-on-wordpress/#comments</comments>
		<pubDate>Tue, 26 May 2009 19:55:39 +0000</pubDate>
		<dc:creator>diegocaro</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[GSoC2009]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[Proyectos]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[gsoc]]></category>
		<category><![CDATA[mptt]]></category>

		<guid isPermaLink="false">http://diegocaro.com/?p=352</guid>
		<description><![CDATA[This post is a report about my proposal &#8220;Implementing MPTT technique for store hierarchical data&#8221; on WordPress, at the Google Summer of Code program. If you don&#8217;t know the MPTT algorithm, you can read this article. The plan for this proposal is understand the actual way for get tree data in categories and make the [...]]]></description>
			<content:encoded><![CDATA[<p>This post is a report about my proposal &#8220;<a href="http://socghop.appspot.com/student_project/show/google/gsoc2009/wordpress/t124024916456">Implementing MPTT technique for store hierarchical data</a>&#8221; on WordPress, at the <a href="http://socghop.appspot.com/">Google Summer of Code</a> program. If you don&#8217;t know the MPTT algorithm, you can <a href="http://dev.mysql.com/tech-resources/articles/hierarchical-data.html">read this article</a>.</p>
<p>The plan for this proposal is understand the actual way for get tree data in categories and make the modifications for get/store the tree data. Later, when all has been ready for categories, add the code for pages.</p>
<p>My deliverable will be a plugin with a new Walker class that use MPTT algorithm, some functions for get data from the database, and a few modifications to the core, for attach the plugin functions.</p>
<p>In the last days, I read the code where WordPress has been using the actual way for get/store the tree data. For get that information, I used the <a href="http://phpdoc.wordpress.org/trunk/">phpdoc page of WordPress</a>.</p>
<p>The main class for get tree data is called &#8220;<a href="http://phpdoc.wordpress.org/trunk/WordPress/Walker.html">Walker</a>&#8220;. It have some subclasses that extend the function of Walker class, getting the html code for list categories, pages, etc&#8230;:</p>
<ul>
<li><a href="http://phpdoc.wordpress.org/trunk/WordPress/Walker_Category.html">Walker_Category</a></li>
<li><a href="http://phpdoc.wordpress.org/trunk/WordPress/Walker_CategoryDropdown.html">Walker_CategoryDropdown</a></li>
<li><a href="http://phpdoc.wordpress.org/trunk/WordPress/Template/Walker_Comment.html">Walker_Comment</a></li>
<li><a href="http://phpdoc.wordpress.org/trunk/WordPress/Walker_Page.html">Walker_Page</a></li>
<li><a href="http://phpdoc.wordpress.org/trunk/WordPress/Walker_PageDropdown.html">Walker_PageDropdown</a></li>
<li><a href="http://phpdoc.wordpress.org/trunk/WordPress/Administration/Walker_Category_Checklist.html">Walker_Category_Checklist</a></li>
</ul>
<p>But, these classes don&#8217;t get the data directly from the database. The way for get that data it&#8217;s calling the function get_terms (it&#8217;s was defined on the line 605, in the file /wp-includes/taxonomy.php) from another functions. These functions are (each function use a subclass of Walker class):</p>
<ul>
<li><a href="http://phpdoc.wordpress.org/trunk/WordPress/Template/_wp-includes---category-template.php.html#functionwalk_category_tree">walk_category_tree()</a></li>
<li><a href="http://phpdoc.wordpress.org/trunk/WordPress/Template/_wp-includes---category-template.php.html#functionwalk_category_dropdown_tree">walk_category_dropdown_tree()</a></li>
<li><a href="http://phpdoc.wordpress.org/trunk/WordPress/Template/_wp-includes---post-template.php.html#functionwalk_page_tree">walk_page_tree()</a></li>
<li><a href="http://phpdoc.wordpress.org/trunk/WordPress/Template/_wp-includes---post-template.php.html#functionwalk_page_dropdown_tree">walk_page_dropdown_tree()</a></li>
<li><a href="http://phpdoc.wordpress.org/trunk/WordPress/Template/_wp-includes---comment-template.php.html#functionwp_list_comments">wp_list_comments()</a></li>
<li> <a href="http://phpdoc.wordpress.org/trunk/WordPress/Comment/_wp-includes---comment.php.html#functionget_comment_pages_count">get_comment_pages_count()</a></li>
</ul>
<p>Now, I have an small idea about the actual scenario for get tree data in WordPress, but for to implement the MPTT, I need to modify the database. I add two new columns y the table &#8220;wp_terms_taxonomy&#8221; called <strong>left </strong>and <strong>right</strong>. These colums are for store the data for get the tree with some sql queries.</p>
<p>I wrote a few lines for start my plugin. It have the original get_terms function with a little modifications for get a tree data using the MPTT algorithm.</p>
<p>Old query:</p>
<blockquote><p>$query = &#8220;SELECT $select_this FROM $wpdb-&gt;terms AS t INNER JOIN $wpdb-&gt;term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ($in_taxonomies) $where ORDER BY $orderby $order $limit&#8221;;</p></blockquote>
<p>New query:</p>
<blockquote><p>$subquery = &#8220;SELECT node . * , ( COUNT( parent.term_id ) -1) AS depth<br />
FROM $wpdb-&gt;term_taxonomy AS node, $wpdb-&gt;term_taxonomy AS parent<br />
WHERE node.left BETWEEN parent.left AND parent.right<br />
GROUP BY node.term_id<br />
ORDER BY node.left&#8221;;<br />
$query = &#8220;SELECT $select_this FROM ($subquery) AS tt INNER JOIN $wpdb-&gt;terms AS t ON t.term_id = tt.term_id WHERE tt.taxonomy IN ($in_taxonomies) $where ORDER BY $orderby $order $limit&#8221;;</p></blockquote>
<p>It&#8217;s works, but it need some modifications for get the tree data with options (get a sub-tree, show only when is a not empty tree, etc&#8230;).</p>
<p>The next step is make a new Walker class for print the tree data of categories.</p>
<p>Note: if my post have a mistake, just let me know for fix it <img src='http://diegocaro.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .</p>
]]></content:encoded>
			<wfw:commentRss>http://diegocaro.com/first-report-for-mptt-on-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to develop in WordPress using Netbeans</title>
		<link>http://diegocaro.com/how-to-develop-in-wordpress-using-netbeans/</link>
		<comments>http://diegocaro.com/how-to-develop-in-wordpress-using-netbeans/#comments</comments>
		<pubDate>Tue, 12 May 2009 03:52:08 +0000</pubDate>
		<dc:creator>diegocaro</dc:creator>
				<category><![CDATA[Computación]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[GSoC2009]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[gsoc]]></category>
		<category><![CDATA[netbeans]]></category>

		<guid isPermaLink="false">http://diegocaro.com/?p=347</guid>
		<description><![CDATA[Easy, read configuring Netbeans project for WordPress and download the last beta of Netbeans 6.7 . That&#8217;s all folks.]]></description>
			<content:encoded><![CDATA[<p>Easy, read <a href="http://wiki.netbeans.org/ConfiguringNetBeansProjectForWordPress">configuring Netbeans project for WordPress</a> and <a href="http://download.netbeans.org/netbeans/6.7/beta/">download the last beta of Netbeans 6.7</a> <img src='http://diegocaro.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>That&#8217;s all folks.</p>
]]></content:encoded>
			<wfw:commentRss>http://diegocaro.com/how-to-develop-in-wordpress-using-netbeans/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Programando para WordPress gracias a Google</title>
		<link>http://diegocaro.com/programando-para-wordpress-gracias-a-google/</link>
		<comments>http://diegocaro.com/programando-para-wordpress-gracias-a-google/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 00:06:39 +0000</pubDate>
		<dc:creator>diegocaro</dc:creator>
				<category><![CDATA[Computación]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[GSoC2009]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[2009]]></category>
		<category><![CDATA[gsoc]]></category>
		<category><![CDATA[mptt]]></category>

		<guid isPermaLink="false">http://diego.bloog.cl/?p=321</guid>
		<description><![CDATA[Ésta fue LA gran semana del mes. Por fin se publicaron los resultados de las postulaciones al Google Summer of Code 2009 (GSoC2009 para los amigos). Lo mejor de todo es que ahora tendré un verano invierno de código en mi querido WordPress. Pero, ¿qué es Google Summer of Code?. Google Summer of Code es [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" align="left" title="Google" src="http://www.google.com/logos/Logo_50wht.gif" alt="" width="163" height="74" />Ésta fue LA gran semana del mes. Por fin se publicaron los <a href="http://socghop.appspot.com/program/accepted_orgs/google/gsoc2009">resultados</a> de las <a href="http://wordpress.org/development/2009/04/summer-of-code-students-announced/">postulaciones</a> al <a href="http://socghop.appspot.com/">Google Summer of Code 2009</a> (GSoC2009 para los amigos). Lo mejor de todo es que ahora tendré un <del datetime="2009-04-26T23:31:22+00:00">verano</del> invierno de código en mi querido <a href="http://wordpress.org/development/2009/04/summer-of-code-students-announced/">WordPress</a>.</p>
<p>Pero, ¿qué es Google Summer of Code?.</p>
<blockquote><p>Google Summer of Code es un programa de Google que pretende &#8220;devolver la mano&#8221; a <a href="http://socghop.appspot.com/program/accepted_orgs/google/gsoc2009">diversos proyectos y organizaciones de software libre</a>, pagando dinero a organizaciones y a estudiantes para que trabajen en un proyecto durante el verano (invierno para el hemisferio sur).</p></blockquote>
<p><img align="right" class="alignright size-medium wp-image-324" title="WordPress" src="http://diego.bloog.cl/wp-content/uploads/wp-icon-300x267.png" alt="WordPress" width="138" height="122" />Este invierno (verano para los gringos) <a href="http://socghop.appspot.com/student_project/show/google/gsoc2009/wordpress/t124024916456">estaré codificando</a> una técnica llamada <a href="http://www.sitepoint.com/print/hierarchical-data-database/">Modified Preorder Tree Traversal</a> (MPTT), que se utiliza para almacenar datos jerárquicos (ej: árboles de datos, XML, etc&#8230;) en bases de datos relacionales, en este caso, para MySQL en el proyecto <a href="http://www.wordpress.org">WordPress</a> (sí, el mismo de los blogs).</p>
<p>La técnica será implementada en el sistema de categorías y páginas, para mejorar el desempeño al agregar, mostrar y editar la jerarquía de las mismas en blogs que posean muchas categorías o páginas. La implementación actual solo almacena un vínculo a la categoría ancestra (padre), lo que se convierte finalmente en infinitas recursiones para poder extraer la jerarquía.</p>
<p>Espero en el futuro seguir escribiendo sobre mi trabajo en WordPress tanto en español, como en inglés.</p>
]]></content:encoded>
			<wfw:commentRss>http://diegocaro.com/programando-para-wordpress-gracias-a-google/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

