PHP Loader

  • blackhart
  • Graduate
  • Graduate
  • No Avatar
  • Registrado: Jul 15, 2005
  • Mensajes: 111
  • Loc: Hartbeat
  • Status: Offline

Nota Julio 9th, 2006, 10:48 am

Hola, soy el uso de PHP para leer un directorio y crear un archivo XML que pueda ser leído por un programa de flash que gira JPG. Yo no hice el código, pero he intentado modificarlo, pero no funciona.

el manguito se pueden encontrar aquí

este es mi código de
Código: [ Select ]

<?php

/*
This is a sample file that reads through a directory, filters the mp3//jpg/flv 
files and builds a playlist from it. After looking through this file, you'll 
probably 'get the idea' and'll be able to setup your own directory. This 
example uses the mp3player.
*/



// search for mp3 files. set this to '.flv' or '.jpg' for the other scripts 
$filter = ".jpg";
// path to the directory you want to scan
$directory = "pics";



// read through the directory and filter files to an array
@$d = dir($directory);
if ($d) { 
    while($entry=$d->read()) { 
        $ps = strpos(strtolower($entry), $filter);
        if (!($ps === false)) { 
            $items[] = $entry; 
        } 
    }
    $d->close();
    sort($items);
}



// third, the playlist is built in an xspf format
// we'll first add an xml header and the opening tags .. 
header("content-type:text/xml;charset=utf-8");

echo "<?xml version='1.0' encoding='UTF-8' ?>\n";
echo "<jpgrotator>\n";
echo " <parameters>\n";
echo "   <rotatetime>5</rotatetime>\n";
echo "   <randomplay>true</randomplay>\n";
echo "   <shownavigation>false</shownavigation>\n";
echo "   <transition>fade</transition>\n";
echo " </parameters>\n";
echo " <photos>\n";


// .. then we loop through the mysql array ..
for($i=0; $i<sizeof($items); $i++) {
    echo "   <photo path=".'http://domain/pics/'.$items[$i]." />\n";
}
 
// .. and last we add the closing tags
echo "    </photos>\n";
echo "</jpgrotator>\n";

?>
  1. <?php
  2. /*
  3. This is a sample file that reads through a directory, filters the mp3//jpg/flv 
  4. files and builds a playlist from it. After looking through this file, you'll 
  5. probably 'get the idea' and'll be able to setup your own directory. This 
  6. example uses the mp3player.
  7. */
  8. // search for mp3 files. set this to '.flv' or '.jpg' for the other scripts 
  9. $filter = ".jpg";
  10. // path to the directory you want to scan
  11. $directory = "pics";
  12. // read through the directory and filter files to an array
  13. @$d = dir($directory);
  14. if ($d) { 
  15.     while($entry=$d->read()) { 
  16.         $ps = strpos(strtolower($entry), $filter);
  17.         if (!($ps === false)) { 
  18.             $items[] = $entry; 
  19.         } 
  20.     }
  21.     $d->close();
  22.     sort($items);
  23. }
  24. // third, the playlist is built in an xspf format
  25. // we'll first add an xml header and the opening tags .. 
  26. header("content-type:text/xml;charset=utf-8");
  27. echo "<?xml version='1.0' encoding='UTF-8' ?>\n";
  28. echo "<jpgrotator>\n";
  29. echo " <parameters>\n";
  30. echo "   <rotatetime>5</rotatetime>\n";
  31. echo "   <randomplay>true</randomplay>\n";
  32. echo "   <shownavigation>false</shownavigation>\n";
  33. echo "   <transition>fade</transition>\n";
  34. echo " </parameters>\n";
  35. echo " <photos>\n";
  36. // .. then we loop through the mysql array ..
  37. for($i=0; $i<sizeof($items); $i++) {
  38.     echo "   <photo path=".'http://domain/pics/'.$items[$i]." />\n";
  39. }
  40.  
  41. // .. and last we add the closing tags
  42. echo "    </photos>\n";
  43. echo "</jpgrotator>\n";
  44. ?>
  • Anonymous
  • Bot
  • No Avatar
  • Registrado: 25 Feb 2008
  • Mensajes: ?
  • Loc: Ozzuland
  • Status: Online

Nota Julio 9th, 2006, 10:48 am

  • IceCold
  • Guru
  • Guru
  • Avatar de Usuario
  • Registrado: Nov 05, 2004
  • Mensajes: 1254
  • Loc: Ro
  • Status: Offline

Nota Julio 10th, 2006, 10:15 am

¿Crea el xml correctamente?
oh, memorias no volátiles i `ll probarlo por mí mismo :D
“True mastery transcede any particular art. It stems from mastery of oneself - the ability, developed throgh self-discipline, to be calm, fully aware, and complety in tune with oneself and the surroundings. Then, and only then, can a person know himself. ”
  • blackhart
  • Graduate
  • Graduate
  • No Avatar
  • Registrado: Jul 15, 2005
  • Mensajes: 111
  • Loc: Hartbeat
  • Status: Offline

Nota Julio 10th, 2006, 10:58 am

Im no seguro...i algo olvidado la mayor parte de los conocimientos codeing i ha...:(
  • blackhart
  • Graduate
  • Graduate
  • No Avatar
  • Registrado: Jul 15, 2005
  • Mensajes: 111
  • Loc: Hartbeat
  • Status: Offline

Nota Julio 12th, 2006, 7:03 am

UM chichón por favor
  • IceCold
  • Guru
  • Guru
  • Avatar de Usuario
  • Registrado: Nov 05, 2004
  • Mensajes: 1254
  • Loc: Ro
  • Status: Offline

Nota Julio 12th, 2006, 2:24 pm

Lo he comprobado, y tuve un error...así que lo cambié
Código: [ Select ]
echo "   <photo path=".'http://domain/pics/'.$items[$i]." />\n";

with


echo "   <photo path=".'"http://domain/pics/'.$items[$i].'" />\n';
  1. echo "   <photo path=".'http://domain/pics/'.$items[$i]." />\n";
  2. with
  3. echo "   <photo path=".'"http://domain/pics/'.$items[$i].'" />\n';

y el XML fue creado en Aceptar. Didnt aspecto más sobre el resto del código
“True mastery transcede any particular art. It stems from mastery of oneself - the ability, developed throgh self-discipline, to be calm, fully aware, and complety in tune with oneself and the surroundings. Then, and only then, can a person know himself. ”
  • blackhart
  • Graduate
  • Graduate
  • No Avatar
  • Registrado: Jul 15, 2005
  • Mensajes: 111
  • Loc: Hartbeat
  • Status: Offline

Nota Julio 12th, 2006, 3:46 pm

Gracias que trabajó,
hey um ¿cómo se prueba fuera de curriosity? De esta manera podría la figura hacia fuera en mi propio :)
  • IceCold
  • Guru
  • Guru
  • Avatar de Usuario
  • Registrado: Nov 05, 2004
  • Mensajes: 1254
  • Loc: Ro
  • Status: Offline

Nota Julio 12th, 2006, 11:38 pm

uhmmm,
He instalado apache + php + mysql para windows en mi equipo, por lo que actúa como un servidor web con php.
Por lo tanto, en el directorio por defecto que tiene apache para web, en mi caso c: \ appserver \ www \ i creado un archivo llamado files.php copiar y pegar el código en ese país, entonces todos los que hice fue escribir en el navegador:
http://localhost:8080/files.php
(: 8080 porque tengo IIS corriendo en el puerto 80, que es la opción predeterminada, así que cambió a correr Apache en el puerto 8080)
“True mastery transcede any particular art. It stems from mastery of oneself - the ability, developed throgh self-discipline, to be calm, fully aware, and complety in tune with oneself and the surroundings. Then, and only then, can a person know himself. ”
  • recep
  • Beginner
  • Beginner
  • No Avatar
  • Registrado: Jul 23, 2006
  • Mensajes: 40
  • Loc: www.loanus.info
  • Status: Offline

Nota Agosto 27th, 2007, 6:55 am

Hmm, agradable rotador, podemos encontrar alguna demo para ello?
  • Fabinator
  • Proficient
  • Proficient
  • No Avatar
  • Registrado: May 05, 2007
  • Mensajes: 467
  • Status: Offline

Nota Agosto 28th, 2007, 5:25 am

no mucho de una oportunidad, usted golpeado un año de edad tema ..

Publicar Información

  • Total de mensajes en este tema: 9 mensajes
  • Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 27 invitados
  • No puede abrir nuevos temas en este Foro
  • No puede responder a temas en este Foro
  • No puede editar sus mensajes en este Foro
  • No puede borrar sus mensajes en este Foro
  • No puede enviar adjuntos en este Foro
 
 

© 2011 Unmelted, LLC. Ozzu® es una marca registrada de Unmelted, LLC