Home | Support Forums | Your Account | Gallery [2] | Downloads | News | Site Map ]
Nuked Gallery
  Create a FREE account or Login   As a guest, you don't have access to our FULL navigation system.
 Forum FAQForum FAQ   StatisticsStatistics   SearchSearch   UsergroupsUsergroups   FavoritesFavorites  

[RELEASE] Gallery Search Block
Goto page 1, 2  Next
 
Post new topic   Reply to topic    NukedGallery.net Forum Index » PHP-Nuke Issues » Blocks View previous topicPrinter friendly versionView next topic
Author Message
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6233
Location: Washington Township, NJ, USA

PostPosted: Fri Dec 19, 2003 8:53 am    Post subject: [RELEASE] Gallery Search Block Reply with quote

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
Offline View user's profile Send private message Visit poster's website
AdBot
   Post subject: [RELEASE] Gallery Search Block  

Back to top
Aylwin

Novice
Novice


Joined: Sep 16, 2003
Posts: 27

PostPosted: Sat Dec 27, 2003 5:56 pm    Post subject: Re: [RELEASE] Gallery Search Block Reply with quote

Very, very nice! Very Happy
Back to top
Offline View user's profile Send private message Visit poster's website
cosmic

Beginner
Beginner


Joined: Nov 25, 2003
Posts: 3

PostPosted: Thu Jan 01, 2004 5:40 am    Post subject: Re: [RELEASE] Gallery Search Block Reply with quote

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
Offline View user's profile Send private message
slackbladder

Moderator
Moderator


Joined: Mar 29, 2003
Posts: 1038
Location: Cambs,UK

PostPosted: Thu Jan 01, 2004 8:31 am    Post subject: Re: [RELEASE] Gallery Search Block Reply with quote

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
Offline View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
cosmic

Beginner
Beginner


Joined: Nov 25, 2003
Posts: 3

PostPosted: Thu Jan 01, 2004 8:41 am    Post subject: Re: [RELEASE] Gallery Search Block Reply with quote

Perfect - thanks! Wink
Back to top
Offline View user's profile Send private message
slackbladder

Moderator
Moderator


Joined: Mar 29, 2003
Posts: 1038
Location: Cambs,UK

PostPosted: Thu Jan 01, 2004 8:47 am    Post subject: Re: [RELEASE] Gallery Search Block Reply with quote

Smile

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
Offline View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Bongolonian

Beginner
Beginner


Joined: Jun 20, 2003
Posts: 9

PostPosted: Sun Jan 04, 2004 3:47 pm    Post subject: Re: [RELEASE] Gallery Search Block Reply with quote

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
Offline View user's profile Send private message
mystavash

Beginner
Beginner


Joined: Sep 07, 2004
Posts: 14

PostPosted: Tue Sep 21, 2004 12:30 pm    Post subject: Re: [RELEASE] Gallery Search Block Reply with quote

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... Smile

Any help would be appreciated!

Anisa.
Back to top
Offline View user's profile Send private message
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6233
Location: Washington Township, NJ, USA

PostPosted: Tue Sep 21, 2004 8:18 pm    Post subject: Re: [RELEASE] Gallery Search Block Reply with quote

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
Offline View user's profile Send private message Visit poster's website
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6233
Location: Washington Township, NJ, USA

PostPosted: Tue Sep 21, 2004 8:42 pm    Post subject: Re: [RELEASE] Gallery Search Block Reply with quote

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
Offline View user's profile Send private message Visit poster's website
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6233
Location: Washington Township, NJ, USA

PostPosted: Wed Sep 22, 2004 8:35 am    Post subject: Re: [RELEASE] Gallery Search Block Reply with quote

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
Offline View user's profile Send private message Visit poster's website
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6233
Location: Washington Township, NJ, USA

PostPosted: Wed Sep 22, 2004 9:09 am    Post subject: Re: [RELEASE] Gallery Search Block Reply with quote

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> &raquo; ";
+                     }
+                  }
+
                   $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") .":&nbsp;&nbsp;<a href=\"" .
+                  $searchdraw["Text1"] = '<div class="desc">'. _("From Album") .":&nbsp;&nbsp;".$parentURLString."<a href=\"" .
                                          makeAlbumUrl($searchAlbum->fields['name']) . "\">" .
                                          $searchAlbum->fields['title'] . "</a></div>";
                   $searchdraw["Text2"] = '<span class="desc">'. $searchCaption .'</span>';

_________________
Back to top
Offline View user's profile Send private message Visit poster's website
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6233
Location: Washington Township, NJ, USA

PostPosted: Wed Sep 22, 2004 8:32 pm    Post subject: Re: [RELEASE] Gallery Search Block Reply with quote

Ok, as of 1.4.5-cvs-b201, my patch to util.php was made available in the main branch of Gallery. The updated patch for search.php is:

Code: › --- search.php   2004-09-21 01:15:45.000000000 -0400
+++ /home/httpd/xxxxxx/htdocs/modules/gallery/search.php   2004-09-22 21:23:21.000000000 -0400
@@ -219,6 +219,15 @@
                      // One of the parents of this item is hidden do not show it to users
                      continue;
                   }
+
+                  $parentNameArray = getParentAlbums($searchAlbum);
+                  if(count($parentNameArray) != 0) {
+                     $parentURLString = '';
+                     foreach($parentNameArray as $pName=>$pTitle) {
+                        $parentURLString .= "<a href=\"".makeAlbumUrl($pName)."\">".$pTitle."</a> &raquo; ";
+                     }
+                  }
+
                   $photoMatch = 1;
                   $id = $searchAlbum->getPhotoId($j);
                   // cause search word to be bolded
@@ -228,7 +237,7 @@
                   $searchdraw["top"] = true;
                   $searchdraw["photolink"] = $searchAlbum->getThumbnailTag($j, $thumbSize);
                   $searchdraw["photoURL"] = makeAlbumUrl($searchAlbum->fields['name'], $id);
-                  $searchdraw["Text1"] = '<div class="desc">'. _("From Album") .":&nbsp;&nbsp;<a href=\"" .
+                  $searchdraw["Text1"] = '<div class="desc">'. _("From Album") .":&nbsp;&nbsp;".$parentURLString."<a href=\"" .
                                          makeAlbumUrl($searchAlbum->fields['name']) . "\">" .
                                          $searchAlbum->fields['title'] . "</a></div>";
                   $searchdraw["Text2"] = '<span class="desc">'. $searchCaption .'</span>';

_________________
Back to top
Offline View user's profile Send private message Visit poster's website
mystavash

Beginner
Beginner


Joined: Sep 07, 2004
Posts: 14

PostPosted: Thu Sep 23, 2004 2:43 am    Post subject: Re: [RELEASE] Gallery Search Block Reply with quote

Thank you for your help! I have Gallery 1.4.4, but I will try it on a testing board. Smile

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. Smile

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
Offline View user's profile Send private message
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6233
Location: Washington Township, NJ, USA

PostPosted: Thu Sep 23, 2004 7:04 am    Post subject: Re: [RELEASE] Gallery Search Block Reply with quote

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
Offline View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    NukedGallery.net Forum Index » PHP-Nuke Issues » Blocks View previous topicPrinter friendly versionView next topic
Goto page 1, 2  Next

 
Jump to:  
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
All times are GMT - 5 Hours

Powered by phpBB © phpBB Group



Sponsors: Web HostingDomain NamesDedicated ServersDedicated Web HostingDomain Name RegistrationWeb hosting AustraliaSEO Web DesignWeb Design New YorkSearch Engine OptimizationSearch Engine Optimisation

6th year online! 2003-2008
Legal • Use of this site consitutes agreement to the Acceptable Use Policy
Hosted by Implosion WorksSourceForge.net Logo • Theme by TonicMedia