PHP Loader

  • blackhart
  • Graduate
  • Graduate
  • No Avatar
  • Inscription: Juil 15, 2005
  • Messages: 111
  • Loc: Hartbeat
  • Status: Offline

Message Juillet 9th, 2006, 10:48 am

Salut, Im utilisation de PHP pour lire un répertoire et créer un fichier XML qui serait lisible que par un programme Flash qui tourne JPG. Je n'ai pas le code mais j'ai essayé de le modifier mais il ne fonctionne pas.

la coiffe peut être trouvé ici

Ceci est mon code
Code: [ 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
  • Inscription: 25 Feb 2008
  • Messages: ?
  • Loc: Ozzuland
  • Status: Online

Message Juillet 9th, 2006, 10:48 am

  • IceCold
  • Guru
  • Guru
  • Avatar de l’utilisateur
  • Inscription: Nov 05, 2004
  • Messages: 1254
  • Loc: Ro
  • Status: Offline

Message Juillet 10th, 2006, 10:15 am

elle crée le xml correctement?
oh, i `ll nvm essayer par moi-même :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
  • Inscription: Juil 15, 2005
  • Messages: 111
  • Loc: Hartbeat
  • Status: Offline

Message Juillet 10th, 2006, 10:58 am

Im not sure...i un peu oublié la plupart des codeing knowldge j'avais...:(
  • blackhart
  • Graduate
  • Graduate
  • No Avatar
  • Inscription: Juil 15, 2005
  • Messages: 111
  • Loc: Hartbeat
  • Status: Offline

Message Juillet 12th, 2006, 7:03 am

um bosse s'il vous plaît
  • IceCold
  • Guru
  • Guru
  • Avatar de l’utilisateur
  • Inscription: Nov 05, 2004
  • Messages: 1254
  • Loc: Ro
  • Status: Offline

Message Juillet 12th, 2006, 2:24 pm

Je l'ai testé, et j'ai eu une erreur...J'ai donc changé
Code: [ 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';

et le XML a été créé sur OK. Na pas regarder de plus sur le reste du code
“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
  • Inscription: Juil 15, 2005
  • Messages: 111
  • Loc: Hartbeat
  • Status: Offline

Message Juillet 12th, 2006, 3:46 pm

Merci qui ont travaillé,
hey euh comment l'avez-vous tester sur curriosity? Ainsi, je pourrais simplement le découvrir sur ma propre :)
  • IceCold
  • Guru
  • Guru
  • Avatar de l’utilisateur
  • Inscription: Nov 05, 2004
  • Messages: 1254
  • Loc: Ro
  • Status: Offline

Message Juillet 12th, 2006, 11:38 pm

uhmmm,
J'ai installé apache + php + mysql pour windows sur mon ordinateur, il agit comme un serveur web avec support PHP.
Ainsi, dans le répertoire par défaut qui prend pour apache web, dans mon cas, c: \ appserver \ www \ i créé un fichier appelé files.php et de copier coller dans votre code, alors j'ai fait était tout à taper dans le navigateur:
http://localhost:8080/files.php
(: 8080 parce que j'ai IIS sur le port 80, qui est par défaut, donc j'ai changé d'Apache pour fonctionner sur le port 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
  • Inscription: Juil 23, 2006
  • Messages: 40
  • Loc: www.loanus.info
  • Status: Offline

Message Août 27th, 2007, 6:55 am

Hmm, sympa rotateurs, peut-on trouver une demo pour le faire?
  • Fabinator
  • Proficient
  • Proficient
  • No Avatar
  • Inscription: Mai 05, 2007
  • Messages: 467
  • Status: Offline

Message Août 28th, 2007, 5:25 am

pas beaucoup de chance, vous avez cogné un an sujet ..

Afficher de l'information

  • Total des messages de ce sujet: 9 messages
  • Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 50 invités
  • Vous ne pouvez pas poster de nouveaux sujets
  • Vous ne pouvez pas répondre aux sujets
  • Vous ne pouvez pas éditer vos messages
  • Vous ne pouvez pas supprimer vos messages
  • Vous ne pouvez pas joindre des fichiers
 
 

© 2011 Unmelted, LLC. Ozzu® est une marque déposée de Unmelted, LLC