hello, i have a website that has my portfolio its running almost 5 months until one day my host server crash and failed to recover my files and some data now i am stuck again with this simple code like before i have made a solution before but that was long ago, i know this could be funny but i am trying to figure this out for 12 hours and now i need help cause i really cant make it.

This is my website which my portfolio shows, its almost done since i the server crashed but i am stuck with this simple coding.

pls. take a look first ->

http://www.7angels.info/portfolio/

as you can see all the thumbnails where listed in horizontal i was thinking of setting the width into a fix size so that it would resize itself but i failed. here is the simple code that i use to display all images.

<?php

echo "<div class='ppbanner'>";
$path = "/home/angelsin/public_html/portfolio/banners/";
$dir_handle = @opendir($path) or die("Unable to open folder");



while (false !== ($file = readdir($dir_handle))) {

if(ereg("(.*)\.(jpg|bmp|jpeg|png|gif)", $file)){
echo "<a href='http://www.7angels.info/portfolio/banners/$file' rel='lightbox' title='Banner Projects'><img src='http://www.7angels.info/portfolio/banners/$file' alt='$file' width='60' height='60' border='0'></a>";
}

}


closedir($dir_handle);

echo "</div>";

?>

now what i want to do is, make the images display not just 1 line horizontally but fits the tables width, something like this

assume the #'s are images

123456
789012
345670

not just

1
2
3
4
5
6

:( sorry if i cant explain it much better, i just want a very simple solution for this very simple code.

thanks!

hello and thanks for the reply, i really appreciate it but you see i only need a simple solution and the script you just gave me is to complciated for me and i dont need slideshows as i wanted the tumbnails to show with a fix sizes.

my only problem is how to show the images without listing it horizontally.

anyone can help?

hi i think i found a mere solution to my problem but the problem is it keeps shwoing only the 1st image on the folder specified..

here is the code i hope someone can help me:

<?php
$files = glob("../portfolio/banners/*.*");
for ($i=1; $i<count($files); $i++)

$num = $files[$i];
$vals = range(1, $i);
$rows = array_chunk($vals,6); //3 = #of cols

{



    echo '<table border="2">';
foreach($rows as $row) {

    echo    '<tr>';
    foreach($row as $col) {
        echo '<td align="center"><img src="'.$num.'" alt="random image" width="60" height="60"></td>';
    }
    echo    '</tr>';
}
echo '</table>';

    }

?>

pls. take a look at my site so you can see what i mean:

[url]http://www.7angels.info/portfolio/[/url]

Edited 3 Years Ago by Reverend Jim: Fixed formatting

This article has been dead for over six months. Start a new discussion instead.