How to sort the country list in predefined values

there is 4 default dolphin modules that sort the country list.  Why they do this i don't know. It makes the sort function in pre values useless.

 

Any way  the 4 modules are:

Ads, events, groups, and store.  Five files will need to be changed for this to work.

 

What I do is remove US   __United States from the bottom of the pre defined values in admin.

I then replace AF Afganastan  with US  __United States and click save at the bottom.

Option 2:  Click the up arrow a million times to get US to the top of the list.

 

next open file:

/modules/boonex/ads/classes/BxAdsFormAdd.php around line 886 you will see:

asort($aCountries)    change this to: //asort($aCountries) and save it. 

 

Next open file:

/modules/boonex/events/classes/BxEventsFormAdd.php around line 79 you will see:

asort($aCountries)   change this to: //asort($aCountries)  and save it.

 

Next open file:

/modules/boonex/events/classes/BxEventsFormSearch.php around line 15 you will see:

asort($aCountries)   change this to: //asort($aCountries)  and save it.

 

Next open file:

/modules/boonex/groups/classes/BxGroupsAdd.php around line 77 you will see:

asort($aCountries)   change this to: //asort($aCountries)  and save it.

 

Next open file:

/modules/boonex/store/classes/BxStoreFormAdd.php around line 52 you will see:

asort($aCountries)   change this to: //asort($aCountries)  and save it.

 

I had it set to asort($aCountries)   change this to: ($aCountries)  and save it.

Changed it to:  per modzzz below post:

asort($aCountries)   change this to: //asort($aCountries)  and save it.

 

Now at this point you can order the pre defined list to your liking for countries and in those modules they will display right.  If you have any 3rd party modules you will need to do the same by removing asort from the code.

 

I thought at one point if you had a country selected in your profile it would pick up on that but i could be wrong about that.

 

Seems like a lot but really should only take about 10 minutes.  Also upgrades will kill your changes but you don't have to worry about that for another year or two.

https://dolphin-techs.com - Skype: Dolphin Techs
Quote · 4 Apr 2015

You have made some mistakes in your instructions. In all the files you mentioned :

Find:

     asort($aCountries)

Replace with :

    //asort($aCountries)

Paypal email is jeromemingo@gmail.com - http://www.boonex.com/market/posts/modzzz
Quote · 4 Apr 2015

THANK YOU SO MUCH!! This helps alot. Seems many people on the forum just like to make us non-techies feel stupid, while not offering any suggestions to help. I post questions on the forum requesting help & suggestions, not ridicule and attacks. Thank you for your help, dolphin_jay!

Only problem though is... the issue I have is getting the list to accept my "save" request. It always reverts to the default after clicking "save". So don't know if your solution will work, since the list won't save. I will give this a try though.  Foot in Mouth

---Robin Rae, http://SecretSisterClub.net
Quote · 4 Apr 2015

Changing the sort order of the countries in those 4 modules is something I had not even considered yet. I will change those also.

The main place I wanted the countries list reordered is in the drop-down menu in the Join (add profile) page. Since most of my members will be from one of about 4-5 countries, I want those countries to be at the top of the list. I want all the other countries to remain on the list, just be under those I chose at the top.

---Robin Rae, http://SecretSisterClub.net
Quote · 4 Apr 2015

Hmm strange seemed to work for me just by removing asort  but to be fear i did it on a windows server so this may not be the case on a Linux server ?

Anyway.  thanks for the correction on that.

https://dolphin-techs.com - Skype: Dolphin Techs
Quote · 4 Apr 2015

ok well...  if you are having trouble saving the list then you will have to do this by and in the database. 

table name sys_pre_values   after you make the changes in the database you always have to clear the dolphin cache in admin..

And I seen what was going on in the other thread that's why i posted here to weed out the junk. 

https://dolphin-techs.com - Skype: Dolphin Techs
Quote · 4 Apr 2015

I had already moved US to the top so I commented out the lines you mentioned and it worked for me. Thanks Jay!

Nothing to see here
Quote · 4 Apr 2015

Your Welcome.  I made a small mistake in the Ads file name though.

it should be BxAdsModule.php.  sorry about that. 

Again for those having trouble saving the counties list...    you need to set max_input_vars =1800 in php.ini.

so it looks like you and I have a lot of servers to update... or at least i do anyway. 

So if you want edit my post up there.

https://dolphin-techs.com - Skype: Dolphin Techs
Quote · 6 Apr 2015

I made a small mistake in the Ads file name though.

it should be BxAdsModule.php.  sorry about that. ...

So if you want edit my post up there.

 

I am going to edit these 5 files, since the changes I made to the country list only work in the Join form.

So I just want to clarify....

Find:  asort($aCountries)

Replace with :  //asort($aCountries)

The file BxAdsModule.php should replace /modules/boonex/ads/classes/BxAdsFormAdd.php when editing for the Ads module?

And this is best done in the database, inside table name sys_pre_values

Please let me know if this is correct. I hope to do these edits today. Thanks!  

---Robin Rae, http://SecretSisterClub.net
Quote · 9 Apr 2015

I already made the changes for you a few days ago. 

https://dolphin-techs.com - Skype: Dolphin Techs
Quote · 9 Apr 2015

I already made the changes for you a few days ago. 

Oh, you did!! Just a couple days ago, I noticed that the countries drop-down list was still in default order. You must have made the changes right after that. Thank you again, Jason!!  Laughing

---Robin Rae, http://SecretSisterClub.net
Quote · 9 Apr 2015

your welcome.

https://dolphin-techs.com - Skype: Dolphin Techs
Quote · 9 Apr 2015

 

there is 4 default dolphin modules that sort the country list.  Why they do this i don't know. It makes the sort function in pre values useless.

 

Any way  the 4 modules are:

Ads, events, groups, and store.  Five files will need to be changed for this to work.

 

Jason, do you know where the sorting option in version 7.2? The site does not have a parameter file aSort responsible for sorting 'country' values. Change parameter $sValues in the $sOrder in /inc/classes/BxDolSearch.php does not help even for the search, the country are displayed in alphabetical order.

Quote · 27 Sep 2015

 

Jason, do you know where the sorting option in version 7.2? The site does not have a parameter file aSort responsible for sorting 'country' values. Change parameter $sValues in the $sOrder in /inc/classes/BxDolSearch.php does not help even for the search, the country are displayed in alphabetical order.

Please have a look at this how to - http://www.boonex.com/forums/topic/How-to-sort-countries-list.htm

 

 

Rules → http://www.boonex.com/terms
Quote · 28 Sep 2015
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.