Hello,
i have a file controller that lists all the files and folders. If its
a folder then a link is show that the user can click and the page
reloads showing that folder contents. If a file is found, which is an
image, then the image thumbnail is shown.
The problem is that the images are shown one after the other down the
page. I want to lay them out in a table 4 coulmns wide and how ever
many needed down. How can i do this?
This is how i am showing the information at present
Folders
<br />
<div py:for="d in dir">
<a href="/file/ftp_session_set/${d}">${d}</a>
</div>
<br />
Files
<br />
<div py:for="f in thumbnail_files">
<img src="${thumbnail_files[f]}" alt="${f}" />
<a href="${large_files[f]}">view a large image</a>
<br />
</div>
i can do this in php like
<?php
if ($_SERVER['HTTP_REFERER'])
{
$ImageDirectory = "/Xinha/plugins/ExtendedFileManager/demo_images/
t/";
$BigImage = "../pictures/picture/t/";
$ctr=0;
echo "<table border=\"0\" width=\"100%\" class = \"maintext\">";
foreach (glob("$ImageDirectory/
{*.gif,*.jpg,*.png,*.GIF,*.JPG,*.PNG}", GLOB_BRACE) as $image)
{
if(!$ctr) echo "<TR><TD>";
$ctr++;
//remove .. for url
$dir = str_replace("..", "", "$BigImage");
//get name for url
$name = str_replace("$ImageDirectory", "", "$image");
//get name on it's own
$fullname = str_replace("/", "", $name);
echo "<td>";
echo"<div class = \"maintextsubheading\">";
echo '<br />';
echo $fullname;
echo"</div>";
echo '<br />';
echo '<div class =\"maintext\">';
echo '<img src="'.$image.'">';
echo '<br />';
echo '<br />';
echo "URL for Rich Text Editor";
echo '<br />';
echo '<br />';
echo "http://bcyorkshire.co.uk/admin".$dir.$name;
echo '<br />';
echo '<br />';
echo "<a href=\"http://bcyorkshire.co.uk/admin$dir$name\">View
full Image</a>";
echo '<br />';
echo '<input type="checkbox" name="delete[]" value="'.
$image.'" />Delete ';
echo '<br />';
echo '<br />';
echo "</td>";
echo "</div>";
if($ctr==3) {$ctr=0;ECHO "</TD></TR>";}
}
if($ctr!=0) {$ctr=2-$ctr; echo "</TD><TD SPAN=$ctr> </TD></
TR>";}
}?>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---