Advertisement:

Author Topic: show only us  (Read 438 times)

Sophia_OS

  • Sr. Member
  • ****
  • Posts: 416
show only us
« on: October 09, 2018, 12:13:37 am »
hey,
in search.php, on page-load, under "Listings" it lists all the countries listings. how can i set it to show only US listings?
theme: bender
thanks,

WEBmods

  • Hero Member
  • *****
  • Posts: 937
  • github.com/webmods-croatia/love-osclass/ | patrick
Re: show only us
« Reply #1 on: October 09, 2018, 12:35:40 am »
Hello,

One solution is to add this code just after 'while(osc_has_items()) {':

Code: [Select]
if(osc_item_country() != 'United States') continue; // change United States depending on country name.

Regards.

Sophia_OS

  • Sr. Member
  • ****
  • Posts: 416
Re: show only us
« Reply #2 on: October 09, 2018, 06:47:40 am »
Hello,

One solution is to add this code just after 'while(osc_has_items()) {':

Code: [Select]
if(osc_item_country() != 'United States') continue; // change United States depending on country name.

Regards.

@patrickFromCroatia
my theme is bender, in bender that code is in loop.php, and if i put your code after that, it stops to run the rest of the code and listing don't appear at all.
i have couple countries in the database, but for now i just want to show united-states listings in search.php page load.
thanks,

Sophia_OS

  • Sr. Member
  • ****
  • Posts: 416
Re: show only us
« Reply #3 on: February 05, 2019, 12:21:01 pm »
Any solution?

WEBmods

  • Hero Member
  • *****
  • Posts: 937
  • github.com/webmods-croatia/love-osclass/ | patrick
Re: show only us
« Reply #4 on: February 05, 2019, 01:39:12 pm »
Check what is stored in osc_item_country() for the item with the United States as a country, maybe its "US", not "United States"...

Regards.

Sophia_OS

  • Sr. Member
  • ****
  • Posts: 416
Re: show only us
« Reply #5 on: February 07, 2019, 10:29:39 pm »
Check what is stored in osc_item_country() for the item with the United States as a country, maybe its "US", not "United States"...

Regards.

There is no problem of listing the usa ads in search.php
I just want to list only usa listings here. No other country's listings.