• [MOD] Select country and gender with gif when register 5 0 5 1
Currently:  

Author Topic: [MOD] Select country and gender with gif when register  (Read 143586 times)

0 Members and 1 Guest are viewing this topic.

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
[MOD] Select country and gender with gif when register
« on: April 12, 2005, 11:04:05 PM »
There are some MODs similar to this one in the forum but I found them confusing and I don't get them to work. This one it is really easy to install.

This MOD will allow to your users to select a Country and a gender when they Register. But if u don't do the step 3 it your user will have the option to select the country and the gender and the show that in their profiles.
If you just want one of these features either Select Country or Select Gender just do what it is after this words.

 :arrow: Screenshot templates/<your templates>/member_editprofile.html:



Green  :arrow:  Gender Select upgrade
Orange  :arrow: Country Select upgrade

 :arrow: Files to edit:

includes/db_field_definitions.php
lang/<your language>/main.php
templates/<your templates>/member_profile.html
templates/<your templates>/register_form.html
templates/<your templates>/member_editprofile.html

To instal this MOD the dropdown for custom fields mod is required  :arrow: http://www.4homepages.de/forum/index.php?topic=7112.0

 :arrow: First: Open phpMyAdmin and create a new column called user_country inside of 4images_users I used type varchar (255).
      And another for the gender call user_gender inside of 4images_users I used type text.


Step 1 Open db_field_definitions.php:

Country Select:

Add before ?> :

Code: [Select]
$var = array("------------",
"---Africa---",
"Ethiopia",
"Somalia",
"South Africa",
"Other",
"---Middle East---",
"Egypt",
"Iran",
"Israel",
"Kuwait",
"Lebanon",
"Morocco",
"Saudi Arabia",
"Syria",
"Turkey",
"U. A. Emirates",
"Other",
"---Asia---",
"Armenia",
"Bangladesh",
"Cambodia",
"China",
"India",
"Indonesia",
"Japan",
"Malaysia",
"Myanmar",
"Nepal",
"Pakistan",
"Philippines",
"Singapore",
"South Korea",
"Sri Lanka",
"Taiwan",
"Thailand",
"Uzbekistan",
"Vietnam",
"Other",
"---Europe---",
"Albania",
"Austria",
"Belarus",
"Belgium",
"Bosnia",
"Bulgaria",
"Croatia",
"Cyprus",
"Czech Rep.",
"Denmark",
"Estonia",
"Finland",
"France",
"Germany",
"Greece",
"Hungary",
"Iceland",
"Ireland",
"Italy",
"Latvia",
"Liechtenstein",
"Lithuania",
"Luxembourg",
"Macedonia",
"Malta",
"Monaco",
"Netherlands",
"Norway",
"Poland",
"Portugal",
"Romania",
"Russia",
"Slovakia",
"Slovenia",
"Spain",
"Sweden",
"Switzerland",
"Ukraine",
"United Kingdom",
"Other",
"Australia",
"Australia",
"New Zealand",
"Other",
"---Latin America---",
"Costa Rica",
"Cuba",
"El Salvador",
"Guatemala",
"Haiti",
"Jamaica",
"Mexico",
"Panama",
"Other",
"---North America---",
"Canada",
"USA",
"Other",
"---South America---",
"Argentina",
"Bolivia",
"Brazil",
"Chile",
"Colombia",
"Ecuador",
"Paraguay",
"Peru",
"Suriname",
"Uruguay",
"Venezuela",
"Other"
);
$additional_user_fields['user_country'] = array($lang['user_country'], "dropdown", 0, $var, 0, 0, 0, 1);

Gender Select:

Code: [Select]
$additional_user_fields['user_gender'] = array($lang['user_gender'], "dropdown", 0, array("n" => "---","b" => "Bisex", "m" => "Male", "w" => "Female"), 1, 0, 0, 0);
Close and save


Step 2 Open main.php


Country Select:


Add before ?> :

Code: [Select]
$lang['user_country'] = "Country:";

Gender Select:


Add before ?> :

Code: [Select]
$lang['user_gender'] = "Sex:";
Close and save


Step 3 Open register_form.html:


Country Select:

Find:

Code: [Select]
<tr>
   <td class="row1"><b>{lang_email}</b></td>
   <td class="row1"><input type="text" name="user_email" size="30" class="input" value="{user_email}" /></td>
</tr>


Add after:

Code: [Select]
<tr>
    <td class="row1"><b>{lang_user_country}</b></td>
  <td class="row1">{user_country_dropdown} </td>
</tr>

Gender Select:

Add this:

Code: [Select]
<tr>
   <td class="row2"><b>{lang_user_gender}</b></td>b
   <td class="row2">&nbsp;<b>{user_gender_dropdown}&nbsp; </b>&nbsp;</td>>
</tr>

Close and save

Step 4 Open member_editprofile.html:
This step is optional only if you want that the users change their country once the are register.

Country Select:

Find:

Code: [Select]
          <tr>
            <td class="row2"><b>{lang_email_confirm}</b></td>
            <td class="row2"><input type="text" name="user_email2"  size="30" value="{user_email2}" class="input" /></td>
          </tr>

Add after:

Code: [Select]
        <tr>
          <td class="row1"><b>{lang_user_country}</b></td>
  <td class="row1">{user_country_dropdown} </td>
</tr>


Gender Select:

Add this:
Code: [Select]
<tr>
    <td class="row2"><b>{lang_user_gender}</b></td>
    <td class="row2">&nbsp;<b>{user_gender_dropdown}&nbsp;</b>&nbsp;<img src="{template_url}/images/{user_gender}.gif"></td>>
</tr>

Close and save

Step 5 Open member_profile.html:

Country Select:
Find:

Code: [Select]
<tr>
<td class="row1"width="40%"><b>{lang_email}</b></td>
<td class="row1">{if user_email}<a href="{user_mailform_link}">{user_email_save}</a>{endif user_email}</td>
</tr>

Add after:

Code: [Select]
<tr>
<td class="row2"width="40%"><b>{lang_user_country}</b></td>
<td class="row2">{user_country}</td>
</tr>


Gender Select:

Add this:

Code: [Select]
<tr>
<td class="row2" width="21%"><b>{lang_user_gender}</b></td>
<td class="row2" width="77%">&nbsp;<img src="{template_url}/images/{user_gender}.gif"></td>
</tr>

Close and save

ok, here you have finished, if you just have installed your gallery 4images and u don't have to much member your are fine
But if u have a lot member registered and u want to show a defualt country and gender then u can run these SQL query:

For Gender Select this will show all the users as Males if u change the 'm' for a 'w' it will show the female symbol

Code: [Select]
UPDATE 4images_users SET user_gender = 'm'
For Country Select

Code: [Select]
UPDATE 4images_users SET user_country = 'your default country'

Upload all the files to your server, and the gif to templates/<your template>/images

That's it!!.

Update: May 5, 2005, 2:42 PM
Save in data base bug solve
Update: May 6, 2005, 4:48 PM
Gender Select upgrade
« Last Edit: February 01, 2006, 02:25:04 AM by V@no »

Offline sicarius

  • Pre-Newbie
  • Posts: 6
    • View Profile
Re: [MOD] Select country when register
« Reply #1 on: April 13, 2005, 03:09:57 PM »
Hi ascanio.

Nice Mod, but by "Kontrolcenter" is always "Afghanistan" marked. :cry:

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: [MOD] Select country when register
« Reply #2 on: April 13, 2005, 03:54:58 PM »
You can do this:

Find:
Code: [Select]
<select name="user_country">
<option value="Afganistan">Afghanistan</option>
Replace:
Code: [Select]
<select name="user_country">
<option value="">Please select a country</option>
<option value="Afganistan">Afghanistan</option>

Offline sicarius

  • Pre-Newbie
  • Posts: 6
    • View Profile
Re: [MOD] Select country when register
« Reply #3 on: April 13, 2005, 11:53:29 PM »
HI, thanks for fast reply

but I mean,

If you have save the country to each user(for example slovenia).
And the User go to "Control Panel" he will see "Afganistan".
(In mysql is the correct country data saved)


Greets Sicarius

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: [MOD] Select country when register
« Reply #4 on: April 14, 2005, 01:18:18 AM »
Quote
And the User go to "Control Panel" he will see "Afganistan".
That's because it is the first option but what users seeon his profile? Afganistan or the country the he or she seleted?

Offline sicarius

  • Pre-Newbie
  • Posts: 6
    • View Profile
Re: [MOD] Select country when register
« Reply #5 on: April 16, 2005, 11:28:32 AM »
afganistan

Offline JensF

  • Addicted member
  • ******
  • Posts: 1.028
    • View Profile
    • http://www.terraristik-galerie.de
Re: [MOD] Select country when register
« Reply #6 on: May 05, 2005, 05:32:15 PM »
Hi,

one Problem.

When i select a country in my Profile and then i save it reload the side and then i don´t see the country. I see the field "Please selct a country".

What must i do that i can see my selected country in the Member Control Panel???
Mit freundlichem Gruß
Jens Funk



-> Sorry for my bad English <-

TheOracle

  • Guest
Re: [MOD] Select country when register
« Reply #7 on: May 05, 2005, 06:39:41 PM »
Hi,

one Problem.

When i select a country in my Profile and then i save it reload the side and then i don´t see the country. I see the field "Please selct a country".

What must i do that i can see my selected country in the Member Control Panel???

That's what I thought would happened actually. The only way I resolved this problem in the past was by implementing V@no's MOD where the additional user fields has been re-worked and expanded in the routines. Hopefully, it is still available in the new forum for you guys. ;)

Now, the reason why the information is not being entered correctly is because there are no query that specifies a NULL statement for this MOD. :)

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: [MOD] Select country when register
« Reply #8 on: May 05, 2005, 07:30:58 PM »
Hi,

one Problem.

When i select a country in my Profile and then i save it reload the side and then i don´t see the country. I see the field "Please selct a country".

What must i do that i can see my selected country in the Member Control Panel???

That's what I thought would happened actually. The only way I resolved this problem in the past was by implementing V@no's MOD where the additional user fields has been re-worked and expanded in the routines. Hopefully, it is still available in the new forum for you guys. ;)

Now, the reason why the information is not being entered correctly is because there are no query that specifies a NULL statement for this MOD. :)

Hi i'm going to update this MOD, that was happening to me also but I repair it! with the  [MOD] Dropdown options for custom database fields, if you go there u will see my discusion with V@no and maybe u can figure out what I did, I will post the modification that i did in a moment ;)

Offline JensF

  • Addicted member
  • ******
  • Posts: 1.028
    • View Profile
    • http://www.terraristik-galerie.de
Re: [MOD] Select country when register
« Reply #9 on: May 05, 2005, 08:14:25 PM »
I don´t understand this. My Bad English :(

I have install the Mod Dropdown options for custom database fields....
Mit freundlichem Gruß
Jens Funk



-> Sorry for my bad English <-

TheOracle

  • Guest
Re: [MOD] Select country when register
« Reply #10 on: May 05, 2005, 08:19:48 PM »
Quote

[MOD] Dropdown options for custom database fields


That's the one I was talking about. Thanks for clarifying this. ;)

Quote

I have install the Mod Dropdown options for custom database fields....


If so, then only this field would need to be modified :

Quote

$additional_user_fields['user_country'] = array($lang['user_country'], "text", 1);


;)

Offline JensF

  • Addicted member
  • ******
  • Posts: 1.028
    • View Profile
    • http://www.terraristik-galerie.de
Re: [MOD] Select country when register
« Reply #11 on: May 05, 2005, 08:31:49 PM »
I have change this

Code: [Select]
$additional_user_fields['user_country'] = array($lang['user_country'], "text", 1);to this
Code: [Select]
$additional_user_fields['user_country'] = array($lang['user_country'], "text", 0);
Now the Country Field is not required yet. OK, thats good. But when a User change here profile they must on every time select the country new while in this field is the text "Select a country".

I want this: I select a country and save. Now i go the next time to my profile and will edit ist i will see in the country field my selected country.

But now i see "Select a country" when i visit in the next time my profile to edit it.....

Oh God, i hope you understand me....
Mit freundlichem Gruß
Jens Funk



-> Sorry for my bad English <-

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Select country when register
« Reply #12 on: May 05, 2005, 08:45:44 PM »
seems like u didnt update the database:
:arrow: First: Open phpMyAdmin and create a new column called user_country inside of 4images_users I used tipe varchar (255).
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: [MOD] Select country when register Update
« Reply #13 on: May 05, 2005, 08:46:25 PM »
I have change this

Code: [Select]
$additional_user_fields['user_country'] = array($lang['user_country'], "text", 1);to this
Code: [Select]
$additional_user_fields['user_country'] = array($lang['user_country'], "text", 0);
Now the Country Field is not required yet. OK, thats good. But when a User change here profile they must on every time select the country new while in this field is the text "Select a country".

I want this: I select a country and save. Now i go the next time to my profile and will edit ist i will see in the country field my selected country.

But now i see "Select a country" when i visit in the next time my profile to edit it.....

Oh God, i hope you understand me....

I have update the first post, Delete the changes made on the page_header.php because u don't need them anymore and also you can delete the countries.html file

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Select country when register Update
« Reply #14 on: May 05, 2005, 08:48:22 PM »
I have update the first post, Delete the changes made on the page_header.php because u don't need them anymore and also you can delete the countries.html file
I dont see any mention about another mod requiremen for your new version: "Dropdown for custom fields" ;)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)