Menu
Hello everyone. I am constantly adding image galleries to sites I create for clients. However, I can never seem to find a gallery script that is simple. Every single one I try is really bulky needing databases, users, and entire engines. These kinds of scripts are just too big for what I need.
Does anyone know of some really simplistic design galleries available? Something that just requires a config file that points to the folder of images or something and a php line or two to insert the gallery into a page (or something similar).
Any ideas?
<i>
</i><!DOC HTML>
<html>
<head>
<title> Simple Gallery </title>
<style type="text/css">
.Gallery { float: left; margin:5px; }
.GalleryPage { display:none; }
.clear { clear:both; }
</style>
<script type="text/javascript">
// For: http://www.webdeveloper.com/forum/showthread.php?t=246427
// Following to be placed in an external JS file after testing
var SampleGallery = [
["http://www.loveroofing.com/gallery/cache/sample-images/urban_terror_icon_by_polishxcii_100_cw85_ch85_thumb.png",'Sample Images'],
["http://www.loveroofing.com/gallery/cache/other-samples/grub-background_100_cw85_ch85_thumb.jpg",'Other Samples'],
["http://www.loveroofing.com/gallery/cache/more-samples/gnome-blackstyle_1600x1200_100_cw85_ch85_thumb.png",'More Samples']
];
var Gallery0 = [
["http://www.loveroofing.com/gallery/cache/sample-images/urban_terror_icon_by_polishxcii_100_cw85_ch85_thumb.png",'Sample 1'],
["http://www.loveroofing.com/gallery/cache/sample-images/urban_terror_icon_by_polishxcii_100_cw85_ch85_thumb.png",'Sample 2'],
["http://www.loveroofing.com/gallery/cache/sample-images/urban_terror_icon_by_polishxcii_100_cw85_ch85_thumb.png",'Sample 3'],
["http://www.loveroofing.com/gallery/cache/sample-images/urban_terror_icon_by_polishxcii_100_cw85_ch85_thumb.png",'Sample 4'],
["http://www.loveroofing.com/gallery/cache/sample-images/urban_terror_icon_by_polishxcii_100_cw85_ch85_thumb.png",'Sample 5'],
["http://www.loveroofing.com/gallery/cache/sample-images/urban_terror_icon_by_polishxcii_100_cw85_ch85_thumb.png",'Sample 6'],
["http://www.loveroofing.com/gallery/cache/sample-images/urban_terror_icon_by_polishxcii_100_cw85_ch85_thumb.png",'Sample 7'],
["http://www.loveroofing.com/gallery/cache/sample-images/urban_terror_icon_by_polishxcii_100_cw85_ch85_thumb.png",'Sample 8'],
["http://www.loveroofing.com/gallery/cache/sample-images/urban_terror_icon_by_polishxcii_100_cw85_ch85_thumb.png",'Sample 9'],
["http://www.loveroofing.com/gallery/cache/sample-images/urban_terror_icon_by_polishxcii_100_cw85_ch85_thumb.png",'Sample 10'],
["http://www.loveroofing.com/gallery/cache/sample-images/urban_terror_icon_by_polishxcii_100_cw85_ch85_thumb.png",'Sample 11'],
["http://www.loveroofing.com/gallery/cache/sample-images/urban_terror_icon_by_polishxcii_100_cw85_ch85_thumb.png",'Sample 12'],
["http://www.loveroofing.com/gallery/cache/sample-images/urban_terror_icon_by_polishxcii_100_cw85_ch85_thumb.png",'Sample 13']
];
var Gallery1 = [
["http://www.loveroofing.com/gallery/cache/other-samples/grub-background_100_cw85_ch85_thumb.jpg",'Other 1'],
["http://www.loveroofing.com/gallery/cache/other-samples/grub-background_100_cw85_ch85_thumb.jpg",'Other 2'],
["http://www.loveroofing.com/gallery/cache/other-samples/grub-background_100_cw85_ch85_thumb.jpg",'Other 3'],
["http://www.loveroofing.com/gallery/cache/other-samples/grub-background_100_cw85_ch85_thumb.jpg",'Other 4'],
["http://www.loveroofing.com/gallery/cache/other-samples/grub-background_100_cw85_ch85_thumb.jpg",'Other 5'],
["http://www.loveroofing.com/gallery/cache/other-samples/grub-background_100_cw85_ch85_thumb.jpg",'Other 6'],
["http://www.loveroofing.com/gallery/cache/other-samples/grub-background_100_cw85_ch85_thumb.jpg",'Other 7'],
["http://www.loveroofing.com/gallery/cache/other-samples/grub-background_100_cw85_ch85_thumb.jpg",'Other 8'],
["http://www.loveroofing.com/gallery/cache/other-samples/grub-background_100_cw85_ch85_thumb.jpg",'Other 9'],
["http://www.loveroofing.com/gallery/cache/other-samples/grub-background_100_cw85_ch85_thumb.jpg",'Other 10'],
["http://www.loveroofing.com/gallery/cache/other-samples/grub-background_100_cw85_ch85_thumb.jpg",'Other 11'],
["http://www.loveroofing.com/gallery/cache/other-samples/grub-background_100_cw85_ch85_thumb.jpg",'Other 12'],
["http://www.loveroofing.com/gallery/cache/other-samples/grub-background_100_cw85_ch85_thumb.jpg",'Other 13']
];
var Gallery2 = [
["http://www.loveroofing.com/gallery/cache/more-samples/gnome-blackstyle_1600x1200_100_cw85_ch85_thumb.png",'More 1'],
["http://www.loveroofing.com/gallery/cache/more-samples/gnome-blackstyle_1600x1200_100_cw85_ch85_thumb.png",'More 2'],
["http://www.loveroofing.com/gallery/cache/more-samples/gnome-blackstyle_1600x1200_100_cw85_ch85_thumb.png",'More 3'],
["http://www.loveroofing.com/gallery/cache/more-samples/gnome-blackstyle_1600x1200_100_cw85_ch85_thumb.png",'More 4'],
["http://www.loveroofing.com/gallery/cache/more-samples/gnome-blackstyle_1600x1200_100_cw85_ch85_thumb.png",'More 5'],
["http://www.loveroofing.com/gallery/cache/more-samples/gnome-blackstyle_1600x1200_100_cw85_ch85_thumb.png",'More 6'],
["http://www.loveroofing.com/gallery/cache/more-samples/gnome-blackstyle_1600x1200_100_cw85_ch85_thumb.png",'More 7'],
["http://www.loveroofing.com/gallery/cache/more-samples/gnome-blackstyle_1600x1200_100_cw85_ch85_thumb.png",'More 8'],
["http://www.loveroofing.com/gallery/cache/more-samples/gnome-blackstyle_1600x1200_100_cw85_ch85_thumb.png",'More 9'],
["http://www.loveroofing.com/gallery/cache/more-samples/gnome-blackstyle_1600x1200_100_cw85_ch85_thumb.png",'More 10'],
["http://www.loveroofing.com/gallery/cache/more-samples/gnome-blackstyle_1600x1200_100_cw85_ch85_thumb.png",'More 11'],
["http://www.loveroofing.com/gallery/cache/more-samples/gnome-blackstyle_1600x1200_100_cw85_ch85_thumb.png",'More 12'],
["http://www.loveroofing.com/gallery/cache/more-samples/gnome-blackstyle_1600x1200_100_cw85_ch85_thumb.png",'More 13']
];
// Following can remain here or in external file
var PagesInGallery = ['GalleryPage0','GalleryPage1','GalleryPage2'];
function toggle(IDS) { // alert(IDS);
for (var i=0; i<PagesInGallery.length; i++) {
if (IDS != PagesInGallery[i]) { document.getElementById(PagesInGallery[i]).style.display = 'none'; }
}
var e = document.getElementById(IDS).style.display;
if (e == 'none') { document.getElementById(IDS).style.display = 'block'; }
else { document.getElementById(IDS).style.display = 'none'; }
}
onload = function() {
for (var i=0; i<PagesInGallery.length; i++) {
document.getElementById(PagesInGallery[i]).style.display = 'none';
}
}
</script>
</head>
<body>
<script type="text/javascript">
var str = '';
for (var i=0; i<SampleGallery.length; i++) {
str += '<div class="Gallery" onclick="toggle('GalleryPage'+i+'')">';
str += '<img src="'+SampleGallery[i][0]+'"><br>'+SampleGallery[i][1];
str += '</div>';
} str += '<p class="clear">';
str += '<div class="GalleryPage" id="GalleryPage0">';
for (var i=0; i<Gallery0.length; i++) {
str += '<div class="Gallery">';
str += '<img src="'+Gallery0[i][0]+'"><br>'+Gallery0[i][1];
str += '</div>';
if ((i % 5) == 4) { str += '<br class="clear">'; }
} str += '</div><p class="clear">';
str += '<div class="GalleryPage" id="GalleryPage1">';
for (var i=0; i<Gallery1.length; i++) {
str += '<div class="Gallery">';
str += '<img src="'+Gallery1[i][0]+'"><br>'+Gallery1[i][1];
str += '</div>';
if ((i % 5) == 4) { str += '<br class="clear">'; }
} str += '</div><p class="clear">';
str += '<div class="GalleryPage" id="GalleryPage2">';
for (var i=0; i<Gallery2.length; i++) {
str += '<div class="Gallery">';
str += '<img src="'+Gallery2[i][0]+'"><br>'+Gallery2[i][1];
str += '</div>';
if ((i % 5) == 4) { str += '<br class="clear">'; }
} str += '</div><p class="clear">';
document.write(str);
</script>
</body>
</html>
Ran the code without modifications here:http://www.loveroofing.com/gallery.php
Thanks a ton. It's very simplistic and just what I need. I will of course do some mods to dress it up a bit but the code is solid. Thanks so much for taking the time to help an amateur out. ?
Marking the thread as "Resolved" as well.[/QUOTE]
0.1.9 — BETA 5.29