WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Droplets & Snippets »
  • RandomImage also from subfolders
  • Print
Pages: [1]   Go Down

Author Topic: RandomImage also from subfolders  (Read 4690 times)

Offline YoJoe

  • Posts: 74
    • projektowanie stron
RandomImage also from subfolders
« on: May 27, 2011, 01:42:36 AM »
Since randomimage droplet uses a readdir() function, I'm wondering if it would be much hassle to change its algorithm to use scandir(), to also draw an image from nested directory.
The main reason is to show randomly chosen image on index page from existing image galleries.

The best way would be to scandir() for all directories in root directory, choose a random subdirectory and then choose a random img from it. Because scanning all subdirs, and loading all img files would take unnecessary time and resources only to grab, and show 1 photo.

There wouldn't be much a problem with nested dirs with images named like:
subdir1
subdir2
...
because it would be a simple change in droplet.
But nested directories are going to have random names, and that's too much for my rookie php skills :/
Logged
WuJitsu - in web I trust  :cool:

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Droplets & Snippets »
  • RandomImage also from subfolders
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2