4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: ascanio on April 12, 2005, 11:04:05 PM

Title: [MOD] Select country and gender with gif when register
Post by: ascanio 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:

(http://members.cox.net/jaimeascanio/gendercountry.png)

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
Title: Re: [MOD] Select country when register
Post by: sicarius on April 13, 2005, 03:09:57 PM
Hi ascanio.

Nice Mod, but by "Kontrolcenter" is always "Afghanistan" marked. :cry:
Title: Re: [MOD] Select country when register
Post by: ascanio 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>
Title: Re: [MOD] Select country when register
Post by: sicarius 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
Title: Re: [MOD] Select country when register
Post by: ascanio 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?
Title: Re: [MOD] Select country when register
Post by: sicarius on April 16, 2005, 11:28:32 AM
afganistan
Title: Re: [MOD] Select country when register
Post by: JensF 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???
Title: Re: [MOD] Select country when register
Post by: TheOracle 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. :)
Title: Re: [MOD] Select country when register
Post by: ascanio 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 ;)
Title: Re: [MOD] Select country when register
Post by: JensF 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....
Title: Re: [MOD] Select country when register
Post by: TheOracle 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);


;)
Title: Re: [MOD] Select country when register
Post by: JensF 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....
Title: Re: [MOD] Select country when register
Post by: V@no 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).
Title: Re: [MOD] Select country when register Update
Post by: ascanio 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
Title: Re: [MOD] Select country when register Update
Post by: V@no 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" ;)
Title: Re: [MOD] Select country when register Update
Post by: ascanio on May 05, 2005, 08:50:35 PM
Quote
$additional_user_fields['user_country'] = array($lang['user_country'], "dropdown", 0, $var, 0, 0, 0, 1);

I think that this [MOD] Dropdown options for custom database fields its requiered
Title: Re: [MOD] Select country when register Update
Post by: TheOracle on May 05, 2005, 09:04:02 PM
Quote

$additional_user_fields['user_country'] = array($lang['user_country], "dropdown", 0, array("n" => "---", $lang['user_country'] => $lang['user_country']), 1, 0, 0, 0);


;)
Title: Re: [MOD] Select country when register Update
Post by: ascanio on May 05, 2005, 09:30:06 PM
I don't understang
Code: [Select]
$additional_user_fields['user_country'] = array($lang['user_country'], "dropdown", 0, $var, 0, 0, 0, 1);This piece of code calls $var which is the list of countries so why did u put that?
Title: Re: [MOD] Select country when register Update
Post by: JensF on May 05, 2005, 09:43:49 PM
I have make the Updates and now it works....Thanks a lot...
Title: Re: [MOD] Select country when register Update
Post by: ascanio on May 05, 2005, 09:55:49 PM
your welcome :)
Title: Re: [MOD] Select country when register Updated
Post by: artpics on May 06, 2005, 02:32:05 AM
hell tried this but i get this

Code: [Select]
SQL-query:

ALTER TABLE `4images_users` ADD `user_country ` VARCHAR( 255 )
MySQL said: 

#1166 - Incorrect column name 'user_country '

when i try to set the db up any help please
Title: Re: [MOD] Select country when register Updated
Post by: V@no on May 06, 2005, 02:43:44 AM
u have a space after the field name.
this is the correct query:
Code: [Select]
ALTER TABLE `4images_users` ADD `user_country` VARCHAR( 255 )
Title: Re: [MOD] Select country and gender with gif when register
Post by: Stryker on July 17, 2005, 06:19:44 PM
I can't see my country and can't change it on my CP.
Title: Re: [MOD] Select country and gender with gif when register
Post by: Kyo on July 17, 2005, 08:37:02 PM
http://www.clubas.net/1/mistake.GIF
Hellow, what I do wrong that where is no Country and sex field? How to fix this problem?
Thank`s Tom.
Title: Re: [MOD] Select country and gender with gif when register
Post by: Stryker on July 18, 2005, 08:03:02 PM
http://www.clubas.net/1/mistake.GIF
Hellow, what I do wrong that where is no Country and sex field? How to fix this problem?
Thank`s Tom.
I have the same problem
Title: Re: [MOD] Select country and gender with gif when register
Post by: Kyo on July 18, 2005, 09:25:58 PM
I think we will have remove this mod, because noboby can help us :roll:
Title: Re: [MOD] Select country and gender with gif when register
Post by: V@no on July 19, 2005, 01:01:32 AM
I think we will have remove this mod, because noboby can help us :roll:
because two people cant make it right, we should remove the entire topic? :roll:
Title: Re: [MOD] Select country and gender with gif when register
Post by: eshpro on September 18, 2005, 01:37:54 AM
well not sure.. but its working for me.
Title: Re: [MOD] Select country and gender with gif when register
Post by: Loda on September 18, 2005, 08:11:38 PM
I think we will have remove this mod, because noboby can help us :roll:

read this at the beginning:
Quote
To instal this MOD the dropdown for custom fields mod is required   http://www.4homepages.de/forum/index.php?topic=7112.0
Title: Re: [MOD] Select country and gender with gif when register
Post by: Loda on November 07, 2005, 09:43:14 PM
it's working for me.. fine..
but one question..
If a new user registers himself and makes an entry in country field, the registration is implemented immediately...
is there a solution for me?
Title: Re: [MOD] Select country and gender with gif when register
Post by: jamstave on November 26, 2005, 10:10:43 PM
Hi..How do i show user country(in text) in the comment page?

jamstave.
Title: Re: [MOD] Select country and gender with gif when register
Post by: Stoleti on December 20, 2005, 09:26:36 PM
i've tried some similar on comments to show user gender (before username) under the country , both text+image ..without success..

Any ideias to make it work ??

 :?:
Title: Re: [MOD] Select country when register
Post by: Fastian on January 26, 2006, 02:41:25 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 am having exactly the same problem. In addition to thism i tried to add the county by using PHP my admin. But still i dont get anything in profile. The country filed remain blank.
I have " [MOD] Dropdown options for custom database fields " already woriking. My gender filed is working fine the only problem is with County.
So help me please.

@TheOracle Could u please tell me what mod u was talking about??

Title: Re: [MOD] Select country and gender with gif when register
Post by: Fastian on January 26, 2006, 02:58:43 PM
A little more info
This is what i have in my member_profile.html
Code: [Select]
<td class="row1"width="40%"><b>{lang_user_country}</b></td>
<td class="row1">{user_country}</td>

But when i see the "view source" of the page i get this

Code: [Select]
td class="row1" width="40%"><b>Country:</b></td>
<td class="row1">&nbsp;</td>
That means, {user_country} is not showing anything. Although i have this filed in my Data base and i have manually added the country as well.
So where do i start looking for the problem ?
Title: Re: [MOD] Select country and gender with gif when register
Post by: V@no on January 26, 2006, 03:08:51 PM
Although i have this filed in my Data base and i have manually added the country as well.
And when you go edit a member, country is showed there as well? (edit through ACP or from members edit profile page)
Title: Re: [MOD] Select country and gender with gif when register
Post by: Fastian on January 26, 2006, 03:33:22 PM
And when you go edit a member, country is showed there as well? (edit through ACP or from members edit profile page)

From ACP, I can only see gender field. No country option there.
As a user, in my profile I can see that country field with dropdown options. (In registration page it’s also there)

I just noticed one more thing. When as I user I change my country, It remains the same in Database (It remains the one I added before, Checked through PHP my admin)


Title: Re: [MOD] Select country and gender with gif when register
Post by: Fastian on January 27, 2006, 02:42:25 PM
Do I need to have this option in ACP ??

When I have a country XYZ for a user ABC set through phpMyAdmin, why i m not getting it when I place {user_country} n his profile.

Please help me. I want to add few other fields as well so waiting for this issue to be resolved.
Title: Re: [MOD] Select country and gender with gif when register
Post by: V@no on January 27, 2006, 02:58:24 PM
1) make sure you have
Code: [Select]
$additional_user_fields['user_country'] = array($lang['user_country'], "dropdown", 0, $var, 0, 0, 0, 1);in includes/db_field_definitions.php
2) if you dont see the dropdown in ACP, then you probably made a misstake while installing the "Dropdown for custom fields" mod.
Title: Re: [MOD] Select country and gender with gif when register
Post by: Fastian on January 27, 2006, 08:42:43 PM
1) make sure you have
Code: [Select]
$additional_user_fields['user_country'] = array($lang['user_country'], "dropdown", 0, $var, 0, 0, 0, 1);in

Yes I do have this part. I double checked everything and to me, if I m doing anything wrong its in member.php from
[MOD] Dropdown options for custom database fields Mainly with step 1. As stated it should be two times but i just have once. So I changed the closes one that i got.

I am attaching both files. (I tried with both) But still can’t see it in ACP. I can see the drop down in user profiled in both cases but it doesn’t work. The country field remains blank.

So if U can have a look and tell me what exactly i am missing. I dont have any doubt in any other file.
Title: Re: [MOD] Select country and gender with gif when register
Post by: Fastian on January 29, 2006, 06:26:48 AM
Any idea what I am missing or doing wrong??

After reading the whole thread I see that I am not the only one having trouble with country field. But I guess others somehow manage to get it to work but I am still trying.

V@no could u please tell me which member.php is correct from above two files.
Title: Re: [MOD] Select country and gender with gif when register
Post by: Fastian on January 31, 2006, 02:24:12 PM
Desperately need this working but still I can’t figure it out that what’s wrong with it. I have installed one other mod which is used to have date of birth of the member and its working fine.

Can someone help me here?? I have checked each step more than 3 times but I don’t know why it’s not working.

I need help here. Is there any other way getting this "Country filed" working??

Title: Re: [MOD] Select country and gender with gif when register
Post by: TheOracle on January 31, 2006, 06:50:50 PM
Actually, I don't get this MOD myself ...

since user_gender and user_country field are involved.

Secondly, where's the $lang['user_sex'] from main.php file in the instructions ?

Third, since these fields shows as :

Quote

$additional_user_fields['user_country'] = array($lang['user_country'], "dropdown", 0, $var, 0, 0, 0, 1);
$additional_user_fields['user_gender'] = array($lang['user_gender'], "dropdown", 0, array("n" => "---","b" => "Bisex", "m" => "Male", "w" => "Female"), 1, 0, 0, 0);


and, since the SQL update should go for "each additional user fields", where's the :

Quote

$additional_user_fields['user_sex'] = array($lang['user_sex'], "dropdown", 0, array("n" => "---","b" => "Bisex", "m" => "Male", "w" => "Female"), 1, 0, 0, 0);


when :

Quote

UPDATE 4images_users SET user_sex = 'your default country'


I must say myself ... it is quite confusing. I could be wrong but there might be some missing instructions from the first post (or perhaps mistakes were involved). ;)
Title: Re: [MOD] Select country and gender with gif when register
Post by: Fastian on January 31, 2006, 09:35:37 PM
Actually, I don't get this MOD myself ...

since user_gender and user_country field are involved.

Secondly, where's the $lang['user_sex'] from main.php file in the instructions ?

I must say myself ... it is quite confusing. I could be wrong but there might be some missing instructions from the first post (or perhaps mistakes were involved). ;)

Throught this mod i m using user_gender and user_country filed. I can see the drop down while editing the profile but thecountry just dont show up in profile. When i checked through phpMyAdmin it appears that countryfield is not getting update.

The update code statements in first post have that mistake. Instead of user_gender thay are showing user_sex. But other than that i cant say whats wrong.
Currently, user_gender is working fine. The only problem is with Country field.

Can i have any other alternative ?? In case this mod is not working perfectly or missing few things as u said
Title: Re: [MOD] Select country and gender with gif when register
Post by: TheOracle on January 31, 2006, 10:19:45 PM
To be honnest, I'd rather not install this MOD due to these unexpected errors. Sorry.
Title: Re: [MOD] Select country and gender with gif when register
Post by: Fastian on January 31, 2006, 11:30:32 PM
To be honnest, I'd rather not install this MOD due to these unexpected errors. Sorry.

I am also thinking the same.

I am going to drop the "Country" part of this module
I will add an additional user field and make it opitional so user can put their country if they want to.  :)
Title: Re: [MOD] Select country and gender with gif when register
Post by: V@no on February 01, 2006, 02:31:14 AM
since user_gender and user_country field are involved.

Secondly, where's the $lang['user_sex'] from main.php file in the instructions ?
user_sex field is only showed at the end of the tutorial, and it been used by a misstake, apperently left of from the previous version...

I've updated the original post.
Title: Re: [MOD] Select country and gender with gif when register
Post by: V@no on February 01, 2006, 02:54:38 AM
Fastian will be pleased.
Please stop the spam!
If you have nothing usefull to say, than say nothing.
Title: Re: [MOD] Select country and gender with gif when register
Post by: IcEcReaM on February 17, 2006, 04:31:58 PM
When i understand you right,
you want, that these field must be filled out?

[qcode]$additional_user_fields['user_country'] = array($lang['user_country'], "dropdown", 1, $var, 0, 0, 0, 1);[/qcode]

[qcode]$additional_user_fields['user_gender'] = array($lang['user_gender'], "dropdown", 1, array("n" => "---","b" => "Bisex", "m" => "Male", "w" => "Female"), 1, 0, 0, 0);[/qcode]

If yes, then i think you should in db_field_definitions.php these lines to this.

The red marked number is different compared to original code.
Title: Re: [MOD] Select country and gender with gif when register
Post by: IcEcReaM on February 17, 2006, 09:00:06 PM
the other values don't need to be changed.

Did you already tried it, does it work as you wanted?
Title: Re: [MOD] Select country and gender with gif when register
Post by: nutnick on March 04, 2006, 10:13:20 PM
Hi help please help! I have installed the gender mod and it all works except when you set the field in the dropdown box and save it is there to see but when you go to the profile page it's not it's back to defult as if it's not saving the data and thats my problem! i'm not sure how to do this!
   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
.
im only useing the gender part
sorry to sound a bit thick but it's only my 3rd day of learning php but will to learn.
Many thanks
 Nick
Title: Re: [MOD] Select country and gender with gif when register
Post by: trez on March 05, 2006, 01:22:40 AM
Quote
Hi help please help! I have installed the gender mod and it all works except when you set the field in the dropdown box and save it is there to see but when you go to the profile page it's not it's back to defult as if it's not saving the data and thats my problem! i'm not sure how to do this!

if you form from that sentence, three or four, maybe we can help you ;) I read it 3 times and really don't understand what you are trying to say.
(please post more clearly the problem thatat ou have / hat you want to change or do)
Title: Re: [MOD] Select country and gender with gif when register
Post by: IcEcReaM on March 20, 2006, 05:03:38 PM
ich versteh deine frage nicht so ganz?
vllt bin ich heute auch nur mit dem falschen bein aufgestanden...^^

könntest du das nochmal für mich erläutern?
Title: Re: [MOD] Select country and gender with gif when register
Post by: IcEcReaM on March 20, 2006, 06:33:20 PM
achso, das müsste einfach so gehen:
Code: [Select]
<td class="row1">{if user_gender}<img src="{template_url}/images/{user_gender}.gif">{endif user_gender}</td>
der if tag gibt immer nur als kondition an, ob entsprechender tag vorhanden ist,
d.h. wenn kein geschlecht gewählt wurde, dürfte {user_gender} an sich auch nicht gesetzt sein.
Title: Re: [MOD] Select country and gender with gif when register
Post by: Stoleti on March 20, 2006, 06:40:18 PM
anyone can help me in make it work on old pms ? (i know this isn't maybe the best topic, but pms topic its locked)  :( , i mean make it just work on inbox ...

on received messages  :P
Title: Re: [MOD] Select country and gender with gif when register
Post by: IcEcReaM on March 20, 2006, 11:40:23 PM
ok, hab das mir mal genauer angeschaut.
Das Problem liegt daran, dass wenn kein Geschlecht gewählt wurde,
dennoch ein Wert gesetzt wird.
Der Grund, warum bei dir ein Broken Link angeigt wird,
ist dass bei dir ein Bild fehlt, nämlich /templates/port/images/n.gif.
entweder du änderst den php code,
oder was einfacher ist, du erstellst das Bild.
Wenn nicht erscheinen soll, wenn kein Geschlecht gewählt wurde,
kopiere einfach die spacer.gif und bennenne die Kopie in n.gif um.
Title: Re: [MOD] Select country and gender with gif when register
Post by: IcEcReaM on March 21, 2006, 01:14:58 AM
gern geschehen.
Hab den Mod nicht installiert,
sonst hätte ich dir gleich sagen können,
dass es daran liegt, und wir hätten das Problem gelöst, dafür haben die anderen jetzt was zum lesen..^^

Wenn das nächste Mal was ist,
kannst du mich auch gerne per PM anschreiben.

Um das Ganze mehrsprachig zu machen, folgendes ändern:
das hier:
Code: [Select]
$additional_user_fields['user_gender'] = array($lang['user_gender'], "dropdown", 1, array("n => "---","b" => "Bisex", "m" => "Male", "w" => "Female"), 1, 0, 0, 0);in das ändern:
Code: [Select]
$additional_user_fields['user_gender'] = array($lang['user_gender'], "dropdown", 0, $lang['gender_array'], 1, 0, 0, 0);
nun kannst du in deiner main.php folgendes verwenden:
Code: [Select]
$lang['gender_array'] = array ("n" => "---","b" => "Bisex", "m" => "Man", "w" => "Woman");
wobei nur die werte die jeweils nach "=>" geändert werden dürfen, das dürfte ja aber klar sein.

Title: Re: [MOD] Select country and gender with gif when register
Post by: PartyPix on May 26, 2006, 02:12:32 PM
Hi @ all

will be go this MOD in V 1.7.2 ,too ?? Please reply me!

///////////////////////////////////////////////////////////////

Hi @ alle

funktioniert dieser Mod auch in Version 1.7.2 ?? Bitte sagt mir bescheit damit ich weiß ob ich diesen installieren kann!

MFG
Title: Re: [MOD] Select country and gender with gif when register
Post by: nfprehn on June 23, 2006, 09:17:20 PM
Does anyone know what changes are required to make this work in 1.7.2?

Many thanks
Title: Re: [MOD] Select country and gender with gif when register
Post by: nfprehn on July 02, 2006, 10:15:22 PM
I (also) have the following problem, and could not find an answer in this forum:

[qcode] Re: [MOD] Select country and gender with gif when register
« Reply #29 on: November 07, 2005, 09:43:14 PM »   

--------------------------------------------------------------------------------
it's working for me.. fine..
but one question..
If a new user registers himself and makes an entry in country field, the registration is implemented immediately...
is there a solution for me? [/qcode]
Title: Re: [MOD] Select country and gender with gif when register
Post by: Bonze on July 26, 2006, 03:58:58 PM
hab auch das "gender" feld eingebaut , funzt auch soweit jedoch bekomme ich im profil editieren bereich sobald ich mein geschlecht ausgewählt hab und abgespeichert hab nur das hier zu sehen ,..
http://img150.imageshack.us/img150/8923/genderbo0.jpg
sonst funktioniert alles normal,.
achso ich hab die version 1.7.3.
hat jemand ne idee was da nich stimmen könnte?
Title: Re: [MOD] Select country and gender with gif when register
Post by: mawenzi on July 26, 2006, 06:07:40 PM
@ Bonze
... offensichtlich ist "gender" nicht in der DB gespeichert, und für "kein gender" liegt ja auch kein Bild vor ...
... von daher "---" und "redX" ...
... überprüfe den Eintrag in die DB mal PhpMyAdmin ob er vorhanden ist ...
Title: Re: [MOD] Select country and gender with gif when register
Post by: Bonze on July 26, 2006, 07:48:12 PM
ne sry fals du das falsch verstanden hast , es ist ein eintrag vorhanden und es wird auch etwas gespeichert weil ich wenn ich mein profil mit ?action=showprofile&user_id=1 anschaue , das entsprechende symbol für männlich angeziegt bekomme , nur halt im profil editieren bereich machts des nich , ..aus welchen gründen auch immer,.
Title: Re: [MOD] Select country and gender with gif when register
Post by: Bonze on July 26, 2006, 09:33:42 PM
ok habs problem gelöst hatte ein prob mit diesem drop down custom fiedl dingens:D
Title: Re: [MOD] Select country and gender with gif when register
Post by: Bonze on July 26, 2006, 10:16:15 PM
mhh das war anscheinend nur die ghälfte der lösung denn , wenn ich das kontrollzentrum aufrufe
sieht es so aus wie auf dem bild, gehe ich hin und wähle mein geschlecht aus und gehe dann auf speichern ist es so wie es sein sollte ees steht in der liste und nebendran mein bildchen ,.
Title: Re: [MOD] Select country and gender with gif when register
Post by: Bonze on July 27, 2006, 11:14:39 AM
mhh du wirsts mir nich glauben aba das hab ich schon gemacht,.
Title: Re: [MOD] Select country and gender with gif when register
Post by: Bonze on July 27, 2006, 01:51:36 PM
mhh ja das funktioniert ja jetzt auch , nur ists ein ganz anderes problem das schwer zu beschreiben ist , also ich öffne das kontrollcenter dann ist im dropdown feld --- ausgewählt und nebendran isn platzhalter
wähle ich jetzt male aus und speichere dies ab , wenn die seite refreshed wird, ist dann male ausgewählt und das passende bild wird nebendran angezeigt ,.
öffne ich dann das kontrolcenter wieder ists wieder wie am anfang , obwohl der datensatz male in der db steht,.
Title: Re: [MOD] Select country and gender with gif when register
Post by: Bonze on July 27, 2006, 08:55:47 PM
ok hab die member.php komplett neu mit alllen mods gemacht und dabei festgestellt das ich nen fehler drinhatte jetzt scheints irgendwie zu gehen ,
Aber : jetzt hab ich nen anderen fehler vielleicht kann von euch jemand mehr damit anfangen
DB Error: Bad SQL Query: UPDATE 4images_users SET user_email = 'fragger255@hotmail.com', user_showemail = 1, user_allowemails = 1, user_invisible = , user_homepage = '', user_icq = '154490947', user_gender = 'w', birthday = '1988-07-27' WHERE user_id = 1
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' user_homepage = '', user_icq = '154490947', user_gender = 'w', birthday = '1988' at line 2

Title: Re: [MOD] Select country and gender with gif when register
Post by: dgparent on August 22, 2006, 03:34:18 PM
Great mod thx. One thing is there a way to just list male ,female or bisexual instead of the gif showing up ? My users don't know what those mean thanks again
Title: Re: [MOD] Select country and gender with gif when register
Post by: Darkness2001 on September 20, 2006, 09:55:03 AM
Hallo zusammen,

ich habe genau das Problem gehabt, das ich den MOD eingebaut hatte aber die "dropdown" nicht dargestellt urden.
Nach langem hin und her habe ich den Fehler gefunden.

Ich habe aus dem Mod [MOD] Dropdown options for custom database fields die Daten für die Member übernommen
(Step 1).

Jetzt funkt. der MOD einwandfrei ;-)

Thanks Darkness  :lol:
Title: Re: [MOD] Select country and gender with gif when register
Post by: TubeTopia on October 24, 2006, 08:07:14 AM
 :) works fine in 1.7.4
Title: Re: [MOD] Select country and gender with gif when register
Post by: ccsakuweb on March 17, 2007, 11:57:33 AM
I would like country flags in view profile. how can I do that?
Title: Re: [MOD] Select country and gender with gif when register
Post by: datenplatz on December 19, 2007, 02:35:27 PM
Code: [Select]
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.

how can i do this ? where is the option in phpmyadmin to create new columns ?
wie kann ich dies machen ? sorry bin vollnoob mit phpmyadmin
Title: Re: [MOD] Select country and gender with gif when register
Post by: thunderstrike on December 19, 2007, 03:09:19 PM
Code: [Select]
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.

how can i do this ? where is the option in phpmyadmin to create new columns ?
wie kann ich dies machen ? sorry bin vollnoob mit phpmyadmin

http://www.vielegruesse.com

If no get how use phpmyadmin - use this plugin:

http://www.4homepages.de/forum/index.php?topic=19254.0

Click: [ Expert mode] link - paste code in textarea and click submit button. ;)

Code: [Select]
ALTER TABLE `4images_users` ADD user_country varchar(255) NOT NULL;

Code: [Select]
ALTER TABLE `4images_users` ADD user_gender text NOT NULL;

(each submit - no same time) ;)
Title: Re: [MOD] Select country and gender with gif when register
Post by: datenplatz on December 19, 2007, 09:36:30 PM
thx a lot , it works  :lol:
Title: Re: [MOD] Select country and gender with gif when register
Post by: masterred on February 20, 2008, 06:14:30 AM
hi

I do like to select the country not to change the field to complete the registration form. As a change in this part includes_functions.php

Quote
function get_dropdown_options($name, $options = array(), $value = "", $multi_dim = 1, $number = 0, $auto = 0, $keypress = 0, $extra = "", $class = "", $i_start = 0, $i_step = 1, $i_stop = 1) {
  $keypress = ($keypress) ? " onkeypress=\"if(window.event.keyCode==13)this.form.submit();\"" : "";
  $auto = ($auto) ? " onchange=\"this.form.submit();\"" : "";
    $dropdown = "<SELECT name=\"".$name."\"".$auto.$keypress." class=\"".(($class) ? $class : "select")."\"".$extra.">\n";
   $i = $i_start;
  if (count($options)) {
    foreach ($options as $key => $val) {
       $what = (($number) ? $i : (($multi_dim) ? $key : $val));
        $dropdown .= "<option value=\"".$what."\"".(($value == $what) ? " selected" : "").">".preg_replace (array("/{key}/siU", "/{val}/siU", "/{what}/siU", "/{value}/siU"), array($key, $val, $what, $value), $val)."</option>\n";
        $i = $i + $i_step;
     }
  }else{
    for ($i = $i_start; $i <= $i_stop; $i += $i_step) {
        $dropdown .= "<option value=\"".$i."\"".(($value == $i) ? " selected" : "").">".$i."</option>\n";
    }
  }
   $dropdown .= "</select>\n";
  return $dropdown;
}
function get_db_fields_dropdown($key, $val, $value) {
  return get_dropdown_options($key, $val[3], $value, $val[4], $val[5], $val[7], 1, "", "select", $val[6]);
}

thank
Title: Re: [MOD] Select country and gender with gif when register
Post by: Tobi.L on June 11, 2008, 06:14:34 PM
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

Das geht bei mir nicht, warum?
Folgende Fehler kommen:
Quote
Fehler

SQL-Befehl:

UPDATE 4images_users SET user_country = 'Germany'

MySQL meldet: Dokumentation
#1054 - Unknown column 'user_country' in 'field list'

und

Quote
Fehler

SQL-Befehl:

UPDATE 4images_users SET user_gender = 'm'

MySQL meldet: Dokumentation
#1054 - Unknown column 'user_country' in 'field list'
Title: Re: [MOD] Select country and gender with gif when register
Post by: mawenzi on June 11, 2008, 07:26:04 PM
... wie es die Fehlermeldung bereits sagt, nur in englisch ...
... keine Spalte 'user_country' in der Tabelle '4images_users' angelegt ...
... und 'user_gender' dann sicher auch nicht ...
Title: Re: [MOD] Select country and gender with gif when register
Post by: Tobi.L on June 11, 2008, 07:35:30 PM
? Sorry, habe eine Frage gestellt!
Habe es aber herausbekommen wie man das macht! Bzw. hab ne PN bekommen und damit gings!
Title: Re: [MOD] Select country and gender with gif when register
Post by: alexmig on March 11, 2009, 11:47:12 PM
If a new user registers himself and makes an entry in country field, the registration is implemented immediately...
The new User as to fill again custom fields.

Thank you
Title: Re: [MOD] Select country and gender with gif when register
Post by: V@no on March 12, 2009, 06:37:49 AM
Sorry, I don't understand
Title: Re: [MOD] Select country and gender with gif when register
Post by: k1lljoy on January 24, 2010, 01:22:39 AM
If I have 1.7.7 version installed, do I still have to install  the Dropdown options for custom database fields MOD (http://www.4homepages.de/forum/index.php?topic=7112.0) first for it to run properly?  :roll:
Title: Re: [MOD] Select country and gender with gif when register
Post by: milanNN on December 20, 2010, 08:55:46 PM
I want to make Dropdown option for country for upload photos.
What files i have to edit?
db_field_definitions.php
$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_image_fields['image_country'] = array($lang['image_country'], "dropdown", 0, $var, 0, 0, 0, 1);main.php
$lang['image_country'] = "Country:";
member_uploadform.html
<tr>
     <td class="row2"><b>{lang_image_country}</b></td>
     <td class="row2">{image_country_dropdown} </td>
</tr>

What else?
Title: Re: [MOD] Select country and gender with gif when register
Post by: haider512 on December 28, 2010, 01:01:57 AM
what to do to make dropdown in to radio buttons..

so during registration..they choose between radio buttons instead of dropdown list..??
Title: Re: [MOD] Select country and gender with gif when register
Post by: V@no on December 28, 2010, 01:14:07 AM
what to do to make dropdown in to radio buttons..

so during registration..they choose between radio buttons instead of dropdown list..??
Sorry for the useless reply, but I really hope you are talking about genders selection only...
Title: Re: [MOD] Select country and gender with gif when register
Post by: haider512 on December 28, 2010, 02:55:57 AM
what to do to make dropdown in to radio buttons..

so during registration..they choose between radio buttons instead of dropdown list..??
Sorry for the useless reply, but I really hope you are talking about genders selection only...

No problem buddy..

yes i only want for gender selection..

That a user have to select thier gender by radio..not drop down..
Title: Re: [MOD] Select country and gender with gif when register
Post by: clubbu on July 15, 2011, 03:33:28 PM
Goodmorning.
i have a question.

you can check or change these options from the admin panel?
Title: Re: [MOD] Select country and gender with gif when register
Post by: marcinos on February 05, 2012, 05:28:43 PM
How formating element {user_country_dropdown} in css,
Title: Re: [MOD] Select country and gender with gif when register
Post by: Jasi on November 29, 2014, 10:40:15 PM
Hi,

mit dem Country Mod hab ich ein kleines Problem, er trägt mir in die DB nur zum Beispiel:
1
2
3
4
anstatt den Country-Namen (Deutschland, Österreich, Schweiz, usw.

Wer kann bitte helfen das Problem zu lösen ?!

Vielen Dank an Alle