===================================================== Folders-to-Gallery Script Spliced together and made to work by Brent Kennedy See: www.scsorlando.com Email: Use contact form. Last Updated: 5/3/09 Current Version is 2.0 ===================================================== Crediting: While i would like to have my companies name all over this script, i realize that the Copyright thing at the bottom is kinda blah... so if you want to, just remove it and put whatever you want. Please leave the comments in the default.asp file though. ===================================================== Special Thanks to: Graphite Theory ( www.graphitetheory.com ) for the style update and images(folder and drop arrow). ===================================================== Usages: Personal, business, whatever, i dont care, i just think its great that someone else would find this useful! ===================================================== Modification: BY ALL MEANS, change this script! Make it better, improve it, Change the look( i am not a graphic arts person by any stretch, so i am sure you all can do this better ). The only thing i ask is that, if you modify it, you sent me a zip file with the new version and what changes you made. You can either note the changes in the file/email or have a separate txt document, whatever is easiest! My plan here is to encorporate any changes i like into the release(i will give credit in comment lines to each change made by you and others). If the changes are significant, then i will just create a different release out of it and add a link to download it as well as link to your page and put your name or company next it. ===================================================== Changed/Added/Removed 5/3/09: -Added BKShowimages function which allows you to tell the script to show the image chosen in the thumbnail area of the script instead of a pop-up. This is more broswer friendly. -Added back button to bkshowimages area, used httpreferrer so users would go right back to where they came from. There is a backup to send them to the gallery they were at just incase that doesnt work. -Added image upload option, now if you set the permissions on your directories, you can allow image uploads if you enable the option. GL/HF -optimized the URL creation code. ***REMINDER: DO NOT USE MASSIVE IMAGES unless you need to. They eat up your servers bandwidth and the user has to wait for the image to load. Use the thumbnail options to save everyone headache. ===================================================== Changed/Added/Removed 12/3/05: -Fixed a javascript error that occured in various browsers because i didnt declare a variable in Javascript. -Added the ability to set the maximum window size in the javascript. This will prevent the file from appearing off screen and cutting off. -Pictures are now centered on the viewers screen. Note: Just a rule of thumb, the maximum picture size for any image file that will be used online should be 800x600. Now i am not saying you cant make it larger, just most people have their screens at that resolution and it fits nicely in 1024x768 resolutions. ===================================================== Changed/Added/Removed 7/15/05: -Fixed an issue with virtual directories, apparently the way i had originally coded the script, virtual directories caused my math to be off. -Added a feature to turn virtual directories on or off and set the path for your virtual directory. ===================================================== Changed/Added/Removed 1/08/05: -Fixed the javascript that was causing the image name not to appear sometimes. -Disabled resizing in the javascript. You can turn that back on if you wish. -Blocked all the code. Someone said something about a cluebat. :) -Added comments to the ASP and JAVASCRIPT coding. ===================================================== Changed/Added/Removed 1/02/05: -Removed all the yes/no settings because, if you typed "Yes" or "YES" but not "yes", then they would not work. They are all changed to 1 and 0 now. -Added a feature for people who want to use an include for this gallery. It lets them set the include page, so if you were to include this into gallery.asp, you would need to make sure all the links pointed to gallery.asp not defualt.asp. So you just change the strgallerypage to gallery.asp and the include will do the rest. -Removed ASP resizer -Added javascript resizer --modified popup page so that the borders were null which makes the image fit perfectly into the new window without any space around it. -Added the ability to set the images used in the script. ===================================================== Changed/Added/Removed 12/23/04: -Fixed a typo in the comments, yes i know not important :) -Added a page counter -Added the ability to change directly between pages of photos instead of hitting previous/next(they are still available though). -Added functionality that will auto resize popup pages based on the image size. -Removed old popup window coding -Added the ability to set how many columns of pictures would be shown. -Added the ability to set how many pictures are shown at one time. -Added the basic copyright protection option. I just overlay a blank tranparent gif on top of the actual picture, blocks the user from just right clicking and saving. You are free to change the picture out with one that has your logo. --Ability to change out copyright picture with another. -New java popup window coding --Sets the title of the popup as the picture name without the extension OR your a title you set using strSetTitle. --Sets the background color of the image window. You can change this setting. -Fixed a basic math issue that was causing the last image to repeat to the top of the next set of images. -Added the ability to set the margin for the folder list so that they are closer or more to the right. -Added the ability to remove the top and bottom(header/Footer) boxes. -Added a photo count next to the gallery name at the top of the gallery. ===================================================== Changed/Added 9/6/04: -Added the ability to set a default gallery that will load when the script loads the first time. -Added the ability to show or not show file stats -Added the ability to turn thumbnails on or off -Added the ability to show or not show the borders of the pictures -Added the ability to show the full file name in the stats or remove the extension -Added the ablity to include generic text before and/or after the gallery folder name. -Cleaned up some of the coding -Fixed an issue with file counting that displayed extra forward/Previous buttons if thumbnails were present. -included code created by www.graphitetheory.com that enhances the overall look. (email: graphitetheory@graphitetheory.com) -Fixed a wrapping issue with long names. ===================================================== Features: 1. Single asp page. 2. Supports categories. 3. supports unlimited picture folders. 4. All text is controlled by styles at the top, feel free to change them. 5. hide a folder, 6. One entry page title, gallery title setting, 7. Ignores front page folders! 8. Ignores .db files, 9. Set how many images you want to display at one time. 10. Set how many columns you want on each page. 11. Auto resizes popup window depending on image size. 12. Basic copyright protection. ===================================================== Making this script work: 1. Edit the file and change these two settings: 1a. "strTitle" this is your page and gallery title, change the text in quotes to whatever you want and you are golden. 1b. "strIgnoreFolder" this is the folder in which the default.asp page is located. Change the text in quotes to match it. If you dont change this, the gallery script hierarchal structure will not work correctly and will not look right. 2. Name the folder you want to be the category name with a prefix of "AA_". For example, if i wanted to make a category named "Families", i would name the folder "AA_Families" and stick it in the directory with the script. 3. Place the folders that are going to contain pictures inside the corresponding category folder. ===================================================== Additional Features: 1. Thumbnails -Enable thumbnails by setting the strusethumbs to "yes" -Creating thumbnails isnt hard and there are many programs out there that will do it (acdsee, ImageMagick to name a few). These programs usually take 10-15 seconds to process a ton of pictures for you, so they are well worth it if you are going to be doing alot of image galleries. -When creating thumbnails, there is basically two settings you need to maintain in order for your pictures to work with this script. --The first requirement is that the thumbnails be 125px by 125px up to 150px by 150px. Keep the numbers the same or you wont have pretty pictures. --The second requirement is that you prefix EVERY thumbnail with a "TN_". If you dont put the "TN_" infront of the file name, the gallery wont read it. Make sure the full pictures and the thumbnails have the same name with the exception of the thumbnails having the prefix of "TN_". EXAMPLE: I have a picture, its name is "PictureofME.jpg". The thumbnail for this picture should be named "TN_PictureofME.jpg". The should both be placed in the same folder. The reason for sticking them in the same folder is that if you create a thumbs folder, it will be read by the gallery and shown in the list to the left(not what you want). 2. Hiding a folder: Just put a "_" prefix on any folder you want to hide. If you have a hidden folder and it has subfolers, make sure to rename them with the "_" prefix or they will show up in the list. 3. Disable/enable file stats: This function does what it says, if stats are disabled the file information below the picture is not show. Just set the strshowstats to "no" to not show them or "yes" to show them. 3b. strborders - Disable borders: If showstats is disabled then you can disable the borders around the pictures or leave them enabled. This feature is only available if the showstats feature is enabled. 3c. strfullfilename - show full file name in the stats, this basically allows you to remove the extension of the picture file ( ie: .jpg, .gif, .png, etc.. ). This is basically the only captions option you have. Name the photo the caption you want and remove the extension using this feature and your golden. 4. straftergallery - Text to show after the folder name of the gallery( not the category ). Just type something between the quotes and it will show up after the name, leave it blank and nothing will show. There is a built in space, so dont worry about the spacing. 5. strbeforegallery - Text to show up before the folder name of the gallery( not the category ). Just type something between the quotes and it will show up before the name, leave it blank and nothing will show. This is NO built in space, so whatever you type will show up merged infront of the folder name. IE: folder is Family, setting is set to "my gallery" the result would look like this "my galleryFamily" So if you want to include a space use a   or use a slash, whatever. 6. strdefaultgallery - This sets up a default gallery for the script to load when its first loaded into a users browser. This is probably the easiest to do. Say your top folder, the one we ignore is "test" and the category folder you create directly below that is "AA_Car Shows" and the folder that contains images below the "AA_Car Shows" folder is "Turkey Rod Run", and thats the folder you want to make default. Just use the following: "AA_Car Shows/Turkey Rod Run" -if the default is in a subcategory folder, just follow the tree down from the top category like so: "AA_Car Shows/Turkey Rod Run/AA_Corvettes/Dads Vett" ===================================================== Problems: 1. As you create more subcategories, the spacing going right gets out of hand. This can now be corrected to some extent with the strULLeftMargin, but eventually it will get pretty far over. ===================================================== Wishlist: I would like to embed the images into the default.asp file. I know this can be done, but its beyond my reach. Hopefully someone will help me out with that or i figure out how to do it( ya right ). Keep checking back! ===================================================== Reasons: This script was created because i couldnt find ANYTHING that did what this script does. I found stuff that went one folder deep, but that didnt fill the category requirement. I also found a script that would show folders and files like a directory listing, but that didnt help show pictures. I picked a few of those apart and put in my own coding and walla, you have a working script that doesnt require a DATABASE! Which, not having a db, was the main requirement of what i needed. Pictures are created everyday and by the hundreds, you dont have time to create a new database entry for each one.