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:
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
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.
Search is made to return the photos with no sort just from beginning to end
I would suggest this in showgallery.tmpl
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.)
Try this instead even though the last one did work
For the first one, it did in fact add the sort to the URL:
but the resulting sort is still not sorted by filedate.
It was on my install ;) sorted by date posted
Now the above edit will get the sort box to work
It's still not working.
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
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
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?
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
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?
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
I did add:
Are you using the latest Photopost?
I see you have not replaced your showgallery.tmpl file yet either
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.
remember when you replace a file using vb3 you need to place the template in the vb3enhanced directory ;)
OK. I just did that... and it's still not doing anything different...
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
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?)
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