Forums | Mahara Community

Developers /
Default country

anonymous profile picture
Account deleted
Posts: 12

13 March 2009, 17:42

Hi, great people!

I can't seem to figure out how to set the default country. Although New Zealand is quite nice, the string "Canada" is much more useful to me. I found the archived forum post indicating that code in artefact/internal/index.php should be changed. So, I made the obvious change, i.e.:

if ($element == 'country') {
        $items[$element]['options'] = getoptions_country();
        // @todo configure default country somehow...
// _AMR_
// old
//        $items[$element]['defaultvalue'] = 'nz';
// new
        $items[$element]['defaultvalue'] = 'ca';
// end

but this seems to have not had the expected effect. HELP! I'm sure this must have been discussed before.

Many, many, many thanks.

Heinz Krettek's profile picture
Posts: 480

14 March 2009, 2:55

Hi Andrei,

i modified the code the way you described it, copied it to my host and started the register with a new account. All is perfect. The country filed in the profile shows my default choosen country.

I can't think what's going wrong with your code modification.



anonymous profile picture
Account deleted
Posts: 1643

14 March 2009, 6:43

Hi, that modification should make it work fine.. I imagine you didn't see it change because you had previously saved the form with the country set to NZ, so the form is displayed to you with the NZ option selected Cool. Maybe try with a different user account?
anonymous profile picture
Account deleted
Posts: 12

14 March 2009, 22:10

Hi, Nigel and Heinz.

Yeah, I think you were right about that. I already used up all my email addresses testing out new users and was too lazy to create another one, thinking it was unnecessary. 

Thanks for your help, especially for testing out my code change. That's well beyond the call of duty.

p.s. must be beautiful in $string[''] this time of year.

anonymous profile picture
Account deleted
Posts: 1643

15 March 2009, 17:27

Heh, I spent all yesterday afternoon riding around enjoying it Laughing perfect weather!

A post by Account deleted was deleted

6 results