I want to make the "Country" field on the user registration page default to "United States". I was looking here in the support forum and found one thread that seemed to work for one person but not for me.
I tried to follow that thread:
www.jomsocial.com/forum/design-and-custo...-united-states#60572
But that solution did not work for me.
Any other solution?
Thank you
Hi Ronald,
What country do you want to use as default?
You need follow my hack www.jomsocial.com/forum/design-and-custo...-united-states#60572 very carefully, Josh Weeman already did it and successfully.
I did it, please check again, should work fine default USA right now.
That is weird - no it does not. However, I changed teh country.php file maybe around the same time and overwritten yoru changes. If you do changes, please make sure that the values of the options are real names (United States) and not these Community variables. Thank you!
:-)
Ok Done, I reapplied the code...
We are using the string varibale instead realname, for making the countries is translateable.
Now the country list is screwed up again. The parameters are again "COM_COMMUNITY_LANG_NAME_" with country code.
Now, it's saved in the database with this screwed up format and all existing users from same country are not found with the new ones from same country. PLEASE Jomsocial codesrs: before yopu throw in some fancy new codes in future versions, please check that it is BACKWARD compatible! The programmers did not consider that people UPGRADE Jomsocial - meaning that they already have many (thousands) of existing users. Now I am spending New Year fixing these &%! bugs. Happy New Year!
I am having a similar problem, when a users selects his COUNTRY we get this
"Country
COM_COMMUNITY_LANG_NAME_AUSTRALIA"
Where do I modify the code to get "AUSTRALIA"
I need it selectable not a default country..
$name appears in several places in this file.. Which one/s do I change to.. I also note jtext::_($name):? is already there in <option value >
<select id="field<?php echo $field->id;?>" name="field<?php echo $field->id;?>" class="<?php echo !empty( $field->tips ) ? 'jomNameTips tipRight ' : '';?>select validate-country<?php echo $class;?>"<?php echo $tooltips;?>>
<option value=""<?php echo empty($field->value) ? ' selected="selected"' : '';?>><?php echo JText::_('COM_COMMUNITY_SELECT_A_COUNTRY');?></option>
<?php
for($a=0;$a<count($countries->country);$a++ )
{
$name = $countries->country[$a]->name;
?>
<option value="<?php echo $name;?>"<?php echo ($field->value == $name) ? ' selected="selected"' : '';?>><?php echo JText::_($name);?></option>
<?php
}
?>
</select>
Thanks
Hi Arthur,
Find the file "country.php" in the directory:
"components/com_community/libraries/fields"
Change the line:
<option value="<?php echo $name;?>"<?php echo ($field->value == $name) ? ' selected="selected"' : '';?> <?php echo (empty($field->value) && $name=='United States') ? ' selected="selected"' : '';?>><?php echo $name;?></option>
to:
<option value="<?php echo JText::_($name);?>"<?php echo ($field->value == JText::_($name)) ? ' selected="selected"' : '';?> <?php echo (empty($field->value) && JText::_($name)=='United States') ? ' selected="selected"' : '';?>><?php echo JText::_($name);?></option>
Basically, change
$name
to
JText::_($name)
By the way, you can change the "United States" to "Australia" to make it default, or just delete " && JText::_($name)=='United States'"
Happy New Year! (Was a nice fireworks in Sydney :-)
Hi Arthur,
Can you create new topic for your issue please? because I am sure your issue is different with this.
thx