Jump to content

tm2000

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

tm2000's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks again Neil - but I'm still having trouble! I added your line: echo("<img class=\"thumb_active\" src=\"" . $thumbnails . "/$splitname[0]_thumb.jpg\" alt=\"$pictitle\"> \n<br />\n".$splitname[0]_thumb.jpg); but it didn't work at all (just showed blank screen) - then, I amended your line, as I think maybe the quote marks were in the wrong place at the end? - so now i have: echo("<img class=\"thumb_active\" src=\"" . $thumbnails . "/$splitname[0]_thumb.jpg\" alt=\"$pictitle\"> \n<br />\n.$splitname[0]_thumb.jpg"); but it's still not adding the filename below the thumbnail: http://www.tygamarketing.com/smartgallery/index.php Any ideas? Sorry to be a pain!! (I'm in the very early stages of learning php, so bear with me!)
  2. I can't get it to work! This is the script that I think needs changing: it's php4 if that helps!! See below: <?php function php_thumbnails($imagefolder,$thumbfolder,$lightbox) { //Get image and thumbnail folder from function $images = "portfolio/" . $imagefolder; //The folder that contains your images. This folder must contain ONLY ".jpg files"! $thumbnails = "portfolio/" . $thumbfolder; // the folder that contains all created thumbnails. //Load Images //load images into an array and sort them alphabeticall: $files = array(); if ($handle = opendir($images)) { while (false !== ($file = readdir($handle))) { //Only do JPG's if(eregi("((.jpeg|.jpg)$)", $file)) { $files[] = array("name" => $file); } } closedir($handle); } //Obtain a list of columns foreach ($files as $key => $row) { $name[$key] = $row['name']; } //Put images in order: array_multisort($name, SORT_ASC, $files); //set the GET variable name $pic = $imagefolder; //Thumbnails //Recursively go trough the array of images and add thmubnails to the page: foreach ($files as $file) { $addy = $_GET[$pic]; $string = $file['name']; // Print the currently viewed thumbnail if( $addy == $file['name'] AND $lightbox == "lb-off") { $name = $file['name']; $splitname = explode (".", $name); $pictitle = str_replace("_"," ",$splitname[0]); echo("<img class=\"thumb_active\" src=\"" . $thumbnails . "/$splitname[0]_thumb.jpg\" alt=\"$pictitle\"> \n"); } // Print thumbnails with link else { // Check if thumbnail already created $name = $file['name']; $splitname = explode (".", $name); $pictitle = str_replace("_"," ",$splitname[0]); if( $lightbox == "lb-on") { $link = "<a rel=\"lightbox[" . $images . "]\" title=\"$splitname[0]\" href=\"" . $images . "/" . $name . "\">"; } else { $link = "<a href=\"?" . $pic . "=" . $file['name'] . "\">"; } if (file_exists("$thumbnails/$splitname[0]_thumb.jpg")) { // Load the thumbnail image echo($link); echo("<img class=\"thumb\" src=\"" . $thumbnails . "/$splitname[0]_thumb.jpg\" alt=\"$pictitle\"></a> \n"); } else { // Create a thumbnail image echo($link); echo("<img class=\"thumb\" src=\"thumbnail.php?imagefolder=" . $images . "&thumbfolder=" . $thumbnails . "&name=" . $file['name'] . "&im=" . $images . "/" . $file['name'] . "\" alt=\"$pictitle\"></a> \n"); } } } reset($files); } ?>
  3. Thanks! I think I've found where it prints the thumbnail 0- this is the line I think that does it: echo("<img class=\"thumb_active\" src=\"" . $thumbnails . "/$splitname[0]_thumb.jpg\" alt=\"$pictitle\"> \n"); So do I just add what you sent underneath?
  4. Hi, I have a great php gallery that I found courtesy of http://www.jkemppainen.com, but what I need to be abel to do is add the file name underneath each thumbnail. I'm a newbie to php, and cannot work out how to do this. This is my demo site: http://www.tygamarketing.com/smartgallery/index.php Any help will be much appreciated!! Thanks in advance! Andy
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.