The Gallery software
Being the lazy person that I am, I decided that it would be much easier to write my own gallery software than customize someone elses. Being the generous person that I am, I now make it available to any passing person free of charge. So, here it is...
Downloading the files
Choose the zip file appropriate to your version of MS Access.
Download gallery97.zip (21kb)
Download gallery2k.zip (19kb)
Download galleryXP.zip (66kb)
When you unzip the zip, select the option (called "Use folder names" in my version of WinZip) which puts the files in the subfolders indicated by the Path info. You should end up with 2 folders - gallery and includes - and an Access db called galleryN.mdb where N is your version of Access. gallery contains the pages which display and administer the gallery (all the .asp files), includes contains common functions (all the .inc files).
How to install the gallery
- The database. Open up the database file in MSAccess and open the Users table. You will find a user called admin with a password of admin who has admin permissions on your photos. Change this username and password to something else and then close the db again. Now upload the database to somewhere on your webserver and make a note of the physical address. By that I mean something that starts with c:\location not http://location.
- dbconn.inc. In the includes directory is a file called dbconn.inc. Open this up in a text editor and you should see the following on the second line
strconn="Driver={Microsoft Access Driver (*.mdb)};Dbq=d:\webs\tinyjo.net\db\gallery.mdb;"
Change the end part of that line (the bit after Dbq=) to the location of the database that you took note of in the earlier step. Be careful not to delete the ;" at the end. Save your changes and exit. - Now you have to decide where you're going to store your photos. The default the software assumes is /images/photos/ (e.g. http://www.tinyjo.net/images/photos/). If you want to put them somewhere else, you need to edit the second line of includes/printphoto.inc and replace /images/photos/ with your location. Note that you should use a URL starting with / - this means from the root of your website. So if you want your photos in http://www.yourwebsite.com/stuff/gallery/photos/ you should put /stuff/gallery/photos/.
- You are now ready to upload the includes and gallery folders to your website. They must both be at the same level (i.e. you put both folders in the same place), but that's the only restriction.
- You're now ready to go. Open your web-browser and go to http://www.yourwebsite.com/gallery/login.asp (assuming you put the gallery folder at the root of your website) and log in using the username and password you set in step 1. Now go to http://www.yourwebsite.com/gallery/ and you can start adding photos.
Using and customizing the gallery
To enter categories, people or places for photos use comma separated lists.
Each page has got a bit at the bottom saying gallery code by me. This is in a paragraph with css class gallerycredit. Hide it if you want to, but don't delete it please.
The whole of the content of each page is enclosed in a gallerycontent div. Each photo is in a photo paragraph. The links sections are gallerylinks paragraphs. Fiddle with the CSS to your hearts content :)
The default page currently shows the 5 most recently uploaded photos. I've also included code for showing 5 random photos. Open up /gallery/default.asp and near the top, you should see a line starting sql2=. Below this are another couple of lines saying sql2= which are commented out (by prefixing with '). To have 5 random photos, uncomment the 2 lower lines (remove the ') and comment out the first one (add ' to the start). In either case, if you want more photos, change the number where it says "Top 5" to whatever you want
Please mail me with any questions, comments or bug reports :)