I'd like to set up a home page that directly displays an album (bypassing the Collections). Is there a way to do this? Right now I have the home page set to an auto redirect to the URL parameters "index.php?level=collection&id=1". Is there some way to plug these parameters in directly in an Index.php page?
DISPLAYING A SINGLE COLLECTION OF ALBUMS You can add this code above the first lines of gallery.php to automatically redirect all calls to gallery.php to a particular collection of albums:
// new code // redirect to a single collection if (!isset($_GET["level"])){ header('Location: http://www.example.com/gallery/?level=collection&id=COLLECTIONID'); } // end code
Replace "COLLECTIONID" with the id number of the collection of album you wish to display (e.g. "id=1")
1. Note that the full url is being used in this example, you may want to use $config["baseurl"] in the call to header() after loading the configuration file. 2. Also notice that the crumb trail provides a link to the collections (but is redirected - meaning it behaves how we want but is deceptive looking in terms of organization.)
* * *
DISPLAYING A SINGLE ALBUM OF IMAGES If you want to directly display an album (not several albums) it gets trickier. Place the following at the top of gallery.php
// new code // redirect to a single album if (!isset($_GET["level"] or $_GET["level"]=='collection')){ header('Location: http://www.example.com/gallery/?level=album&id=ALBUMID'); } // end code
Replace ALBUMID with the id number of the album to display
1. This will redirect the default call to the page (with no url string) to the album and also when level=collection, but not when level=picture 2. the crumb trail is no longer ideal as it tries to link to collections. You can modify the bread crumb trail generation in gallery.php. Search for "case 'album':" in the generate_breadcrumbs function. Above "break;" add: $breadcrumbs = '<b>'.$album_name.'<b>'; Search for "case 'picture':" in the same function. Above "break;" add: $breadcrumbs = ' <a href="'.$_SERVER["PHP_SELF"].'">'.$album_link.'</a> » ' . '<span id="image_name"><b>'.$picture_name.'</b></span>'; NOTE: I have not tested this change with the slideshow -- expect some issues.
WARNING: not for use if you are using "Generate Cruft-Free URLs"
I tried this and all it did was print the code at the top of my page. I would like to show only collection 1 on an additional page and all albums on my main plaogger installation. I assume this will work with any page calling in the gallery.php - but i need to get it working though.. please explain in better detail where to put it and how to use the baseurl part and pls check your code.
if (!isset($_GET["level"] or $_GET["level"]=='collection')){ header($_SERVER["PHP_SELF"].'?level=album&id=ALBUMID'); }
that way you get the current page that's already been loaded... though i can't remember off the top of my head wether or not PHP_SELF includes GET variables... i don't think so... but i would just do a print on it anyway to test... if it does you need to do some more stuff...