<?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>erufenix .::. blog &#187; PHP</title>
	<atom:link href="http://erufenix.ingeenia.net/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://erufenix.ingeenia.net</link>
	<description>Otro Blog de WordPress</description>
	<lastBuildDate>Thu, 01 Apr 2010 21:10:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Copiar archivos entre carpetas con PHP</title>
		<link>http://erufenix.ingeenia.net/copiar-archivos-entre-carpetas-con-php/</link>
		<comments>http://erufenix.ingeenia.net/copiar-archivos-entre-carpetas-con-php/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 21:16:18 +0000</pubDate>
		<dc:creator>erufenix</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[archivos]]></category>
		<category><![CDATA[códigos]]></category>
		<category><![CDATA[comandos]]></category>
		<category><![CDATA[respaldos]]></category>

		<guid isPermaLink="false">http://erufenix.ingeenia.net/?p=1913</guid>
		<description><![CDATA[Digamos que queremos hacer un respaldo de archivos del servidor o copiar archivos de una ubicación a otra. Para esto este código nos puede servir.
En primera tenemos $dir y $dir2 que corresponden a la ruta origen y la ruta destino respectivamente, luego hacemos cambios a un script que ya había publicado antes, donde:

$dp=opendir($dir); abre el [...]


Related posts:<ol><li><a href='http://erufenix.ingeenia.net/has-una-pagina-de-rolas/' rel='bookmark' title='Permanent Link: Has una página de rolas'>Has una página de rolas</a></li><li><a href='http://erufenix.ingeenia.net/has-una-pagina-de-videos/' rel='bookmark' title='Permanent Link: Has una página de vídeos'>Has una página de vídeos</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Digamos que queremos hacer un respaldo de archivos del servidor o copiar archivos de una ubicación a otra. Para esto este código nos puede servir.</p>
<p>En primera tenemos $dir y $dir2 que corresponden a la ruta origen y la ruta destino respectivamente, luego hacemos cambios a un script que ya había <a href="http://erufenix.ingeenia.net/has-una-pagina-de-videos/">publicado</a> antes, donde:</p>
<ul>
<li><b>$dp=opendir($dir);</b> abre el directorio para su lectura.</li>
<li><b>while($file=readdir($dp))</b> ciclo que lee el directorio mientras existan archivos en él.</li>
<li>Con <b>$extension=getExtension($file);</b> aplicamos un filtro para solo copiar archivos con ciertas extensiones</li>
<li>En la variable <b>$cmd</b> guardamos una cadena con el comando <a href="http://www.ibiblio.org/pub/linux/docs/LuCaS/Cursos/distro/intermedio/html/node21.html" target='_blank'>cp</a> con sus parametros y con la función <b><a href="http://mx.php.net/manual/en/book.exec.php" target='_blank'>exec()</a></b> ejecutamos el comando en el sistema. </li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> getExtension<span style="color: #009900;">&#40;</span><span style="color: #000088;">$archivo</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
      	 <span style="color: #000088;">$a</span><span style="color: #339933;">=</span><span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;.&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$archivo</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      	 <span style="color: #b1b100;">return</span> <span style="color: #000088;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$a</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>
        <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000088;">$dir</span>  <span style="color: #339933;">=</span> getRuta<span style="color: #009900;">&#40;</span><span style="color: #000088;">$CveCom</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$dir2</span> <span style="color: #339933;">=</span> getRuta<span style="color: #009900;">&#40;</span><span style="color: #000088;">$comn</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;">file_exists</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: #666666; font-style: italic;">//verificamos que existe el directorio</span>
   <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;br/&gt;Error... El directorio no existe. Configura bien tu variable <span style="color: #000099; font-weight: bold;">\&quot;</span>dir<span style="color: #000099; font-weight: bold;">\&quot;</span> ...&quot;</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;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">//echo $dir;</span>
    <span style="color: #000088;">$dp</span><span style="color: #339933;">=</span><span style="color: #990000;">opendir</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;">while</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #339933;">=</span><span style="color: #990000;">readdir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dp</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">//hacemos un ciclo para guardar los nombres de los directorios y archivos que se tienen en el directorio actual</span>
          <span style="color: #009900;">&#123;</span>
           <span style="color: #000088;">$extension</span><span style="color: #339933;">=</span>getExtension<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: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$extension</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;php&quot;</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$extension</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;html&quot;</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$extension</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;htm&quot;</span><span style="color: #009900;">&#41;</span>
	          <span style="color: #009900;">&#123;</span>
                    <span style="color: #000088;">$srcfile</span><span style="color: #339933;">=</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;">$file</span><span style="color: #339933;">;</span>
		    <span style="color: #000088;">$dstfile</span><span style="color: #339933;">=</span><span style="color: #000088;">$dir2</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;/&quot;</span><span style="color: #339933;">;</span>
		    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Copiar '<span style="color: #006699; font-weight: bold;">$srcfile</span>' a '<span style="color: #006699; font-weight: bold;">$dstfile</span>'... &lt;br&gt;&quot;</span><span style="color: #339933;">;</span>
	            <span style="color: #000088;">$cmd</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;cp <span style="color: #006699; font-weight: bold;">$srcfile</span> <span style="color: #006699; font-weight: bold;">$dstfile</span>&quot;</span><span style="color: #339933;">;</span>
		    <span style="color: #000088;">$eje1</span><span style="color: #339933;">=</span><span style="color: #990000;">exec</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cmd</span><span style="color: #339933;">,</span> <span style="color: #000088;">$output</span><span style="color: #339933;">,</span> <span style="color: #000088;">$return_var</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: #009900;">&#125;</span></pre></div></div>

<p>Otra opción para copiar los archivos sería la función <a href="http://mx.php.net/manual/en/function.copy.php" target="_blank">copy()</a>, pero al ejecutar el script marcaba error al ejecutarse, así que decidi usar la alternativa del exec().</></p>


<p>Related posts:<ol><li><a href='http://erufenix.ingeenia.net/has-una-pagina-de-rolas/' rel='bookmark' title='Permanent Link: Has una página de rolas'>Has una página de rolas</a></li><li><a href='http://erufenix.ingeenia.net/has-una-pagina-de-videos/' rel='bookmark' title='Permanent Link: Has una página de vídeos'>Has una página de vídeos</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://erufenix.ingeenia.net/copiar-archivos-entre-carpetas-con-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Has una página de rolas</title>
		<link>http://erufenix.ingeenia.net/has-una-pagina-de-rolas/</link>
		<comments>http://erufenix.ingeenia.net/has-una-pagina-de-rolas/#comments</comments>
		<pubDate>Tue, 18 Dec 2007 08:14:49 +0000</pubDate>
		<dc:creator>erufenix</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programación]]></category>

		<guid isPermaLink="false">http://erufenix.codesys.org/has-una-pagina-de-rolas</guid>
		<description><![CDATA[Hace unos post publique post de como organizar y visualizar los vídeos FLV almacenados en nuestro server; en esta ocasión veremos como organizar mp3.
Básicamente el código es el mismo, pero con unas modificaciones.

Ver código modificado


ocultar



$contenido = '&#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62;
&#60;playlist version=&#34;1&#34; xmlns=&#34;http://xspf.org/ns/0/&#34;&#62;
	&#60;trackList&#62;';
while($file=readdir($dp))
       {
        [...]


Related posts:<ol><li><a href='http://erufenix.ingeenia.net/has-una-pagina-de-videos/' rel='bookmark' title='Permanent Link: Has una página de vídeos'>Has una página de vídeos</a></li><li><a href='http://erufenix.ingeenia.net/copiar-archivos-entre-carpetas-con-php/' rel='bookmark' title='Permanent Link: Copiar archivos entre carpetas con PHP'>Copiar archivos entre carpetas con PHP</a></li><li><a href='http://erufenix.ingeenia.net/generar-un-xml-con-php/' rel='bookmark' title='Permanent Link: Generar un XML con php'>Generar un XML con php</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Hace unos post publique <a href="http://erufenix.codesys.org/has-una-pagina-de-videos">post</a> de como organizar y visualizar los vídeos <a href="http://es.wikipedia.org/wiki/FLV">FLV</a> almacenados en nuestro server; en esta ocasión veremos como organizar mp3.</p>
<p>Básicamente el código es el mismo, pero con unas modificaciones.</p>
<div id="status1-codr1">
<a href="javascript:oculta3('codr1');">Ver código modificado</a>
</div>
<div id="status2-codr1" class="show" >
<a href="javascript:oculta3('codr1');">ocultar</a>
</div>
<div id="codr1" class="show">

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">$contenido = '<span style="color: #000000; font-weight: bold;">&lt;?</span>xml version<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;1.0&quot;</span> encoding<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;playlist version=&quot;1&quot; xmlns=&quot;http://xspf.org/ns/0/&quot;&gt;
	&lt;trackList&gt;';
while($file=readdir($dp))
       {
        $extension=getExtension($file);
	      if($extension==&quot;mp3&quot;)
	         {
                  $filenames[]=$file;
                }
       }
sort($filenames);
for($i=0;$i&lt;count($filenames);$i++)
    {
     $ruta=$referer.&quot;/&quot;.$filenames[$i];
     $rolaname=substr($filenames[$i],0,-4);
     $se=sepcade($rolaname);
		 $contenido.='
&lt;track&gt;
&lt;title&gt;'.$se.'&lt;/title&gt;
&lt;creator&gt;&lt;/creator&gt;
&lt;location&gt;'.$ruta.'&lt;/location&gt;
&lt;/track&gt;';
}</pre></div></div>

</div>
<p>Otro cambio que hice fue en la parte en que se escribe el archivo el XML, ya que aun cambiando los permisos del archivo (mod 777) no se escribía el valor de contenido en el archivo, pero con el sig. código se soluciono.</p>
<div id="status1-codr2">
<a href="javascript:oculta3('codr2');">Ver código de archivos</a>
</div>
<div id="status2-codr2" class="show" >
<a href="javascript:oculta3('codr2');">ocultar</a>
</div>
<div id="codr2" class="show">

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">is_writable</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$archivo</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;">// En nuestro ejemplo estamos abriendo $nombre_archivo en modo de adición.</span>
    <span style="color: #666666; font-style: italic;">// El apuntador de archivo se encuentra al final del archivo, asi que</span>
    <span style="color: #666666; font-style: italic;">// alli es donde ira $contenido cuando llamemos fwrite().</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$gestor</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fopen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$archivo</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'wb'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
		     <span style="color: #009900;">&#123;</span>
          <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;No se puede abrir el archivo (<span style="color: #006699; font-weight: bold;">$archivo</span>)&quot;</span><span style="color: #339933;">;</span>
          <span style="color: #990000;">exit</span><span style="color: #339933;">;</span>
         <span style="color: #009900;">&#125;</span>
    <span style="color: #666666; font-style: italic;">// Escribir $contenido a nuestro arcivo abierto.</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">fwrite</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$gestor</span><span style="color: #339933;">,</span> <span style="color: #000088;">$contenido</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #009900;">&#41;</span>
		    <span style="color: #009900;">&#123;</span>
         <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;No se puede escribir al archivo (<span style="color: #006699; font-weight: bold;">$archivo</span>)&quot;</span><span style="color: #339933;">;</span>
         <span style="color: #990000;">exit</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
		 <span style="color: #990000;">fclose</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$gestor</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span></pre></div></div>

</div>
<p>El resultado lo puedes ver en esta <a href="http://erufenix.codesys.org/rolas/index.php" title="Mis rolas" rel="gb_page_fs[]">página</a> y el código completo <a href="http://erufenix.codesys.org/rolas/source.php" title="Código" rel="gb_page_fs[]">aquí</a></p>


<p>Related posts:<ol><li><a href='http://erufenix.ingeenia.net/has-una-pagina-de-videos/' rel='bookmark' title='Permanent Link: Has una página de vídeos'>Has una página de vídeos</a></li><li><a href='http://erufenix.ingeenia.net/copiar-archivos-entre-carpetas-con-php/' rel='bookmark' title='Permanent Link: Copiar archivos entre carpetas con PHP'>Copiar archivos entre carpetas con PHP</a></li><li><a href='http://erufenix.ingeenia.net/generar-un-xml-con-php/' rel='bookmark' title='Permanent Link: Generar un XML con php'>Generar un XML con php</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://erufenix.ingeenia.net/has-una-pagina-de-rolas/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Páginas seguras con PHPsp</title>
		<link>http://erufenix.ingeenia.net/paginas-seguras-con-phpsp/</link>
		<comments>http://erufenix.ingeenia.net/paginas-seguras-con-phpsp/#comments</comments>
		<pubDate>Thu, 06 Sep 2007 23:14:31 +0000</pubDate>
		<dc:creator>erufenix</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programación]]></category>

		<guid isPermaLink="false">http://erufenix.codesys.org/paginas-seguras-con-phpsp</guid>
		<description><![CDATA[Si tu eres desarrollador de aplicaciones en php y se te complica hacer la sección de identificación y logeo, phpsp es tu solución
Phpsp es una serie de scripts escritas en php que de manera fácil y sencilla crean un sistema de logeo e identificación para una aplicación php. Características

Seguridad fácil para las páginas
Crear diferentes grupos [...]


Related posts:<ol><li><a href='http://erufenix.ingeenia.net/md5/' rel='bookmark' title='Permanent Link: Ecriptar password'>Ecriptar password</a></li><li><a href='http://erufenix.ingeenia.net/galeria-para-word-press/' rel='bookmark' title='Permanent Link: Galería de fotos para WordPress'>Galería de fotos para WordPress</a></li><li><a href='http://erufenix.ingeenia.net/mira_ama_sin_indexphp/' rel='bookmark' title='Permanent Link: Mira ama sin index.php'>Mira ama sin index.php</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Si tu eres desarrollador de aplicaciones en php y se te complica hacer la sección de identificación y logeo, phpsp es tu solución</p>
<p><a href="http://www.phpsecurepages.com">Phpsp</a> es una serie de scripts escritas en php que de manera fácil y sencilla crean un sistema de logeo e identificación para una aplicación php. Características</p>
<ul>
<li>Seguridad fácil para las páginas</li>
<li>Crear diferentes grupos de usuarios cada con sus propios permisos</li>
<li>Puede usarse con o sin base de datos</li>
<li>Manejo de sesiones</li>
<li>Soporte multilenguaje</li>
<li>Interfaz personalizable</li>
<li>Trabaja con php3, php4, php5</li>
</ul>
<div id="status1-phps">
<a href="javascript:oculta3('phps');">Instalación, configuración y uso</a>
</div>
<div id="status2-phps" class="show" >
<a href="javascript:oculta3('phps');">ocultar</a>
</div>
<div id="phps" class="show">
<div class="entry_int">
<p><b>· Instalación</b></p>
<ul>
<li><span>1. </span>Descomprimir phpSecurePages en la aplicación o en servidor</li>
<li><span>2. </span>Configurar el archivo secure.php</li>
</ul>
<p><span>Ejecutar el sig. script si vas a usar BD</span></p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #990099; font-weight: bold;">TABLE</span> phpSP_users <span style="color: #FF00FF;">&#40;</span>
primary_key <span style="color: #999900; font-weight: bold;">MEDIUMINT</span> <span style="color: #FF9900; font-weight: bold;">UNSIGNED</span> <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span> <span style="color: #FF9900; font-weight: bold;">AUTO_INCREMENT</span><span style="color: #000033;">,</span>
<span style="color: #000099;">user</span> <span style="color: #999900; font-weight: bold;">VARCHAR</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">50</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>
<span style="color: #000099;">password</span> <span style="color: #999900; font-weight: bold;">VARCHAR</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">32</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>
userlevel <span style="color: #999900; font-weight: bold;">TINYINT</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">3</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span>
<span style="color: #990099; font-weight: bold;">PRIMARY KEY</span> <span style="color: #FF00FF;">&#40;</span>primary_key<span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span>
<span style="color: #990099; font-weight: bold;">KEY</span> <span style="color: #FF00FF;">&#40;</span><span style="color: #000099;">user</span><span style="color: #FF00FF;">&#41;</span>
<span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span></pre></div></div>

<p><b>· Configuración</b></p>
<p>Editar el archivo secure.php y modificar los siguientes parámetros</p>
<ul>
<li><b>$cfgIndexpag</b>: página inicial del sitio</li>
<li><b>$languageFile</b>: lenguaje de phpsp</li>
<li><b>$useDatabase</b>: en true, para usar BD</li>
</ul>
<p>Más info de la configuración <a href="http://www.phpsecurepages.com/readme.php">aqui</a></p>
<p><b>· Uso</b></p>
<p>Poner el siguiente código al inicio de tus páginas</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: #000088;">$cfgProgDir</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'phpSecurePages/'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cfgProgDir</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;secure.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

</div>
<p><a href="http://www.phpsecurepages.com/test/test.php">Ejemplo de phpsp</a></p>
</div>


<p>Related posts:<ol><li><a href='http://erufenix.ingeenia.net/md5/' rel='bookmark' title='Permanent Link: Ecriptar password'>Ecriptar password</a></li><li><a href='http://erufenix.ingeenia.net/galeria-para-word-press/' rel='bookmark' title='Permanent Link: Galería de fotos para WordPress'>Galería de fotos para WordPress</a></li><li><a href='http://erufenix.ingeenia.net/mira_ama_sin_indexphp/' rel='bookmark' title='Permanent Link: Mira ama sin index.php'>Mira ama sin index.php</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://erufenix.ingeenia.net/paginas-seguras-con-phpsp/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>show/hide en los post</title>
		<link>http://erufenix.ingeenia.net/showhide-en-los-post/</link>
		<comments>http://erufenix.ingeenia.net/showhide-en-los-post/#comments</comments>
		<pubDate>Mon, 20 Aug 2007 06:32:31 +0000</pubDate>
		<dc:creator>erufenix</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programación]]></category>

		<guid isPermaLink="false">http://erufenix.codesys.org/showhide-en-los-post</guid>
		<description><![CDATA[Cuando escribo post muy largos en mi blog, no me gusta que estos ocupen una gran parte del blog; así que decidí investigar la manera de ocultar o mostrar parte del contenido.
Para word press hay muchos plugins que hacen esto, pero al probarlos no me gustaron ya que muchos de ellos recargan la pagina para [...]


Related posts:<ol><li><a href='http://erufenix.ingeenia.net/has-una-pagina-de-rolas/' rel='bookmark' title='Permanent Link: Has una página de rolas'>Has una página de rolas</a></li><li><a href='http://erufenix.ingeenia.net/generar-un-xml-con-php/' rel='bookmark' title='Permanent Link: Generar un XML con php'>Generar un XML con php</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Cuando escribo post muy largos en mi blog, no me gusta que estos ocupen una gran parte del blog; así que decidí investigar la manera de ocultar o mostrar parte del contenido.</p>
<p>Para word press hay muchos plugins que hacen esto, pero al probarlos no me gustaron ya que muchos de ellos recargan la pagina para mostrar el contenido restante de un post. Así que mejor decidí implementar algo por mi cuenta.</p>
<div>
<p><b>1. </b>Empecemos por el css incluyendo el siguiente código.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.show</span>
  <span style="color: #00AA00;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
  <span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.hide</span>
  <span style="color: #00AA00;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
   <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
  <span style="color: #00AA00;">&#125;</span></pre></div></div>

<p><b>2. </b>Con javascript usaremos el siguiente <a href="http://erufenix.codesys.org/js/xwindow.js">script</a> y el código.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> oculta3<span style="color: #009900;">&#40;</span>id<span style="color: #009900;">&#41;</span>
   <span style="color: #009900;">&#123;</span>
   <span style="color: #003366; font-weight: bold;">var</span> elemento <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>id<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #003366; font-weight: bold;">var</span> state1<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;status1-&quot;</span><span style="color: #339933;">+</span>id<span style="color: #339933;">;</span>
   <span style="color: #003366; font-weight: bold;">var</span> state2<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;status2-&quot;</span><span style="color: #339933;">+</span>id<span style="color: #339933;">;</span>
   <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>elemento.<span style="color: #660066;">className</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;show&quot;</span><span style="color: #009900;">&#41;</span>
     <span style="color: #009900;">&#123;</span>
      elemento.<span style="color: #660066;">className</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;hide&quot;</span><span style="color: #339933;">;</span>
      xDisplay<span style="color: #009900;">&#40;</span>state1<span style="color: #339933;">,</span><span style="color: #3366CC;">'none'</span><span style="color: #009900;">&#41;</span>
      xDisplay<span style="color: #009900;">&#40;</span>state2<span style="color: #339933;">,</span><span style="color: #3366CC;">'block'</span><span style="color: #009900;">&#41;</span>
     <span style="color: #009900;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">else</span>
    <span style="color: #009900;">&#123;</span>
      elemento.<span style="color: #660066;">className</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;show&quot;</span><span style="color: #339933;">;</span>
      xDisplay<span style="color: #009900;">&#40;</span>state1<span style="color: #339933;">,</span><span style="color: #3366CC;">'block'</span><span style="color: #009900;">&#41;</span>
      xDisplay<span style="color: #009900;">&#40;</span>state2<span style="color: #339933;">,</span><span style="color: #3366CC;">'none'</span><span style="color: #009900;">&#41;</span>
   <span style="color: #009900;">&#125;</span>
 <span style="color: #009900;">&#125;</span></pre></div></div>

<p><b>3. </b>En el html lo siguiente</p>
<div id="ocj" class="show">

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;status1-nombre&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript:oculta3('nombre');&quot;</span>&gt;</span>mostrar<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;status2-nombre&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;show&quot;</span> &gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript:oculta3('nombre');&quot;</span>&gt;</span>ocultar<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nombre&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;show&quot;</span>&gt;</span>Contenido oculto<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></div></div>

<p>
El primer div indica el mensaje que se mostrara cuando el contenido este oculto, el segundo div muestra lo contrario y el tercer div es donde estará el contenido a ocultar. Donde &#8216;nombre&#8217; lo cambiaremos por el identificador del div que vayamos a usar.
</p>
</div>
</div>
<div id="status1-ocj">
<a href="javascript:oculta3('ocj');">Leer más&#8230;</a>
</div>
<div id="status2-ocj" class="show" >
<a href="javascript:oculta3('ocj');">Ocultar</a>
</div>


<p>Related posts:<ol><li><a href='http://erufenix.ingeenia.net/has-una-pagina-de-rolas/' rel='bookmark' title='Permanent Link: Has una página de rolas'>Has una página de rolas</a></li><li><a href='http://erufenix.ingeenia.net/generar-un-xml-con-php/' rel='bookmark' title='Permanent Link: Generar un XML con php'>Generar un XML con php</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://erufenix.ingeenia.net/showhide-en-los-post/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generar un XML con php</title>
		<link>http://erufenix.ingeenia.net/generar-un-xml-con-php/</link>
		<comments>http://erufenix.ingeenia.net/generar-un-xml-con-php/#comments</comments>
		<pubDate>Fri, 27 Jul 2007 06:36:44 +0000</pubDate>
		<dc:creator>erufenix</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programación]]></category>

		<guid isPermaLink="false">http://erufenix.codesys.org/generar-un-xml-con-php</guid>
		<description><![CDATA[Para este ejemplo vamos a crear un XML de la forma

&#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62;
&#60;playlist version=&#34;1&#34; xmlns=&#34;http://xspf.org/ns/0/&#34;&#62;
&#60;trackList&#62;
&#60;track&#62;
&#60;title&#62;&#60;/title&#62;
&#60;creator&#62;&#60;/creator&#62;
&#60;location&#62;&#60;/location&#62;
&#60;/track&#62;
&#60;/trackList&#62;



1.Creamos una variable que contenga las primeras tres líneas del XML


$contenido='&#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62;
&#60;playlist version=&#34;1&#34; xmlns=&#34;http://xspf.org/ns/0/&#34;&#62;
&#60;trackList&#62;';


2.Mediante un for llenamos los datos del xml: tile, creator y location. 


for&#40;$i=0;$i&#60;count&#40;$filenames&#41;;$i++&#41;&#123;
$contenido.='
   &#60;track&#62;
   &#60;title&#62;'.$se.'&#60;/title&#62;
   &#60;creator&#62;&#60;/creator&#62;
   &#60;location&#62;'.$ruta.'&#60;/location&#62;
   [...]


Related posts:<ol><li><a href='http://erufenix.ingeenia.net/has-una-pagina-de-rolas/' rel='bookmark' title='Permanent Link: Has una página de rolas'>Has una página de rolas</a></li><li><a href='http://erufenix.ingeenia.net/flash-php-mysql/' rel='bookmark' title='Permanent Link: Flash + php + mysql'>Flash + php + mysql</a></li><li><a href='http://erufenix.ingeenia.net/paginas-seguras-con-phpsp/' rel='bookmark' title='Permanent Link: Páginas seguras con PHPsp'>Páginas seguras con PHPsp</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Para este ejemplo vamos a crear un <a href="http://es.wikipedia.org/wiki/XML">XML</a> de la forma</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;playlist</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://xspf.org/ns/0/&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;trackList<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;track<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;creator<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/creator<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;location<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/location<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/track<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/trackList<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<div class="entry_int">
<ul>
<li><span>1.</span>Creamos una variable que contenga las primeras tres líneas del XML</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">$contenido='<span style="color: #000000; font-weight: bold;">&lt;?</span>xml version<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;1.0&quot;</span> encoding<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;playlist version=&quot;1&quot; xmlns=&quot;http://xspf.org/ns/0/&quot;&gt;
&lt;trackList&gt;';</pre></div></div>

<ul>
<li><span>2.</span>Mediante un for llenamos los datos del xml: tile, creator y location. </li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><span style="color: #000088;">$i</span><span style="color: #339933;">&lt;</span>count<span style="color: #009900;">&#40;</span><span style="color: #000088;">$filenames</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$contenido</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">'
   &lt;track&gt;
   &lt;title&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$se</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/title&gt;
   &lt;creator&gt;&lt;/creator&gt;
   &lt;location&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$ruta</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/location&gt;
   &lt;/track&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<div id="oxml" class="show">
<ul>
<li><span>3.</span>Agregar a la variable las ultimas líneas después del for</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$contenido</span><span style="color: #339933;">.=</span><span style="color: #0000ff;">'
&lt;/trackList&gt;
&lt;/playlist&gt;'</span><span style="color: #339933;">;</span></pre></div></div>

<ul>
<li><span>4.</span>Por último para guardar el el valor de $contenido, lo hacemos con las siguientes funciones de archivo.</li>
</ul>
<pre lang ="php">
$file3=$dir."/archivo.xml";
$archivo=fopen($file,"w");
fwrite($archivo,utf8_encode($contenido));
fclose($archivo);
</pre>
<p>Para ver con más detalle el código <a href="http://erufenix.codesys.org/videos/explorador_videos.phps">aquí</a> y el xml generado <a href="http://erufenix.codesys.org/videos/rocklist.xml">aquí</a></p>
</div>
</div>
<div id="status1-oxml">
<p><a href="javascript:oculta3('oxml');">Leer más</a></p>
</div>
<div id="status2-oxml" class="show" >
<p><a href="javascript:oculta3('oxml');">ocultar</a></p>
</div>


<p>Related posts:<ol><li><a href='http://erufenix.ingeenia.net/has-una-pagina-de-rolas/' rel='bookmark' title='Permanent Link: Has una página de rolas'>Has una página de rolas</a></li><li><a href='http://erufenix.ingeenia.net/flash-php-mysql/' rel='bookmark' title='Permanent Link: Flash + php + mysql'>Flash + php + mysql</a></li><li><a href='http://erufenix.ingeenia.net/paginas-seguras-con-phpsp/' rel='bookmark' title='Permanent Link: Páginas seguras con PHPsp'>Páginas seguras con PHPsp</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://erufenix.ingeenia.net/generar-un-xml-con-php/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Has una página de vídeos</title>
		<link>http://erufenix.ingeenia.net/has-una-pagina-de-videos/</link>
		<comments>http://erufenix.ingeenia.net/has-una-pagina-de-videos/#comments</comments>
		<pubDate>Wed, 25 Jul 2007 04:17:12 +0000</pubDate>
		<dc:creator>erufenix</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programación]]></category>

		<guid isPermaLink="false">http://erufenix.codesys.org/has-una-pagina-de-videos</guid>
		<description><![CDATA[
Como ya tengo varios vídeos (formato FLV) en mi hosting, me vi en la necesidad de crear algún método para administrarlos y no estar entrando al ftp, cada vez que quiera ver la url del un vídeo, entonces recordé que hace tiempo Ivan karam publico un explorador de archivos hecho en php en la page [...]


Related posts:<ol><li><a href='http://erufenix.ingeenia.net/has-una-pagina-de-rolas/' rel='bookmark' title='Permanent Link: Has una página de rolas'>Has una página de rolas</a></li><li><a href='http://erufenix.ingeenia.net/generar-un-xml-con-php/' rel='bookmark' title='Permanent Link: Generar un XML con php'>Generar un XML con php</a></li><li><a href='http://erufenix.ingeenia.net/copiar-archivos-entre-carpetas-con-php/' rel='bookmark' title='Permanent Link: Copiar archivos entre carpetas con PHP'>Copiar archivos entre carpetas con PHP</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>
Como ya tengo varios vídeos (formato <a href="http://es.wikipedia.org/wiki/FLV">FLV</a>) en mi hosting, me vi en la necesidad de crear algún método para administrarlos y no estar entrando al ftp, cada vez que quiera ver la <a href="http://es.wikipedia.org/wiki/URL">url</a> del un vídeo, entonces recordé que hace tiempo <a href="http://ivan.tuxteno.com">Ivan karam</a> publico un <a href="http://www.tuxteno.com/index.php/blog/view/Explorador%20de%20Archivos%20en%20PHP?id=221">explorador de archivos</a> hecho en php en la page de tuxteno. El cual tome y le hice las siguientes modificaciones para poder administrar los vídeos</p>
<p>&bull;Con getcwd obtengo el directorio actual donde se ejecuta el script y con la <a href="http://mx.php.net/manual/es/reserved.variables.php">variable predefinida</a> $_SERVER obtengo varios datos del servidor</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$referer</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
   <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$referer</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'SERVER_NAME'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;/videos/vids&quot;</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span></pre></div></div>

<p>&bull; Con esta función obtengo la extensión de un archivo, para este caso .flv</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> getExtension<span style="color: #009900;">&#40;</span><span style="color: #000088;">$archivo</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
      	 <span style="color: #000088;">$a</span><span style="color: #339933;">=</span><span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;.&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$archivo</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      	 <span style="color: #b1b100;">return</span> <span style="color: #000088;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$a</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>
        <span style="color: #009900;">&#125;</span></pre></div></div>

<p>Como mis archivos los tengo nombrados con guión bajo, algo así un_archivo_1.flv, entonces uso esta función para cambiar esos guiones por espacios y mandarlos a imprimir</p>
<div id="vidis" class="show">

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> sepcade<span style="color: #009900;">&#40;</span><span style="color: #000088;">$cadena</span><span style="color: #009900;">&#41;</span>
        <span style="color: #000088;">$cade3</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$cade2</span><span style="color: #339933;">=</span><span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;_&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$cadena</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	      <span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$j</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><span style="color: #000088;">$j</span><span style="color: #339933;">&lt;</span>count<span style="color: #009900;">&#40;</span><span style="color: #000088;">$cade2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000088;">$j</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
	        <span style="color: #009900;">&#123;</span>
	         <span style="color: #000088;">$cade3</span><span style="color: #339933;">.=</span><span style="color: #000088;">$cade2</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$j</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: #009900;">&#125;</span>
      	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$cade3</span><span style="color: #339933;">;</span>
       <span style="color: #009900;">&#125;</span></pre></div></div>

<p>&bull; Para reproducir los vídeos creo una función java script usando <a href="http://blog.deconcept.com/swfobject/">swfobject</a> y <a href="http://www.cross-browser.com/">xlibrary</a>, para evitar que se recargue la página cada vez que se cambia de vídeo.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> playmovie<span style="color: #009900;">&#40;</span>file<span style="color: #009900;">&#41;</span>
     <span style="color: #009900;">&#123;</span>
      <span style="color: #003366; font-weight: bold;">var</span> video <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> SWFObject<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;http://erufenix.codesys.org/media/flvplayer.swf&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;mymovie&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;640&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;480&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;8&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;#336699&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #003366; font-weight: bold;">var</span> sep_file<span style="color: #339933;">=</span>file.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;/&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #003366; font-weight: bold;">var</span> sep2_file<span style="color: #339933;">=</span>sep_file<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">5</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #003366; font-weight: bold;">var</span> sep3_file<span style="color: #339933;">=</span>sep_file<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">5</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;_&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      video.<span style="color: #660066;">addVariable</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;file&quot;</span><span style="color: #339933;">,</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      video.<span style="color: #660066;">addVariable</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;autostart&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;true&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      video.<span style="color: #660066;">addParam</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;wmode&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;transparent&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      video.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;videos&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #003366; font-weight: bold;">var</span> sej<span style="color: #339933;">=</span>cadesep<span style="color: #009900;">&#40;</span>sep3_file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      xInnerHtml<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'title2'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;Estas viendo: &quot;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;&lt;a href='&quot;</span> <span style="color: #339933;">+</span> file <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;'&gt;&quot;</span> <span style="color: #339933;">+</span> sej <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;&lt;<span style="color: #000099; font-weight: bold;">\/</span>a&gt;&quot;</span><span style="color: #009900;">&#41;</span>
      document.<span style="color: #660066;">title</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;:: Videos de erufenix :: - &quot;</span><span style="color: #339933;">+</span>sej<span style="color: #339933;">;</span>
     <span style="color: #009900;">&#125;</span></pre></div></div>

<p>Puedes ver el el script funcionando en <a href="http://erufenix.codesys.org/videos/">http://erufenix.codesys.org/videos/</a> y el código completo <a href="http://erufenix.codesys.org/videos/explorador_videos.phps" rel="gb_page_fs[]">aqui</a></p>
</div>
<div id="status1-vidis">
<p><a href="javascript:oculta3('vidis');">Leer más&#8230;</a></p>
</div>
<div id="status2-vidis" class="show" >
<p><a href="javascript:oculta3('vidis');">ocultar</a></p>
</div>


<p>Related posts:<ol><li><a href='http://erufenix.ingeenia.net/has-una-pagina-de-rolas/' rel='bookmark' title='Permanent Link: Has una página de rolas'>Has una página de rolas</a></li><li><a href='http://erufenix.ingeenia.net/generar-un-xml-con-php/' rel='bookmark' title='Permanent Link: Generar un XML con php'>Generar un XML con php</a></li><li><a href='http://erufenix.ingeenia.net/copiar-archivos-entre-carpetas-con-php/' rel='bookmark' title='Permanent Link: Copiar archivos entre carpetas con PHP'>Copiar archivos entre carpetas con PHP</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://erufenix.ingeenia.net/has-una-pagina-de-videos/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
