Help to stop randomizing search results across mulitple pages

4 posts by 2 authors in: Forums > CMS Builder
Last Post: September 15, 2010   (RSS)

Hey guys,

We have our results viewers setup to show all of our listings randomly. We have it setup this way in order to allow our customers to have an "equal" chance at getting there listings seen. The problem we run into is that once a user goes to a second page in the results and clicks the previous button or clicks the back button in their browser the Random function "re-randomizes" the results making the search not very usable. We want to do something that only randomizes the listings once for a particular user. Or maybe remembers where the listings were as the user clicks through the multiple pages of results.

We do not require potential renters to setup an account so they are not logged into our system in any way. I think this could be setup using cookies or better yet sessions?

thanks!
Lauren
Jason Glass

Re: [chris] Help to stop randomizing search results across mulitple pages

Thanks for the response!
We added this code and are getting a
"Notice: Undefined index: random_string...." error.

I am not that familiar with this sessions stuff. But, from what I assume we are getting this error because "random_string" is not defined anywhere. The issue is we do not know where or how to define this variable correctly.

Any more help would be greatly appreciated :)

Lauren
Jason Glass

Re: [rentittoday] Help to stop randomizing search results across mulitple pages

By Chris - September 15, 2010 - edited: September 15, 2010

Hi Lauren,

The first line there is meant to define the 'random_string' element if it's not already defined:

if (!@$_SESSION['random_string']) { $_SESSION['random_string'] = uniqid(''); }

Could you email me your FTP information and I'll see if I can get this figured out for you? chris@interactivetools.com
All the best,
Chris