Advertisement

09.27.2007 at 10:09PM PDT, ID: 22858681
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.2

PHP - read directory of photos - loop code to display all

Asked by innercproductions in PHP Scripting Language

Tags: , , ,

I have a directory in the "./images/" folder. Let's call it "2006".
The directory contains a lot of thumbnail photos. The directory will be updated for more photos in the future.

Let's say all of the files are called "photo_001_tn.jpg" (with the number changing for each pic)


I want a script to display all of the images in this folder with a link to the large pic for that thumbnail.
We will assume the larger version has the same name as the thumbnail, minus the "_tn" part.
So a large pic of the above thumbnail would be "photo_001.jpg".

I need the script to only display "jpg", "gif", and "png" files.
I need a variable at the top of the script so I can change this.

I want the script to end up displaying this HTML code.
(This is cut down just to explain the point. I will probably change this up a little.)

<a href="./images/2006/photo_001.jpg">
<img src="./images/2006/photo_001_tn.jpg" alt="Photo from 2006" hspace="2" vspace="2">
</a>

But...(important)... I would like it to do 4 pics on the first row, then move to another row.
Instead of just displaying them all together. I only have room for 4 per row.
And how would I make this changable, in case I need 3 per row, etc. Can there be a variable at the beginning of the script?



Start Free Trial
[+][-]09.27.2007 at 10:35PM PDT, ID: 19976667

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: PHP Scripting Language
Tags: php, directory, read, display
Sign Up Now!
Solution Provided By: MasonWolf
Participating Experts: 3
Solution Grade: A
 
 
[+][-]09.27.2007 at 10:36PM PDT, ID: 19976669

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]11.05.2007 at 11:49AM PST, ID: 20218896

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]09.01.2008 at 06:34AM PDT, ID: 22360029

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]09.05.2008 at 09:07PM PDT, ID: 22405760

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628