Community @ The Turning Gate

Support community for TTG plugins and products.

NOTICE

The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.

This forum is now closed, and exists here as a read-only archive.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2015-05-10 15:50:57

ninaj
Member
Registered: 2015-04-26
Posts: 4

Search not working when password protection turned on

Hi,
I have finally figured out how to get the search to work properly (must be Gallery, NOT CRG - so sad) and everything works perfectly...UNTIL I turn on "enable password." Once I turn on "enable password," the login works as it should, but then when I go to search for a term, I get nothing. Is there something I'm missing?

I tried copying the /search/ folder into the protected gallery, and then tried the folder above that, thinking maybe it couldn't access the images due to the password protection, but that changed nothing.

Any ideas, or solutions?

Offline

#2 2015-05-10 19:59:34

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Search not working when password protection turned on

search works globally (it cannot be gallery specific) so you probably wouldn't want images in a password protected gallery to show up in a search.
This is also the reason search doesn't work for CRG: your clients wouldn't want their images showing up in a search by some random visitor to your site.


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#3 2015-05-10 22:20:44

Matthew
Administrator
From: San Francisco, CA
Registered: 2012-09-24
Posts: 5,795
Website

Re: Search not working when password protection turned on

You're not missing anything. Search is intentionally disabled to protect password protected and client images.


Matt

The Turning Gate, http://theturninggate.net

Offline

#4 2015-05-11 02:29:21

ninaj
Member
Registered: 2015-04-26
Posts: 4

Re: Search not working when password protection turned on

Thanks for the quick reply! Is there any way I can go into the code and re-enable search for password protected galleries? Or alternate way to make a search happen?

Here's my deal: I do a ton of event/conference photography, where speakers & participants want to find photos of themselves quickly out of a gallery of hundreds of photos. I want to be able to password protect the gallery because it gives the illusion of privacy for the participants who want to control their image. I'd rather not use Photoshelter or similar subscription solution (self-employed so trying to keep monthly costs down), and don't want to use flickr or more public places like that.

Can I create stand-alone galleries where I password protect the folder in c panel, instead of through TTG, and have the search still work?

Offline

#5 2015-05-13 20:18:14

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 4,399

Re: Search not working when password protection turned on

If you make the following edits, search should work on any photo and album other than those explicitly hidden from search.  That means photos in password-protected albums, and password protected albums, and CRG albums.

It goes without saying that you should only make these changes if you fully understand what that means. 

We will not be held responsible for photos and albums that you did not intend to be discoverable or viewable inadvertently becoming discoverable or viewable.

The changes are all in publisher/application/dao/SearchDAO.php

1. Change this line from:

$excludeAlbumsClause =  'a.enable_password=? and a.hide_from_search=? and a.enable_crg=?';

to:

$excludeAlbumsClause = 'a.hide_from_search=?';

2. Change these lines from:

$params = array('no', 'no', 'no', '%'.$term.'%');
$caption_params = array('no', 'no', 'no', 'image_caption', '%'.$term.'%');

to:

$params = array('no', '%'.$term.'%');
$caption_params = array('no', 'image_caption', '%'.$term.'%');

Note that there is a lot more to solving this searchability than just opening search for all cases.  A proper solution would take into consideration the logged-in status of the albums, album sets and CRG login, and be much more involved.

Offline

#6 2015-05-19 01:30:39

ninaj
Member
Registered: 2015-04-26
Posts: 4

Re: Search not working when password protection turned on

You saved my bacon! Thanks so much for the edits, Ben! I will not hold anyone, other than myself, responsible for the consequences of making the edits to search on my site.

This is possibly the best, most helpful, and most active forum on the internet. Thanks for all of your help.

Offline

Board footer

Powered by FluxBB