Tuesday, 15 June 2010

javascript - PHP to build gallery navigation -


I was wondering whether to automatically create a navigation menu for an image gallery, It is possible to use. Currently I have a simple "showcase" with link-coded links for various folders of pictures (jquery and ajax and php, some things that I do not quite understand, but how to learn from tutorials and preferences) In, I have three files:

  • main.php
  • Main.css
  • images.php < P> And I use hard link on main.php, call images.php script to load images to a specific folder On the main page to use the image in a Divijh.

    This is my current NAV setup:

    My question is this: Since all my images are in subdrees under "images" DIR, is there any way i can just create a navigation point (php script?) Can I "subtract" the names of "images"? (Such as when I add more folders, it is kept)

    Also, for some reason I can not do the variable on my script 'images.php? Dirname = images / ', is there any way to fix this?

    If they are all in the images directory, Code> $ image_path

      and   

    and to get all the subdirectories

      & lt; Php $ image_path = '/ full / path / to / images'; $ D = dir ($ image_path); While (wrong! == ($ entry = $ d-> read ())} {if_dir ($ image_path. $ Entry)} {if (($ entry! = '.')) ($ Entry! = ' .. ')) {Allo $ entry; # Or print your HTML code for each directory}}}? & Gt;    

No comments:

Post a Comment