<?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>Laboratório 72</title>
	<atom:link href="http://www.laboratorio72.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.laboratorio72.com</link>
	<description>Web Design e Desenvolvimento</description>
	<lastBuildDate>Sun, 29 Jan 2012 22:54:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Wamp WordPress Auto-Install</title>
		<link>http://www.laboratorio72.com/wamp-wordpress-auto-install/</link>
		<comments>http://www.laboratorio72.com/wamp-wordpress-auto-install/#comments</comments>
		<pubDate>Fri, 10 Jun 2011 20:12:39 +0000</pubDate>
		<dc:creator>Mateus Reis</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[instalação automática]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WAMP]]></category>
		<category><![CDATA[Wordpress Auto-Install]]></category>

		<guid isPermaLink="false">http://www.laboratorio72.com/?p=388</guid>
		<description><![CDATA[Depois de algumas dezenas de instalações do WordPress e de seguir sempre a mesma fatídica rotina: baixar o WordPress no site oficial, criar a pasta, criar o banco de dados no phpmyadmin, descompactar o zip, preencher o wp-config.php, deletar o wp-config-sample.php e então botar para rolar, vou compartilhar aqui um script que instala automaticamente o [...]]]></description>
			<content:encoded><![CDATA[<p>Depois de algumas dezenas de instalações do <strong>WordPress</strong> e de seguir sempre a mesma fatídica rotina: baixar o WordPress no site oficial, criar a pasta, criar o banco de dados no phpmyadmin, descompactar o zip, preencher o wp-config.php, deletar o wp-config-sample.php e então botar para rolar, vou compartilhar aqui um script que instala automaticamente o WordPress no seu servidor. Esse script foi feito pensando no <a href="http://www.wampserver.com/en/" target="_blank">WAMP</a> como servidor web e usando <a href="http://aligangji.com/blog/2010/03/wordpress-automatic-installer-shell-script/" target="_blank">esse script como base</a>. Fique à vontade para modificar o script.</p>
<p>Por etapas.</p>
<p><strong>1.</strong> No <strong>WAMP</strong>, verifique se as seguintes extensões do php estão habilitdadads: <strong>php_curl</strong>, <strong>php_openssl</strong> e <strong>php_zip</strong>. Elas serão necessárias para o script rodar. Veja onde ficam essas configurações <a href="http://www.laboratorio72.com/wp-content/uploads/2011/06/wamp-setup.png" target="_blank">clicando aqui</a>. Também é necessário ter conexão com internet. O script vai baixar a última versão do WordPress do site oficial.</p>
<p><strong>2.</strong> Baixe o script abaixo e salve como <strong>.php</strong> na pasta que você pretende instalar o WordPress. O nome do arquivo fica por sua conta. O script pode ter qualquer nome. Lembre-se de deletá-lo depois de criar seu wordpress.</p>
<p><strong>3.</strong> Com a pasta criada e o script no lugar, navegue até ele. Como meu server local atende como localhost, a url fica algo assim: <strong>http://localhost/xibiu/</strong>. <strong>Xibiu</strong>, no caso, é a pasta.</p>
<p><img src="http://www.laboratorio72.com/wp-content/uploads/2011/06/xibiu.png" alt="" title="xibiu" width="607" height="238" class="aligncenter size-full wp-image-391" /></p>
<p><strong>4.</strong> Uma vez na pasta, execute o script (no exemplo o script se chama <strong>Wamp-Wordpress-Auto-Install.php</strong>) e preencha os campos indicados. Não precisa criar um banco de dados antes no mysql, basta informar o nome do banco de dados que o script cria um banco automaticamente. </p>
<p><img src="http://www.laboratorio72.com/wp-content/uploads/2011/06/Wordpress-Auto-Install.png" alt="" title="Wordpress-Auto-Install" width="607" height="566" class="aligncenter size-full wp-image-390" /></p>
<p><strong>5.</strong> Clicou em <strong>CREATE!</strong>, agora aguarde um pouco. Se tudo der certo você será redirecionado para a tela inicial do WordPress, onde você define a senha e o nome do blog. </p>
<p><img src="http://www.laboratorio72.com/wp-content/uploads/2011/06/bem-vindo.png" alt="" title="bem-vindo" width="607" height="670" class="aligncenter size-full wp-image-392" /></p>
<p>Vale lembrar que esse script funciona perfeitamente para a versão <strong>3.1.3 </strong>do <strong>WordPress</strong>. A partir daí, talvez seja necessário alterar o código. </p>
<p>E se você quiser outras versões do WordPress, aqui estão as versões em <a href="http://br.wordpress.org/releases/#latest" target="_blank">português</a> e <a href="http://wordpress.org/download/release-archive/" target="_blank">inglês</a>. </p>
<p>Eis o script:</p>

<div class="wp_syntax"><div 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;">/*
Wordpress Auto-Install
Script URI: http://www.laboratorio72.com/blog/wamp-wordpress-auto-install/
Author: Mateus Reis (laboratorio72.com)
Version: 1.0
Description: Auto install wordpress for WAMP webserver. Needs php_curl, php_zip and php_openssl extensions to work.
License: GPLv2 or later
*/</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/*
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
&nbsp;
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
&nbsp;
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// get current filename </span>
<span style="color: #000088;">$file</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;SCRIPT_NAME&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$break</span> <span style="color: #339933;">=</span> <span style="color: #990000;">Explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$pfile</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$break</span><span style="color: #009900;">&#91;</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$break</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> 
&nbsp;
<span style="color: #666666; font-style: italic;">// default options </span>
<span style="color: #000088;">$default_host</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'localhost'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$defatul_user</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'root'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span>
	&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;pt-br&quot;&gt;
	&lt;head&gt;
		&lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
		&lt;title&gt;Wordpress Auto-Install&lt;/title&gt;
	&lt;/head&gt;
	&lt;body&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">// copy contents</span>
<span style="color: #000000; font-weight: bold;">function</span> full_copy<span style="color: #009900;">&#40;</span><span style="color: #000088;">$source</span><span style="color: #339933;">,</span> <span style="color: #000088;">$target</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">is_dir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$source</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #339933;">@</span><span style="color: #990000;">mkdir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$target</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$d</span> <span style="color: #339933;">=</span> <span style="color: #990000;">dir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$source</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">FALSE</span> <span style="color: #339933;">!==</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$entry</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$d</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">read</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$entry</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'.'</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$entry</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'..'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">continue</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #000088;">$Entry</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$source</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$entry</span><span style="color: #339933;">;</span>           
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">is_dir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$Entry</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                full_copy<span style="color: #009900;">&#40;</span><span style="color: #000088;">$Entry</span><span style="color: #339933;">,</span> <span style="color: #000088;">$target</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$entry</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">continue</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #990000;">copy</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$Entry</span><span style="color: #339933;">,</span> <span style="color: #000088;">$target</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$entry</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000088;">$d</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
        <span style="color: #990000;">copy</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$source</span><span style="color: #339933;">,</span> <span style="color: #000088;">$target</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// delete folder</span>
<span style="color: #000000; font-weight: bold;">function</span> rrmdir<span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">is_dir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
	<span style="color: #000088;">$objects</span> <span style="color: #339933;">=</span> <span style="color: #990000;">scandir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
	<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$objects</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$object</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$object</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;.&quot;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$object</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;..&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">filetype</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;/&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$object</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;dir&quot;</span><span style="color: #009900;">&#41;</span> rrmdir<span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;/&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$object</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">else</span> <span style="color: #990000;">unlink</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;/&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$object</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
		<span style="color: #009900;">&#125;</span> 
	<span style="color: #009900;">&#125;</span> 
	<span style="color: #990000;">reset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$objects</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
	<span style="color: #990000;">rmdir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
   <span style="color: #009900;">&#125;</span> 
 <span style="color: #009900;">&#125;</span> 
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">// form post     </span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_METHOD'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'POST'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">file_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;wp-config.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ERROR! wp-config.php already exists!'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000088;">$options</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span> <span style="color: #b1b100;">AS</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$value</span><span style="color: #339933;">;</span>	
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>	
&nbsp;
	<span style="color: #666666; font-style: italic;">// local vars, dumb way</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;database_username&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$user</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;database_username&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$user</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$default_user</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;database_username&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// default host</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;database_password&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$pass</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;database_password&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$pass</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;database_name&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$dbse</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;database_name&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
		<span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Missing database name!'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;database_host&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$host</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;database_host&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$host</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$default_host</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;database_host&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// default host</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;database_prefix&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$prefix</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;database_prefix&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$prefix</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// validate</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Missing enough data!'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// database creation</span>
	<span style="color: #000088;">$con</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_connect</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$host</span><span style="color: #339933;">,</span><span style="color: #000088;">$user</span><span style="color: #339933;">,</span><span style="color: #000088;">$pass</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$con</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	  <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Could not connect: '</span> <span style="color: #339933;">.</span> <span style="color: #990000;">mysql_error</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>	
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;CREATE DATABASE <span style="color: #006699; font-weight: bold;">$dbse</span>&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$con</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	  <span style="color: #666666; font-style: italic;">//echo &quot;Database created&quot;;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
	  <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Error creating database: &quot;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">mysql_error</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	  <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #990000;">mysql_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$con</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
	<span style="color: #666666; font-style: italic;">// download wordpress latest.zip</span>
	<span style="color: #000088;">$ch</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_URL<span style="color: #339933;">,</span><span style="color: #0000ff;">'http://wordpress.org/latest.zip'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$fp</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fopen</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'latest.zip'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'w'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_FILE<span style="color: #339933;">,</span> <span style="color: #000088;">$fp</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">curl_exec</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">curl_close</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">fclose</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fp</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// get current path</span>
	<span style="color: #000088;">$dir</span> <span style="color: #339933;">=</span> <span style="color: #990000;">getcwd</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// extract zip </span>
	<span style="color: #000088;">$zip</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ZipArchive<span style="color: #339933;">;</span>
     <span style="color: #000088;">$res</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$zip</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">open</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'latest.zip'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$res</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">TRUE</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
         <span style="color: #000088;">$zip</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">extractTo</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         <span style="color: #000088;">$zip</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
         <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Zip Extract failed!'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// move files</span>
	full_copy<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wordpress'</span><span style="color: #339933;">,</span><span style="color: #000088;">$dir</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// delete wordpress folder</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">is_dir</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wordpress'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    	rrmdir<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wordpress'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// delete latest.zip</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">file_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'latest.zip'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    	<span style="color: #990000;">unlink</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'latest.zip'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// build wp-config.php</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">file_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;wp-config-sample.php&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #990000;">file_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;wp-config.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$wpconfig</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;wp-config-sample.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000088;">$keys</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;https://api.wordpress.org/secret-key/1.1/salt/&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #666666; font-style: italic;">//echo $keys;</span>
		<span style="color: #666666; font-style: italic;">//echo &quot;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&quot;;</span>
&nbsp;
		<span style="color: #000088;">$start</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wpconfig</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;define('AUTH_KEY'&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #666666; font-style: italic;">//echo $start;</span>
		<span style="color: #666666; font-style: italic;">//echo &quot;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&quot;;</span>
&nbsp;
		<span style="color: #000088;">$search</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wpconfig</span><span style="color: #339933;">,</span> <span style="color: #000088;">$start</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">478</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// important! this is the start of define('AUTH_KEY' for current wordpress install</span>
&nbsp;
		<span style="color: #000088;">$wpconfig</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$search</span><span style="color: #339933;">,</span> <span style="color: #000088;">$keys</span><span style="color: #339933;">,</span> <span style="color: #000088;">$wpconfig</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</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;">$user</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$wpconfig</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;define('DB_USER', 'username_here');&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;define('DB_USER', '<span style="color: #006699; font-weight: bold;">$user</span>');&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$wpconfig</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// allow empty password</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$pass</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$wpconfig</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;define('DB_PASSWORD', 'password_here');&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;define('DB_PASSWORD', '<span style="color: #006699; font-weight: bold;">$pass</span>');&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$wpconfig</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<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;">$dbse</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$wpconfig</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;define('DB_NAME', 'database_name_here');&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;define('DB_NAME', '<span style="color: #006699; font-weight: bold;">$dbse</span>');&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$wpconfig</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</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;">$host</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$wpconfig</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;define('DB_HOST', 'localhost');&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;define('DB_HOST', '<span style="color: #006699; font-weight: bold;">$host</span>');&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$wpconfig</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</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;">$prefix</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$wpconfig</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\$</span>table_prefix  = 'wp_';&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\$</span>table_prefix  = '<span style="color: #006699; font-weight: bold;">$prefix</span>';&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$wpconfig</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$file</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fopen</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;wp-config.php&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;wb&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #990000;">fwrite</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #339933;">,</span> <span style="color: #000088;">$wpconfig</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #990000;">fclose</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> 
&nbsp;
	<span style="color: #666666; font-style: italic;">// kill wp-config-sample.php</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">file_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp-config-sample.php'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    	<span style="color: #990000;">unlink</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp-config-sample.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Done!</span>
	<span style="color: #666666; font-style: italic;">// echo 'Done! Go to &lt;a href=&quot;wp-admin/install.php&quot;&gt;wp-admin/install.php&lt;/a&gt; and delete '. $pfile .' from root folder.';	</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// automatic redirect to setup page</span>
	<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Location: wp-admin/install.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">?&gt;</span>
	&lt;h1&gt;Wordpress Auto-Install&lt;/h1&gt;
&nbsp;
	&lt;form action=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$pfile</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; method=&quot;post&quot;&gt;
&nbsp;
		&lt;p&gt;&lt;strong&gt;Database User Name&lt;/strong&gt;&lt;/p&gt;
		&lt;p&gt;Your MySQL username&lt;/p&gt;
		&lt;p&gt;&lt;input type=&quot;text&quot; name=&quot;database_username&quot; value=&quot;root&quot; id=&quot;&quot;&gt;&lt;/p&gt;
&nbsp;
		&lt;p&gt;&lt;strong&gt;Database Name&lt;/strong&gt;&lt;/p&gt;
		&lt;p&gt;The name of the database you want to run WP in.&lt;/p&gt;
		&lt;p&gt;&lt;input type=&quot;text&quot; name=&quot;database_name&quot; value=&quot;&quot; id=&quot;&quot;&gt;&lt;/p&gt;
&nbsp;
		&lt;p&gt;&lt;strong&gt;Database Password&lt;/strong&gt;&lt;/p&gt;
		&lt;p&gt;Your MySQL password&lt;/p&gt;
		&lt;p&gt;&lt;input type=&quot;text&quot; name=&quot;database_password&quot; value=&quot;&quot; id=&quot;&quot;&gt;&lt;/p&gt;		
&nbsp;
		&lt;p&gt;&lt;strong&gt;Database Host&lt;/strong&gt;&lt;/p&gt;
		&lt;p&gt;You should be able to get this info from your web host, if localhost does not work. If null: localhost will be used.&lt;/p&gt;
		&lt;p&gt;&lt;input type=&quot;text&quot; name=&quot;database_host&quot; value=&quot;localhost&quot; id=&quot;&quot;&gt;&lt;/p&gt;
&nbsp;
		&lt;p&gt;&lt;strong&gt;Database Table Prefix&lt;/strong&gt;&lt;/p&gt;
		&lt;p&gt;If you want to run multiple WordPress installations in a single database, change this.&lt;/p&gt;
		&lt;input type=&quot;text&quot; name=&quot;database_prefix&quot; value=&quot;&quot; id=&quot;&quot;&gt;&lt;/p&gt;
&nbsp;
		&lt;p&gt;&lt;input type=&quot;submit&quot; value=&quot;CREATE!&quot;&gt;&lt;/p&gt;
	&lt;/form&gt;
	&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://www.laboratorio72.com&quot; target=&quot;_blank&quot;&gt;Laboratório 72&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span>	
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
	&lt;/body&gt;
&lt;/html&gt;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.laboratorio72.com/wamp-wordpress-auto-install/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Atualizando automaticamente o ano do copyright de seu site</title>
		<link>http://www.laboratorio72.com/atualizando-automaticamente-o-ano-do-copyright-de-seu-site/</link>
		<comments>http://www.laboratorio72.com/atualizando-automaticamente-o-ano-do-copyright-de-seu-site/#comments</comments>
		<pubDate>Fri, 15 Apr 2011 22:38:16 +0000</pubDate>
		<dc:creator>Mateus Reis</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[date]]></category>

		<guid isPermaLink="false">http://www.laboratorio72.com/?p=369</guid>
		<description><![CDATA[Um script bobinho, mas útil: &#38;copy; Copyright &#60;?php echo date&#40;&#34;Y&#34;&#41;; ?&#62; - Todos os direitos reservados. Normalmente, em sites com a notificação de copyright em algum canto, é difícil lembrar de alterar o ano. A idéia aqui é deixar que o PHP altere automaticamente enquanto você curte tranquilamente a ressaca do ano novo.]]></description>
			<content:encoded><![CDATA[<p>Um script bobinho, mas útil:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&amp;copy; Copyright <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Y&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> - Todos os direitos reservados.</pre></div></div>

<p>Normalmente, em sites com a notificação de copyright em algum canto, é difícil lembrar de alterar o ano. A idéia aqui é deixar que o PHP altere automaticamente enquanto você curte tranquilamente a ressaca do ano novo.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.laboratorio72.com/atualizando-automaticamente-o-ano-do-copyright-de-seu-site/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Publicando conteúdo do WordPress em outros documentos php</title>
		<link>http://www.laboratorio72.com/publicando-conteudo-do-wordpress-em-outros-documentos-php/</link>
		<comments>http://www.laboratorio72.com/publicando-conteudo-do-wordpress-em-outros-documentos-php/#comments</comments>
		<pubDate>Thu, 14 Apr 2011 20:48:02 +0000</pubDate>
		<dc:creator>Mateus Reis</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[snippets]]></category>

		<guid isPermaLink="false">http://www.laboratorio72.com/?p=339</guid>
		<description><![CDATA[Com a chegada dos custom post types, o WordPress ficou mais flexível no gerenciamento do conteúdo. Agora dá para criar conteúdos específicos para problemas específicos. E provavelmente vai chegar o dia em que você vai precisar remover esse conteúdo das pastas &#8220;oficiais&#8221; do blog, para, por exemplo, exibí-los num iframe qualquer. Para isso basta colocar [...]]]></description>
			<content:encoded><![CDATA[<p>Com a chegada dos custom post types, o WordPress ficou mais flexível no gerenciamento do conteúdo. Agora dá para criar conteúdos específicos para problemas específicos. E provavelmente vai chegar o dia em que você vai precisar remover esse conteúdo das pastas &#8220;oficiais&#8221; do blog, para, por exemplo, exibí-los num iframe qualquer. Para isso basta colocar o seguinte código no seu php:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-Type: text/html; charset=utf-8'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'WP_USE_THEMES'</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: #b1b100;">require</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'../../wp-load.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// aponte para o wp-load.php da raiz da instalação </span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;!-- aqui vai o loop, o htm, css e todo o resto da página --&gt;</pre></div></div>

<p>Abaixo disso, você pode colocar um loop normal de posts ou custom posts, um css diferente, enfim, configurar como desejar. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.laboratorio72.com/publicando-conteudo-do-wordpress-em-outros-documentos-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Como traduzir um WordPress instalado em inglês</title>
		<link>http://www.laboratorio72.com/como-traduzir-um-wordpress-instalado-em-ingles/</link>
		<comments>http://www.laboratorio72.com/como-traduzir-um-wordpress-instalado-em-ingles/#comments</comments>
		<pubDate>Tue, 12 Apr 2011 20:51:53 +0000</pubDate>
		<dc:creator>Mateus Reis</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.laboratorio72.com/?p=347</guid>
		<description><![CDATA[Sem ter que reinstalar nada? Simples. Entre na página de download do WordPress e baixe a versão em português. Abra o arquivo zipado e localize a pasta languages, dentro da pasta wp-content. Agora é só extrair essa pasta para a pasta wp-content/languages da sua instalação gringa do WordPress. Feito isso, edite o arquivo wp-config.php da [...]]]></description>
			<content:encoded><![CDATA[<p>Sem ter que reinstalar nada? Simples. Entre na página de download do <a href="http://br.wordpress.org/" target="_blank">WordPress</a> e baixe a versão em português.</p>
<p>Abra o arquivo zipado e localize a pasta <strong>languages</strong>, dentro da pasta <strong>wp-content</strong>. Agora é só extrair essa pasta para a pasta <strong>wp-content/languages</strong> da sua instalação gringa do WordPress.</p>
<p>Feito isso, edite o arquivo <strong>wp-config.php</strong> da raiz, localize o código abaixo e altere de:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">define</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'WPLANG'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Para:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">define</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'WPLANG'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'pt_BR'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Feito isso, confira se os itens do painel foram traduzidos corretamente. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.laboratorio72.com/como-traduzir-um-wordpress-instalado-em-ingles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

