PhotoPost Community

PhotoPost Community (http://www.photopost.com/forum/)
-   Photopost Pro Bug Reports (http://www.photopost.com/forum/photopost-pro-bug-reports/)
-   -   Problems Sorting with Search (http://www.photopost.com/forum/photopost-pro-bug-reports/121406-problems-sorting-search.html)

kwrd December 8th, 2005 10:41 AM

Problems Sorting with Search
 
When we do a search on the gallery, we want the results to come back sorted by newest photos first. How do I make that the default?

Also, when we do a search, if we scroll down to the "Sort Photos" section and change the "sort by", "timeframe", and "order" drop-down values, the resulting page loses the search (and then sorts ALL the photos -- not just the photos returned from the search).

For example, if I do a gallery search on the word "green", this is the resulting page:
showgallery.php?mcats=all&si=green&what=allfields&name=&when=0&whenterm=&condition=and

And it returns 843 results but they're not sorted by date (newest photos first).

So I scroll down to the bottom of the page to the "Sort Photos" box and select:
Sort by: Posted Date
Timeframe: Beginning
Order: Descending
and then click the "Sort Now" button.

The resulting page is showgallery.php (without any other variables/values at the end of the URL). And now it's showing 54,688 results instead of just the 843 results that were returned from my search.

Chuck S December 8th, 2005 11:02 AM

Search is made to return the photos with no sort just from beginning to end

I would suggest this in showgallery.tmpl


Code:

Content visible to verified customers only.

kwrd December 8th, 2005 11:34 AM

Unfortunately neither of these solutions worked.

The search is still sorting in no particular order.

And when I change the sort order on the bottom of the page, the resulting page shows all the photos. (It loses the search parameters.)

Chuck S December 8th, 2005 11:46 AM

Try this instead even though the last one did work

kwrd December 8th, 2005 11:50 AM

For the first one, it did in fact add the sort to the URL:

showgallery.php?mcats=all&si=green&what=allfields&name=&when=0&whenterm=&condition=and&sortby=d

but the resulting sort is still not sorted by filedate.

Chuck S December 8th, 2005 11:52 AM

It was on my install ;) sorted by date posted

Now the above edit will get the sort box to work

kwrd December 8th, 2005 12:28 PM

It's still not working.

Chuck S December 8th, 2005 01:03 PM

As I priorly stated search does not return by any sort and is not suppose to. It returns the first to the last. I gave you a little tweak to try and it does work

http://www.reeftalk.com/gallery/search.php

try searching for reef they are indeed sorted by date

Now the edit in showgallery.tmpl I will be placing in as a bug fix and should fix the sort issue for that box

Now the

kwrd December 8th, 2005 01:15 PM

I did try using the tweak - and it just isn't working on our site. I must be missing something.

Can I have your code for showgallery.tmpl to compare to my version?
And/or showgallery.php? Is there something in there that needs to be changed?

Chuck S December 8th, 2005 01:30 PM

search.php is the file I meantioned you make the change for your site ;) to do a sort beforehand

showgallery.tmpl change is the sort box below which is a bug and will be corrected in the build

Code:

Content visible to verified customers only.

kwrd December 8th, 2005 01:45 PM

OK. Now I'm really confused.

In your post #2 above, you have code that you said to edit in showgallery.tmpl.

I did that. But where is the code that I'm supposed to edit in search.php?

Chuck S December 8th, 2005 03:49 PM

The one that I gave to you as a special edit in search.php since I already stated search does not pull any sort parameters and not suppose to. This at the bottom of search.php


http://www.photopost.com/forum/showp...12&postcount=5

kwrd December 8th, 2005 05:17 PM

I did add:

Code:

Content visible to verified customers only.
to the end of the URL string in search.php but that didn't effect it at all. It still doesn't sort it. I see that's it's working for you on the reeftalk.com gallery -- but it's not sorting it on our site. I must be missing something in showgallery.php or showgallery.tmpl because it just isn't sorting it for me.

Chuck S December 8th, 2005 05:29 PM

Are you using the latest Photopost?

I see you have not replaced your showgallery.tmpl file yet either

kwrd December 8th, 2005 05:40 PM

We're using version 5.2.1

I did replace the showgallery.tmpl file but it didn't seem to make any difference so I reverted it back. I just replaced it again so you can see... but it doesn't seem to be helping at all.

Chuck S December 8th, 2005 05:41 PM

remember when you replace a file using vb3 you need to place the template in the vb3enhanced directory ;)

kwrd December 8th, 2005 05:50 PM

OK. I just did that... and it's still not doing anything different...

Chuck S December 8th, 2005 06:06 PM

It clearly works try sorting the search results by posted date

Do you have any sticky images? as you know they will override any sort

kwrd December 8th, 2005 07:20 PM

Yep! That's it! It just so happened the particular word I was searching on ended up having 10 pages of photos that were sticky! I'm sorry to have dragged this out for so long! Thanks for being patient with me!

Is there anyway to override the sticky photos during a search? (So that the results come back sorted by date, regardless if they're sticky or not?)

Chuck S December 8th, 2005 07:35 PM

No every sort takes into account sticky photos otherwise it would be a bug not to ;)


All times are GMT -5. The time now is 05:18 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97