Hey,
I'm trying to implement search anchor links and I'm not quite sure how to do so. What I'm wanting to do is make the Uploaded time (mtime) a hyperlink so people can click it and it will show all of the photos with that same mtime.
I've tried using the `getSearchURL()` function, but the parameter descriptions aren't very detailed and the $fields parameter is even the wrong data type in the docs. (I created a Trac ticket for that)
I tried the following, `getSearchURL( $image->data['mtime'], '', 'mtime', '' );`, but that results in no search results being found.
I greatly appreciate any help with this.
Comments
You should not be directly accessing the data property of the image. Use the $image->get() instead. The data element may not actually be populated.
But basically your problem is that you are getting bitten by your mod_rewrite rules. The search url generated will be
`/page/search/1231019760?searchfields=mtime`
which will be interpreted as page 1231019760 of the search which has no "words" on which to match. Put the mtime value in quotation marks and it will work.
That DID work, but one thing I didn't take into consideration is that the mtime is a UNIX timestamp and therefore only that one image will match the search results.
I would have to be able to specify a range for that to work using mktime(), which probably means writing my own custom search function.
Thanks for the info on the get() method. I saw it in the docs, but didn't look into the purpose of it and that makes sense.