<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ca">
	<id>http://wiki.joanillo.org/index.php?action=history&amp;feed=atom&amp;title=Hack_WordPress</id>
	<title>Hack WordPress - Historial de revisió</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.joanillo.org/index.php?action=history&amp;feed=atom&amp;title=Hack_WordPress"/>
	<link rel="alternate" type="text/html" href="http://wiki.joanillo.org/index.php?title=Hack_WordPress&amp;action=history"/>
	<updated>2026-08-30T10:12:20Z</updated>
	<subtitle>Historial de revisió per a aquesta pàgina del wiki</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>http://wiki.joanillo.org/index.php?title=Hack_WordPress&amp;diff=297000&amp;oldid=prev</id>
		<title>Joan a 23:50, 17 oct 2020</title>
		<link rel="alternate" type="text/html" href="http://wiki.joanillo.org/index.php?title=Hack_WordPress&amp;diff=297000&amp;oldid=prev"/>
		<updated>2020-10-17T23:50:24Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ca&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Versió més antiga&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revisió del 23:50, 17 oct 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Línia 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línia 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;__TOC__&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Canviar la data d'un post==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Canviar la data d'un post==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Un post té múltiples entrades en la taula wp_posts, corresponents a l'entrada primeres més les revisions posteriors i els ''autosave''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Un post té múltiples entrades en la taula wp_posts, corresponents a l'entrada primeres més les revisions posteriors i els ''autosave''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l92&quot; &gt;Línia 92:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línia 93:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;update wp_posts set post_content=REPLACE(post_content, 'http://blog.empresalibre.org/wp-content/uploads', 'http://localhost/blog/wp-content/uploads');  &lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;update wp_posts set post_content=REPLACE(post_content, 'http://blog.empresalibre.org/wp-content/uploads', 'http://localhost/blog/wp-content/uploads');  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=Nou Wordpress (setembre 2020)=&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;==pàgines Català i Espanyol (redireccionaments)==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Tinc un nou wordpress (), tinc instal·lat el plugin polylang (català i castellà), i tinc 2 pàgines (Català, Castellà), que en realitat són 4, perquè hi ha les traduccions, amb els id: 876, 883, 886, 888.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Autor}}, gener 2009&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Vull que quan accedeixi a aquetes pàgines no es vegi el seu contingut, sinó que es faci una redirecció. En el fitxer ''header.php'' (que està en el theme que tinc instal·lat, el ''twentytwelve'') posem aquestes línies:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;pre&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;?php&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;//echo get_the_ID();&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;if (get_the_ID()==876 || get_the_ID()==883) {&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;header('Location: http://www.joanillo.org/?lang=ca');&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;} else if (get_the_ID()==886 || get_the_ID()==888) {&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;header('Location: http://www.joanillo.org/?lang=es');&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;?&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/pre&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Recordar que per tal de què funcioni els redireccionaments (''header''), s'ha de fer abans d'escriure res per pantalla.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Autor}}, gener 2009&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;, octubre 2020&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Categoria: Wordpress]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Categoria: Wordpress]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Categoria: DMS]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Categoria: DMS]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Joan</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.joanillo.org/index.php?title=Hack_WordPress&amp;diff=4237&amp;oldid=prev</id>
		<title>Joan: /* Treballar en local i en remot */</title>
		<link rel="alternate" type="text/html" href="http://wiki.joanillo.org/index.php?title=Hack_WordPress&amp;diff=4237&amp;oldid=prev"/>
		<updated>2009-12-17T09:29:56Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Treballar en local i en remot&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Pàgina nova&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Canviar la data d'un post==&lt;br /&gt;
Un post té múltiples entrades en la taula wp_posts, corresponents a l'entrada primeres més les revisions posteriors i els ''autosave''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mysql&amp;gt; desc wp_posts;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Si vull modificar tots els posts associats a un post_pare a la mateixa data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mysql&amp;gt; select ID, post_date,post_date_gmt,post_modified,post_modified_gmt,post_name,post_parent from wp_posts where post_title='titol_post';&lt;br /&gt;
mysql&amp;gt; update wp_posts set post_date='2008-12-28',post_date_gmt='2008-12-28',post_modified='2008-12-28',post_modified_gmt='2008-12-28' where post_title='titol_post';&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Si només vull modificar el post original, buscaré per post_parent=0:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mysql&amp;gt; update wp_posts set post_date='2008-12-28',post_date_gmt='2008-12-28',post_modified='2008-12-28',post_modified_gmt='2008-12-28' where post_title='titol_post' and post_parent=0;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Sobre la traducció al català/castellà...==&lt;br /&gt;
Al final agafo com a tema de referència un que es diu curved-10.&lt;br /&gt;
&lt;br /&gt;
No és veritat que després d'instal.lar el wordpress en català estigui tot en català. Concretament, les plantilles també s'han de traduir. Això ho faig a pèl. Per exemple, ''No Comments'' es tradueix per ''Sense comentaris'', i això ho faig cercant aquesta informació directament en els fitxers.&lt;br /&gt;
&lt;br /&gt;
Més complicat és el format de la data que la canvio en la zona d'administració i no em fa cas. Això és perquè les plantilles estan ficades de forma absoluta. La manera de procedir és buscar en el codi font, després buscar en el fitxer php directament i identificar el que he de substituir. Finalment veig que he de substituir &lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php the_time('F jS, Y') ?&amp;gt; per &amp;lt;?php the_time('j F Y') ?&amp;gt; en els fitxers themes/curved-10/index.php, themes/curved-10/search.php i themes/curved-10/single.php&lt;br /&gt;
&lt;br /&gt;
Això s'haurà de fer amb tot: ''Leave a Reply'', ''logged as...'', etc.&lt;br /&gt;
&lt;br /&gt;
==Treballar en local i en remot==&lt;br /&gt;
'''NOTA''': tot aquest tema s'ha evitat editant el fitxer /etc/hosts. Ara ja puc fer www.joanillo.org en local&lt;br /&gt;
&lt;br /&gt;
El wordpress només pot estar configurat en local o en remot. Estic fent referència, dins de la zona d'administració (wp-admin/options-general.php), als valors ''Adreça del WordPress'' i ''Adreça del blog'', que no tenen perquè coincidir. Si poso ''http://localhost/blog'' no puc accedir remotament, i si poso ''http://wikijoan.dyndns.org/blog'' no puc accedir localment.&lt;br /&gt;
&lt;br /&gt;
Fent una cerca pel Google, sembla ser que efectivament no es pot treballar en els dos modes, la qual cosa per a mi és un inconvenient greu. Algú apunta a què el router es pot configurar per treballar en  mode ''loopback'', que permetria fer http://wikijoan.dyndns.org/blog des de dins de la xarxa (ho he de mirar).&lt;br /&gt;
&lt;br /&gt;
Una altra possibilitat que jo he trobat és tocar directament els paràmetres d'una forma que sigui fàcil i còmoda. Investigant una mica veig que aquesta informació es guarda directament en la base de dades.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mysql -u root -p&lt;br /&gt;
mysql&amp;gt; use blog&lt;br /&gt;
mysql&amp;gt; select option_name from wp_options;&lt;br /&gt;
mysql&amp;gt; select option_name,option_value from wp_options where option_name='home';&lt;br /&gt;
mysql&amp;gt; select option_name,option_value from wp_options where option_name='siteurl';&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Puc modificar directament aquests valors. Per fer-ho còmode, he de crear un script i un accés directe al script en l'escriptori amb la connexió al mysql, execució de les dues comandes, i desconnexió.&lt;br /&gt;
&lt;br /&gt;
Per treballar localment, fitxer wp_local.sql:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
update wp_options set option_value='http://localhost/blog' where option_name='home';&lt;br /&gt;
update wp_options set option_value='http://localhost/blog' where option_name='siteurl';&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
i per treballar remotament, fitxer wp_remot.sql:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
update wp_options set option_value='http://wikijoan.dyndns.org/blog' where option_name='home';&lt;br /&gt;
update wp_options set option_value='http://wikijoan.dyndns.org/blog' where option_name='siteurl';&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
El problema és que quan treballi localment ningú es podrà connectar remotament, i un blog té per finalitat que tothom s'hi pugui connectar!&lt;br /&gt;
&lt;br /&gt;
Automatitzem aquesta tasca mitjançant dos scripts php que s'executaran a http://localhost o http://www.empresalibre.org o http://wikijoan.dyndns.org.&lt;br /&gt;
&lt;br /&gt;
fitxer blog_local.php:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
exec(&amp;quot;mysql -u root -p**** blog &amp;lt; /home/joan/copia_seguretat/scripts/wp_local.sql&amp;quot;);                                      &lt;br /&gt;
echo &amp;quot;el blog funciona en local&amp;quot;;                    &lt;br /&gt;
?&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
fitxer blog_remot.php:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
exec(&amp;quot;mysql -u root -p**** blog &amp;lt; /home/joan/copia_seguretat/scripts/wp_remot.sql&amp;quot;);                                      &lt;br /&gt;
echo &amp;quot;el blog funciona en remot&amp;quot;;                    &lt;br /&gt;
?&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
i els scripts són els que hem vist més amunt&lt;br /&gt;
&lt;br /&gt;
'''Nota:'''&lt;br /&gt;
Després de diversos canvis, ara ja puc accedir al blog remotament mitjançant http://blog.empresalibre.org. Això implica un canvi en les comandes que s'executen en el fitxer wp_remot.sql:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
update wp_options set option_value='http://blog.empresalibre.org' where option_name='home';&lt;br /&gt;
update wp_options set option_value='http://blog.empresalibre.org' where option_name='siteurl';&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Problema en les imatges==&lt;br /&gt;
El problema està en què quan faig un upload d'una imatge (continguda en un post) en local o en remot, es queda emmagatzemada la referència absoluta de la imatge. La conseqüència és que si faig el upload en local, no es veu en remot. I a l'inversa. La solució és integrar en els scripts wp_remot.sql, wp_130.sql i wp_local.sql les següents instruccions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
update wp_posts set post_content=REPLACE(post_content, 'http://192.168.1.130/blog/wp-content/uploads', 'http://www.empresalibre.org/blog/wp-content/uploads'); &lt;br /&gt;
# update wp_posts set post_content=REPLACE(post_content, 'http://www.empresalibre.org/blog/wp-content/uploads', 'http://192.168.1.130/blog/wp-content/uploads'); &lt;br /&gt;
# update wp_posts set post_content=REPLACE(post_content, 'http://www.empresalibre.org/blog/wp-content/uploads', 'http://localhost/blog/wp-content/uploads'); &lt;br /&gt;
update wp_posts set post_content=REPLACE(post_content, 'http://blog.empresalibre.org/wp-content/uploads', 'http://192.168.1.130/blog/wp-content/uploads'); &lt;br /&gt;
update wp_posts set post_content=REPLACE(post_content, 'http://blog.empresalibre.org/wp-content/uploads', 'http://localhost/blog/wp-content/uploads'); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Autor}}, gener 2009&lt;br /&gt;
[[Categoria: Wordpress]]&lt;br /&gt;
[[Categoria: DMS]]&lt;/div&gt;</summary>
		<author><name>Joan</name></author>
		
	</entry>
</feed>