<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Lecciones Prácticas</title>
	<atom:link href="http://www.leccionespracticas.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.leccionespracticas.com</link>
	<description>aprende conmigo!</description>
	<lastBuildDate>Mon, 06 Sep 2010 12:14:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Eliminar tildes con python [SOLUCIONADO]</title>
		<link>http://www.leccionespracticas.com/uncategorized/eliminar-tildes-con-python-solucionado/</link>
		<comments>http://www.leccionespracticas.com/uncategorized/eliminar-tildes-con-python-solucionado/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 11:44:26 +0000</pubDate>
		<dc:creator>Miguel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.leccionespracticas.com/?p=1382</guid>
		<description><![CDATA[Es muy probable que si programas en python te encuentres, alguna vez, con una situación en la que debes eliminar las tildes de algún texto. Esto se puede hacer fácilmente utilizando el módulo unicodedata. He creado la funcion elimina_tildes tal que asi: 1 2 3 4 5 6 7 import unicodedata def elimina_tildes&#40;s&#41;: return ''.join&#40;&#40;c [...]


Related posts:<ol><li><a href='http://www.leccionespracticas.com/uncategorized/pdftk-tildes-y-caracteres-especiales-en-metadatos-de-pdf/' rel='bookmark' title='Permanent Link: pdftk: tildes y caracteres especiales en metadatos de pdf'>pdftk: tildes y caracteres especiales en metadatos de pdf</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Es muy probable que si programas en python te encuentres, alguna vez, con una situación en la que debes <b>eliminar las tildes</b> de algún texto.</p>
<p>Esto se puede hacer fácilmente utilizando el módulo <em>unicodedata</em>.</p>
<p>He creado la funcion <em>elimina_tildes</em> tal que asi:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">unicodedata</span>
<span style="color: #ff7700;font-weight:bold;">def</span> elimina_tildes<span style="color: black;">&#40;</span>s<span style="color: black;">&#41;</span>:
   <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #483d8b;">''</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span><span style="color: black;">&#40;</span>c <span style="color: #ff7700;font-weight:bold;">for</span> c <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #dc143c;">unicodedata</span>.<span style="color: black;">normalize</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'NFD'</span>, s<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #dc143c;">unicodedata</span>.<span style="color: black;">category</span><span style="color: black;">&#40;</span>c<span style="color: black;">&#41;</span> <span style="color: #66cc66;">!</span>= <span style="color: #483d8b;">'Mn'</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># que se puede usar asi:</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #ff7700;font-weight:bold;">print</span> elimina_tildes<span style="color: black;">&#40;</span>u<span style="color: #483d8b;">&quot;córcholis&quot;</span><span style="color: black;">&#41;</span>
corcholis</pre></td></tr></table></div>

<p>Espero que os resulte útil.</p>
<p>Más detalles en <a href="http://stackoverflow.com/questions/517923/what-is-the-best-way-to-remove-accents-in-a-python-unicode-string">stackoverflow.com</a></p>


<p>Related posts:<ol><li><a href='http://www.leccionespracticas.com/uncategorized/pdftk-tildes-y-caracteres-especiales-en-metadatos-de-pdf/' rel='bookmark' title='Permanent Link: pdftk: tildes y caracteres especiales en metadatos de pdf'>pdftk: tildes y caracteres especiales en metadatos de pdf</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leccionespracticas.com/uncategorized/eliminar-tildes-con-python-solucionado/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>vBulletin: change the redirect or the url in the login process</title>
		<link>http://www.leccionespracticas.com/informatica-web/vbulletin-informatica-web/vbulletin-change-the-redirect-or-the-url-in-the-login-process/</link>
		<comments>http://www.leccionespracticas.com/informatica-web/vbulletin-informatica-web/vbulletin-change-the-redirect-or-the-url-in-the-login-process/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 10:06:19 +0000</pubDate>
		<dc:creator>Miguel</dc:creator>
				<category><![CDATA[vBulletin]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[formulario]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[redirect]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[vb]]></category>
		<category><![CDATA[vbulletin]]></category>

		<guid isPermaLink="false">http://www.leccionespracticas.com/?p=1357</guid>
		<description><![CDATA[There is a common thing for vBulletin users to want to customize the login box. This can be done by Admin CP -> Styles &#038; Templates -> Style Manager -> « » -> Navigation / Breadcrumb Templates -> navbar (Note for spanish users: Buscar Plantillas de navegación entre las plantillas, y dentro de ella, navbar) [...]


Related posts:<ol><li><a href='http://www.leccionespracticas.com/informatica-web/vbulletin-informatica-web/vbulletin-change-sticky-text-style-solved/' rel='bookmark' title='Permanent Link: vBulletin: change sticky text style [SOLVED]'>vBulletin: change sticky text style [SOLVED]</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/vbulletin-informatica-web/vbulletin-and-forms-parameters-via-post-or-get/' rel='bookmark' title='Permanent Link: vBulletin and forms: parameters via post or get'>vBulletin and forms: parameters via post or get</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/vbulletin-informatica-web/vbulletin-adsense-module-for-vbadvanced/' rel='bookmark' title='Permanent Link: vBulletin: adsense module for vBAdvanced [SOLVED]'>vBulletin: adsense module for vBAdvanced [SOLVED]</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>There is a common thing for <b>vBulletin</b> users to want to <b>customize</b> the login box.</p>
<p>This can be done by <em>Admin CP -> Styles &#038; Templates -> Style Manager -> « » -> Navigation / Breadcrumb Templates -> navbar</em> (Note for spanish users: Buscar <em>Plantillas de navegación</em> entre las plantillas, y dentro de ella, <em>navbar</em>)</p>
<p>By default, vBulletin&#8217;s login forms redirect you back to the page you were viewing. You can define your own redirection URL by adding this hidden field to the login form:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;</span>input <span style="color: #007800;"><span style="color: #7a0874; font-weight: bold;">type</span></span>=<span style="color: #ff0000;">&quot;hidden&quot;</span> <span style="color: #007800;">name</span>=<span style="color: #ff0000;">&quot;url&quot;</span> <span style="color: #007800;">value</span>=<span style="color: #ff0000;">&quot;REDIRECTION URL HERE&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></pre></div></div>

<p>The code is inserted like follows (pay attention to last lines):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">                 <span style="color: #000000; font-weight: bold;">&lt;!</span>-- <span style="color: #c20cb9; font-weight: bold;">login</span> form --<span style="color: #000000; font-weight: bold;">&gt;</span>
&nbsp;
                 <span style="color: #000000; font-weight: bold;">&lt;!</span>-- BLABLABLA a lot of html code here ... --<span style="color: #000000; font-weight: bold;">&gt;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">&lt;</span>input <span style="color: #007800;"><span style="color: #7a0874; font-weight: bold;">type</span></span>=<span style="color: #ff0000;">&quot;hidden&quot;</span> <span style="color: #007800;">name</span>=<span style="color: #ff0000;">&quot;vb_login_md5password_utf&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;</span>input <span style="color: #007800;"><span style="color: #7a0874; font-weight: bold;">type</span></span>=<span style="color: #ff0000;">&quot;hidden&quot;</span> <span style="color: #007800;">name</span>=<span style="color: #ff0000;">&quot;url&quot;</span> <span style="color: #007800;">value</span>=<span style="color: #ff0000;">&quot;REDIRECTION URL HERE&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;/</span>form<span style="color: #000000; font-weight: bold;">&gt;</span>
		<span style="color: #000000; font-weight: bold;">&lt;!</span>-- <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #c20cb9; font-weight: bold;">login</span> form --<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p>Notice you can also change the validation URL (for instance if you are having issues with <a href="http://www.vbseo.com/f4/redirecting-non-www-www-version-3856/" rel="nofollow">non-www and www</a> url&#8217;s, etc).</p>
<p>Rather than doing fancy-custom .htaccess to change URL from non-www to www you should <b>change your vbulletin Forum URL</b> following these steps:</p>
<p>- Close your board from the AdminCP<br />
- Change the Forum URL to the new URL<br />
AdminCP -> vBulletin Options -> Site Name / URL / Contact Details -> Forum URL<br />
- Reset Cookie Path &#038; Domain to default values:<br />
AdminCP -> vBulletin Options -> Cookies and HTTP Header Options</p>
<p>Next Move all the files to the new directory on your server, and re-open board. </p>


<p>Related posts:<ol><li><a href='http://www.leccionespracticas.com/informatica-web/vbulletin-informatica-web/vbulletin-change-sticky-text-style-solved/' rel='bookmark' title='Permanent Link: vBulletin: change sticky text style [SOLVED]'>vBulletin: change sticky text style [SOLVED]</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/vbulletin-informatica-web/vbulletin-and-forms-parameters-via-post-or-get/' rel='bookmark' title='Permanent Link: vBulletin and forms: parameters via post or get'>vBulletin and forms: parameters via post or get</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/vbulletin-informatica-web/vbulletin-adsense-module-for-vbadvanced/' rel='bookmark' title='Permanent Link: vBulletin: adsense module for vBAdvanced [SOLVED]'>vBulletin: adsense module for vBAdvanced [SOLVED]</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leccionespracticas.com/informatica-web/vbulletin-informatica-web/vbulletin-change-the-redirect-or-the-url-in-the-login-process/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drupal para tontos (II): urls amigables con pathauto, theming de Views, etc</title>
		<link>http://www.leccionespracticas.com/informatica-web/drupal-informatica-web/drupal-para-tontos-ii-urls-amigables-con-pathauto/</link>
		<comments>http://www.leccionespracticas.com/informatica-web/drupal-informatica-web/drupal-para-tontos-ii-urls-amigables-con-pathauto/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 08:48:00 +0000</pubDate>
		<dc:creator>Miguel</dc:creator>
				<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://www.leccionespracticas.com/?p=1339</guid>
		<description><![CDATA[Ayer os conté cómo crear content types complejos con el módulo noderefURL. Como ejemplo creamos fichas de personas con datos propios y galería de fotos relacionada. Nuestro ejemplo es muy mejorable, veamos por qué: 1. Mejorar la URL: si visitamos el nodo de ejemplo que creamos en el anterior post, veremos que la URL es [...]


Related posts:<ol><li><a href='http://www.leccionespracticas.com/informatica-web/drupal-informatica-web/drupal-para-tontos-crear-un-nuevo-content-type-compuesto-para-galeria-fotografica/' rel='bookmark' title='Permanent Link: Drupal para tontos: crear un nuevo Content Type COMPUESTO para galería fotográfica'>Drupal para tontos: crear un nuevo Content Type COMPUESTO para galería fotográfica</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/drupal-informatica-web/drupal-6-pathauto-missing-in-administer-site-configuration-solved/' rel='bookmark' title='Permanent Link: Drupal 6: pathauto missing in Administer -> Site Configuration [SOLVED]'>Drupal 6: pathauto missing in Administer -> Site Configuration [SOLVED]</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/drupal-useful-modules/' rel='bookmark' title='Permanent Link: Drupal: Useful modules'>Drupal: Useful modules</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Ayer os conté <a href="http://www.leccionespracticas.com/informatica-web/drupal-informatica-web/drupal-para-tontos-crear-un-nuevo-content-type-compuesto-para-galeria-fotografica/">cómo crear content types complejos con el módulo noderefURL</a>. Como ejemplo creamos fichas de personas con datos propios y galería de fotos relacionada. Nuestro ejemplo es muy mejorable, veamos por qué:</p>
<p>1. Mejorar la URL: si visitamos el nodo de ejemplo que creamos en el anterior post, veremos que la URL es similar a:<br />
www.tusitio.com/node/14. Esta URL es poco descriptiva. Para mejorarla usaremos los módulos <a href="http://drupal.org/project/token">Token</a>, <b>Path</b> (instalado por defecto en Drupal 6) y <a href="http://drupal.org/project/pathauto">Pathauto</a></p>
<p>2. Crear una categoría de menú para mostrar un listado de fichas: hemos creado una ficha y la hemos visto. Pero&#8230; ¿cómo veremos un listado de todas las fichas? ¿Cómo se ordenará esta visualización? ¿y si queremos tener una visualización &#8220;especial&#8221; del listado de fichas? Para ello usaremos el módulo <a href="http://drupal.org/project/views">Views</a></p>
<p>3. Crear &#8220;subcategorías&#8221; de fichas basándonos, por ejemplo, en el género. ¿Cómo añadir esta información a las fichas? Para ello usaremos el <b>Módulo Taxonomy</b> (ya instalado en Drupal 6). Si deseas puedes consultar <a href=="http://drupal.org/handbook/modules/taxonomy">este estupendo manual de taxonomy para drupal</a>.</p>
<h3>Configurando pathauto y URL&#8217;s automáticas</h3>
<p>Vamos a empezar instalando y activando todos los módulos enumerados anteriormente. A continuación vamos a ir a <em>/admin/build/path/pathauto</em> y desplegaremos los <em>Node path settings</em>. En esta sección, en <em>Patter for all Ficha paths</em> ponemos <em>fichas/[titler-raw]</em>.</p>
<p><a href="http://img34.imageshack.us/img34/7898/drup7.jpg"><img src="http://img34.imageshack.us/img34/7898/drup7.jpg" alt="pathauto drupal node path settings" width="550px" /></a></p>
<p>Para que nuestro nodo de ejemplo tenga una URL de este tipo deberemos editarlo, desplegar las <em>ULR path settings</em> y marcar <em>Automatic alias</em>. La URL del nodo será ahora del tipo <em>/ficha/miguel-martín</em>. </p>
<p><a href="http://img215.imageshack.us/img215/9584/drup8.jpg"><img src="http://img215.imageshack.us/img215/9584/drup8.jpg" width="550px" alt="pathauto drupal tilde" /></a></p>
<p>Si os fijáis, esta URL contiene una tilde. Como deseo eliminar las tildes de las URL&#8217;s, vuelvo a las opciones de pathauto y marco, en <em>General Settings</em> la opción <em>Reduce strings to letters and numbers from ASCII-96</em>. </p>
<p>Si deseo que funcionen tanto <em>/ficha/miguel-martín</em> como <em>/ficha/miguel-martin</em> deberé marcar, además, en las <em>Update action</em> de <em>General Settings</em>, la opción <em>Create a new alias. Leave the existing alias functioning</em>.</p>
<p><a href="http://img227.imageshack.us/img227/513/drup9.jpg"><img src="http://img227.imageshack.us/img227/513/drup9.jpg" width="550px" alt="pathauto configuration drupal" /></a></p>
<p>Si ya tenía muchos nodos creados sin asignar url&#8217;s, puedo marcar la opción <em>Bulk generate aliases for nodes that are not aliased</em> y se generarán de forma automática estas URL&#8217;s. ¿No es genial?</p>
<h3>Creando un listado de &#8220;Fichas&#8221; usando <em>Views</em></h3>
<p>Ahora vamos a jugar con el módulo <em>Views</em> para que al insertar la url /ficha nos liste todos los nodos de este tipo. Veamos cómo (si queréis leerlo en inglés, podéis hacerlo en <a href="<http://realtech.burningbird.net/content-management/planet-drupal-entries/drupal-views-and-taxonomy-pages">este excelente tutorial</a>).</p>
<p>Empezamos yendo al menú de <em>Views</em> (<em>/admin/build/views</em>) y pulsamos <em>Add</em>. Nos solicita varios datos (ver siguiente imagen):</p>
<p><a href="http://img710.imageshack.us/img710/4111/drup11.jpg"><img src="http://img710.imageshack.us/img710/4111/drup11.jpg" alt="drupal views add new view" width="550px" /></a></p>
<p>Pulsamos Next.</p>
<p>Lo próximo que vamos a hacer es añadir campos (<em>Add Fields</em>) sobre qué deseamos mostrar. En mi caso marco:<br />
* Content-foto (field_foto) [OJO! Cuando lo añadas, la última opción es "FORMAT" y debe tener seleccionado <em>Image</em> para que la imagen se muestre como tal ]<br />
* Node: Link<br />
* Node: Path<br />
* Node: Title</p>
<p>Y pulso &#8220;add&#8221;.</p>
<p>Ahora tengo que añadir un FILTRO (<em>Filter</em>) para que esta vista sólo me muestre los nodos que me interesann.<br />
* Filtro por <em>Node Type</em> == &#8216;ficha&#8217;. (elegimos en el filtro la opción <em>Node: Type</em>)</p>
<p><a href="http://img708.imageshack.us/img708/4126/drup12.jpg"><img src="http://img708.imageshack.us/img708/4126/drup12.jpg" alt="taxonomy filter drupal" width="550px" /></a></p>
<p>A continuación hay que crear un <em>Display</em> para esta vista. Puede ser tanto una página, como un bloque, como un feed. En mi caso crearé una página (<em>Page</em>), pero perfectamente podría ser un bloque. Los matices entre página, bloque, feed, etc, los podéis leer en el manual del módulo Views. </p>
<p>Bien, pulsamos en <em>Add Display</em>. Veremos que en la parte inferior aparece la opción de darle un <em>Path</em>. Pulsamos sobre <em>None</em> y en el campo que aparece la URL, insertamos la palabra &#8216;ficha&#8217;. Se han marcado los pasos en la siguiente imagen (click para ampliarla):</p>
<p><a href="http://img691.imageshack.us/img691/6058/drup13.jpg"><img src="http://img691.imageshack.us/img691/6058/drup13.jpg" width="550px" alt="drupal views add display page" /></a></p>
<p>Además, si nos fijamos, aparece la <b>consulta (<em>query</em>) mysql</b> que genera esta vista. En mi caso la consulta es:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">SELECT node.nid AS nid,
   node_data_field_foto.field_foto_fid AS node_data_field_foto_field_foto_fid,
   node_data_field_foto.field_foto_list AS node_data_field_foto_field_foto_list,
   node_data_field_foto.field_foto_data AS node_data_field_foto_field_foto_data,
   node_data_field_foto.delta AS node_data_field_foto_delta,
   node.type AS node_type,
   node.vid AS node_vid,
   node.title AS node_title
 FROM drup_node node 
 LEFT JOIN drup_content_field_foto node_data_field_foto ON node.vid = node_data_field_foto.vid
 WHERE node.type <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'ficha'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>También aparece una previsualización (<em>preview</em>) de cómo se ve el resultado de la ficha:<br />
<a href="http://img696.imageshack.us/img696/5585/drup14.jpg"><img src="http://img696.imageshack.us/img696/5585/drup14.jpg" width="550px" alt="drupal views page display preview"></a></p>
<h3>Dando estilo a los <em>Page Display&#8217;s</em> creados con <em>Views</em> usando el módulo <em>Theme Developer</em></h3>
<p>Ya hemos creado nuestra nueva vista. Veamos qué aspecto tiene:</p>
<p><a href="http://img697.imageshack.us/img697/2579/drup15.jpg"><img src="http://img697.imageshack.us/img697/2579/drup15.jpg" width="550px" alt="drupal preview" /></a></p>
<p>Si os fijáis, en la parte inferior derecha aparece una ventanita negra (<em>Drupal Themer Information</em>), que forma parte del paquete <a href="http://drupal.org/node/209561">Theme Developer</a>. Este paquete resulta de mucha utilidad cuando estamos creando temas. Nos dice qué fichero está produciendo esa salida (en este caso, es el <em>views-view-fields.tpl.php</em>).</p>
<p>A continuación vamos a personalizar ese fichero. Deseamos personalizarlo SOLO para esta vista, y no para las demás. Por tanto deberemos crear un NUEVO fichero para darle el estilo que deseemos a nuestro listado de fichas. Sin embargo, aun nos queda una duda: ¿cómo nombrar a ese nuevo fichero?</p>
<p>Entre los nombres propuestos por Drupal en esta <em>View</em> para las <em>Row style output</em> elijo <em>views-view-fields&#8211;listafichas&#8211;page-1.tpl.php</em> y pulso <em>Rescan Template Files</em>. Aparecerá en negrita el nuevo fichero usado para formatear la vista:</p>
<p><a href="http://a.imageshack.us/img693/9738/drup19.jpg"><img src="http://a.imageshack.us/img693/9738/drup19.jpg" width="550px" alt="drupal views module template scan" /></a></p>
<p>Para empezar es bueno que se muestren los valores de los fields &#8220;en bruto&#8221; (el vector) y asi a partir de ahí ir jugando. Para ello, prueba el siguiente código (presta atención a las últimas líneas):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">// $Id: views-view-fields.tpl.php,v 1.6 2008/09/24 22:48:21 merlinofchaos Exp $</span>
<span style="color: #009933; font-style: italic;">/**
 * @file views-view-fields.tpl.php
 * Default simple view template to all the fields as a row.
 *
 * - $view: The view in use.
 * - $fields: an array of $field objects. Each one contains:
 *   - $field-&gt;content: The output of the field.
 *   - $field-&gt;raw: The raw data for the field, if it exists. This is NOT output safe.
 *   - $field-&gt;class: The safe class id to use.
 *   - $field-&gt;handler: The Views field handler object controlling this field. Do not use
 *     var_export to dump this object, as it can't handle the recursion.
 *   - $field-&gt;inline: Whether or not the field should be inline.
 *   - $field-&gt;inline_html: either div or span based on the above flag.
 *   - $field-&gt;separator: an optional separator that may appear before a field.
 * - $row: The raw result object from the query, with all data it fetched.
 *
 * @ingroup views_templates
 */</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$fields</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$id</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$field</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
  <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$field</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">separator</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
    <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">print</span> <span style="color: #000088;">$field</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">separator</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
  <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
  &lt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">print</span> <span style="color: #000088;">$field</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">inline_html</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span> class=&quot;views-field-<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">print</span> <span style="color: #000088;">$field</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">class</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
    <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$field</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">label</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
      &lt;label class=&quot;views-label-<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">print</span> <span style="color: #000088;">$field</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">class</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
        <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">print</span> <span style="color: #000088;">$field</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">label</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>:
      &lt;/label&gt;
    <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
      <span style="color: #000000; font-weight: bold;">&lt;?php</span>
      <span style="color: #666666; font-style: italic;">// $field-&gt;element_type is either SPAN or DIV depending upon whether or not</span>
      <span style="color: #666666; font-style: italic;">// the field is a 'block' element type or 'inline' element type.</span>
      <span style="color: #000000; font-weight: bold;">?&gt;</span>
      &lt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">print</span> <span style="color: #000088;">$field</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">element_type</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> class=&quot;field-content&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">print</span> <span style="color: #000088;">$field</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">content</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">print</span> <span style="color: #000088;">$field</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">element_type</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&gt;
  &lt;/<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">print</span> <span style="color: #000088;">$field</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">inline_html</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endforeach</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">//print print_r(array_keys(get_defined_vars()), 1);</span>
<span style="color: #666666; font-style: italic;">//print print_r(array_keys($fields))</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// O si tienes instalado el módulo developer, usa la función dpm o  dprint_r:</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;br /&gt;&quot;</span><span style="color: #339933;">.</span>dpm<span style="color: #009900;">&#40;</span><span style="color: #000088;">$fields</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;.</span><span style="color: #0000ff;">&quot;&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Esta función <em>dsm</em> nos crea una caja amarilla con la información de las variables (<em>fields</em>) que podemos usar:</p>
<p><a href="http://a.imageshack.us/img687/8461/drup20.jpg"><img src="http://a.imageshack.us/img687/8461/drup20.jpg" width="550px" alt="drupal views module dsm function" /></a></p>
<p>Por ejemplo podemos acceder a la variable <em>field_foto_fid</em>, que es la que contiene la &#8220;imagen de perfil&#8221; de la ficha con:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">print</span> <span style="color: #0000ff;">&quot;&lt;pre&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">print_r</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fields</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'field_foto_fid'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">content</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;</span></pre></div></div>

<p>&#8220;;
</pre>
<p>¡A partir de este punto las posibilidades son ilimitadas!</p>
<p>En vez de escribir un rollo enorme, podéis ver este completo screencast sobre theming con views.</p>
<p><embed src="http://blip.tv/play/AYGOp2AC" type="application/x-shockwave-flash" width="480" height="300" allowscriptaccess="always" allowfullscreen="true"></embed></p>


<p>Related posts:<ol><li><a href='http://www.leccionespracticas.com/informatica-web/drupal-informatica-web/drupal-para-tontos-crear-un-nuevo-content-type-compuesto-para-galeria-fotografica/' rel='bookmark' title='Permanent Link: Drupal para tontos: crear un nuevo Content Type COMPUESTO para galería fotográfica'>Drupal para tontos: crear un nuevo Content Type COMPUESTO para galería fotográfica</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/drupal-informatica-web/drupal-6-pathauto-missing-in-administer-site-configuration-solved/' rel='bookmark' title='Permanent Link: Drupal 6: pathauto missing in Administer -> Site Configuration [SOLVED]'>Drupal 6: pathauto missing in Administer -> Site Configuration [SOLVED]</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/drupal-useful-modules/' rel='bookmark' title='Permanent Link: Drupal: Useful modules'>Drupal: Useful modules</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leccionespracticas.com/informatica-web/drupal-informatica-web/drupal-para-tontos-ii-urls-amigables-con-pathauto/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Drupal para tontos: crear un nuevo Content Type COMPUESTO para galería fotográfica</title>
		<link>http://www.leccionespracticas.com/informatica-web/drupal-informatica-web/drupal-para-tontos-crear-un-nuevo-content-type-compuesto-para-galeria-fotografica/</link>
		<comments>http://www.leccionespracticas.com/informatica-web/drupal-informatica-web/drupal-para-tontos-crear-un-nuevo-content-type-compuesto-para-galeria-fotografica/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 12:38:19 +0000</pubDate>
		<dc:creator>Miguel</dc:creator>
				<category><![CDATA[Drupal]]></category>
		<category><![CDATA[cck]]></category>
		<category><![CDATA[content type]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[galería de imágenes]]></category>
		<category><![CDATA[image gallery]]></category>
		<category><![CDATA[imagefield]]></category>
		<category><![CDATA[tipos complejos]]></category>

		<guid isPermaLink="false">http://www.leccionespracticas.com/?p=1308</guid>
		<description><![CDATA[Hoy os voy a explicar cómo crear nuevos Content Types complejos. ¿Para qué sirve esto? Imagina que quieres hacer &#8220;fichas&#8221; de usuarios, que contengan, por ejemplo: - Fotografía de perfil - URL de su página web - Texto - Galería de fotos asociada Queremos llegar a algo parecido a: Imagina, además, que la galería se [...]


Related posts:<ol><li><a href='http://www.leccionespracticas.com/informatica-web/drupal-informatica-web/drupal-para-tontos-ii-urls-amigables-con-pathauto/' rel='bookmark' title='Permanent Link: Drupal para tontos (II): urls amigables con pathauto, theming de Views, etc'>Drupal para tontos (II): urls amigables con pathauto, theming de Views, etc</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/drupal-informatica-web/drupal-an-image-thumbnail-was-not-able-to-be-created-solved/' rel='bookmark' title='Permanent Link: Drupal: &#8216;an image thumbnail was not able to be created&#8217; [SOLVED]'>Drupal: &#8216;an image thumbnail was not able to be created&#8217; [SOLVED]</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/drupal-informatica-web/drupal-6-pathauto-missing-in-administer-site-configuration-solved/' rel='bookmark' title='Permanent Link: Drupal 6: pathauto missing in Administer -> Site Configuration [SOLVED]'>Drupal 6: pathauto missing in Administer -> Site Configuration [SOLVED]</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Hoy os voy a explicar cómo crear nuevos Content Types complejos. ¿Para qué sirve esto? Imagina que quieres hacer &#8220;fichas&#8221; de usuarios, que contengan, por ejemplo:<br />
- Fotografía de perfil<br />
- URL de su página web<br />
- Texto<br />
- Galería de fotos asociada</p>
<p>Queremos llegar a algo parecido a:<br />
<img src="http://img443.imageshack.us/img443/305/drup2.jpg" alt="drupal custom content type complex nodereference style css" width="550px" /></p>
<p>Imagina, además, que la galería se actualiza muy a menudo, pero no el resto de campos. O que quieres dar al usuario la opción de modificar las fotos de su galería, pero no el resto de campos. O quieres que un usuario tenga la opción de tener varias galerías, y ya tienes un <em>Content Type</em> galería que te gustaría seguir usando. O muchísimos otros casos donde queremos gestionar por separado unos datos del nodo de otros.</p>
<p>Una opción muy interesante para solventar este problema es crear <em>Content Types</em> complejos (con datos propios al nodo y &#8220;punteros&#8221; que &#8220;apuntan&#8221; a nodos de otro tipo).</p>
<h3>Módulos necesarios</h3>
<p>Para realizar los pasos que vienen a continuación es necesario tener instalados los siguientes módulos en Drupal. El orden en que los pongo es el orden en que los instalé yo (si no tienes ni idea, <a href="http://www.drupalweb.com/instalarmodulo">aqui puedes ver cómo instalar un módulo drupal</a>):</p>
<ul>
<li><a href="http://drupal.org/project/cck">CCK</a>: Para poder crear <em>Custom Content Types</em></li>
<li><a href="http://drupal.org/project/filefield">FileField</a>, <a href="http://drupal.org/project/imageapi">ImageAPI</a>, <a href="http://drupal.org/project/imagefield">ImageField</a> e <a href="">ImageCache</a>.</li>
<li><a href="http://drupal.org/project/nodereference_url">NodeReferenceURL</a>: módulo para crear referencias entre nodos.</li>
<li><a href="http://simple.puntolatinoclub.de/content/gallery-assist-download-links">Gallery Assist</a>: un módulo que implementa galerías de fotos. He instalado <em>Gallery Assist, Gallery Assist ImageCache, Gallery Assist Lightboxes</em>. En <a href="http://simple.puntolatinoclub.de/screencasts">este sitio web</a> se explica con un <em>screencast</em> cómo instalar todo esto. </li>
<li></li>
</ul>
<p>Una vez instalados todos los módulos deberemos activarlos (<em>/admin/build/modules</em>).</p>
<h3>Proceso de configuración</h3>
<p>Ya tenemos instalados, activados y en funcionamiento nuestros módulos. Ahora hay que crear el nuevo <em>Content Type</em> (<em>/admin/content/types/</em>). En mi caso, hay dos tipos de nodos que intervienen:<br />
1) Nodo &#8220;ficha&#8221;, que contendrá como <b>propios</b> los campos: url, cuerpo, foto y como puntero (<em><b>node reference</b></em>) la galería de fotos en cuestión.<br />
<img src="http://img248.imageshack.us/img248/8716/drup1.jpg" width="550px" alt="drupal custom content type" /></p>
<p>2) Nodo tipo &#8220;gallery&#8221; (contiene la galería de fotos en sí misma). Este <em>Content Type</em> se crea de forma automática al instalar <a href="http://simple.puntolatinoclub.de/content/gallery-assist">Gallery Assist</a>.</p>
<p>A la hora de crear el nodo &#8220;ficha&#8221;, los Custom Fields quedan asi (click para ampliar la imagen):<br />
<a href="http://img228.imageshack.us/img228/8097/drup3.jpg"><img src="http://img228.imageshack.us/img228/8097/drup3.jpg" alt="custom content type fields drupal" width="550px" /></a></p>
<p>En <em>Manage Fields</em> vemos el campo <em>url</em> (Type: text, Name: field_url), el campo <em>foto</em> (Type: File, Name: field_foto) y el campo <em>galleria_fotos</em> (Type: Node reference, Name: field_noderefgalleryassist). </p>
<p>Cuando creé este último campo, tuve que elegir el <em>widget</em> usado durante la creación del nodo. Hay varias opciones para este campo. Yo marco &#8216;select list&#8217;. A continuación una pequeña explicación (en inglés) sobre qué diferencias hay entre cada opción:</p>
<p><img src="http://drupaleasy.com/files/03_field_nodereference.png" /><br />
<em><br />
<u>Select list</u><br />
    if you don&#8217;t have too many nodes to choose from, this can be a great choice; the user can see all of her choices at once and make a decision on which node to reference;<br />
<u>Check boxes/radio buttons</u><br />
    if you need to refer to multiple nodes at once, checkboxes can help; and/or if the list of possibilities is even smaller than needed for a select list (5 to 9 at most), then radio buttons may be your choice;<br />
<u>Autocomplete</u><br />
    this widget works very similar to a freetagging taxonomy selector or the Authored by: field at the bottom of a node form; you start typing, and Drupal will display a list of node titles that match the text you entered; you often only need to type a few letters to find exactly what you need, however, this requires the user to have some idea of what she is looking for; you also have the option to choose whether to search inside the node&#8217;s titles, or only at the beginning;<br />
</em></p>
<p>También deberé seleccionar el &#8220;tipo de contenidos que pueden ser referenciados&#8221; (<em>Content types that can be referenced</em>) y elijo &#8220;gallery&#8221;. El menú que nos permite realizar esta selección es similar a:<br />
<img src="http://drupaleasy.com/files/04_node_type.png" /></p>
<p>En <em>Display Fields</em> del tipo de nodo &#8220;ficha&#8221; (<em>admin/content/node-type/ficha/display</em>), prestemos especial atención al Field <em>galleria_fotos</em>, en especial al parámetro <em>Full node</em>, que debe tener seleccionado <em>Teaser</em>. Esto hace que nuestra galería G1 se muestre completa en la &#8220;Ficha&#8221; F1 con la que guarda relación. Más información sobre esto <a href="http://drupaleasy.com/blogs/ryanprice/2009/08/theming-nodereference-or-reusing-complex-data-drupal">en el manual de theming complex data drupal</a>.</p>
<p><a href="http://img153.imageshack.us/img153/250/drup4.jpg"><img src="http://img153.imageshack.us/img153/250/drup4.jpg" alt="drupal complex data" width="550px" /></a></p>
<h3>Creando nodos de ejemplo de tipo &#8220;ficha&#8221; y &#8220;gallery&#8221;</h3>
<p>A continuación vamos a crear un nuevo nodo &#8220;Ficha&#8221; con una &#8220;gallery&#8221; asociada. Para ello primero creo la &#8220;gallery&#8221;, subo las fotos y guardo el nodo. Después creo una nueva &#8220;Ficha&#8221;, relleno los campos y selecciono de la lista de opciones la galería que deso enlazar a esta &#8220;ficha&#8221;.</p>
<p>Al final tendréis algo asi:<br />
<a href="http://img94.imageshack.us/img94/4103/drup5.jpg"><img src="http://img94.imageshack.us/img94/4103/drup5.jpg" alt="drupal custom types" width="550px" /></a></p>
<h3>Dándole estilo</h3>
<p>Si habéis seguido los consejos hasta este punto, y no teneis customizada la plantilla de mostrar nodos, veréis algo asi:<br />
<a href="http://img339.imageshack.us/img339/909/drup6.jpg"><img src="http://img339.imageshack.us/img339/909/drup6.jpg" width="550px" /></a></p>
<p>Sí, sale, pero no como queremos. Por ello voy a crear dos plantillas personalizadas (<em>custom templates</em>) para mostrar los contenidos como yo deseo, una para la &#8220;ficha&#8221; y otra para la &#8220;gallery&#8221;.</p>
<p><b>* Plantilla para la galería: en <em>/themes/garland/node-gallery_assist.tpl.php</em></b> con el siguiente contenido:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">// $Id: node.tpl.php,v 1.5 2007/10/11 09:51:29 goba Exp $</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
  &lt;div class=&quot;content clear-block&quot;&gt;
    <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">print</span> <span style="color: #000088;">$content</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
  &lt;/div&gt;</pre></td></tr></table></div>

<p><b>* Plantilla para la ficha: en <em>/themes/garland/node-ficha.tpl.php</em></b> con el siguiente contenido:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">// $Id: node-ficha.tpl.php,v 1.0 2010/07/05 08:39:36 miguelm Exp $</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;h2 class=&quot;title&quot;&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">print</span> <span style="color: #000088;">$node_url</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">print</span> <span style="color: #000088;">$title</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;&lt;/h2&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&lt;div id=&quot;maincontainer&quot; style=&quot;margin-left: 50px;&quot;&gt;
  &lt;br /&gt;
  &lt;!-- para poner algo en la zona superior 
  &lt;div id=&quot;topsection&quot;&gt;
    &lt;div class=&quot;innertube&quot;&gt;&lt;h1&gt;CSS Liquid Layout #2.1- (Fixed-Fluid)&lt;/h1&gt;&lt;/div&gt;
  &lt;/div&gt;--&gt;
&nbsp;
  &lt;div id=&quot;contentwrapper&quot; style=&quot;float: left; width: 100%;&quot;&gt;
    &lt;div id=&quot;contentcolumn&quot; style=&quot;margin-left: 200px; &gt;
      &lt;div class=&quot;innertube&quot; style=&quot;margin:10px&quot;&gt;
      <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #666666; font-style: italic;">/* para mostrar el cuerpo del nodo */</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">content</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'body'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'#value'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&nbsp;
  &lt;div id=&quot;leftcolumn&quot; style=&quot;float: left; width: 200px; margin-left: -100%; font-size:&quot;&gt;
    &lt;div class=&quot;innertube&quot;&gt;
      <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #666666; font-style: italic;">/* para mostrar la imagen del campo field_foto */</span><span style="color: #b1b100;">echo</span> theme<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'imagefield_image'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_foto</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'width'</span> <span style="color: #339933;">=&gt;</span>  <span style="color: #0000ff;">'200'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$getsize</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
      &lt;br /&gt;
      <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #666666; font-style: italic;">/* para mostrar la URL */</span> <span style="color: #b1b100;">echo</span> l<span style="color: #009900;">&#40;</span>t<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Visita la web de '</span><span style="color: #339933;">.</span><span style="color: #000088;">$title</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_url</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'safe'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'class'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'active'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field_noderefgalleryassist</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'view'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Ahora, si recargamos el nodo de la Ficha, veremos que queda como nosotros queríamos:<br />
<a href="http://img443.imageshack.us/img443/305/drup2.jpg"><img src="http://img443.imageshack.us/img443/305/drup2.jpg" alt="drupal custom content type complex nodereference style css" width="550px" /></a></p>
<p>Espero que os haya sido útil <img src='http://www.leccionespracticas.com/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>


<p>Related posts:<ol><li><a href='http://www.leccionespracticas.com/informatica-web/drupal-informatica-web/drupal-para-tontos-ii-urls-amigables-con-pathauto/' rel='bookmark' title='Permanent Link: Drupal para tontos (II): urls amigables con pathauto, theming de Views, etc'>Drupal para tontos (II): urls amigables con pathauto, theming de Views, etc</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/drupal-informatica-web/drupal-an-image-thumbnail-was-not-able-to-be-created-solved/' rel='bookmark' title='Permanent Link: Drupal: &#8216;an image thumbnail was not able to be created&#8217; [SOLVED]'>Drupal: &#8216;an image thumbnail was not able to be created&#8217; [SOLVED]</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/drupal-informatica-web/drupal-6-pathauto-missing-in-administer-site-configuration-solved/' rel='bookmark' title='Permanent Link: Drupal 6: pathauto missing in Administer -> Site Configuration [SOLVED]'>Drupal 6: pathauto missing in Administer -> Site Configuration [SOLVED]</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leccionespracticas.com/informatica-web/drupal-informatica-web/drupal-para-tontos-crear-un-nuevo-content-type-compuesto-para-galeria-fotografica/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CSS Layout examples</title>
		<link>http://www.leccionespracticas.com/informatica-web/css-layout-examples/</link>
		<comments>http://www.leccionespracticas.com/informatica-web/css-layout-examples/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 07:36:47 +0000</pubDate>
		<dc:creator>Miguel</dc:creator>
				<category><![CDATA[Informática - web]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[dos columnas]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[two column]]></category>

		<guid isPermaLink="false">http://www.leccionespracticas.com/?p=1306</guid>
		<description><![CDATA[Usually I find myself answering to questions like &#8220;how do I set up a two column layout with fixed/fluid width?&#8221; and so on. Well, for all of you who have issues with layouts, take a look at dynamicdrive.com. For instance, here you can find several CSS configurations for two column layouts&#8221;. Related posts:Joomla plugin and [...]


Related posts:<ol><li><a href='http://www.leccionespracticas.com/informatica-web/joomla-plugin-and-templating-how-to-know-if-you-are-in-the-frontpage/' rel='bookmark' title='Permanent Link: Joomla plugin and templating: how to know if you are in the frontpage'>Joomla plugin and templating: how to know if you are in the frontpage</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/css-how-do-you-put-a-sticky-footer-at-the-bottom-of-the-window/' rel='bookmark' title='Permanent Link: CSS: How do you put a sticky footer at the bottom of the window?'>CSS: How do you put a sticky footer at the bottom of the window?</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Usually I find myself answering to questions like &#8220;how do I set up a two column layout with fixed/fluid width?&#8221; and so on.<br />
Well, for all of you who have issues with layouts, take a look at <a href="http://www.dynamicdrive.com/style/layouts">dynamicdrive.com</a>.</p>
<p>For instance, <a href="http://www.dynamicdrive.com/style/layouts/category/C9/">here you can find several CSS configurations for two column layouts&#8221;</a>.</p>


<p>Related posts:<ol><li><a href='http://www.leccionespracticas.com/informatica-web/joomla-plugin-and-templating-how-to-know-if-you-are-in-the-frontpage/' rel='bookmark' title='Permanent Link: Joomla plugin and templating: how to know if you are in the frontpage'>Joomla plugin and templating: how to know if you are in the frontpage</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/css-how-do-you-put-a-sticky-footer-at-the-bottom-of-the-window/' rel='bookmark' title='Permanent Link: CSS: How do you put a sticky footer at the bottom of the window?'>CSS: How do you put a sticky footer at the bottom of the window?</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leccionespracticas.com/informatica-web/css-layout-examples/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Errno 13] Permission denied: &#8216;/root/.python-eggs&#8217; [SOLVED]</title>
		<link>http://www.leccionespracticas.com/informatica-web/errno-13-permission-denied-root-python-eggs-solved/</link>
		<comments>http://www.leccionespracticas.com/informatica-web/errno-13-permission-denied-root-python-eggs-solved/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 06:58:22 +0000</pubDate>
		<dc:creator>Miguel</dc:creator>
				<category><![CDATA[Informática - web]]></category>
		<category><![CDATA[cds]]></category>
		<category><![CDATA[CDS Invenio]]></category>
		<category><![CDATA[errno 13]]></category>
		<category><![CDATA[mod_python]]></category>
		<category><![CDATA[permission denied]]></category>
		<category><![CDATA[python-eggs]]></category>
		<category><![CDATA[PYTHON_EGG_CACHE]]></category>

		<guid isPermaLink="false">http://www.leccionespracticas.com/?p=1301</guid>
		<description><![CDATA[A few days ago I had to install MySQLdb. The installation is quite simple: # tar -xzvf MySQL-python-1.2.2.tar.gz # cd MySQL-python-1.2.2 # python setup.py build # python setup.py install But then I checked a page which had to use this python module (MySQLdb) and&#8230; oops, it did not work: Can't extract file(s) to egg cache [...]


Related posts:<ol><li><a href='http://www.leccionespracticas.com/informatica-utilidades-internet/python-how-do-i-check-the-variable-type-solved/' rel='bookmark' title='Permanent Link: Python: how do I check the variable type? [solved]'>Python: how do I check the variable type? [solved]</a></li>
<li><a href='http://www.leccionespracticas.com/cds-invenio/cds-invenio-bibrank-exceptions-solved/' rel='bookmark' title='Permanent Link: CDS Invenio: bibrank exceptions [SOLVED]'>CDS Invenio: bibrank exceptions [SOLVED]</a></li>
<li><a href='http://www.leccionespracticas.com/cds-invenio/cds-invenio-notice-mod_python-reimporting-module-mod_python-publisher/' rel='bookmark' title='Permanent Link: CDS-Invenio: [notice] mod_python: (Re)importing module &#8216;mod_python.publisher&#8217;'>CDS-Invenio: [notice] mod_python: (Re)importing module &#8216;mod_python.publisher&#8217;</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>A few days ago I had to install <a href="http://sourceforge.net/projects/mysql-python/">MySQLdb</a>. The installation is quite simple:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># tar -xzvf MySQL-python-1.2.2.tar.gz</span>
<span style="color: #666666; font-style: italic;"># cd MySQL-python-1.2.2</span>
<span style="color: #666666; font-style: italic;"># python setup.py build</span>
<span style="color: #666666; font-style: italic;"># python setup.py install</span></pre></div></div>

<p>But then I checked a page which had to use this python module (MySQLdb) and&#8230; oops, it did not work:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">    Can<span style="color: #ff0000;">'t extract file(s) to egg cache
    The following error occurred while trying to extract file(s) to the Python &lt;b&gt;egg cache&lt;/b&gt;:
    [Errno 13] Permission denied: '</span><span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.python-eggs<span style="color: #ff0000;">'
    The Python egg cache directory is currently set to:
    /root/.python-eggs
    Perhaps your account does not have write access to this directory? You can change the cache directory by setting the PYTHON_EGG_CACHE environment variable to point to an accessible directory.</span></pre></div></div>

<p>The problem was obviously that apache user did not have rights to write into /root/.python-eggs so the page crashed. A simple export of that variable pointing to a directory into which apache user can write will do the trick *temporarily*</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># export PYTHON_EGG_CACHE=/var/www/.python-eggs/</span></pre></div></div>

<p>But I wanted this variable to be *permanently* set to that dir&#8230; so I thought a &#8220;SetEnv&#8221; in apache configuration would do the job. But it did not.</p>
<h3>Two different fixes</h3>
<p>1) Assuming your test server runs newer Invenio with mod_wsgi, you can try <a href="http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIPythonEggs">http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIPythonEggs</a><br />
or its equivalent for mod_python. </p>
<p>2) Otherwise you can always install Python modules uncompressed, for mod_wsgi or mod_python, then the egg decompression would not be needed upon runtime, so no problem with privileges. If packages such as MySQLdb were installed as Python eggs, and the directory setup is done so that Apache user cannot decompress them upon Apache startup, an error like the one shown above is usually seen.</p>
<p>This can be solved by simply installing the problematic module uncompressed:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Python<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2.3</span><span style="color: #000000; font-weight: bold;">/</span>site-packages<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>or <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>python2.4<span style="color: #000000; font-weight: bold;">/</span>site-packages<span style="color: #000000; font-weight: bold;">/</span> or wherever your site-packages are<span style="color: #7a0874; font-weight: bold;">&#41;</span>
$ <span style="color: #c20cb9; font-weight: bold;">file</span> MySQL_python-1.2.2-py2.3-macosx-<span style="color: #000000;">10.4</span>-i386.egg
$ <span style="color: #c20cb9; font-weight: bold;">unzip</span> <span style="color: #660033;">-t</span> MySQL_python-1.2.2-py2.3-macosx-<span style="color: #000000;">10.4</span>-i386.egg
$ <span style="color: #c20cb9; font-weight: bold;">mv</span> MySQL_python-1.2.2-py2.3-macosx-<span style="color: #000000;">10.4</span>-i386.egg foo.zip
$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> MySQL_python-1.2.2-py2.3-macosx-<span style="color: #000000;">10.4</span>-i386.egg
$ <span style="color: #7a0874; font-weight: bold;">cd</span> MySQL_python-1.2.2-py2.3-macosx-<span style="color: #000000;">10.4</span>-i386.egg<span style="color: #000000; font-weight: bold;">/</span>
$ <span style="color: #c20cb9; font-weight: bold;">unzip</span> ..<span style="color: #000000; font-weight: bold;">/</span>foo.zip
$ <span style="color: #c20cb9; font-weight: bold;">rm</span> ..<span style="color: #000000; font-weight: bold;">/</span>foo.zip</pre></div></div>

<p>Working nice and smoooth <img src='http://www.leccionespracticas.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>


<p>Related posts:<ol><li><a href='http://www.leccionespracticas.com/informatica-utilidades-internet/python-how-do-i-check-the-variable-type-solved/' rel='bookmark' title='Permanent Link: Python: how do I check the variable type? [solved]'>Python: how do I check the variable type? [solved]</a></li>
<li><a href='http://www.leccionespracticas.com/cds-invenio/cds-invenio-bibrank-exceptions-solved/' rel='bookmark' title='Permanent Link: CDS Invenio: bibrank exceptions [SOLVED]'>CDS Invenio: bibrank exceptions [SOLVED]</a></li>
<li><a href='http://www.leccionespracticas.com/cds-invenio/cds-invenio-notice-mod_python-reimporting-module-mod_python-publisher/' rel='bookmark' title='Permanent Link: CDS-Invenio: [notice] mod_python: (Re)importing module &#8216;mod_python.publisher&#8217;'>CDS-Invenio: [notice] mod_python: (Re)importing module &#8216;mod_python.publisher&#8217;</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leccionespracticas.com/informatica-web/errno-13-permission-denied-root-python-eggs-solved/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Utilizando ECLIPSE para programar python en entorno git</title>
		<link>http://www.leccionespracticas.com/informatica-utilidades-internet/utilizando-eclipse-para-programar-python-en-entorno-git/</link>
		<comments>http://www.leccionespracticas.com/informatica-utilidades-internet/utilizando-eclipse-para-programar-python-en-entorno-git/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 10:06:48 +0000</pubDate>
		<dc:creator>Miguel</dc:creator>
				<category><![CDATA[Informática - utilidades internet]]></category>
		<category><![CDATA[Informática - web]]></category>
		<category><![CDATA[desarrollo]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[egit]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[programacion]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[pydev]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.leccionespracticas.com/?p=1277</guid>
		<description><![CDATA[A modo de chuleta, una vez más, os pongo los pasos necesarios para trabajar con Eclipse, EGit y PyDev. 1. Instalar Eclipse Classic. 2. Iniciar Eclipse, y deberías ver una pantalla similar a: 3. Instalar PyDev desde Eclipse. Para ello, en la pantalla anterior, pulsa sobre la flecha de la derecha. Aparecerá una pantalla de [...]


Related posts:<ol><li><a href='http://www.leccionespracticas.com/informatica-utilidades-internet/depython-a-python-decompiler/' rel='bookmark' title='Permanent Link: dePython, a python decompiler'>dePython, a python decompiler</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-utilidades-internet/python-how-do-i-check-the-variable-type-solved/' rel='bookmark' title='Permanent Link: Python: how do I check the variable type? [solved]'>Python: how do I check the variable type? [solved]</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/errno-13-permission-denied-root-python-eggs-solved/' rel='bookmark' title='Permanent Link: [Errno 13] Permission denied: &#8216;/root/.python-eggs&#8217; [SOLVED]'>[Errno 13] Permission denied: &#8216;/root/.python-eggs&#8217; [SOLVED]</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>A modo de chuleta, una vez más, os pongo los pasos necesarios para trabajar con <a href="http://www.eclipse.org/">Eclipse</a>, <a href="http://www.eclipse.org/egit/">EGit</a> y <a href="http://pydev.org/">PyDev</a>.</p>
<p><b>1. Instalar <a href="http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops/R-3.5.2-201002111343/eclipse-SDK-3.5.2-win32.zip">Eclipse Classic</a>.</b></p>
<p><b>2. Iniciar Eclipse</b>, y deberías ver una pantalla similar a:<br />
<img src="http://www.rose-hulman.edu/class/csse/resources/Eclipse/PythonImages/image003.png" alt="eclipse classic" width="550px" /></p>
<p><b>3. Instalar PyDev desde Eclipse</b>. Para ello, en la pantalla anterior, pulsa sobre la flecha de la derecha. Aparecerá una pantalla de este tipo:<br />
<img src="http://www.rose-hulman.edu/class/csse/resources/Eclipse/PythonImages/image005.png" alt="eclipse workspace"  width="550px" /></p>
<p>A continuación ve al menú <em>Help -> Install new software</em>.<br />
<img src="http://www.rose-hulman.edu/class/csse/resources/Eclipse/PythonImages/image34_01.png" alt="eclipse install new software" width="550px"  /></p>
<p>Selecciona &#8220;Add&#8221; y añade la siguiente URL en el campo &#8220;Location&#8221;:</p>
<p>http://pydev.org/updates</p>
<p><img src="http://www.rose-hulman.edu/class/csse/resources/Eclipse/PythonImages/SelectPyDevForEclipose.jpg" alt="select pydev for eclipse" width="550px"  /></p>
<p>Selecciona la opción &#8220;PyDev for Eclipse&#8221;. No selecciones la opción &#8220;PyDev Mylyn Integration&#8221;. Solo queda pulsar &#8220;siguiente, siguiente, siguiente&#8221; y reiniciar eclipse.</p>
<p><b>4. Configurar PyDev desde Eclipse</b>:<br />
Ve al menú &#8220;window -> preferences&#8221;, expande &#8220;PyDev&#8221; y selecciona &#8220;Python Interpreter&#8221;. Deberías ver algo asi:<br />
<img src="http://www.rose-hulman.edu/class/csse/resources/Eclipse/PythonImages/image34_05.png" alt="pydev configure eclipse" width="550px"  /></p>
<p>Debes añadir un nuevo intérprete, indicando la ruta donde tienes instalado python:</p>
<p><img src="http://www.rose-hulman.edu/class/csse/resources/Eclipse/PythonImages/eclipse-select-interpreter-dialog.jpg" alt="python pydev eclipse configuration" width="550px"  /></p>
<p><img src="http://www.rose-hulman.edu/class/csse/resources/Eclipse/PythonImages/SelectionNeededDialog.jpg" width="550px"  /></p>
<p>Selecciona todos MENOS el PySrc y python31.zip. Pulsa ok tantas veces como sea necesario y termina el proceso. Ya estás listo para programar en python usando eclipse.</p>
<p><b>5. Instalar EGit desde Eclipse</b><br />
El proceso para instalar egit es muy similar al descrito en el paso 3, simplemente usa la siguiente url en el campo &#8220;location&#8221;:</p>
<p>http://download.eclipse.org/egit/updates</p>
<p><b>6.  Escribiendo tu primer programa python:</b><br />
Ve al menú &#8220;Window > Open Perspective > Other&#8230;&#8221; y elige &#8220;Pydev&#8221;, entonces haz click en &#8216;ok&#8217;. Si te fijas en la esquina superior derecha verás que la perspectiva ha cambiado de &#8220;java&#8221; a &#8220;pydev&#8221;<br />
<img src="http://www.rose-hulman.edu/class/csse/resources/Eclipse/PythonImages/image029.png" alt="pydev perspective eclipse" width="450px" /></p>
<p><img src="http://www.rose-hulman.edu/class/csse/resources/Eclipse/PythonImages/image34_06.png" alt="pydev perspective eclipse" width="550px" /></p>
<p><b>7.  Creando un proyecto nuevo:</b><br />
Ve a &#8220;File > New > Pydev Project&#8221; para empezar un asistente.<br />
En la siguiente pantalla, introduce el nombre del proyecto y selecciona como tipo &#8220;python 3.0&#8243;. Asegúrate de que las opciones &#8220;create default &#8216;src&#8217; folder&#8221; y &#8220;add it to the pythonpath?&#8221; están seleccionadas. Haz click en Finish.<br />
<img src="http://www.rose-hulman.edu/class/csse/resources/Eclipse/PythonImages/NewPyDevProjectDialog.jpg" width="550px" alt="python project eclipse" /><br />
<img src="http://www.rose-hulman.edu/class/csse/resources/Eclipse/PythonImages/image027.png" width="550px" alt="python project eclipse" /></p>
<p><b>8.  Creando un módulo nuevo:</b><br />
&#8220;File → New → Pydev Module&#8221;<br />
<img src="http://www.rose-hulman.edu/class/csse/resources/Eclipse/PythonImages/image039noPackage.png" widht="550px" alt="eclipse new python module" /></p>
<p>Si miras en el &#8220;Package Explorer&#8221; verás un icono con tu nuevo fichero dentro de la carpeta &#8216;src&#8217; (carpeta que creó Eclipse cuando hiciste el proyecto en el paso anterior).<br />
<img src="http://www.rose-hulman.edu/class/csse/resources/Eclipse/PythonImages/image041noPackage.png" width="250px" alt="python package eclipse" /></p>
<p><b> 9.  Ejecución de tu primer programa:</b><br />
Vamos a hacer un &#8220;hello world&#8221; en python. Para ello simplemente escribe print(&#8216;Hello, World!&#8217;) en tu fichero. Guárdalo (ctrl+S) y para ejecutarlo, simplemente ve a &#8220;run as > python run&#8221;:<br />
<img src="http://www.rose-hulman.edu/class/csse/resources/Eclipse/PythonImages/image047.png" width="550px" alt="python program run" /></p>
<p><b> 10.  Añadir tus ficheros a repositorio GIT:</b></p>
<p>Seleccionado el proyecto que deseamos añadir, pulsamos botón derecho y &#8220;Team -> Share Project&#8221;<br />
<img src="http://wiki.eclipse.org/images/1/1d/02-TeamShareProject.png" alt="egit eclipse share project"></p>
<p>Marcamos la opción GIT y pulsamos &#8220;next&#8221;:<br />
<img src="http://wiki.eclipse.org/images/8/88/03-SelectRepositoryTypeGit.png" alt="select repository git" /></p>
<p>Seleccionamos el proyecto a añadir y pulsamos Create para crear el nuevo repositorio GIT:<br />
<img src="http://wiki.eclipse.org/images/5/57/04-SelectProjectToConfigureGitRepository.png" alt="eclipse new git repository" /></p>
<p>A continuación pulsamos &#8220;Finish&#8221;:<br />
<img src="http://wiki.eclipse.org/Image:05-CreateNewGitRepository.png" alt="eclipse new git repository finish" /></p>
<p>El proyecto está marcado ahora con el texto &#8220;[MASTER]&#8220;, que indica que los ficheros pertenecen a la rama principal del repositorio GIT. Los interrogantes al lado de algunos archivos (en la imagen los archivos .classpath y .project) indican que esos archivos no pertecen aun al repositorio git:<br />
<img src="http://wiki.eclipse.org/images/2/29/06-NewGitRepository.png" alt="master repository" /></p>
<p>Para hacer que pertenezcan (y se cambie el interrogante por un signo &#8220;+&#8221;) debemos <em>trackear</em> el proyecto. Para ello seleccionamos el proyecto, botón derecho, &#8220;Team > Track&#8221;<br />
<img src="http://wiki.eclipse.org/images/b/b6/07-AddToVersionControl.png" alt="team track git project eclipse" /></p>
<p>Es muy probable que tengamos ficheros que NO deseemos que se añadan al track. Para ello creamos un fichero llamado <em>.gitignore</em> e introducimos aquéllos ficheros que NO deseamos que pertenezcan. Imaginemos que todos ellos estan en una carpeta llamada <em>ignoredfolder</em>. Pues en el fichero .gitignore escribiremos <em>ignoredfolder</em>. A continuación añadimos <em>.gitignore</em> al control de versiones.</p>
<p>Podemos añadir exclusiones más generales (por ejemplo si nuestra configuración de una BD, nombres de usuarios y passwords estan en un fichero llamado .settings en todos nuestros proyectos, o queremos excluir todos los ficheros .zip) podemos utilizar el menu: Preferences > Team > IgnoredResources</p>
<p><img src="http://wiki.eclipse.org/images/0/0d/09-IgnoredResources.png" alt="egit ignored resources menu" /></p>
<p>Ahora debemos hacer un commit de los cambios. Para ello Team > Commit:<br />
<img src="http://wiki.eclipse.org/images/2/27/10-ClickCommit.png" alt="team commit egit eclipse" width="550px" /></p>
<p>Debes insertar un mensajes explicando tus cambios. La primera linea (separada por una linea en blanco) se convertirá en el &#8220;short log&#8221; para este commit. Por defecto el autor y el committer se cogen del fichero .gitconfig de tu directorio home del proyecto. Puedes, además, marcar &#8220;Add Signed-off-by&#8221; para añadir un tag Signed-off-by. Al enviar cambios de otros autores puede ser conveniente alterar el campo autor para insertar los datos de nombre y mail del autor. Pulsa commit para enviar los cambios.</p>
<p><img src="http://wiki.eclipse.org/images/e/ea/11-CommitDialog.png" width="550px" alt="commit changes egit eclipse" /></p>
<p>Ahora han cambiado los &#8220;+&#8221; que aparecían al lado de los archivos por otro icono:<br />
<img src="http://wiki.eclipse.org/images/e/e7/12-CommittedFiles.png" alt="changes commited egit eclipse" /></p>
<p>Para mostrar el HISTORIAL de un fichero, puedes pulsar botón derecho y luego &#8220;Team > Show Local History&#8221;:<br />
<img src="http://wiki.eclipse.org/images/f/fd/14-ResourceHistory.png" alt="resource history egit eclipse" /></p>
<p>Esto es lo básico. Podéis leer mucho más en los enlaces de abajo <img src='http://www.leccionespracticas.com/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>___________<br />
Más información sobre pydev y eclipse (en inglés) en <a href="http://www.rose-hulman.edu/class/csse/resources/Eclipse/eclipse-python-configuration.htm">http://www.rose-hulman.edu/class/csse/resources/Eclipse/eclipse-python-configuration.htm</a>.</p>
<p>Más información sobre egit para eclipse (en inglés) en <a href="http://wiki.eclipse.org/EGit">http://wiki.eclipse.org/EGit</a></p>


<p>Related posts:<ol><li><a href='http://www.leccionespracticas.com/informatica-utilidades-internet/depython-a-python-decompiler/' rel='bookmark' title='Permanent Link: dePython, a python decompiler'>dePython, a python decompiler</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-utilidades-internet/python-how-do-i-check-the-variable-type-solved/' rel='bookmark' title='Permanent Link: Python: how do I check the variable type? [solved]'>Python: how do I check the variable type? [solved]</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/errno-13-permission-denied-root-python-eggs-solved/' rel='bookmark' title='Permanent Link: [Errno 13] Permission denied: &#8216;/root/.python-eggs&#8217; [SOLVED]'>[Errno 13] Permission denied: &#8216;/root/.python-eggs&#8217; [SOLVED]</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leccionespracticas.com/informatica-utilidades-internet/utilizando-eclipse-para-programar-python-en-entorno-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Burp suite, foxy proxyand mod_rewrite</title>
		<link>http://www.leccionespracticas.com/informatica-utilidades-internet/burp-suite-foxy-proxyand-mod_rewrite/</link>
		<comments>http://www.leccionespracticas.com/informatica-utilidades-internet/burp-suite-foxy-proxyand-mod_rewrite/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 10:35:11 +0000</pubDate>
		<dc:creator>Miguel</dc:creator>
				<category><![CDATA[Informática - utilidades internet]]></category>
		<category><![CDATA[Informática - web]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[burp suite]]></category>
		<category><![CDATA[daws]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[foxy proxy]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[seguridad]]></category>

		<guid isPermaLink="false">http://www.leccionespracticas.com/?p=1261</guid>
		<description><![CDATA[Currently I am attending a workshop on Designing Secure Wep Apps and there I learned about Burp suite and Foxy proxy (standard). What is Burp Suite? Burp Suite is an integrated platform for attacking web applications. It contains all of the Burp tools with numerous interfaces between them designed to facilitate and speed up the [...]


Related posts:<ol><li><a href='http://www.leccionespracticas.com/informatica-utilidades-internet/mozbackup-the-best-way-to-migrate-backup-mozilla-and-firefox/' rel='bookmark' title='Permanent Link: mozbackup, the best way to migrate / backup mozilla and firefox'>mozbackup, the best way to migrate / backup mozilla and firefox</a></li>
<li><a href='http://www.leccionespracticas.com/uncategorized/mod_rewrite-rewritecond-rewriterule/' rel='bookmark' title='Permanent Link: mod_rewrite: RewriteCond, RewriteRule, QUERY_STRING, REQUEST_URI [GUIA RÁPIDA]'>mod_rewrite: RewriteCond, RewriteRule, QUERY_STRING, REQUEST_URI [GUIA RÁPIDA]</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Currently I am attending a workshop on Designing Secure Wep Apps and there I learned about <a href="http://portswigger.net/suite/download.html">Burp suite</a> and <a href="http://foxyproxy.mozdev.org/downloads.html">Foxy proxy (standard)</a>.</p>
<h3>What is Burp Suite?</h3>
<p>Burp Suite is an integrated platform for attacking web applications. It contains all of the Burp tools with numerous interfaces between them designed to facilitate and speed up the process of attacking an application. All tools share the same robust framework for handling HTTP requests, persistence, authentication, upstream proxies, logging, alerting and extensibility.</p>
<p>Burp Suite allows you to combine manual and automated techniques to enumerate, analyse, scan, attack and exploit web applications. The various Burp tools work together effectively to share information and allow findings identified within one tool to form the basis of an attack using another.</p>
<p>Key features unique to Burp Suite include:</p>
<p>    * Detailed analysis and rendering of requests and responses.<br />
    * One-click transfer of interesting requests between tools.<br />
    * Site map showing information accumulated about target applications in tree and table form.<br />
    * Ability to &#8220;passively&#8221; spider an application in a non-intrusive manner, with all requests originating from the user&#8217;s browser.<br />
    * Suite-level target scope configuration, driving numerous individual tool actions.<br />
    * Fully fledged web vulnerability scanner. [Pro version only]<br />
    * Ability to save and restore state. [Pro version only]<br />
    * FIPS-compliant statistical analysis of session token randomness.<br />
    * Utilities for decoding and comparing application data.<br />
    * A range of engagement tools, to make your work faster and more effective. [Pro version only]<br />
    * Suite-wide search function. [Pro version only]<br />
    * Support for custom client and server SSL certificates.<br />
    * Extensibility via the IBurpExtender interface.<br />
    * Centrally configured settings for upstream proxies, web and proxy authentication, and logging.<br />
    * Tools can run in a single tabbed window, or be detached in individual windows.<br />
    * Runs in both Linux and Windows.</p>
<h3>What is Foxy Proxy?</h3>
<p>FoxyProxy is a set of proxy management tools for Firefox, Thunderbird, Seamonkey, and Songbird. There are three editions available (basic, standard, plus). Both basic and standard are free. I use standard.</p>
<p>More coming next days!</p>


<p>Related posts:<ol><li><a href='http://www.leccionespracticas.com/informatica-utilidades-internet/mozbackup-the-best-way-to-migrate-backup-mozilla-and-firefox/' rel='bookmark' title='Permanent Link: mozbackup, the best way to migrate / backup mozilla and firefox'>mozbackup, the best way to migrate / backup mozilla and firefox</a></li>
<li><a href='http://www.leccionespracticas.com/uncategorized/mod_rewrite-rewritecond-rewriterule/' rel='bookmark' title='Permanent Link: mod_rewrite: RewriteCond, RewriteRule, QUERY_STRING, REQUEST_URI [GUIA RÁPIDA]'>mod_rewrite: RewriteCond, RewriteRule, QUERY_STRING, REQUEST_URI [GUIA RÁPIDA]</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leccionespracticas.com/informatica-utilidades-internet/burp-suite-foxy-proxyand-mod_rewrite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creando un repositorio GIT a partir de las fuentes</title>
		<link>http://www.leccionespracticas.com/informatica-sistemas-y-servidores/creando-un-repositorio-git-a-partir-de-las-fuentes/</link>
		<comments>http://www.leccionespracticas.com/informatica-sistemas-y-servidores/creando-un-repositorio-git-a-partir-de-las-fuentes/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 10:32:29 +0000</pubDate>
		<dc:creator>Miguel</dc:creator>
				<category><![CDATA[Informática - Sistemas y servidores]]></category>
		<category><![CDATA[Informática - utilidades internet]]></category>
		<category><![CDATA[Informática - web]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[desarrollo]]></category>
		<category><![CDATA[developing]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[repository]]></category>
		<category><![CDATA[sources]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://www.leccionespracticas.com/?p=1268</guid>
		<description><![CDATA[De cara al desarrollo de aplicaciones es muy interesante tener algún software de control de versiones, tipo Subversion o GIT. Os comento a modo de &#8220;chuleta&#8221; cómo hacer esto desde las fuentes. Para ello, algunas consideraciones preliminares: Servidor y SO: Linux myserver.com 2.6.18-194.3.1.el5 #1 SMP Sun May 2 04:17:42 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux [...]


Related posts:<ol><li><a href='http://www.leccionespracticas.com/informatica-utilidades-internet/acceso-apache-con-ldap-y-con-fichero-de-contrasenas/' rel='bookmark' title='Permanent Link: Protect your site with password to ldap users and not-ldap (privileged) users'>Protect your site with password to ldap users and not-ldap (privileged) users</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/hello-world-2/' rel='bookmark' title='Permanent Link: Creando sitemaps de forma automática'>Creando sitemaps de forma automática</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-sistemas-y-servidores/solved-apache-error-client-xxx-file-does-not-exist/' rel='bookmark' title='Permanent Link: [SOLVED] Apache: &#8216;[error] [client ::XXX] File does not exist:&#8217;'>[SOLVED] Apache: &#8216;[error] [client ::XXX] File does not exist:&#8217;</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>De cara al desarrollo de aplicaciones es muy interesante tener algún software de control de versiones, tipo <a href="http://es.wikipedia.org/wiki/Subversion">Subversion</a> o <a href="http://es.wikipedia.org/wiki/Git">GIT</a>.</p>
<p>Os comento a modo de &#8220;chuleta&#8221; cómo hacer esto desde las fuentes.</p>
<p>Para ello, algunas consideraciones preliminares:</p>
<p><b>Servidor y SO</b>: Linux myserver.com 2.6.18-194.3.1.el5 #1 SMP Sun May 2 04:17:42 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux<br />
<b>Archivos de código</b>: /soft/cds-invenio<br />
<b>Versión de GIT</b>:  git-1.6.6.2 (instalado desde las fuentes)</p>
<p>Asumo que la instalación de GIT es simple y podéis hacerla vosotros mismos sin ayuda. Hay muchísimos manuales indicando cómo hacerlo (usad google).</p>
<p>Una vez instalado GIT, procedemos:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Creamos el archivo de configuracion del gitweb....</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>aneto cds-invenio<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;">#vi /etc/gitweb.conf</span>
<span style="color: #666666; font-style: italic;"># ----------------------------------------------------------------------------</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># gitweb.conf</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Configuration file for the web interface to GIT.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># This file is a Perl script that is executed by the gitweb interface</span>
<span style="color: #666666; font-style: italic;"># after the defaults are set.  To override a setting, just uncomment</span>
<span style="color: #666666; font-style: italic;"># it here and set it to the appropriate value.</span>
<span style="color: #666666; font-style: italic;">#</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Core git executable to use.</span>
<span style="color: #666666; font-style: italic;"># This can just be &quot;git&quot; if your webserver has a sensible PATH.</span>
<span style="color: #666666; font-style: italic;">#our $GIT = &quot;/path/to/git&quot;;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Absolute fs-path which will be prepended to the project path.</span>
<span style="color: #666666; font-style: italic;"># This is where your GIT repositories live in.</span>
<span style="color: #666666; font-style: italic;"># ESTA VARIABLE ES FUNDAMENTAL!!!</span>
our <span style="color: #007800;">$projectroot</span> = <span style="color: #ff0000;">&quot;/soft/git&quot;</span>;
&nbsp;
<span style="color: #666666; font-style: italic;"># Target of the home link on top of all pages.</span>
<span style="color: #666666; font-style: italic;">#our $home_link = $my_uri || &quot;/&quot;;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># String of the home link on top of all pages.</span>
our <span style="color: #007800;">$home_link_str</span> = <span style="color: #ff0000;">&quot;view projects&quot;</span>;
&nbsp;
<span style="color: #666666; font-style: italic;"># Name of your site or organization to appear in page titles.</span>
<span style="color: #666666; font-style: italic;"># Replace this with something more descriptive for clearer bookmarks.</span>
<span style="color: #666666; font-style: italic;">#our $site_name = &quot;&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Filename of HTML text to include at top of each page.</span>
<span style="color: #666666; font-style: italic;"># Must be an absolute filename (i.e., not relative to htdocs).</span>
<span style="color: #666666; font-style: italic;">#our $site_header = &quot;&quot;;</span>
<span style="color: #666666; font-style: italic;"># HTML text to include at home page.</span>
<span style="color: #666666; font-style: italic;"># Must be an absolute filename (i.e., not relative to htdocs).</span>
<span style="color: #666666; font-style: italic;">#our $home_text = &quot;/gitweb/indextext.html&quot;;</span>
<span style="color: #666666; font-style: italic;"># Filename of HTML text to include at bottom of each page.</span>
<span style="color: #666666; font-style: italic;"># Must be an absolute filename (i.e., not relative to htdocs).</span>
<span style="color: #666666; font-style: italic;">#our $site_footer = &quot;&quot;;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># URI of the stylesheet to use.</span>
our <span style="color: #007800;">$stylesheet</span> = <span style="color: #ff0000;">&quot;/git/gitweb.css&quot;</span>;
<span style="color: #666666; font-style: italic;"># URI of GIT logo (72x27 size).</span>
our <span style="color: #007800;">$logo</span> = <span style="color: #ff0000;">&quot;/git/git-logo.png&quot;</span>;
<span style="color: #666666; font-style: italic;"># URI of GIT favicon, assumed to be image/png type.</span>
our <span style="color: #007800;">$favicon</span> = <span style="color: #ff0000;">&quot;/git/git-favicon.png&quot;</span>;
&nbsp;
<span style="color: #666666; font-style: italic;"># URI and label (title) of GIT logo link.</span>
<span style="color: #666666; font-style: italic;">#our $logo_url = &quot;http://git.or.cz/&quot;;</span>
<span style="color: #666666; font-style: italic;">#our $logo_label = &quot;git homepage&quot;;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Source of projects list.</span>
<span style="color: #666666; font-style: italic;">#our $projects_list = &quot;&quot;;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Show repository only if this file exists.</span>
<span style="color: #666666; font-style: italic;"># Only effective if this variable evaluates to true.</span>
<span style="color: #666666; font-style: italic;">#our $export_ok = &quot;&quot;;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Only allow viewing of repositories also shown on the overview page.</span>
<span style="color: #666666; font-style: italic;">#our $strict_export = &quot;&quot;;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># List of git base URLs used for URL to where fetch project from,</span>
<span style="color: #666666; font-style: italic;"># i.e. full URL is &quot;$git_base_url/$project&quot;</span>
<span style="color: #666666; font-style: italic;">#our @git_base_url_list = grep { $_ ne '' } (&quot;/some/url&quot;);</span>
<span style="color: #666666; font-style: italic;"># --------------------------------------------------------------------------------</span></pre></div></div>

<p>Entonces añadimos al archivo de configuración de Apache algunas líneas útiles (el directorio <em>/var/www/cgi-git/gitweb</em> y <em>/var/www/html/git</em> deben existir):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>aneto cds-invenio<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># vi /etc/httpd/conf/httpd.conf</span>
<span style="color: #666666; font-style: italic;"># Añadir:</span>
Alias <span style="color: #000000; font-weight: bold;">/</span>gitweb <span style="color: #ff0000;">&quot;/var/www/cgi-bin/gitweb/&quot;</span>
<span style="color: #000000; font-weight: bold;">&lt;</span>Directory <span style="color: #ff0000;">&quot;/var/www/cgi-bin/gitweb&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
            Options Indexes FollowSymlinks ExecCGI
            AllowOverride None
            Order allow,deny
            Allow from all
<span style="color: #000000; font-weight: bold;">&lt;/</span>Directory<span style="color: #000000; font-weight: bold;">&gt;</span>
Alias <span style="color: #000000; font-weight: bold;">/</span>git <span style="color: #ff0000;">&quot;/var/www/html/git&quot;</span>
<span style="color: #000000; font-weight: bold;">&lt;</span>Directory <span style="color: #ff0000;">&quot;/var/www/html/git&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
            Options None
            AllowOverride None
            Order allow,deny
            Allow from all
<span style="color: #000000; font-weight: bold;">&lt;/</span>Directory<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p>Y procedemos a reinicar apache y crear el nuevo repositorio GIT&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>aneto cds-invenio<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;">#/etc/init.d/httpd restart</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>aneto cds-invenio<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># cd /soft/cds-invenio</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>aneto cds-invenio<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># git init</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>aneto cds-invenio<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># git add .</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>aneto cds-invenio<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># git commit -m &quot;inicialización del repositorio&quot;</span></pre></div></div>

<p>Una vez hecho esto, editamos algunos archivos de los que GIT ha creado (añadir información a &#8216;description&#8217; y a &#8216;config&#8217;).</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>aneto cds-invenio<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># vi /soft/cds-invenio/description </span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>aneto cds-invenio<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># vi /soft/cds-invenio/config</span>
<span style="color: #660033;">--------------------------------------------------------</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>core<span style="color: #7a0874; font-weight: bold;">&#93;</span>
        repositoryformatversion = <span style="color: #000000;">0</span>
        filemode = <span style="color: #c20cb9; font-weight: bold;">true</span>
        bare = <span style="color: #c20cb9; font-weight: bold;">false</span>
        logallrefupdates = <span style="color: #c20cb9; font-weight: bold;">true</span>
        worktree = <span style="color: #000000; font-weight: bold;">/</span>soft<span style="color: #000000; font-weight: bold;">/</span>cds-invenio
        owner = <span style="color: #ff0000;">&quot;Miguel Martin&quot;</span></pre></div></div>

<p>A continuación clonamos sólo los datos de GIT en un fichero .git:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>aneto cds-invenio<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># cd /soft/cds-invenio/</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>aneto cds-invenio<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># git clone --bare cdsinvenio cdsinvenio.git</span></pre></div></div>

<p>Podemos probar a cargar en nuestro servidor esta url: http://myserver.com/cgi-bin/gitweb.cgi y ver si aparece algo&#8230; Puede que se produzcan fallos con gitweb.js si está en el directorio /cgi-bin/gitweb&#8230; si es el caso podemos editar gitweb.cgi y modificar la RUTA al gitweb.js.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Editamos el gitweb.cgi porque hay fallos en el JS:</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>aneto cds-invenio<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># vi /var/www/cgi-bin/gitweb/gitweb.cgi</span>
&nbsp;
 <span style="color: #666666; font-style: italic;"># URI of stylesheets</span>
 our <span style="color: #000000; font-weight: bold;">@</span>stylesheets = <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">&quot;/var/www/cgi-bin/gitweb/gitweb.css&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
 <span style="color: #666666; font-style: italic;"># URI of a single stylesheet, which can be overridden in GITWEB_CONFIG.</span>
 our <span style="color: #007800;">$stylesheet</span> = undef;
 <span style="color: #666666; font-style: italic;"># URI of GIT logo (72x27 size)</span>
 our <span style="color: #007800;">$logo</span> = <span style="color: #ff0000;">&quot;/var/www/cgi-bin/gitweb/git-logo.png&quot;</span>;
 <span style="color: #666666; font-style: italic;"># URI of GIT favicon, assumed to be image/png type</span>
 our <span style="color: #007800;">$favicon</span> = <span style="color: #ff0000;">&quot;/var/www/cgi-bin/gitweb/git-favicon.png&quot;</span>;
 <span style="color: #666666; font-style: italic;"># URI of gitweb.js (JavaScript code for gitweb)</span>
 our <span style="color: #007800;">$javascript</span> = <span style="color: #ff0000;">&quot;/git/gitweb.js&quot;</span>;
&nbsp;
 <span style="color: #666666; font-style: italic;"># URI and label (title) of GIT logo link</span>
 <span style="color: #666666; font-style: italic;">#our $logo_url = &quot;http://www.kernel.org/pub/software/scm/git/docs/&quot;;</span>
 <span style="color: #666666; font-style: italic;">#our $logo_label = &quot;git documentation&quot;;</span>
 our <span style="color: #007800;">$logo_url</span> = <span style="color: #ff0000;">&quot;http://git-scm.com/&quot;</span>;
 our <span style="color: #007800;">$logo_label</span> = <span style="color: #ff0000;">&quot;git homepage&quot;</span>;</pre></div></div>

<p>Y ahora copiamos el js a su lugar&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#Copiamos el Js a /var/www/html/git</span>
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>cgi-bin<span style="color: #000000; font-weight: bold;">/</span>gitweb.js <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>html<span style="color: #000000; font-weight: bold;">/</span>git<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p># Hacemos un PUSH de todo&#8230;<br />
[root@aneto teresa]# git push &#8211;all /soft/git/cdsinvenio.git</p>
<p>Y voilá! Nuestro repositorio git con todo accesible desde http://myserver.com/cgi-bin/gitweb.git</p>
<p>Algunos enlaces interesantes&#8230;<br />
<a href="http://webcache.googleusercontent.com/search?q=cache:FT8uj7TSNZIJ:gofedora.com/how-to-install-configure-gitweb/+gitweb.cgi+configuration&#038;cd=3&#038;hl=es&#038;ct=clnk&#038;gl=es&#038;client=firefox-a">link 1 (en)</a><br />
<a href="http://ianloic.com/2007/09/13/how_i_set_up_gitweb/">link 2 (en)</a><br />
<a href="http://geneura.ugr.es/~jmerelo/tutoriales/git/">link 3 (es)</a><br />
<a href="http://blog.inbatu.com/2009/01/24/crear-un-repositorio-git-remoto/">link 4 (es)</a></p>


<p>Related posts:<ol><li><a href='http://www.leccionespracticas.com/informatica-utilidades-internet/acceso-apache-con-ldap-y-con-fichero-de-contrasenas/' rel='bookmark' title='Permanent Link: Protect your site with password to ldap users and not-ldap (privileged) users'>Protect your site with password to ldap users and not-ldap (privileged) users</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/hello-world-2/' rel='bookmark' title='Permanent Link: Creando sitemaps de forma automática'>Creando sitemaps de forma automática</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-sistemas-y-servidores/solved-apache-error-client-xxx-file-does-not-exist/' rel='bookmark' title='Permanent Link: [SOLVED] Apache: &#8216;[error] [client ::XXX] File does not exist:&#8217;'>[SOLVED] Apache: &#8216;[error] [client ::XXX] File does not exist:&#8217;</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leccionespracticas.com/informatica-sistemas-y-servidores/creando-un-repositorio-git-a-partir-de-las-fuentes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>vBA news module customization (avoid topic links display)</title>
		<link>http://www.leccionespracticas.com/informatica-web/vbulletin-informatica-web/vba-news-module-customization-avoid-topic-links-display/</link>
		<comments>http://www.leccionespracticas.com/informatica-web/vbulletin-informatica-web/vba-news-module-customization-avoid-topic-links-display/#comments</comments>
		<pubDate>Wed, 19 May 2010 07:41:46 +0000</pubDate>
		<dc:creator>Miguel</dc:creator>
				<category><![CDATA[vBulletin]]></category>
		<category><![CDATA[adv_portal_module_wrapper]]></category>
		<category><![CDATA[customization]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[vba]]></category>
		<category><![CDATA[vbadvanced]]></category>
		<category><![CDATA[vbulletin]]></category>

		<guid isPermaLink="false">http://www.leccionespracticas.com/?p=1256</guid>
		<description><![CDATA[A client&#8217;s vBulletin board uses vbadvaced news module to display posts from a hidden forum. Every post is wrapped with adv_portal_module_wrapper. My client did not want the topic links to be displayed, so he asked me to hack the code to achieve this. Change adv_portal_module_wrapper The adv_portal_module_wrapper you will find in you ACP &#8212;> style [...]


Related posts:<ol><li><a href='http://www.leccionespracticas.com/informatica-web/vbulletin-informatica-web/vbulletin-vbadvanced-display-google-news-rss-feed/' rel='bookmark' title='Permanent Link: vBulletin + vBAdvanced: Display google news RSS feed'>vBulletin + vBAdvanced: Display google news RSS feed</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/vbulletin-informatica-web/vbulletin-adsense-module-for-vbadvanced/' rel='bookmark' title='Permanent Link: vBulletin: adsense module for vBAdvanced [SOLVED]'>vBulletin: adsense module for vBAdvanced [SOLVED]</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/vbulletin-informatica-web/vbulletin-change-sticky-text-style-solved/' rel='bookmark' title='Permanent Link: vBulletin: change sticky text style [SOLVED]'>vBulletin: change sticky text style [SOLVED]</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>A client&#8217;s vBulletin board uses vbadvaced news module to display posts from a hidden forum. Every post is wrapped with <b>adv_portal_module_wrapper</b>.</p>
<p>My client did not want the topic links to be displayed, so he asked me to hack the code to achieve this.</p>
<h3>Change <b>adv_portal_module_wrapper</b></h3>
<p>The adv_portal_module_wrapper you will find in you ACP &#8212;> style manager &#8212;> in the drop down for which ever style your working on pick edit templates &#8212;> vbadvanced cmps templates &#8212;> adv_portal_module_wrapper (should be located halfway down in the list of templates)</p>
<p>However you might want to copy that template and make a new one in case you need the default, you can add one by ACP &#8212;> style manager &#8212;> the add template. copy and paste your adv_portal_module_wrapper contents in for a starting point.</p>
<p>The following is the original code of <b>adv_portal_module_wrapper</b>:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">$mods[formcode]
&nbsp;
&lt;div style=&quot;padding-bottom:$vba_style[portal_vspace]px&quot;&gt;
	&lt;table align=&quot;center&quot; border=&quot;0&quot; cellpadding=&quot;$stylevar[cellpadding]&quot; cellspacing=&quot;$stylevar[cellspacing]&quot; class=&quot;tborder&quot; width=&quot;100%&quot;&gt;
		&lt;thead&gt;
			&lt;tr&gt;
				&lt;td class=&quot;tcat&quot; colspan=&quot;$mods[colspan]&quot;&gt;
				&lt;if condition=&quot;$vba_style['portal_collapsemods']&quot;&gt;
					&lt;a href=&quot;#top&quot; onclick=&quot;return toggle_collapse('module_$mods[collapse]')&quot; style=&quot;float:$stylevar[right]&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;collapseimg_module_$mods[collapse]&quot; src=&quot;$stylevar[imgdir_button]/collapse_tcat$modimgcollapse.gif&quot; /&gt;&lt;/a&gt;
				&lt;/if&gt;
				&lt;span class=&quot;smallfont&quot;&gt;&lt;strong&gt;$vba_style[portal_blockbullet] &lt;if condition=&quot;$mods['link']&quot;&gt;&lt;a href=&quot;$mods[link]&quot;&gt;$mods[title]&lt;/a&gt;&lt;else /&gt;$mods[title]&lt;/if&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;
			&lt;/tr&gt;
		&lt;/thead&gt;
		&lt;tbody id=&quot;collapseobj_module_$mods[collapse]&quot; style=&quot;$modcollapse&quot;&gt;
			&lt;if condition=&quot;$show['tablerow']&quot;&gt;
				&lt;tr&gt;
					&lt;td class=&quot;$bgclass&quot;&gt;
						$modulehtml
					&lt;/td&gt;
				&lt;/tr&gt;
			&lt;else /&gt;
				$modulehtml
			&lt;/if&gt;
		&lt;/tbody&gt;
	&lt;/table&gt;
&lt;/div&gt;
&lt;if condition=&quot;$show['endform']&quot;&gt;&lt;/form&gt;&lt;/if&gt;</pre></td></tr></table></div>

<p>I noticed the links where being created with the <b>$mods[title]</b> (refer to line 11). So where is this variable defined? Thanks to grep linux command I found out where it was assigned a value:<br />
<code><br />
/includes/vba_cmps_include_top.php<br />
/modules/news.php<br />
</code></p>
<p>In <em>/modules/news.php</em> there is this line, which gave me the clue on how to solve this issue</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$mods</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'title'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$news</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'prefix'</span><span style="color: #009900;">&#93;</span> ? <span style="color: #000088;">$news</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'prefix'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' &lt;a href=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$vbulletin</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'bburl'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/showthread.php?'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$vbulletin</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">session</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">vars</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'sessionurl'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'t='</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$news</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'threadid'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;&gt;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$news</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'title'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/a&gt;'</span><span style="color: #339933;">;</span></pre></div></div>

<p>So I thought I&#8217;d change the <em><b>$mods['title']</b></em> call in <b>adv_portal_module_wrapper</b> to <em><b>$news['title']</b></em>, so my resulting copy of adv_portal_module_wrapper is called adv_portal_module_wrapper_miguel and is like follows (the only thing changed is line 11):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">$mods[formcode]
&lt;!-- adv_portal_module_wrapper_miguel --&gt;
&lt;div style=&quot;padding-bottom:$vba_style[portal_vspace]px&quot;&gt;
	&lt;table align=&quot;center&quot; border=&quot;0&quot; cellpadding=&quot;$stylevar[cellpadding]&quot; cellspacing=&quot;$stylevar[cellspacing]&quot; class=&quot;tborder&quot; width=&quot;100%&quot;&gt;
		&lt;thead&gt;
			&lt;tr&gt;
				&lt;td class=&quot;tcat&quot; colspan=&quot;$mods[colspan]&quot;&gt;
				&lt;if condition=&quot;$vba_style['portal_collapsemods']&quot;&gt;
					&lt;a href=&quot;#top&quot; onclick=&quot;return toggle_collapse('module_$mods[collapse]')&quot; style=&quot;float:$stylevar[right]&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;collapseimg_module_$mods[collapse]&quot; src=&quot;$stylevar[imgdir_button]/collapse_tcat$modimgcollapse.gif&quot; /&gt;&lt;/a&gt;
				&lt;/if&gt;
				&lt;span class=&quot;smallfont&quot;&gt;&lt;strong&gt;$vba_style[portal_blockbullet] $news[title]&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;
			&lt;/tr&gt;
		&lt;/thead&gt;
		&lt;tbody id=&quot;collapseobj_module_$mods[collapse]&quot; style=&quot;$modcollapse&quot;&gt;
			&lt;if condition=&quot;$show['tablerow']&quot;&gt;
				&lt;tr&gt;
					&lt;td class=&quot;$bgclass&quot;&gt;
						$modulehtml
					&lt;/td&gt;
				&lt;/tr&gt;
			&lt;else /&gt;
				$modulehtml
			&lt;/if&gt;
		&lt;/tbody&gt;
	&lt;/table&gt;
&lt;/div&gt;
&lt;if condition=&quot;$show['endform']&quot;&gt;&lt;/form&gt;&lt;/if&gt;</pre></td></tr></table></div>



<p>Related posts:<ol><li><a href='http://www.leccionespracticas.com/informatica-web/vbulletin-informatica-web/vbulletin-vbadvanced-display-google-news-rss-feed/' rel='bookmark' title='Permanent Link: vBulletin + vBAdvanced: Display google news RSS feed'>vBulletin + vBAdvanced: Display google news RSS feed</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/vbulletin-informatica-web/vbulletin-adsense-module-for-vbadvanced/' rel='bookmark' title='Permanent Link: vBulletin: adsense module for vBAdvanced [SOLVED]'>vBulletin: adsense module for vBAdvanced [SOLVED]</a></li>
<li><a href='http://www.leccionespracticas.com/informatica-web/vbulletin-informatica-web/vbulletin-change-sticky-text-style-solved/' rel='bookmark' title='Permanent Link: vBulletin: change sticky text style [SOLVED]'>vBulletin: change sticky text style [SOLVED]</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.leccionespracticas.com/informatica-web/vbulletin-informatica-web/vba-news-module-customization-avoid-topic-links-display/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 2.183 seconds -->
