its a diretory listing of all files, including hidden files (the a flag right?)... but not sure what the R flag is for ... basically i have no idea
R is recursive...see the output in BASH. You would compile that output into a single file or put it in an array. Then use a variation of the random function and take the int() of that output and read the entry for a single line. That is your URL of your random image. Ruben
i understood the recursive R, ive seen the word BASH, and know its a command, and know most of the words you said.. but the meaning and execution are alien to me.... im telling ya... i am a total noob with this lol
Okay, all this discussion got me going. I have the code to do this if you're interested. It assumes you have some way to select (via regex) a pattern of the correct directories. In my site, for example, I have all my images in directories named *****/images/*.jpg, whereas thumbnails are in ****/thumbs/*.jpg/ So if there's some similar pattern to your directories, it can be done. Drop me a PM and I'll send you the code. It's php, so will work on your server. Dave
Ruben would cringe i can tell lol but i have completed a 3 disk set on learning html .. and am now learning the basics to PHP. nothing super advanced, but everything has to start somewhere. hopefully, when i am done with this PHP book, i may be able to better understand and possibly expand existing code found on the internet
The only problem with starting with PHP is that it teaches bad programming habits that are though to break. PHP is a powerful widget tool for the Net and is, as a fact, what coin talk uses. But it think I'd rather teach people the principles of coding first using something like Perl which, although also easier to screw up, does have all the basic coding principles available including real scope, lexical scoping, procedural coding, object design, API building, etc. Ruben
i figured you would belive something like that ...and i am all for learning the basics FIRST. To do anything right, if the foundation is rocky, anything that comes next can be a real mess. BUT.... perl is not easy to learn ...and reading books on it is daunting to dang near impossible when you dont know the code... at least for me. I would love to take classes to learn it, as i know i would do better... but with the wife out of work, its nothing i could do to help my hobby. I was reading through some chapters in the PHP book ... and either the book is wrong, or something else is wrong. I would type the code exactly as it apeared in the book, up it to my server, open the page... and it wouldnt display what the book said it should. Tough to learn what is right when that happens lol
Ok .. due in no small part to the help of Dave M, i got the Random image generator working. The same script is going to count unique files for me as well, but i have to re-work the code, rename a bunch of variables ect... and it should work. But since both scripts will in essence be creating large arrays, it might slow things down a bit.. so i shall see if i leave them both on the same page. For now... the random image generator is now running on my home page Until i finish re-working my site for faster viewing, there are only 100-200 images being pulled from for the random generator, but as each page is fixed, they will auto populate the 'pull' list Thanks again for the help Dave!!! And Ruben .. thanks for that link. I didnt understand much of any of it i think i will stick with PHP for now :thumb: