FRIHOSTFORUMSSEARCHFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

JS: function to show all pictures in one directory

 


steve1200
I want to present easily a few images and I don't want to handle with the source code.
Do you understand what I want?

the printed text should look like:
Code:
<a href="images/IMAGE.jpg" rel="lightbox[templates]"><img src="images/small/IMAGEsmall.jpg" alt="" /></a>


Can you help me? I'm not so good in JS Wink (lightbox is a tool, to present the picture)

Thank you!
coreymanshack
steve1200 wrote:
I want to present easily a few images and I don't want to handle with the source code.
Do you understand what I want?

the printed text should look like:
Code:
<a href="images/IMAGE.jpg" rel="lightbox[templates]"><img src="images/small/IMAGEsmall.jpg" alt="" /></a>


Can you help me? I'm not so good in JS Wink (lightbox is a tool, to present the picture)

Thank you!


Did you read the how-to on the front page?
steve1200
you didn't unterstand what I meant. Wink

I have integrated lightbox, but that's not important, for that what I want.

So, I need a script that reads out all the pictures of one folder. It doesn't have to be in JS, PHP or perl is also ok! So, could you be so kind to write such a script for me? I think it's not to complicated.

Lightbox is just an effect, I want to add.

greets,
Steve

p.s. I would pay with Frih$ Wink

edit: Oh, I just recognized that I didn't wrote what I exactly want in my first post. It's just in the topic. So I think it was my mistake, that you misunterstood me.
fuhgeddaboutit
a way would be to create a script that would cycle through the contents of a directory, but I'm not sure if this can be done in just JS.
I would use php to go about getting the files.

I don't have a lot of time, as soon as I do I'll try to hook you up with a script
jmraker
In PHP... assuming the only files in the directory are images and a index.php
Code:
<?php
foreach(glob('images/*') as $file){
   switch($file){
      case 'images/index.php': // skip this file
         continue;
      default:
         $thumb = str_replace('images/', 'images/small/', $file);
         echo '<a href="' . $file . '" rel="lightbox[templates]"><img src="' . $thumb . '" alt="" /></a>';
         
   }
}
?>
steve1200
Thanks for your answers!

Yesterday I met with a friend of mine and he wrote a script for me, which does the job. It's written in Perl.
If someone is interested in the script, write me a message. My Friend doesn't want me, to post it in a forum, but I can send it to others private.

greets,
Steve
Related topics

Firefox Advanced Configuration
[JS] unset 'setTimeout'
150 frh$ for menubar Please CLOSE
Directory tree in PHP
wont load images

How To : Improve Your PHP Programming
How do you show HTML/PHP code on your website?
PatTheGreat.com
You're invited!!!!
Putting something on every page...

Our mother Earth
Boosting the performance of IE6
I need some major help...
Ohio High School Porn Homework Canceled
Country Statistics
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.