| Author |
Message |
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6233 Location: Washington Township, NJ, USA
|
Posted: Fri Dec 19, 2003 8:53 am Post subject: [RELEASE] Gallery Search Block |
|
|
A very simple block to add to your site to allow Gallery searching from anywhere. A sample can be found at http://phpnuke.nukedgallery.net [nukedgallery.net]. The file can be downloaded from here [nukedgallery.net] _________________
 |
|
| Back to top |
|
|
AdBot
|
| Post subject: [RELEASE] Gallery Search Block |
|
|
|
|
|
| Back to top |
|
 |
Aylwin
Novice


Joined: Sep 16, 2003 Posts: 27
|
Posted: Sat Dec 27, 2003 5:56 pm Post subject: Re: [RELEASE] Gallery Search Block |
|
|
Very, very nice!  |
|
| Back to top |
|
|
cosmic
Beginner


Joined: Nov 25, 2003 Posts: 3
|
Posted: Thu Jan 01, 2004 5:40 am Post subject: Re: [RELEASE] Gallery Search Block |
|
|
Just what I've been looking for - excellent!
I do have one problem though, when I activate the block all my topic icons disappear! Any ideas on this please?
Nuke 6.5 gal 1.4.2 |
|
| Back to top |
|
|
slackbladder
Moderator


Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Thu Jan 01, 2004 8:31 am Post subject: Re: [RELEASE] Gallery Search Block |
|
|
Not used the search box - but try this:
modules/News/index.php:
$s_sid = $row[sid];
to
$s_sid = "$row[sid]";
admin.php:
$sid = $row[sid];
to
$sid = "$row[sid]"; _________________ "The only difference between me and a madman is that I'm not mad." |
|
| Back to top |
|
|
cosmic
Beginner


Joined: Nov 25, 2003 Posts: 3
|
Posted: Thu Jan 01, 2004 8:41 am Post subject: Re: [RELEASE] Gallery Search Block |
|
|
Perfect - thanks!  |
|
| Back to top |
|
|
slackbladder
Moderator


Joined: Mar 29, 2003 Posts: 1038 Location: Cambs,UK
|
Posted: Thu Jan 01, 2004 8:47 am Post subject: Re: [RELEASE] Gallery Search Block |
|
|
You may need to edit your /modules/Top/index.php also if you use it. _________________ "The only difference between me and a madman is that I'm not mad." |
|
| Back to top |
|
|
Bongolonian
Beginner


Joined: Jun 20, 2003 Posts: 9
|
Posted: Sun Jan 04, 2004 3:47 pm Post subject: Re: [RELEASE] Gallery Search Block |
|
|
Cheers man, had the same prob, fixed it thanks to your post
Also if your using the "Last 5 Articles" block then you have to change that also |
|
| Back to top |
|
|
mystavash
Beginner


Joined: Sep 07, 2004 Posts: 14
|
Posted: Tue Sep 21, 2004 12:30 pm Post subject: Re: [RELEASE] Gallery Search Block |
|
|
Maybe this is too much to ask from the already marvelous search, but is there anyway to get the results to display the immediate parent album's title and then the search result album's title?
My site goes ABC>series>sets, and to save space, I didn't put the series name in the set albums themselves (you can see the parent album at the top anyway), but in the search results, you don't have that, and without a highlight, you don't really know what a set is sometimes. It'd be nice if it could display series album title : set album title...
Any help would be appreciated!
Anisa. |
|
| Back to top |
|
|
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6233 Location: Washington Township, NJ, USA
|
Posted: Tue Sep 21, 2004 8:18 pm Post subject: Re: [RELEASE] Gallery Search Block |
|
|
hmm...good idea...BUT...(there's always a "but")...this block uses the built-in search function in Gallery (no use in me reinventing the wheel). so, such a mod would have to go into the core gallery code. i will see what i can dig up and will submit a patch for inclusion in the next release. once such a patch is available, i'll post it here. _________________
 |
|
| Back to top |
|
|
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6233 Location: Washington Township, NJ, USA
|
Posted: Tue Sep 21, 2004 8:42 pm Post subject: Re: [RELEASE] Gallery Search Block |
|
|
i've got a preliminary version working, search for "dog" in the gallery.
you'll notice the last result, the "are you having fun yet?" image, is inside the "december 2002" album of the "sugar" master album, however, i haven't gotten the parent recursion to root working (efficiently) yet. for now, it's bedtime, but i will tackle this soon. _________________
 |
|
| Back to top |
|
|
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6233 Location: Washington Township, NJ, USA
|
Posted: Wed Sep 22, 2004 8:35 am Post subject: Re: [RELEASE] Gallery Search Block |
|
|
http://www.nukedgallery.net/modules/gal ... g&go=Go%21
i believe is what you're looking for. i'm speaking with the devs now about including it in the next CVS build. there is concern that it may be a substantial performance hit on large galleries, though. _________________
 |
|
| Back to top |
|
|
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6233 Location: Washington Township, NJ, USA
|
Posted: Wed Sep 22, 2004 9:09 am Post subject: Re: [RELEASE] Gallery Search Block |
|
|
here is the patch code, submitted at http://sourceforge.net/tracker/?func=de ... tid=307130 and http://sourceforge.net/tracker/?func=de ... tid=307130
Note that these patches are against 1.4.5-cvs-b200
Patch to util.php:
Code: › --- util.php 2004-09-21 20:43:43.000000000 -0400
+++ /home/httpd/xxxxx/htdocs/modules/gallery/util.php 2004-09-22 09:50:10.000000000 -0400
@@ -3502,6 +3502,28 @@
}
+/*
+ * Returns an array of the parent album names for a given child
+ * album.
+ * Code by: Dariush Molavi
+ */
+function getParentAlbums($childAlbum) {
+ $tAlbum = new Album();
+ $tAlbum = $childAlbum;
+ $parentNameArray = array();
+ do{
+ $pAlbumName = $tAlbum->fields['parentAlbumName'];
+ if($pAlbumName) {
+ $pAlbum = new Album();
+ $pAlbum->load($pAlbumName);
+ $parentNameArray[] = $pAlbumName;
+ }
+ $tAlbum = $pAlbum;
+ } while($pAlbumName);
+ $parentNameArray = array_reverse($parentNameArray);
+
+ return $parentNameArray;
+}
require_once(dirname(__FILE__) . '/lib/lang.php');
require_once(dirname(__FILE__) . '/lib/Form.php');
Patch to search.php:
Code: › --- search.php 2004-09-21 01:15:45.000000000 -0400
+++ /home/httpd/xxxxx/htdocs/modules/gallery/search.php 2004-09-22 09:53:24.000000000 -0400
@@ -219,6 +219,17 @@
// One of the parents of this item is hidden do not show it to users
continue;
}
+
+ $parentNameArray = getParentAlbums($searchAlbum);
+ if(count($parentNameArray) != 0) {
+ $parentURLString = '';
+ for($z=0; $z<count($parentNameArray); $z++) {
+ $temp = new Album();
+ $temp->load($parentNameArray[$z]);
+ $parentURLString .= "<a href=\"".makeAlbumUrl($parentNameArray[$z])."\">".$temp->fields['title']."</a> » ";
+ }
+ }
+
$photoMatch = 1;
$id = $searchAlbum->getPhotoId($j);
// cause search word to be bolded
@@ -228,7 +239,7 @@
$searchdraw["top"] = true;
$searchdraw["photolink"] = $searchAlbum->getThumbnailTag($j, $thumbSize);
$searchdraw["photoURL"] = makeAlbumUrl($searchAlbum->fields['name'], $id);
- $searchdraw["Text1"] = '<div class="desc">'. _("From Album") .": <a href=\"" .
+ $searchdraw["Text1"] = '<div class="desc">'. _("From Album") .": ".$parentURLString."<a href=\"" .
makeAlbumUrl($searchAlbum->fields['name']) . "\">" .
$searchAlbum->fields['title'] . "</a></div>";
$searchdraw["Text2"] = '<span class="desc">'. $searchCaption .'</span>'; _________________
 |
|
| Back to top |
|
|
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6233 Location: Washington Township, NJ, USA
|
|
| Back to top |
|
|
mystavash
Beginner


Joined: Sep 07, 2004 Posts: 14
|
Posted: Thu Sep 23, 2004 2:43 am Post subject: Re: [RELEASE] Gallery Search Block |
|
|
Thank you for your help! I have Gallery 1.4.4, but I will try it on a testing board.
I am not absolutely sure that this exactly the way I want to go, but I will test it out.
In my case, the images are not actual photos, they're trading card scans.
My site is set up like this:
Code: › # A B
Series 1 title
Set A
Set B
Set C
Series 2 title
Set A
Set D
Set E
I don't know if my explanation makes sense, so here is the link: http://64.17.165.160/modules.php?name=gallery
(Sorry about the pink. ^.^)
I have some empty albums basically as placeholders, so they will pop up in the search, but not have a highlight image to show what set they're from. These are all invariably (for my site) subsubalbums, so it would be nice to show the subalbum name in the search result. For example, if someone types Set A , the two set A albums will popup, but without a highlight image, it's impossible to distinguish between the two. Or even if it does have a highlight image, if the user is unfamiliar with the series, it doesn't help much.
Similarly, when I search on your site for July, the July subalbums popup, but I have no way of knowing which dog album they come from.
Another thing I was hoping to be able to do is be able to search for Series 1 Set A and get just that set, but I haven't figured a good way to do that.
Anisa. |
|
| Back to top |
|
|
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6233 Location: Washington Township, NJ, USA
|
Posted: Thu Sep 23, 2004 7:04 am Post subject: Re: [RELEASE] Gallery Search Block |
|
|
ah, i gotcha....you want the album paths displayed for photos and for the albums themselves that are returned.
let me make a quick mod and i'll post the updated patch. _________________
 |
|
| Back to top |
|
|
|
|
|
|
|