My apologies for my late reply. Thank you for your help and your time!
Yes, what you have on your site is more what I was looking for. I ran it though my test site. Instead of showing the album titles on my site, though, it shows the album names, is that some difference between Gallery 1.4.4 and 1.4.5?
Also, for my site, although the URLs for the photo are are fine, the URLs for the albums all have a trailing \... the same problem is on your site. Perhaps from this line?
PHP: › <?php /*
** Returns an array of the parent album names for a given album.
** Key is albumname, value is albumtitle
** Array is reverted, so the first Element is the topalbum.
** If you set $addChild true, then the child album itself is added as last Element.
** Based on code by: Dariush Molavi
*/
function getParentAlbums($addChild=false) {
global $gallery;
Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
Posted: Fri Sep 24, 2004 11:02 am Post subject: Re: [RELEASE] Gallery Search Block
hmm..my mistake...
add:
PHP: › <?php /*
* Returns an array of the parent album names for a given child
* album.
* Array is reverted, so the first Element is the topalbum.
* If you set $addChild true, then the child album itself is added as last Element.
* Based on code by: Dariush Molavi
*/
function getParentAlbums($childAlbum, $addChild=false) {
$pAlbum = $childAlbum;
$parentNameArray = array();
if ($addChild == true) {
$parentNameArray[$pAlbum->fields['name']] = $pAlbum->fields['title'];
}
while ($pAlbum = $pAlbum->getParentAlbum(FALSE)) {
$parentNameArray[$pAlbum->fields['name']] = $pAlbum->fields['title'];
}
Posted: Sat Sep 25, 2004 5:00 pm Post subject: Re: [RELEASE] Gallery Search Block
Thank you so much for your help!
So, just so it's clear to anyone reading this, for Gallery 1.4.4, here are add a bread crumb to a search result to show the parent albums, as shown here [nukedgallery.net], here are Dari's instructions:
Code: › $searchTitle = eregi_replace("($searchstring)", "<b>\\1</b>", $searchTitle); // cause search word to be bolded
$searchDescription = eregi_replace("($searchstring)", "<b>\\1</b>", $searchDescription); // cause search word to be bolded
$searchSummary = eregi_replace("($searchstring)", "<b>\\1</b>", $searchSummary); // cause search word to be bolded
Code: › function &getParentAlbum($loadphotos=TRUE) {
if ($this->fields['parentAlbumName']) {
$parentAlbum = new Album();
$parentAlbum->load($this->fields['parentAlbumName'], $loadphotos);
return $parentAlbum;
}
return null;
}
And ADD AFTER it:
Code: › /*
** Returns an array of the parent album names for a given album.
** Key is albumname, value is albumtitle
** Array is reverted, so the first Element is the topalbum.
** If you set $addChild true, then the child album itself is added as last Element.
** Based on code by: Dariush Molavi
*/
function getParentAlbums($addChild=false) {
global $gallery;
Code: › /*
* Returns an array of the parent album names for a given child
* album.
* Array is reverted, so the first Element is the topalbum.
* If you set $addChild true, then the child album itself is added as last Element.
* Based on code by: Dariush Molavi
*/
function getParentAlbums($childAlbum, $addChild=false) {
$pAlbum = $childAlbum;
$parentNameArray = array();
if ($addChild == true) {
$parentNameArray[$pAlbum->fields['name']] = $pAlbum->fields['title'];
}
while ($pAlbum = $pAlbum->getParentAlbum(FALSE)) {
$parentNameArray[$pAlbum->fields['name']] = $pAlbum->fields['title'];
}
Save and done! If I made any mistakes, please feel free to edit them. o.o
You can see this function implemented at my site as well, http://64.17.165.160/ [64.17.165.160]. The 'Scans Search' is the gallery search. An example search [64.17.165.160] with an album and photo displayed.
Posted: Fri Oct 13, 2006 11:50 am Post subject: Re: [RELEASE] Gallery Search Block
i noticed this was a pretty old topic so i was wondering if it was still compatible with the newest version of gallery (cuz i wasnt able to find any other) and where exacly you have to place the NG-GallerySearch.php
is it by any chance in here
0:/gallery2/modules/imageblock/templates/blocks/
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum