Skip Navigation

[Closed] Map View – Need to Scale Result Limit with Search Area…

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 3 replies, has 2 voices.

Last updated by Minesh 1 year, 11 months ago.

Assisted by: Minesh.

Author
Posts
#2361125

Tell us what you are trying to do?
Because Views "Display [x] Items" only goes to 50 or No Limit, I have an add_filter function using $view_settings['limit'] = '[x]' line to change the limit to a custom number... BUT... it falls a bit short of what I need...

When a user is searching 60 miles, 75 results should be more than enough, but when they search 600 miles, I might want 300 results and if they're searching 1600 miles I might want No Limit.

As it is though they can widen the search to the whole planet and only get the static number of results set with the function.

Please understand I don't want to "Display [No Limit]" or an arbitrarily high number across the board because that will take a very long time for all searches, and the vast majority of users will only be searching small areas. But for those users wanting to search locations nationwide or worldwide, I'd like to give them an appropriate amount of results.

So I'm thinking there's some way to get the "show results with [x]" amount in that function so I can set an if statement or switch statement or something along those lines.

Hoping support can provide some ideas here.

Is there any documentation that you are following?
No

Is there a similar example that we can see?
hidden link

What is the link to your site?
hidden link

#2361533

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

When I try to access the problem URL you shared: hidden link

I can see its throwing the error :

Forbidden
You don't have permission to access this resource.

As I understand, you want to change the number of posts to be displayed at a time based on the distance search miles input?

#2362805

Correct Minesh.

The error is actually a firewall. If you send me your IP address I can whitelist you.

But yes, your understanding is correct, I want augment my function so that as the distance changes, the amount of results (posts) being looped by the view changes.

Of course, I'm open to alternative suggestions. It may be that there is a better way of setting this, but please take a look at the view (and nested views) in the web page to start and if needed I can better describe the structure.

#2364181

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

My current IP is: 49.36.65.150 but meanwhile you whitelist me there is a possibility that it might be changed as I'm having dynamic IP.

Will you able to setup a staging site on another server where there will be no IP restrictions?

The topic ‘[Closed] Map View – Need to Scale Result Limit with Search Area…’ is closed to new replies.