WordPress.org

Ready to get started?Download WordPress

Forums

php script to pick up files in a fold (5 posts)

  1. kding
    Member
    Posted 8 years ago #

    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;
    $n++;
    }
    }
    // close the directory and sort the array
    closedir($fdir);
    array_multisort($playlist);

  2. whooami
    Member
    Posted 8 years ago #

    what does this have to do with wordpress????

  3. vkaryl
    Member
    Posted 8 years ago #

    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.

  4. kding
    Member
    Posted 8 years ago #

    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.

  5. vkaryl
    Member
    Posted 8 years ago #

    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.]

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags