Support » Plugins and Hacks » php script to pick up files in a fold

php script to pick up files in a fold

  • Hello, I am using a slide show swf to show pictures in a fold for my wordpress blog. I don’t know about php script. I am using the following to pick every file with an extension .jpg. I want to modify it to pick up everyfile with an extension either .jpg or gif. and also there is a word thumb_ in file name. In this case not all files in the fold will be displayed. How can I do that? your instruction will be greatly appreciated.

    // reading the directory and inserting the mp3 files in the playlist array
    $n = 0;
    $playlist = array();
    $fdir = opendir($dir);
    while($i = readdir($fdir)) {
    // if a .jpg string is found, add the file to the array
    if (strpos(strtolower($i),”.jpg”) !== false) {
    $playlist[$n] = $i;
    // close the directory and sort the array

Viewing 4 replies - 1 through 4 (of 4 total)
  • what does this have to do with wordpress????

    Well, heesh is wanting to use the script to display two sorts of image files in hisser blog. So it’s wp related in a bassackwords sort of way….

    kding, you may have to write a script using nested “for” loops or some such, and that IS without the purview of this forum. While your request does pertain to a wp blog, you really need to find info on this sort of script elsewhere. There might be a listserv at lists.evolt.org which could be of more assistance.

    vkaryl, thank you. I know I should have looked for somewhere else. the script can be used to make a slide show plug in. there isn’t one available for wordpress. thanks again for your kind response.

    Yeah, I figured it was something like that. Many of the people on the evolt lists also have familiarity with wordpress, so that’d be your best bet.

    Best of luck! [Y’know, though, there are a bunch of plugins that do galleries, etc. You might want to take a look at http://codex.wordpress.org/Plugins and see if you can get a link to one that will work for you.]

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘php script to pick up files in a fold’ is closed to new replies.
Skip to toolbar