Need Freelancer\Help - Improve Display of Search Results

ntrantham

Joined: 2008-10-14
Posts: 15
Posted: Mon, 2009-10-05 16:07

I have made the following modifications to my Search Module.

1.) saul11's Enhanced Search to allow for only searching within sub-albums. (Being able to disable the Gallery-Wide Search)
http://gallery.menalto.com/node/53722

2.) Hide the checkbox on the Search form that was added by Saul's mod so that the user could not uncheck it.

3.) Bypass SearchScan.tpl and go direct to SearchShowAll.tpl
http://gallery.menalto.com/node/28699

4.) Suprsidr's Mod to allow the Slidshow to work from Keyword Albums
http://gallery.menalto.com/node/83256

The problem I have is:

1.) The Search results even in SearchShowAll are hideous. It does not completely use the Site Theme to display the results the way that the KeyWordAlbum and other Dynamic Albums do.

2.) Can not get the Slideshow to work from SearchScan, and it is not even there in SearchShowAll.

3.) Can not get the Shopping Cart to appear in either the Search results or the Keyword\Dynamic Albums.

What I would like to be able to do is:

1.) Redirect the Search results to be displayed as a Keyword Album. This way the thumbnails are presented the same as the rest of my site, and the Slideshow will work. But the ability to limit the search results by sub-album remains.

2.) Add the Shopping Cart ability to the Keyword Albums.

3.) Add the boolean search mod ontop of Saul11's mod.
http://gallery.menalto.com/node/65875

4.) Restrict search results so that albums are not returned, only photo's. (I have no other items in my Gallery, just photos and Albums.)

I have limited coding skills, so I have been able to mess around with this some, but just do not have the skill required to complete it. Can someone help? I am willing to make a donation in order to get it completed, if you need\want the donation then lets talk...

I can provide my gallery as a test site as it is only for family and friends...

 
ntrantham

Joined: 2008-10-14
Posts: 15
Posted: Tue, 2009-10-06 03:08

- removed...

 
ntrantham

Joined: 2008-10-14
Posts: 15
Posted: Tue, 2009-10-06 03:08

- removed...

 
ntrantham

Joined: 2008-10-14
Posts: 15
Posted: Tue, 2009-10-06 03:07

-removed...

 
ntrantham

Joined: 2008-10-14
Posts: 15
Posted: Tue, 2009-10-06 03:07

- removed...

 
ntrantham

Joined: 2008-10-14
Posts: 15
Posted: Tue, 2009-10-06 03:23

Ok, after talking to myself on here for a few hours, and tweaking the site I have come across a few things...

I was able to add the boolean hack to the search module.

I was able to clean up the Search results, some...

Here are my problems:

With the Search Results I have no Slideshow, no Cart, no standard navigation (not like the rest of the albums in my site,) clicking on an image will result in leaving the search results and being taken to that image in it's normal album.

With the Keywords Album I have no Cart, no text box to enter multiple keywords, now way to restrict searchs based on current album, and no boolean expressions. I know multiple keywords work as I can manually edit the URL once it is in the address bar - just no easy way for others to do it. No tweaks needed to make the results look like every other album in my gallery, clicking on an image leaves you in the Keyword Album, works great.

So, I don't know what would be easier. Modding the Search Module to include Slideshow, Cart, changing the navigation, and fixing it so that viewing an image will not take you away from the search results.

Or, adding the shopping cart, restricting results to only include current and sub-albums, boolean search, and some kind of search block to the Keyword module.

Is anyone up for this? Or am I alone in wanting something like this?

PS - The reason I want something like this is because my gallery is all family pictures, and I take pictures for my son's soccer team. The other parents on the team do not like having to sort through all 200+ pictures I take during a single game, not to mention the whole season. I would love for them to be able to search each game album for just their son, view the slideshow, click one button and have all the pictures of their son zipped up for them, etc... The search restriction works great here to return only pictures in one game, or only pictures from this season, etc...

Right now they have to go through the whole album and add each picture one at a time, or download the whole album and delete the ones they don't want.

Not to mention my family using this to just pull pictures of their Grandson during the last vacation, etc...

Is this kind of Search available in Gallery 3, should I just wait?

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Tue, 2009-10-06 03:27
Quote:
Can not get the Slideshow to work from SearchScan, and it is not even there in SearchShowAll.

What album type does gallery refer a search result album as?
my final attempt works for all GalleryDynamicAlbums you may need to add the album type (GallerySearchAlbum?) to the condition.
Enabling debug 'buffered' on your search results page will show the smarty panel with the album type.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
ntrantham

Joined: 2008-10-14
Posts: 15
Posted: Wed, 2009-10-07 19:03

Ok... I tried it... Here is what I am getting.

From the Smarty Window:
moduleId => "GalleryCoreSearch"
results => Array (5)
start => 1
end => 9
count => 9
albumName => null

From the Normal browser window, at the top:
Notice: Undefined variable: albumName in /home/localhub/public_html/mygallery/modules/core/classes/GalleryCoreSearch.class on line 338

Does this mean that the SearchModule does not define an albumName? Which I guess would also be why when you click on a photo you are taken to that photo in it's normal album and not like the Keyword Album that actually treats the results as a new album.

So, I tried a few things...

Under the <head> of the SearchShowAll.tpl I added your code, but took out the condition for album type (the first IF statement, and the closing of that IF statement)

And then then added the ForEach loop to add the ItemLinks in... At first, I just get nothing on the page. If I take out the condition surrounding the forEach loop, ({if (isset($links) || isset($theme.itemLinks))}) I get an error that the Index for the ForEach loop is undefined.

Even if I could get this to work, I am still left with several other issues regarding the rest of the problems with the Search Module. It just seems as if the Search Module was written in a completely odd fashion that handles the results completely on it's own. Looking through the includes files and .tpl files it looks so different then how all of the other modules are written as far as variable naming standards, etc...

So, at this point I guess I would like to look into just modifying the Keywords module to add back the cart, add a new block to the module so that instead of making you click the keywords you can type them in a text box, and then being able to restrict the search results like Saul11's enhanced search does with the normal search.

 
ntrantham

Joined: 2008-10-14
Posts: 15
Posted: Thu, 2009-10-08 19:33

Looking in the keywordalbum.inc file I believe this is where the module performs it's search of the Gallery to find all items matching the keyword:

list ($ret, $searchResults) = $gallery->search($query, array_merge($keywords, $data));
if ($ret) {
return array($ret, null);
}

This is line 191.

Saul11's Enhanced Search Module (only includes current album and sub-albums if a checkbox is checked) looks like this:

list ($ret, $resultSet) =
$instance->search($form['options'][$id],
array(SearchUtilities::sanitizeSearchCriteria($form['searchCriteria']), ($form['searchAlbum'] ? $form['albumId'] : 0)));
if ($ret) {
return array($ret->wrap(__FILE__, __LINE__), null);
}

Line 78 in SearchScan.inc

I have tried, but don't know enough about coding to figure out the variables, or what Saul's line is really even doing, but in the Keyword module, how could I modify the search line to function the same as the Search Module?

I am assuming since the Search Module has all ready been modified to do this, and works on it's own this way, that it is simply a matter of modifying the KeywordAlbum.inc to pass the appropriate parameters to the new Search function so that the AlbumID is included.

Thanks...

 
ntrantham

Joined: 2008-10-14
Posts: 15
Posted: Mon, 2009-10-12 03:36

I just found a module named Title Search.

Did a quick mod to make it KeyWord Search..

It gives a search box to type in the words, but is limited to single word searches.

So, it would need four things:

1.) Limit search to sub-albums. - This is a must have...
2.) Ability to specify multiple keywords.
3.) Figure out how to add the Add All to Cart Link back on the Album Page.
4.) Add the boolean search code. So I can do +keyword -keyword searches.

So, now I am looking at either trying to mod this module further, the keywordalbum module, or the search module, or write a new one...

What I am looking for:

1.) Display Search Results as Dynamic Album (slideshow works, browsing pictures works.)
2.) Limit Search Results to current album and sub-albums.
3.) Fix link for Add All to Cart
4.) Multiple Keyword Search
5.) Boolean Search

This would be great if it could search multiple things, like keyword, title, description, etc... but all I really need is Keyword Search.

Can anyone do this? Again, I am willing to 'donate' for assistance...