Thanks, Andrew, but, he already told us what he wanted. If you re-read the entire post…
Bill, I looked into the code for you. You could assign names to the images that correspond to the folder name. So, in your example page, you have “summer” as the name of a folder. You can name that folder’s image as “summer.jpg”. (or .gif .png, etc…) And, then whenever you print a folder name, just display the image instead. Did that make sense?
So, in the SIF code, it displays folder names in a subroutine with this code:
[php]
function RenderFolder(){
$rel=$this->base_folder;
if ($rel==".") return “”;
$rel=explode(DIRECTORY_SEPARATOR,$rel);
$parms=$_GET;
unset($parms['site']);
unset($parms['sif']);
$pth=array();
array_unshift($rel,basename(realpath("."))); // add the root folder also to the bread-crumps
$notfirst=0;
foreach ($rel as $dir) {
if ($notfirst==1) $folder.=$dir.DIRECTORY_SEPARATOR;
$notfirst=1;
$parms['folder']=$folder;
$flink="?".http_build_query($parms);
$dir=nice_chars($dir);
$pth[]="<a href=\"$flink\">$dir</a>";
}
$pths=implode(" ~ ",$pth);
$s="<p class=\"folder\"><b>Folder</b>: $pths";
$s.="</p>";
return $s;
}
[/php]
As you see, this line:
$s="<p class=“folder”>Folder: $pths";
displays the Folder: some-folder-name onto the screen above the thumbs…
You would have to alter this line to display the image for that folder. So, you can use the $pths variable and alter it to display the image instead. So, this “renderfolder()” function will display a folder name. You would have to look where it is called and alter the code to display the folder’s image instead. As far as I can see, the display of the page is all done in this function:
[php]
function RenderSIF(){
$this->thumber=$this->GetThumber();
$str=$this->RenderTitle();
$str.=$this->RenderFolder();
$str.=$this->RenderTable($this->dirs_and_files);
$ptit=$this->PageTitle();
echo $this->html($str,$ptit);
}
[/php]
This function pulls the title, folder name and directory/files list and displays them. It adds in a page title and then turns it into html to be displayed. You would have to alter this function to display an image instead of the folder name. Did all that make sense???
To do this, you would have to alter the “renderfolder” function, in this section of the code:
[php]
$pths=implode(" ~ ",$pth);
$s="<p class=\"folder\"><b>Folder</b>: $pths";
$s.="</p>";
return $s;
[/php]
This section takes the $pth and places it into $pths variable which is then displayed with Folder: and text.
You would have to change this section to take the folder names out of $pth and replace it with an “img” tag. Which would point at the images you have for the folders. Loosely something like this:
s$="<img src=\folder_images" . $pth . “.jpg”>";
I am not sure at all of this is the real code you need. If you can not get it working let us know and I will test it when I have more time tomorrow…
Well, there you have all of the sections that involve your project. Look at them and if you still can’t figure it out, I will help. I am just out of time to test this right now. Hope this much helps you solve it…