Remove Country

I do not need country to show in any part of my site. 

I have removed it from all profile fields, but it still shows up.

7.1.4 Help!

See Screenshot attachment.

Thanks.

 

 

Quote · 23 Jun 2014

Did you also remove it from the join form?

Geeks, making the world a better place
Quote · 23 Jun 2014

I did.

Quote · 23 Jun 2014

OK, I guess country is a set field in the database and members have already added information there.  The templates are getting the data from the database and displaying it.

You can edit templates and remove the country key.

Or, if country is not used then one could run a mysql query to remove the country data from the database.

Geeks, making the world a better place
Quote · 23 Jun 2014

Just added a new user which did not have a country entry and it still showed up as United States, so it must default to US.

So I think editing the template is sounding easiest??

Is that done in admin. or in the cpanel (data bases).

Quote · 23 Jun 2014

 

Just added a new user which did not have a country entry and it still showed up as United States, so it must default to US.

So I think editing the template is sounding easiest??

Is that done in admin. or in the cpanel (data bases).

 Remember, there are several places to remove the fields.

In the builder.

You have 

remove all instances of country and remember to remove the mandatory check. 

builder-edit.JPG · 16K · 844 views
builder-edit1.JPG · 20.4K · 839 views
builder-edit2.JPG · 22.2K · 858 views
ManOfTeal.COM a Proud UNA site, six years running strong!
Quote · 23 Jun 2014

All instances of country within field builder are removed.

Country mandatory box is unchecked. But would that matter if the country field is removed ( placed in "inactive items")?

Quote · 23 Jun 2014

If you have removed all instances of country from the join form; then Dolphin must still add in the default value to the database.  I am not as verse in the join form and join form processing as others.  In that case, I would edit the country field (you may have to add it back to the join form to edit the item) and change it to a text input box and make sure it is not mandatory.  That way it should default to adding a null value to the database.

If you want to work through the templates to hide it, then you need to track down all the areas in Dolphin that might display the country.

Geeks, making the world a better place
Quote · 23 Jun 2014

Just so you don't waste time, Dolphin does not allow you to have a null value in the select.  If you remove the default value, it will just add the first country in the list; which it pulls from the LKey.  That is why I said to change it to an input text box.

Geeks, making the world a better place
Quote · 23 Jun 2014

Can't believe dolphin makes it this difficult to remove a country field from viewing.

Will attempt to resolve with your solution gg. and let you know what happens.

Thank You.

Quote · 23 Jun 2014

 

Can't believe dolphin makes it this difficult to remove a country field from viewing.

Will attempt to resolve with your solution gg. and let you know what happens.

Thank You.

 Are you doing the profile viewing via the admin account?

ManOfTeal.COM a Proud UNA site, six years running strong!
Quote · 23 Jun 2014

Yes.

But I also created a new member after removing all instances of the Country item blocks from the Builder and the Country still shows itself as  "United States" for the new member I created in addition to all existing members.

Quote · 23 Jun 2014

Also, the drop down box for Country only shows, drop down list and radio button, it does not show me text input text box??

So I am not able to try the fix gg suggested, must be doing something wrong???

Quote · 23 Jun 2014

 

Also, the drop down box for Country only shows, drop down list and radio button, it does not show me text input text box??

So I am not able to try the fix gg suggested, must be doing something wrong???

Yes you can; I just changed it on a test site.  As I said, you may have to drag it to the join form to edit it.  I changed it to a text field with no default and it worked.  Maybe something else is going on with your site.  I was under the impression that an item placed in the inactive box would not be processed and thus nothing added to the database.

You may need to allow someone to log in and check out things; but don't paste login credentials in the forum as they are indexed by the search engines.

Geeks, making the world a better place
Quote · 23 Jun 2014

If you want, you can do what i did on my site for those thumbnail blocks.

Go to admin->Settings->Advanced Settings->Profiles and change the setting of Member brief info: from Location to Headline instead.

If you insist on using location and keep the city and remove the country then you will need to make a code edit to inc\classes\BxDolMemberInfo.php finding this

case 'sys_location':
            return (empty($aData['City']) ? '' : $aData['City'] . ', ') . _t($GLOBALS['aPreValues']['Country'][$aData['Country']]['LKey']);

And replace with this.

case 'sys_location':
            return (empty($aData['City']) ? '' : $aData['City'] . ', ');

https://www.deanbassett.com
Quote · 23 Jun 2014

I made a simple fix by you (g-g) and made it difficult for myself. Was looking for  input text box under the advanced menu!

So found it and did what you suggested and it worked, but only worked when I created a new member. The existing members still show Country. Which is OK because my site is brand new and all created member are phantom members created by me.

But if I had a bunch of real member, just wondering, would I be stuck, and they would forever show Country??

Thanks for the fix!!

Quote · 23 Jun 2014

And did you see my solution?

https://www.deanbassett.com
Quote · 23 Jun 2014

No Deano, I missed your post.

 

The g-g fix worked, but now I intend to add County & State.

So is your approach going to work better in the following scenario?

 

1) Following "City," I want to show "County"

 

2) Then under City & County I want to show "State"

Quote · 23 Jun 2014

My solution was for the user to avoid editing files that may get changed during upgrades; I figure the form approach would be the safest.

If it is only test members on your site then removing them removes the data.

 

@Deano:  I thought moving the country field to inactive on the join form would keep Dolphin from adding any data to that column in the database.  However, this topic would seem to indicate that is not the case; is this for all inactive fields?

Geeks, making the world a better place
Quote · 23 Jun 2014

OK Deano, Did the code change as you prescribed, all Countries that were posted are gone, even from the existing members!!

Thank You, is this also where the code would go to include the County, and State I want to include as I described in the post above?

Quote · 23 Jun 2014

 


@Deano:  I thought moving the country field to inactive on the join form would keep Dolphin from adding any data to that column in the database.  However, this topic would seem to indicate that is not the case; is this for all inactive fields?

For the thumbnails if set to location info, the code pulls directly from the database. When a field is dragged to inactive, it is still in the database, so that code as it was written would still pull it.

https://www.deanbassett.com
Quote · 23 Jun 2014

You would have to change that code again to pull the proper info for location from the database. But yes. It's just a matter of coming up with the proper code to display the info you want.


Example. This was the original code line.

            return (empty($aData['City']) ? '' : $aData['City'] . ', ') . _t($GLOBALS['aPreValues']['Country'][$aData['Country']]['LKey']);

For county you change country in that line to county. But this also assumes that county is in the pre-values like country is. If county is just a text field then it will have to be done differently. Unfortunately your kinda on your own on that as we do not know how your custom fields have been setup in the database. It's kinda hard for us to work with custom stuff we have no direct access to.

https://www.deanbassett.com
Quote · 23 Jun 2014

Thank you, I guess I'll attempt to Change Country to County and then make a new selection  drop down list for each County.

Then I guess I can do the same for State. 

Quote · 23 Jun 2014

 

 


@Deano:  I thought moving the country field to inactive on the join form would keep Dolphin from adding any data to that column in the database.  However, this topic would seem to indicate that is not the case; is this for all inactive fields?

For the thumbnails if set to location info, the code pulls directly from the database. When a field is dragged to inactive, it is still in the database, so that code as it was written would still pull it.

I am talking about when a member joins.  faceclub stated that the country field was removed from the join form but it was still inserting US (which was the default value) into the database when he created a new member using the join form.

Geeks, making the world a better place
Quote · 23 Jun 2014

 

Thank you, I guess I'll attempt to Change Country to County and then make a new selection  drop down list for each County.

Then I guess I can do the same for State. 

What you can do is to create new predefined lists and simply point the selector to use that predefined list.  You can change the language key for country to county and Dolphin will still pull from the country column in the database.  Change the list that it uses to your new county list and Dolphin is none the wiser.  If you need help with predefined lists, then let us know.

I think I have a predefined lists for states; I think someone on here gave one for free.  Modzzz ships a php file that will automatically add a states predefined list with some of his modules, contact him.

Geeks, making the world a better place
Quote · 23 Jun 2014

Thank you G-G. I will change Country to County as you suggest, seems easy enough for my novice Dolphin skill level.

And Yes a predefined lists for states would be great, but would not have clue how to include it into site. I'm sure I could probably figure it out in time, but Advice would be welcomed!

Quote · 24 Jun 2014

 

Thank you G-G. I will change Country to County as you suggest, seems easy enough for my novice Dolphin skill level.

And Yes a predefined lists for states would be great, but would not have clue how to include it into site. I'm sure I could probably figure it out in time, but Advice would be welcomed!

 Once the predefined list is added, telling the country filed to use it is easy.  I will try to make some screen shots.

Geeks, making the world a better place
Quote · 24 Jun 2014

The Professor created a list that you can insert using a mysql query, if you can log into something like phpmyadmin, you can run this query to add the states list; always backup your database first.  You can remove any rows that you don't want included.

 

 

INSERT INTO `sys_pre_values` (`Key`, `Value`, `Order`, `LKey`, `LKey2`, `LKey3`, `Extra`, `Extra2`, `Extra3`) VALUES
('State', '  ', 0, '-Any-', '', '', '', '', ''),
('State', 'OR', 43, 'Oregon', '', '', '', '', ''),
('State', 'PA', 42, 'Pennsylvania', '', '', '', '', ''),
('State', 'PW', 41, 'Palau', '', '', '', '', ''),
('State', 'OK', 40, 'Oklahoma', '', '', '', '', ''),
('State', 'OH', 39, 'Ohio', '', '', '', '', ''),
('State', 'MP', 38, 'Northern Mariana Islands', '', '', '', '', ''),
('State', 'ND', 37, 'North Dakota', '', '', '', '', ''),
('State', 'NC', 36, 'North Carolina', '', '', '', '', ''),
('State', 'NY', 35, 'New York', '', '', '', '', ''),
('State', 'NM', 34, 'New Mexico', '', '', '', '', ''),
('State', 'NJ', 33, 'New Jersey', '', '', '', '', ''),
('State', 'NH', 32, 'New Hampshire', '', '', '', '', ''),
('State', 'NV', 31, 'Nevada', '', '', '', '', ''),
('State', 'NE', 30, 'Nebraska', '', '', '', '', ''),
('State', 'MT', 29, 'Montana', '', '', '', '', ''),
('State', 'MO', 28, 'Missouri', '', '', '', '', ''),
('State', 'MS', 27, 'Mississippi', '', '', '', '', ''),
('State', 'MN', 26, 'Minnesota', '', '', '', '', ''),
('State', 'MI', 25, 'Michigan', '', '', '', '', ''),
('State', 'MA', 24, 'Massachusetts', '', '', '', '', ''),
('State', 'MD', 23, 'Maryland', '', '', '', '', ''),
('State', 'MH', 22, 'Marshall Islands', '', '', '', '', ''),
('State', 'ME', 21, 'Maine', '', '', '', '', ''),
('State', 'LA', 20, 'Louisiana', '', '', '', '', ''),
('State', 'KY', 19, 'Kentucky', '', '', '', '', ''),
('State', 'KS', 18, 'Kansas', '', '', '', '', ''),
('State', 'IA', 17, 'Iowa', '', '', '', '', ''),
('State', 'IN', 16, 'Indiana', '', '', '', '', ''),
('State', 'IL', 15, 'Illinois', '', '', '', '', ''),
('State', 'ID', 14, 'Idaho', '', '', '', '', ''),
('State', 'HI', 13, 'Hawaii', '', '', '', '', ''),
('State', 'GU', 12, 'Guam', '', '', '', '', ''),
('State', 'GA', 11, 'Georgia', '', '', '', '', ''),
('State', 'FL', 10, 'Florida', '', '', '', '', ''),
('State', 'FM', 9, 'Federated States of Micronesia', '', '', '', '', ''),
('State', 'DC', 8, 'District of Columbia', '', '', '', '', ''),
('State', 'DE', 7, 'Delaware', '', '', '', '', ''),
('State', 'CT', 6, 'Connecticut', '', '', '', '', ''),
('State', 'CO', 5, 'Colorado', '', '', '', '', ''),
('State', 'CA', 4, 'California', '', '', '', '', ''),
('State', 'PR', 44, 'Puerto Rico', '', '', '', '', ''),
('State', 'AR', 3, 'Arkansas', '', '', '', '', ''),
('State', 'AZ', 2, 'Arizona', '', '', '', '', ''),
('State', 'AK', 1, 'Alaska', '', '', '', '', ''),
('State', 'AL', 0, 'Alabama', '', '', '', '', ''),
('State', 'RI', 45, 'Rhode Island', '', '', '', '', ''),
('State', 'SC', 46, 'South Carolina', '', '', '', '', ''),
('State', 'SD', 47, 'South Dakota', '', '', '', '', ''),
('State', 'TN', 48, 'Tennessee', '', '', '', '', ''),
('State', 'TX', 49, 'Texas', '', '', '', '', ''),
('State', 'UT', 50, 'Utah', '', '', '', '', ''),
('State', 'VT', 51, 'Vermont', '', '', '', '', ''),
('State', 'VI', 52, 'Virgin Islands', '', '', '', '', ''),
('State', 'VA', 53, 'Virginia', '', '', '', '', ''),
('State', 'WA', 54, 'Washington', '', '', '', '', ''),
('State', 'WV', 55, 'West Virginia', '', '', '', '', ''),
('State', 'WI', 56, 'Wisconsin', '', '', '', '', ''),
('State', 'WY', 57, 'Wyoming', '', '', '', '', ''),
('State', 'AE', 58, 'Armed Forces Canada', '', '', '', '', ''),
('State', 'AA', 59, 'Armed Forces Americas (except Canada)', '', '', '', '', '');

Geeks, making the world a better place
Quote · 24 Jun 2014

Second part is to change which predefined list the country field will use; here are the screenshots I promised.

When the country item pops up, click on advance and then click on the edit button outlined in red

 

The possible values field will change and allow you to enter a new list.  Note that it must have the #! in front of the name.

change_possible_values.jpg · 96.5K · 860 views
possible_values.jpg · 106.6K · 855 views
Geeks, making the world a better place
Quote · 25 Jun 2014

Thanks G-G. Having great luck as a result of screenshots you posted editing and or creating new lists!

So good to have so much control over the info.

 

Having trouble, I created a "STATE" Item and associated it with the predifined list of States I created, only showing 5 States for test purposes.

Now I'm trying to include the code for all the states you posted in my Cpanel - PhpMyAdmin, but cannot figure it out.

I can find and view the State data base I created showing the 5 states I input, but cannot see where I put the 50 state code you posted to change my data base to reflect all 50 states.

 

BTW, I'm doing all this in a dolphin test site, not my primary site.

 

Thanks!

Quote · 25 Jun 2014

 

Thanks G-G. Having great luck as a result of screenshots you posted editing and or creating new lists!

So good to have so much control over the info.

 

Having trouble, I created a "STATE" Item and associated it with the predifined list of States I created, only showing 5 States for test purposes.

Now I'm trying to include the code for all the states you posted in my Cpanel - PhpMyAdmin, but cannot figure it out.

I can find and view the State data base I created showing the 5 states I input, but cannot see where I put the 50 state code you posted to change my data base to reflect all 50 states.

 

BTW, I'm doing all this in a dolphin test site, not my primary site.

 

Thanks!

I am not sure what you mean by state database, you don't create a database, you add the list to the Dolphin sys_pre_values table in the Dolphin database, perhaps this is just a confusion of terms.

In cPanel/phpMyAdmin, go to your Dolphin database, click on SQL; you would paste in the entire query for adding a states list to the sys_pre_values table and click the go button.

As I said, if you just want the US 50 states, then simply remove the lines you don't want to include.

Geeks, making the world a better place
Quote · 25 Jun 2014

Awesome!!! It worked perfectly. All 50 states showing themselves.

 

With regards to terminology, In my mind when I created "Predefined Values" of  states in (foreground) the 

Dolphin admin. panel  at the same time is it not automatically creating a data base in the (background) phmyadmin.

Is my thinking on this correct?? I want to understand whats actually going on for future creations of ITEMS with   "Predefined Values" 

 

Thank You for the help!

 

PS - For someone following this post to learn the same, see post where she includes 

specifically "Possible Values" = Dont forget to include #! as shown

Quote · 25 Jun 2014

Look at a database as a collection of tables, tables are a collection of columns and rows.  So no, when you work in the admin or in phpMyAdmin that makes changes, it does not create a new database; it can add tables to the database; you will see this happen when you install modules, or it can add rows to a table or columns to a table.  For example, if you add items to the profile fields builder in the Dolphin admin, it will add the columns to the profile table.  When a new member joins, a row is added to the Profiles table.  I hope that helps a bit in the understanding.

Geeks, making the world a better place
Quote · 25 Jun 2014

Got It, Tables, that makes it clear to me!

Thank You.

Quote · 25 Jun 2014

Back to the Deano Fix within the Cpanel =  inc\classes\BxDolMemberInfo.php

Got the Tables up and running in admin, but not showing up on my site.


Want to show = City, County, State ( City only showing on site with two Comas following City)

Here is the current code I've tried =

 

return (empty($aData['City']) ? '' : $aData['City'] . ', ')

 

            . _t($GLOBALS['aPreValues']['County'][$aData['County']]['LKey'] . ', ')

 

                     . _t($GLOBALS['aPreValues']['State'][$aData['State']]['LKey']);

 
 

See Attachment Please.

Thanks

Quote · 25 Jun 2014

That would be normal if those members have not yet selected a county or a state. Because the fields are empty and it's displaying them as such.

So check. Have any of those members shown selected a county and city?

https://www.deanbassett.com
Quote · 26 Jun 2014

I believed you said that your members were test members made by you.  So what you need to do to test is to log in as the members and go to profile edit and update the profiles.

Geeks, making the world a better place
Quote · 26 Jun 2014
 
 
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.