4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: V@no on March 29, 2005, 08:30:22 PM

Title: [MOD] Dropdown options for custom database fields
Post by: V@no on March 29, 2005, 08:30:22 PM
This mod will add new feature to use dropdown options for custom database fields, that could be specifyed in /includes/db_field_definitions.php

-------- [ Installation ] ---------

4images v1.7.6 and newer

Step 1

:flag-en: Open members.php
:flag-de: Öffne members.php

:flag-en: search:
:flag-de: suche:  
Code: [Select]
else {
        $value = (isset($HTTP_POST_VARS[$key])) ? format_text(stripslashes(trim($HTTP_POST_VARS[$key]))) : $image_row[$key];
      }

:flag-en: Insert above  
:flag-de: füge darüber ein:

Code: [Select]
elseif ($val[1] == "dropdown") {
        $value = (isset($HTTP_POST_VARS[$key])) ? format_text(stripslashes(trim($HTTP_POST_VARS[$key]))) : $image_row[$key];
        $additional_field_array[$key.'_dropdown'] = get_db_fields_dropdown($key, $val, $value);
      }

Step 1.1

:flag-en: search:
:flag-de: suche:

Code: [Select]
else {
        $value = (isset($HTTP_POST_VARS[$key])) ? format_text(trim($HTTP_POST_VARS[$key]), 2) : $user_info[$key];
      }

:flag-en: Insert above:
:flag-de: füge darüber ein:

Code: [Select]
elseif ($val[1] == "dropdown") {
        $value = (isset($HTTP_POST_VARS[$key])) ? format_text(trim($HTTP_POST_VARS[$key]), 2) : $user_info[$key];
        $additional_field_array[$key.'_dropdown'] = get_db_fields_dropdown($key, $val, $value);
      }


Step 2
:flag-en: Open register.php
:flag-de: Öffne register.php

:flag-en: search:
:flag-de: suche:

Code: [Select]
else {
            $additional_field_array[$key.'_yes'] = "";
            $additional_field_array[$key.'_no'] = " checked=\"checked\"";
          }
        }

:flag-en: Replace with:
:flag-de: ersetze mit:

Code: [Select]
else {
            $additional_field_array[$key.'_yes'] = "";
            $additional_field_array[$key.'_no'] = " checked=\"checked\"";
          }
        }
        elseif ($val[1] == "dropdown") {
          $value = (isset($HTTP_POST_VARS[$key])) ? $HTTP_POST_VARS[$key] : $user_info[$key];
           $additional_field_array[$key.'_dropdown'] = get_db_fields_dropdown($key, $val, $value);
        }


Step 3
:flag-en: Open includes/functions.php
At the end, above closing ?> insert:

:flag-de: Öffne includes/funktions.php
füge am ende vor ?> folgendes ein

Code: [Select]
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]);
}


Step 4
:flag-en: Open admin/admin_functions.php
:flag-de: Öffne admin/admin_functions.php

:flag-en: search:
:flag-de: suche:

Code: [Select]
case "radio":
        show_radio_row($val[0], $field_name, ($value == "") ? 1 : $value);
        break;

:flag-en: Insert below:
:flag-de: füge darunter ein:

Code: [Select]
case "dropdown":
        show_user_dropdown_row($field_name, $val, $value);
        break;

Step 4.1

:flag-en: At the end, above closing ?> insert:

:flag-de: füge am ende vor ?> folgendes ein

Code: [Select]
function show_user_dropdown_row($name, $val, $value = 0){
  echo "<tr class=\"".get_row_bg()."\" valign='top'>\n<td><p class=\"rowtitle\">".$val[0]."</p></td>\n";
  echo "<td><p>\n";
  echo get_dropdown_options($name, $val[3], $value, $val[4], $val[5], $val[7], 1, "", "select", $val[6]);
  echo "</p></td>\n</tr>\n";
}







4images v1.7 - v1.7.5

Step 1 (updated 05-22-2004)
Open members.php

Find two times:
Code: [Select]
     else {
        $value = (isset($HTTP_POST_VARS[$key])) ? htmlspecialchars(stripslashes(trim($HTTP_POST_VARS[$key]))) : "";
      }

Replace both of them with:
Code: [Select]
     elseif ($val[1] == "dropdown") {
        $value = (isset($HTTP_POST_VARS[$key])) ? $HTTP_POST_VARS[$key] : $image_row[$key];
         $additional_field_array[$key.'_dropdown'] = get_db_fields_dropdown($key, $val, $value);
      }
      else {
        $value = (isset($HTTP_POST_VARS[$key])) ? htmlspecialchars(stripslashes(trim($HTTP_POST_VARS[$key]))) : ((isset($image_row[$key])) ? $image_row[$key] : "");
      }


4images v1.7.3

Find two times:
Code: [Select]
     else {
        $value = (isset($HTTP_POST_VARS[$key])) ? format_text(stripslashes(trim($HTTP_POST_VARS[$key]))) : $image_row[$key];
      }

Insert above both of them:
Code: [Select]
     elseif ($val[1] == "dropdown") {
        $value = (isset($HTTP_POST_VARS[$key])) ? format_text(stripslashes(trim($HTTP_POST_VARS[$key]))) : $image_row[$key];
        $additional_field_array[$key.'_dropdown'] = get_db_fields_dropdown($key, $val, $value);
      }



Step 1.1

4images v1.7

Find:
Code: [Select]
     else {
        $value = (isset($HTTP_POST_VARS[$key])) ? htmlspecialchars(trim($HTTP_POST_VARS[$key])) : $user_info[$key];
      }

Replace with:
Code: [Select]
     elseif ($val[1] == "dropdown") {
        $value = (isset($HTTP_POST_VARS[$key])) ? $HTTP_POST_VARS[$key] : $user_info[$key];
         $additional_field_array[$key.'_dropdown'] = get_db_fields_dropdown($key, $val, $value);
      }
      else {
        $value = (isset($HTTP_POST_VARS[$key])) ? htmlspecialchars(trim($HTTP_POST_VARS[$key])) : $user_info[$key];
      }



4images v1.7.3

Find:
Code: [Select]
     else {
        $value = (isset($HTTP_POST_VARS[$key])) ? format_text(trim($HTTP_POST_VARS[$key]), 2) : $user_info[$key];
      }

Insert above:
Code: [Select]
     elseif ($val[1] == "dropdown") {
        $value = (isset($HTTP_POST_VARS[$key])) ? format_text(trim($HTTP_POST_VARS[$key]), 2) : $user_info[$key];
        $additional_field_array[$key.'_dropdown'] = get_db_fields_dropdown($key, $val, $value);
      }




Step 2
Open register.php
Find:
Code: [Select]
         else {
            $additional_field_array[$key.'_yes'] = "";
            $additional_field_array[$key.'_no'] = " checked=\"checked\"";
          }
        }

Replace with:
Code: [Select]
         else {
            $additional_field_array[$key.'_yes'] = "";
            $additional_field_array[$key.'_no'] = " checked=\"checked\"";
          }
        }
        elseif ($val[1] == "dropdown") {
          $value = (isset($HTTP_POST_VARS[$key])) ? $HTTP_POST_VARS[$key] : $user_info[$key];
           $additional_field_array[$key.'_dropdown'] = get_db_fields_dropdown($key, $val, $value);
        }




Step 3 (updated 2005-12-01)
Open includes/functions.php
At the end, above closing ?> insert:
Code: [Select]
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]);
}




Step 4
Open admin/admin_functions.php
Find:
Code: [Select]
     case "radio":
        show_radio_row($val[0], $field_name, ($value == "") ? 1 : $value);
        break;

Insert below:
Code: [Select]
     case "dropdown":
        show_user_dropdown_row($field_name, $val, $value);
        break;



Step 4.2
At the end, above closing ?> insert:
Code: [Select]
function show_user_dropdown_row($name, $val, $value = 0){
  echo "<tr class=\"".get_row_bg()."\" valign='top'>\n<td><p class=\"rowtitle\">".$val[0]."</p></td>\n";
  echo "<td><p>\n";
  echo get_dropdown_options($name, $val[3], $value, $val[4], $val[5], $val[7], 1, "", "select", $val[6]);
  echo "</p></td>\n</tr>\n";
}




---------- [ How to use ] -----------

the format that u need to enter in includes/db_field_definitions.php must be like this:
Quote
$additional_user_fields['%column_name%'] = array("%field_description%", "%admin_field_type%", %is_required%, %dropdown_array% [, %is_multidimention%, %is_number%, %start_number%, %is_auto%]);


----------
%column_name% string

- Replace %column_name% with name of the table column.
You can use the tag {%column_name%_dropdown} in the templates to display the dropdown.

----------
%field_description% string

Replace %field_description% with a custom name. This name will be displayed in the Control Panel.
The value can be displayed in the templates with the tag {lang_%column_name%}.
It is also recommended to add this tag to the language files (main.php) and to replace "%field_description%"
with $lang['%column_name%']. (example: $lang['example'] = "Some description"; )

----------
%admin_field_type% string

- Replace %admin_field_type% with the type of input field you would like to use in your

----------
%is_required% bool

- Sets up the field as required when adding data through the Control Panel or the user upload form.

----------
%dropdown_array% array

- Array with a list of items for dropdown options.

----------
%is_multidimention% bool (optional. default 0)

- If %dropdown_array% is multidimetion array, set it to 1 otherwise 0

----------
%is_number% bool (optional. default 1)

- If %dropdown_array% is not multidimention array and you want use number in the value, set it to 1 otherwise 0

----------
%start_number% number (optional. default 0)

- Start number that will be used as value for first item in %dropdown_array%, when %is_number% is set to 1.

----------
%is_auto% bool (optional. default 0)

- Makes dropdown auto select (no need "submit" button)



--------- [ Examples ] ----------
 
Quote
$additional_user_fields['user_gender'] = array($lang['user_gender'], "dropdown", 0, array("---", "male", "female"), 0, 1, 5, 0);

it will produse template tag {user_gender_dropdown} with this code:

Code: [Select]
 <select name="user_gender" onkeypress="if(window.event.keyCode==13)this.form.submit();" />
    <option value="5">---</option>
    <option value="6">male</option>
    <option value="7">female</option>
  </select>



Quote
$additional_user_fields['user_gender'] = array($lang['user_gender'], "dropdown", 0, array("---", "male", "female"), 0, 0, 0, 1);

it will produse template tag {user_gender_dropdown} with this code:
 
Code: [Select]
 <select name="user_gender" onkeypress="if(window.event.keyCode==13)this.form.submit();" onchange="this.form.submit();" />
    <option value="---">---</option>
    <option value="male">male</option>
    <option value="female">female</option>
  </select>



Quote
$additional_user_fields['user_gender'] = array($lang['user_gender'], "dropdown", 0, array("n" => "---", "m" => "Male", "f" => "Female"), 1, 0, 0, 0);

it will produse template tag {user_gender_dropdown} with this code:

Code: [Select]
 <select name="user_gender" onkeypress="if(window.event.keyCode==13)this.form.submit();" />
    <option value="n">---</option>
    <option value="m">Male</option>
    <option value="f">Female</option>
  </select>

Title: Re: [MOD] Dropdown options for custom database fields
Post by: bentleykf on April 03, 2005, 03:31:25 AM
the first step has a typo, with the first piece of code to find, you are missing a ";".
The second occurance of  that same code differs, with ": $image_row[$key];" at the end instead of nothing.

-bents
Title: Re: [MOD] Dropdown options for custom database fields
Post by: V@no on April 03, 2005, 06:16:51 AM
Thank you.
I've fixed the step.

about the presense of $image_row[$key] - is a bug fix when values of additional fields not being populated in the edit image page.
I've updated the step so it would be more compatible with the first found instance.
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Toso on April 06, 2005, 02:04:56 PM
Hey V@no,

is it possible to show the selected value in member_editprofile.html?
Title: Re: [MOD] Dropdown options for custom database fields
Post by: V@no on April 06, 2005, 02:09:24 PM
sorry, I dont understand your question.
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Toso on April 06, 2005, 02:26:58 PM
O.k. I try to explain.

I have installed {user_gender_dropdown} in the userprofile.
If a user would like to change the value in his profile he can not see the last selection.


Sorry its very difficult to explain it... :cry:
Title: Re: [MOD] Dropdown options for custom database fields
Post by: V@no on April 06, 2005, 02:29:46 PM
If a user would like to change the value in his profile he can not see the last selection.
that should not have happend.
Perhaps u missed Step 1.1
Title: Re: [MOD] Dropdown options for custom database fields
Post by: ascanio on April 07, 2005, 01:54:40 AM
Open members.php
Find two times:
I just find it once is this for 1.7.1 also?
I try replacing that one time and I did the other modifications and it seem to be "working" I put {user_gender} in member_prfoile.html to see the gender and I put male when I register and what I get is a 6 :S
Title: Re: [MOD] Dropdown options for custom database fields
Post by: ascanio on April 27, 2005, 07:13:19 PM
Hi V@no ! , so if I want to do a drop down menu like the gender one but for states, do i have to put something like this?:

Code: [Select]
$additional_user_fields['user_state'] = array($lang['user_state'], "dropdown", 0, array("Madrid", "Barcelona", "Valencia", " ......","......","etc"), 1, 0, 0, 0);
Title: Re: [MOD] Dropdown options for custom database fields
Post by: V@no on April 28, 2005, 01:31:09 AM
correct
and, for better "viewing" u can put every state on a new line, or load the list into an external variable:
Code: [Select]
$var = array("Madrid",
             "Barcelona",
             "Valencia",
             " ......",
             "......",
              "etc"
);
$additional_user_fields['user_state'] = array($lang['user_state'], "dropdown", 0, $var, 1, 0, 0, 0);
Title: Re: [MOD] Dropdown options for custom database fields
Post by: ascanio on April 28, 2005, 05:56:10 PM
Hi V@no I did what u told me but with the list of countries and I get this error:

Code: [Select]
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/ascanio/domains/girlsandgirls.
My country list is this:

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, 1, 0, 0, 0);

Title: Re: [MOD] Dropdown options for custom database fields
Post by: V@no on April 29, 2005, 12:16:26 AM
"Middle East"'
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Warrior on May 29, 2005, 02:19:27 AM
Question- Can "members.php" be substituted with "details.php" and "register.php" be substituted with "upload.php"?

What I am wanting to do is require a field from a drop down menu stating which format a zipped or RAR file has in it (meaning is the file a Lightwave file, 3DSMax file, etc) when someone uploads from the upload page *or* when a file is added in the Admin CP.

Then I want those results shown on the detail.php and AdminCP edit pages, etc for the file.
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Warrior on May 29, 2005, 02:53:38 AM
...hmm Looking this over, do I really need to mod details.php (members.php in yours) if I don't need a drop down on the details.php page in the first place?

The only thing I want there on the details.php is the results from the drop down selection taking place from the uploads, The results on details.php would be given by the db_field_definitions.php code anyways, right?
Title: Re: [MOD] Dropdown options for custom database fields
Post by: V@no on May 29, 2005, 07:00:50 AM
I dont think u need this mod for what u are trying to do, because it doesnt require multilanguage support in the items of the dropdown, so just add your new field in 4images_images table in the database, update db_field_definitions.php with your new field info (use "text" type) and create dropdown menu directly in member_uploadform.html template. that's all.
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Warrior on May 29, 2005, 07:07:05 AM
What would the drop down look like in the uploadform.html template?
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Warrior on May 29, 2005, 07:42:57 AM
See... I want the field required, but that initial --- entry is being accepted.
Title: Re: [MOD] Dropdown options for custom database fields
Post by: V@no on May 29, 2005, 07:58:09 AM
What would the drop down look like in the uploadform.html template?
thats a basic HTML knowlege u should have ;)

See... I want the field required, but that initial --- entry is being accepted.
that is controled by information u entered in db_field_definitions.php (read comments in that file for more info)
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Warrior on May 29, 2005, 08:41:16 AM
Isn't working :(

Nothing I try with that db_field_definitions.php even gets put into the database :(
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Warrior on May 29, 2005, 09:34:41 AM
Ok.. I should go ahead and take myself out behind the barn and beat myself with a 2x4... or shoot myself.

Database field had a space before its name.

...oye  :roll:
Title: Re: [MOD] Dropdown options for custom database fields
Post by: drhtm on June 08, 2005, 03:17:00 AM
great mod!

what if I want to add different language to display in the dropdown, for example, i want english and french so the options in the dropdown will conform to the language selected by the user. is this possible?
Title: Re: [MOD] Dropdown options for custom database fields
Post by: V@no on June 08, 2005, 03:27:27 AM
put your array into $lang['somename'] variable and put into your main.php files (language files)
so, the result would looks something like this:
db_field_definitions.php:
Quote
$additional_user_fields['user_gender'] = array($lang['user_gender'], "dropdown", 0, $lang['user_gender_array'], 0, 1, 5, 0);
main.php:
Quote
$lang['user_gender_array'] = array("---", "male", "female");
Title: Re: [MOD] Dropdown options for custom database fields
Post by: drhtm on June 08, 2005, 05:31:53 AM
put your array into $lang['somename'] variable and put into your main.php files (language files)
so, the result would looks something like this:
db_field_definitions.php:
Quote
$additional_user_fields['user_gender'] = array($lang['user_gender'], "dropdown", 0, $lang['user_gender_array'], 0, 1, 5, 0);
main.php:
Quote
$lang['user_gender_array'] = array("---", "male", "female");

that's beautiful.  it works as promised, however, one problem i notice is that if i edit my profile while my site is in english and I save the information, then if i switch to french, and view my profile, the english text is displayed instead of the french one.  any ideas?
Title: Re: [MOD] Dropdown options for custom database fields
Post by: V@no on June 08, 2005, 06:02:57 AM
it depence on how u save the information into the database.
I'd suggest to use multi-dimention arrays:
Code: [Select]
array(
  0 => "---",
  1 => "male",
  2 => "female"
);
so in the database would save numbers (array keys) instead of values.
That way u can use trully mult-language text. (please read more about how to use multi-dim arrays in the original topic.)
Title: Re: [MOD] Dropdown options for custom database fields
Post by: drhtm on June 08, 2005, 01:50:05 PM
it depence on how u save the information into the database.
I'd suggest to use multi-dimention arrays:
Code: [Select]
array(
  0 => "---",
  1 => "male",
  2 => "female"
);
so in the database would save numbers (array keys) instead of values.
That way u can use trully mult-language text. (please read more about how to use multi-dim arrays in the original topic.)

oh yes, i see.  I read the orginal topic and it makes sense now.  However, if the user selects male, then the '1' will be saved in the database.  How do I retrieve it in the members profile so it will display 'male' in english or french?  I don't think I understand that part...
Title: Re: [MOD] Dropdown options for custom database fields
Post by: V@no on June 08, 2005, 02:07:43 PM
something like:
$lang['user_gender_array'][$user_info['user_gender']]
Title: Re: [MOD] Dropdown options for custom database fields
Post by: drhtm on June 08, 2005, 02:38:55 PM
wait, now i'm confused.

Step by step.
from includes/db_field_definitions.php
I add
Code: [Select]
$additional_user_fields['user_gender'] = array($lang['user_gender'], "dropdown", 0, $lang['user_gender_array'], 1, 0, 0, 0);
In the language files (main.php)

I add in the english main.php
Code: [Select]
$lang['user_gender_array'] = array("0" => "------", "1" => "Male", "2" => "Female");
 I add in the french main.php
Code: [Select]
$lang['user_gender_array'] = array("0" => "------", "1" => "Mâle", "2" => "Femelle");
and then? in the members_profile.html template I add?????? So it will display 'female' when it's english and 'femelle' when its french...

Code: [Select]
$lang['user_gender_array'][$user_info['user_gender']] doesn't make sense to me. I'm sorry.

Title: Re: [MOD] Dropdown options for custom database fields
Post by: V@no on June 08, 2005, 02:46:32 PM
actualy in members_profile.html u should not change anything...update your pforile again and it should be ok.
Title: Re: [MOD] Dropdown options for custom database fields
Post by: drhtm on June 08, 2005, 02:57:14 PM
hmmm....

I use this in my template {user_gender} and it displays '1'...?
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Stryker on June 22, 2005, 12:52:36 AM
I need make checkbox for custom database fields. Like this: <input type="checkbox" name="checkbox" value="checkbox">

Please, help me. Thanks
Title: Re: [MOD] Dropdown options for custom database fields
Post by: cipriansamoila on August 08, 2005, 06:28:53 AM
hi,

i could see the dropdown you integrate for user or image fields.

How would I adapt your instructions to add a dropdown to the comment form?
I followed your instructions so far but won't work, of course they are for another files.

Please help me with this.
Title: Re: [MOD] Dropdown options for custom database fields
Post by: V@no on August 08, 2005, 06:55:26 AM
4images does not support custom fields for comments
Title: Re: [MOD] Dropdown options for custom database fields
Post by: cipriansamoila on August 08, 2005, 04:05:09 PM
Is there any alternative I can get a Yes or No in the dabase after posting the comment?

In the comment form I have a question: Do you like this image? and they would answer yes or no. And then I need to count how many yes and how many nos i got for each image.
What do you recommend I should use?

THank you in advance.
Ciprian


4images does not support custom fields for comments

Title: Re: [MOD] Dropdown options for custom database fields
Post by: iban on September 03, 2005, 04:41:26 PM
Quote
$additional_user_fields['%column_name%'] = array("%field_description%", "%admin_field_type%", %is_required%, %dropdown_array% [, %is_multidimention%, %is_number%, %start_number%, %is_auto%]);

I set the %is_required parameter to "1" and when I am registering a new user, that field appears as optional. Is that a bug or have I gor a mistake in my mod code?

Many thanks
Title: Re: [MOD] Dropdown options for custom database fields
Post by: cipriansamoila on September 05, 2005, 07:21:28 PM
Hello Vano,

I try again asking about an alternative to add a new field in comment page.
A dropdown YES or NO.

I want the YES or NO to be add in the database, so I can make a statistics of how many liked the photo or not.
The rating system is far too complicated.
Maybe that would be an alternative, but it needs heavy recoding.

What do you say about that?

Thank you in advance.
Cip
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Santhosh on September 25, 2005, 04:55:41 PM
Hi all,

I wish to insert one page for advanced search of events added to the table 4images_addevents. I have to insert two drop down boxes one for including the city and the other for including type in the search. How can we do this.

Please help.

Thanks in advance.
Title: Re: [MOD] Dropdown options for custom database fields
Post by: soyola on January 28, 2006, 09:58:15 PM
Do you must create a drop down column in your database before using this mod right?  What kind of column should you create in your database?
Title: Re: [MOD] Dropdown options for custom database fields
Post by: soyola on January 28, 2006, 11:26:56 PM
Quote
else {
        $value = (isset($HTTP_POST_VARS[$key])) ? htmlspecialchars(stripslashes(trim($HTTP_POST_VARS[$key]))) : ""; 


Only shows up once but there is another similar code shows up first and that was


Quote
else {
        $value = (isset($HTTP_POST_VARS[$key])) ? htmlspecialchars(stripslashes(trim($HTTP_POST_VARS[$key]))) : $image_row[$key];
      }

There is also
Quote
else {
        $value = (isset($HTTP_POST_VARS[$key])) ? htmlspecialchars(trim($HTTP_POST_VARS[$key])) : $user_info[$key];
      }


Should I just replace the top two codes with

Quote
elseif ($val[1] == "dropdown") {
        $value = (isset($HTTP_POST_VARS[$key])) ? $HTTP_POST_VARS[$key] : $image_row[$key];
         $additional_field_array[$key.'_dropdown'] = get_db_fields_dropdown($key, $val, $value);
      }
      else {
        $value = (isset($HTTP_POST_VARS[$key])) ? htmlspecialchars(stripslashes(trim($HTTP_POST_VARS[$key]))) : ((isset($image_row[$key])) ? $image_row[$key] : "");
      }

Title: Re: [MOD] Dropdown options for custom database fields
Post by: soyola on January 29, 2006, 12:57:10 AM
How do you show member genders in their profile page ?  I have been looking through FAQ and other boards but there is nothing
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Stoleti on January 29, 2006, 05:23:09 AM
How do you show member genders in their profile page ?  I have been looking through FAQ and other boards but there is nothing

try http://www.4homepages.de/forum/index.php?topic=7385.0 install this MOD  8)

if you want show icon too (after gender) :

Added After

Code: [Select]
<img src="{template_url}/images/{user_gender}.gif">
i hope this help you !
Title: Re: [MOD] Dropdown options for custom database fields
Post by: soyola on January 29, 2006, 07:22:55 PM
I made my drop down fields required but it appears users can register it without choosing any value. Here is what my db_definitions field looks like
Quote
$additional_user_fields['user_gender'] = array($lang['user_gender'], "dropdown", 1, array("---", "Male", "Female"));

It's probably because its first value is "---" and it thinks it already has a value there but in reality I want users choose either M or F.  Do you know any solutions to this problem?

Thank you very much for your help
Title: Re: [MOD] Dropdown options for custom database fields
Post by: V@no on January 29, 2006, 07:59:42 PM
I'd suggest you use multidimention array instead. This way it would store number ( 0 - XX ) in the database, which is better in every way you look at it.
Quote
$additional_user_fields['user_gender'] = array($lang['user_gender'], "dropdown", 1, array("---", "Male", "Female"), 1);
Title: Re: [MOD] Dropdown options for custom database fields
Post by: glitzer on February 11, 2006, 01:53:20 PM
Bitte um kurze Hilfestellung.

Ich habe nun den Mod Installiert damit user das Geschlecht + Land eingeben können.

Nun aber haben ca. 3000 User von mir keine Eingabe bisher gemacht weil ich das erst jetzt reingegeben habe.
Nun steht im Profil überall "männlich" als Standard

und beim Land steht "your default country".

Ich würde nun gerne als Standart "bisex" haben..weil ich das als "keine Angabe" genommen habe..weils einfach heißen soll eines von beiden
und ich würde gerne statt "your defailt country" einen anderen text nehmen wie zb. keine Angabe auch.
Finde diesen text aber nirgenst zum ändern.

Bitte um Hilfe!
Danke
lg
Alexx
Title: Re: [MOD] Dropdown options for custom database fields
Post by: BartAfterDark on March 02, 2006, 09:29:41 PM
seems this mod needs an update so it becomes compatibel with 1.7.2 :)

Code: [Select]
      else {
        $value = (isset($HTTP_POST_VARS[$key])) ? htmlspecialchars(stripslashes(trim($HTTP_POST_VARS[$key]))) : "";
      }
Can't be found anymore
Title: Re: [MOD] Dropdown options for custom database fields
Post by: killerwhale65 on March 07, 2006, 05:36:22 PM
hi,

i would like to add custom drop-downs, but not for the user registration, but for the images and image-uploads. In what files will i have to be?

thanks!
Title: Re: [MOD] Dropdown options for custom database fields
Post by: sabba on March 30, 2006, 10:06:12 PM
Is there a way to make it compatible with 1.7.2?

sabba
Title: Re: [MOD] Dropdown options for custom database fields
Post by: mx5gr on April 25, 2006, 07:00:29 PM
Is there a way to make it compatible with 1.7.2?

sabba

Any luck?

The problem seems to be member.php
Title: Re: [MOD] Dropdown options for custom database fields
Post by: PartyPix on May 27, 2006, 06:56:49 PM
Will the MOD go in Version 1.7.2,too ???

Funktioniert dieser MOD auch in Version 1.7.2 ????

Title: Re: [MOD] Dropdown options for custom database fields
Post by: nfprehn on June 23, 2006, 08:49:03 PM
I would be really grateful if someone would explain how this could work with 1.7.2.

THANKS!

Wäre super wenn jemand erklären könnte wie das mit 1.7.2 funtionieren könnte.


DANKE!
Title: Re: [MOD] Dropdown options for custom database fields
Post by: sajwal on July 26, 2006, 03:52:45 PM
Hi, I am using 1.7.3 and i did not find members.php but member.php, and secondly in 1.7.3 i did not find this line to edit anywhere?

else {
        $value = (isset($HTTP_POST_VARS[$key])) ? htmlspecialchars(stripslashes(trim($HTTP_POST_VARS[$key]))) : "";
      }
Is it not meant for 1.7.3 or already the dropdown function present in it? how to use if it is there?


Please help, desparate to use dropdown list in registeration
Title: Re: [MOD] Dropdown options for custom database fields
Post by: sajwal on July 31, 2006, 01:34:47 PM
V@no pls. reply to my query...to add this feature to my 1.7.3 4images gallery
Title: Re: [MOD] Dropdown options for custom database fields
Post by: V@no on July 31, 2006, 08:22:13 PM
Ok, I've added v1.7.3 support
Title: Re: [MOD] Dropdown options for custom database fields
Post by: sajwal on July 31, 2006, 10:58:14 PM
Thankyou very very much V@no,   :D , i am too happy with your generousity
Title: Re: [MOD] Dropdown options for custom database fields
Post by: F2F on October 18, 2006, 12:51:46 PM
Weird...

I get this warning:

Code: [Select]
Warning: Undefined index: image_place in register.php on line 376
image_place is the custom field I created and this is line 376:

Code: [Select]
$value = (isset($HTTP_POST_VARS[$key])) ? $HTTP_POST_VARS[$key] : $user_info[$key];
Everything else is fine. I'm using 1.7.3, any idea? Thanks in advance.
Title: Re: [MOD] Dropdown options for custom database fields
Post by: F2F on October 18, 2006, 09:51:14 PM
Nevermind, I managed another way to use custom dropdowns...
Title: Re: [MOD] Dropdown options for custom database fields
Post by: mawenzi on October 18, 2006, 11:35:26 PM
thanks v@no for this very useful and perfectly working modification ...
Title: Re: [MOD] Dropdown options for custom database fields
Post by: F2F on October 19, 2006, 05:16:49 AM
Oh, yes, a BIG thanks to V@no for all his help and support here, no doubt about that.
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Darkness2001 on October 25, 2006, 09:58:56 PM
Hallo,

Vorschlag : Warum baut Ihr diesen Mod nicht als Standard in die neuste Version 1.7.4 mit ein.
Es sind zwar nur ein Paar Schritte aber erspart das erneute einbauen  :?:

Grüße Darkness  :mrgreen:
Title: Re: [MOD] Dropdown options for custom database fields
Post by: live@ct on December 20, 2006, 09:06:31 PM
exist the option to make a if_value_ofthedropdown?

for example

for the gender, you can choose between Male, Female, Bi
if the user choose Male,
you can use something like:

{if_gender_male_dropdown} {endif_gender_male_dropdown}

this to hide or show content for the selection, it can be, foto, portrait, lanscape
if I choose landscape it show only the content and style for landscape pictures, if is it portrait it only show the content and style for portrait etc etc

thanks for your help!
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Parasco on February 18, 2007, 08:42:00 PM
Hi all,

In the db_field_def how would we add the $lang['xxx'] to the dropdown options?  I need this cos my site is multilingual
Title: Re: [MOD] Dropdown options for custom database fields
Post by: topdolla on February 22, 2007, 06:08:51 PM
Hey V@no ,

What if I wanted to put a gender, age, location, etc.. in the registration form? Can you give me an example for one of them and then I will follow because I read other threats and there a bit confusing, jumping from one thing to another. Currently I have username, password, and e-mail for registration and member profile but I would like to add other fields.

I tried doing the gender part for this mod http://www.4homepages.de/forum/index.php?topic=16626.0 , for me to do that mod, i have to do your drop down mod. I know how to create new columns in phpadmin, im just missing the script to put it in the registration form, any help? Thanks
Title: Re: [MOD] Dropdown options for custom database fields
Post by: The Sailor on July 07, 2007, 03:55:21 PM
it did't work with 1.7.4 i didnt find the first code:
Code: [Select]
$value = (isset($HTTP_POST_VARS[$key])) ? htmlspecialchars(stripslashes(trim($HTTP_POST_VARS[$key]))) : "";
in member.php  :roll:
Title: Re: [MOD] Dropdown options for custom database fields
Post by: The Sailor on July 09, 2007, 11:12:37 AM
it did't work with 1.7.4 i didnt find the first code:
Code: [Select]
$value = (isset($HTTP_POST_VARS[$key])) ? htmlspecialchars(stripslashes(trim($HTTP_POST_VARS[$key]))) : "";
in member.php  :roll:
can anyone help me with that please?
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Peppino on July 15, 2007, 07:35:49 PM
Hello!
I´ve a problem

In the db_fields_definitions i add the following line

Code: [Select]
$additional_categories_fields['cat_cost'] = array($lang['cat_cost'], "dropdown", 0, array("0" => "0", "10" => "10", "25" => "25", "100" => "100", "250" => "250"), 1, 0, 0, 0);
And in the admin/categories.php

Code: [Select]
function show_cat_cost_select($title = "", $type, $status, $array) {
  global $HTTP_POST_VARS;
  if (isset($HTTP_POST_VARS[$type])) {
    $status = $HTTP_POST_VARS[$type];
  }
  echo "<tr class=\"".get_row_bg()."\" valign=\"top\">\n<td><p class=\"rowtitle\">".$title."</p></td>\n";
  echo "<td>\n<select name=\"".$type."\">\n";
  foreach ($array as $key => $val) {
    echo "<option value=\"".$key."\"";
    if ($status == $key) {
      echo " selected=\"selected\"";
    }
    echo ">".$val."</option>\n";
  }
  echo "</select>\n</td>\n</tr>\n";
}
But in the sourcetext ist following

<tr class="tablerow" valign="top">
<td><p class="rowtitle">Kosten pro Image</p></td>
<td>
<select name="cat_cost">
<option value="0">0</option>
<option value="1">10</option>
<option value="2" selected="selected">25</option>
<option value="3">100</option>
<option value="4">250</option>
</select>
</td>
</tr>

Where can i change this?

Thanks
Title: [REQ] Dropdown options for custom database fields for 1.7.4
Post by: The Sailor on July 21, 2007, 04:14:10 PM
hi all  :)


[MOD] Dropdown options for custom database fields (http://"http://www.4homepages.de/forum/index.php?topic=7112.0")

i need this mod  because there is some mods need it!  :!:
Title: Re: [MOD] Dropdown options for custom database fields
Post by: computer123 on August 13, 2007, 11:00:12 PM
Is there anyone who try to make this mod of V@no compatible with 1.7.4?

I believe that THE KING V@no has no time anymore to support us with his MODS. (Last Active:  November 03, 2006, 11:56:03 PM)!!!

I installed everything and I could use the dropdown field on the ACP but on the Member profielEdit does not save the options to the database.
I think that the problem in member.php because you find this line just once (NOT TWICE):

Quote
4images v1.7.3

Find two times:

Code:
      else {
        $value = (isset($HTTP_POST_VARS[$key])) ? format_text(stripslashes(trim($HTTP_POST_VARS[$key]))) : $image_row[$key];
      }

Insert above both of them:

Code:
      elseif ($val[1] == "dropdown") {
        $value = (isset($HTTP_POST_VARS[$key])) ? format_text(stripslashes(trim($HTTP_POST_VARS[$key]))) : $image_row[$key];
        $additional_field_array[$key.'_dropdown'] = get_db_fields_dropdown($key, $val, $value);
      }



Does anyone DARE to change the MOD of THE KING V@no?

Thanks,
SZ




Thank you in advance,
SZ
Title: Re: [MOD] Dropdown options for custom database fields
Post by: thunderstrike on August 13, 2007, 11:16:42 PM
In demand from some - I respond.


(once - member.php)

Quote
else {
        $value = (isset($HTTP_POST_VARS[$key])) ? format_text(stripslashes(trim($HTTP_POST_VARS[$key]))) : $image_row[$key];
      }

Add before:

Quote
elseif ($val[1] == "dropdown") {
        $value = (isset($HTTP_POST_VARS[$key])) ? format_text(stripslashes(trim($HTTP_POST_VARS[$key]))) : $image_row[$key];
        $additional_field_array[$key.'_dropdown'] = get_db_fields_dropdown($key, $val, $value);
      }
Title: Re: [MOD] Dropdown options for custom database fields
Post by: computer123 on August 13, 2007, 11:40:14 PM
Thanks thunderstrike,

I did that in the beginning but it does not work!

When you choose something on the Dropdown (Member profielEdit) you get this message:
Try again (Something like that) but when I use it at the ACP it work good.

Any idea???
Title: Re: [MOD] Dropdown options for custom database fields
Post by: thunderstrike on August 14, 2007, 12:00:29 AM
Quote
Try again (Something like that)

What is this something ??
Title: Re: [MOD] Dropdown options for custom database fields
Post by: computer123 on August 14, 2007, 12:07:19 AM
When you forgot to typ something in a required field you get this error asking you to fill the field.

NB: I translated to my language (Dutch-Holland), so I can not remember the original error message.

Title: Re: [MOD] Dropdown options for custom database fields
Post by: thunderstrike on August 14, 2007, 12:15:47 AM
Hard respond when no exact text error message ...
Title: Re: [MOD] Dropdown options for custom database fields
Post by: computer123 on August 14, 2007, 12:42:27 AM
Here we go,  I just looked for it:

Please fill out the {field_name} field!

Title: Re: [MOD] Dropdown options for custom database fields
Post by: thunderstrike on August 14, 2007, 12:54:16 AM
Which file ?
Title: Re: [MOD] Dropdown options for custom database fields
Post by: computer123 on August 14, 2007, 01:04:35 AM
member_editprofile.html
Title: Re: [MOD] Dropdown options for custom database fields
Post by: thunderstrike on August 14, 2007, 01:58:29 AM
Do step 1.1 - 4images v1.7.3 ?
Title: Re: [MOD] Dropdown options for custom database fields
Post by: computer123 on August 14, 2007, 02:31:42 AM
Ofcourse, I think that we have to change someting in member.php.

If you use 1.7.4 so please install this very important MOD and you will see yourself what wrong :idea:

NOTE: Thousand of 4images users wil thank you if you solve this problem.

WE NEED YOUR PHP KNOWLEDGE!

Title: Re: [MOD] Dropdown options for custom database fields
Post by: thunderstrike on August 14, 2007, 02:32:46 AM
Post in topic all diff report foreach users ... how can no if problem with MOD and no user ?  :mrgreen:
Title: Re: [MOD] Dropdown options for custom database fields
Post by: bacterio on October 07, 2007, 09:28:16 PM
For dropdown Male, Female, ---, who is:

ALTER TABLE 4images_images ADD images_sex...... ?¿?¿?¿
Title: Re: [MOD] Dropdown options for custom database fields
Post by: thunderstrike on October 07, 2007, 09:48:13 PM
Sorry ... I no get last reply ...
what is question with code ?
Title: Re: [MOD] Dropdown options for custom database fields
Post by: bacterio on October 07, 2007, 10:49:36 PM
$additional_image_fields['images_sex'] = array($lang['image_sex'], "dropdown", 0, array("---","Male", "Female"), 1, 0, 0, 0);

As a new field within the table for dropdown is added?

ALTER TABLE 4images_images ADD .......? ? ?
Title: Re: [MOD] Dropdown options for custom database fields
Post by: thunderstrike on October 08, 2007, 12:06:36 AM
Code: [Select]
ALTER TABLE ".IMAGES_TABLE." ADD image_sex varchar(8) NOT NULL";

If in phpmyadmin, replace " . IMAGES_TABLE . " with real image table name with prefix (and, yes, remove: " . ... . " include).
Title: Re: [MOD] Dropdown options for custom database fields
Post by: bacterio on October 09, 2007, 01:05:40 AM
Can be adapted this mod to add dropdown in member_uploadform.html ??? no in register user.

When raising one photo to specify continent: Europe, Asia .....
Title: Re: [MOD] Dropdown options for custom database fields
Post by: thunderstrike on October 09, 2007, 01:13:34 AM
Quote
Can be adapted this mod to add dropdown in member_uploadform.html ??? no in register user.

Step 1 and step 1.1 in member.php in uploadform action. ;)

Quote
When raising one photo to specify continent: Europe, Asia .....

This ... I no get question ...
Title: Re: [MOD] Dropdown options for custom database fields
Post by: bacterio on October 09, 2007, 12:10:52 PM
Ok, works!

But now I have a problem.

When choosing a country immediately is sent the image and it does not let continue filling up the form. Eligo the city and inserts intro automatically.

The problem can esar here ????????:

  $keypress = ($keypress)? “onkeypress= \ “if (window.event.keyCode==13) this.form.submit (); \ "": "";
Title: Re: [MOD] Dropdown options for custom database fields
Post by: thunderstrike on October 09, 2007, 01:37:21 PM
Is keypress variable exist in uploadform ? If no ... must add it. ;)
Title: Re: [MOD] Dropdown options for custom database fields
Post by: bacterio on October 09, 2007, 02:10:17 PM
I do not understand to you….

I have made steps 1 and 1,1 in member.php and admin/admin_functions, includes/functions.php in register.php not because single quieor to add dropdown in member_uploadform.html

But the variable? where is due to add and like?  :oops:
Title: Re: [MOD] Dropdown options for custom database fields
Post by: thunderstrike on October 09, 2007, 02:55:35 PM
Sorry for last post ... $keypress is in functions ... please post exact error message is say on screen.
Title: Re: [MOD] Dropdown options for custom database fields
Post by: bacterio on October 09, 2007, 03:47:03 PM
There is no error, the problem is that when selecting a value of the list of dropdown in member_uploadform.html puts intro without letting fill up the fields that lack if option to press the button to accept. If you have single dropdown it puts as I complete field to fill up and it already is, but has but fields after dropdown you cannot fill up them.
Title: Re: [MOD] Dropdown options for custom database fields
Post by: bacterio on October 09, 2007, 09:40:57 PM
It already works correctly.

In includes/function.php I have had to eliminate:

onkeypress= \ “if (window.event.keyCode==13) this.form.submit ()

By:

onkeypress= \ “if (window.event.keyCode==13)

Thank you very much by everything!
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Jan-Lukas on May 11, 2008, 06:35:08 PM
Bitte für version 1.7.6 im ersten Posting nachtragen

dieses ist in der 1.7.6 nur 1x vorhanden

Code: [Select]
else {
        $value = (isset($HTTP_POST_VARS[$key])) ? format_text(stripslashes(trim($HTTP_POST_VARS[$key]))) : $image_row[$key];
      }

der Rest ist wie bei 1.7.3 zu bearbeiten

Title: Re: [MOD] Dropdown options for custom database fields
Post by: kai on May 11, 2008, 07:19:33 PM

dieses ist in der 1.7.6 nur 1x vorhanden

Hi Harald,

könntest du hier als Anwort die komplette Anleitung für 1.7.6 reinschreiben?
Anschließend setzte ich die in den ersten Post von Vano. Danke!
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Jan-Lukas on May 12, 2008, 11:41:09 PM
4images v1.7.6

Step 1

:flag-en: Open members.php
:flag-de: Öffne members.php

:flag-en: search:
:flag-de: suche: 
Code: [Select]
else {
        $value = (isset($HTTP_POST_VARS[$key])) ? format_text(stripslashes(trim($HTTP_POST_VARS[$key]))) : $image_row[$key];
      }

:flag-en: Insert above   
:flag-de: füge darüber ein:

Code: [Select]
elseif ($val[1] == "dropdown") {
        $value = (isset($HTTP_POST_VARS[$key])) ? format_text(stripslashes(trim($HTTP_POST_VARS[$key]))) : $image_row[$key];
        $additional_field_array[$key.'_dropdown'] = get_db_fields_dropdown($key, $val, $value);
      }

Step 1.1

:flag-en: search:
:flag-de: suche:

Code: [Select]
else {
        $value = (isset($HTTP_POST_VARS[$key])) ? format_text(trim($HTTP_POST_VARS[$key]), 2) : $user_info[$key];
      }

:flag-en: Insert above:
:flag-de: füge darüber ein:

Code: [Select]
elseif ($val[1] == "dropdown") {
        $value = (isset($HTTP_POST_VARS[$key])) ? format_text(trim($HTTP_POST_VARS[$key]), 2) : $user_info[$key];
        $additional_field_array[$key.'_dropdown'] = get_db_fields_dropdown($key, $val, $value);
      }


Step 2
:flag-en: Open register.php
:flag-de: Öffne register.php

:flag-en: search:
:flag-de: suche:

Code: [Select]
else {
            $additional_field_array[$key.'_yes'] = "";
            $additional_field_array[$key.'_no'] = " checked=\"checked\"";
          }
        }

:flag-en: Replace with:
:flag-de: ersetze mit:

Code: [Select]
else {
            $additional_field_array[$key.'_yes'] = "";
            $additional_field_array[$key.'_no'] = " checked=\"checked\"";
          }
        }
        elseif ($val[1] == "dropdown") {
          $value = (isset($HTTP_POST_VARS[$key])) ? $HTTP_POST_VARS[$key] : $user_info[$key];
           $additional_field_array[$key.'_dropdown'] = get_db_fields_dropdown($key, $val, $value);
        }


Step 3
:flag-en: Open includes/functions.php
At the end, above closing ?> insert:

:flag-de: Öffne includes/funktions.php
füge am ende vor ?> folgendes ein

Code: [Select]
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]);
}


Step 4
:flag-en: Open admin/admin_functions.php
:flag-de: Öffne admin/admin_functions.php

:flag-en: search:
:flag-de: suche:

Code: [Select]
case "radio":
        show_radio_row($val[0], $field_name, ($value == "") ? 1 : $value);
        break;

:flag-en: Insert below:
:flag-de: füge darunter ein:

Code: [Select]
case "dropdown":
        show_user_dropdown_row($field_name, $val, $value);
        break;

Step 4.1

:flag-en: At the end, above closing ?> insert:

:flag-de: füge am ende vor ?> folgendes ein

Code: [Select]
function show_user_dropdown_row($name, $val, $value = 0){
  echo "<tr class=\"".get_row_bg()."\" valign='top'>\n<td><p class=\"rowtitle\">".$val[0]."</p></td>\n";
  echo "<td><p>\n";
  echo get_dropdown_options($name, $val[3], $value, $val[4], $val[5], $val[7], 1, "", "select", $val[6]);
  echo "</p></td>\n</tr>\n";
}









Title: Re: [MOD] Dropdown options for custom database fields
Post by: kai on May 13, 2008, 08:21:47 AM
Thanks, first post edited.
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Tobi.L on June 09, 2008, 07:06:19 PM
Hallo zusammen,

klasse an dem Ersteller dieser Mod.
Da ich vorhin dabei war krampfhaft nen Dropdown einzubauen, bin ich auf der Suche nach solch einen Mod gewesen und bin fündig geworden. Scheint auch zu laufen, das blöde ist nur das ich kein Englisch, bin überfragt.

Ich möchte etwas folgender maßen:

(Ps.: Eins vorweg, wie man normale User + Imagefelder einfügt weis ich)

Ich möchte ein Dropdown Menü mit Mehrfachauswahl.
Was muss dann für das Dropdown in die d_funktions.. und in die main.php

ich blicke da nicht durch!
Title: Re: [MOD] Dropdown options for custom database fields
Post by: nobby on June 09, 2008, 07:15:47 PM
Hallo Tobi,

dann würde ich mich mal auf den Hosenboden setzen und Englisch lernen, ohne kommst Du in der heutigen Zeit nicht mehr weit...

Naja, und wenn alle stricke reißen gibt es ja noch den Google-Translator, der ist sehr Hilfreich  :wink:

nobby
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Tobi.L on June 09, 2008, 07:45:57 PM
Ja das ist mir klar,
aber ich komme mir Google auch nicht viel weiter! Ein bisschen Englsich kann ich aber hier blicke ich nicht durch!

Das habe ich z.B in der Editprofil stehen:
Code: [Select]
<select name="user_film" onkeypress="if(window.event.keyCode==13)this.form.submit();" size="5" class="input" multiple>
      <option>keine Angabe</option>
      <option>A-Team</option>
      <option>A Nightmare on Elmstreet</option>
    </select>

Das ist eine Auswahl wo man mehr auf einmal auswählen kann!

Wenn ich z.B A-Team auswähle, dann wird das im Profil angezeigt auch das A Nightmare...

Das steht in der db_function:
Code: [Select]
$additional_user_fields['user_film'] = array($lang['user_film'], "dropdown", 0, array("keineAngabe", "anightmareonelmstreet", "ateam"), 1, 0, 0, 1);
Ich bekomme es nicht hin, wenn ich A-Team und A Nightmare on Elmstreet auswähle, dass beides im Profil angezeigt wird.

Dazu möchte ich das, dass der User im Editprofil sieht was er ausgewählt hat, denn es springt immer auf "keine Angabe" zurück und das heisst, wenn der User nur irgendetwas am Profil ändern, sei es nur die ICQ Nummer, dann ist seine Film Auswahl auch weg!
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Jan-Lukas on June 10, 2008, 12:44:03 AM
@ Kai, @ Detlef,
Kannst Du bitte im ersten Posting Step. 4.1 editieren ?
natürlich muss das nicht
 
Quote
Open includes/functions.php
At the end, above closing ?> insert:

 Öffne includes/funktions.php
füge am ende vor ?> folgendes ein

heissen, denn wird ja in der admin/admin_functions.php geändert  :wink:

mein Posting hab ich schon editiert

Danke
Title: Re: [MOD] Dropdown options for custom database fields
Post by: kai on June 10, 2008, 09:47:12 AM
@ Jan-Lukas: Ok, 1st post edited.
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Tobi.L on June 10, 2008, 11:12:21 PM
Ja das ist mir klar,
aber ich komme mir Google auch nicht viel weiter! Ein bisschen Englsich kann ich aber hier blicke ich nicht durch!

Das habe ich z.B in der Editprofil stehen:
Code: [Select]
<select name="user_film" onkeypress="if(window.event.keyCode==13)this.form.submit();" size="5" class="input" multiple>
      <option>keine Angabe</option>
      <option>A-Team</option>
      <option>A Nightmare on Elmstreet</option>
    </select>

Das ist eine Auswahl wo man mehr auf einmal auswählen kann!

Wenn ich z.B A-Team auswähle, dann wird das im Profil angezeigt auch das A Nightmare...

Das steht in der db_function:
Code: [Select]
$additional_user_fields['user_film'] = array($lang['user_film'], "dropdown", 0, array("keineAngabe", "anightmareonelmstreet", "ateam"), 1, 0, 0, 1);
Ich bekomme es nicht hin, wenn ich A-Team und A Nightmare on Elmstreet auswähle, dass beides im Profil angezeigt wird.

Dazu möchte ich das, dass der User im Editprofil sieht was er ausgewählt hat, denn es springt immer auf "keine Angabe" zurück und das heisst, wenn der User nur irgendetwas am Profil ändern, sei es nur die ICQ Nummer, dann ist seine Film Auswahl auch weg!

Ich blicke da nicht durch!
Title: Re: [MOD] Dropdown options for custom database fields
Post by: sidharth186 on August 10, 2008, 11:59:27 AM
Hi !

Please help me ....I am using version 1.7.6

I have added a custom field 'User Type' in the Database and have also created a Dropdown for that using your MOD .

But the only problem that I am facing is :

In the ACP the Edit User - User Type shows the dropdown but does not show the value that was previously selected....

I mean if the User Type was Photographer when the account was created, the ACP will still show the dropdown starting from '----' , 'General', 'Photographer'

Also kindly tell me how to search for the users when I go to Edit Users in ACP , on the basis of this new custom field , i.e., 'User Type' as that field is currently not visible in the search form.

I hope you can solve this ....

I will be highly grateful to you if you can help me out on this ...

Thanks a lot
Title: Re: [MOD] Dropdown options for custom database fields
Post by: V@no on August 10, 2008, 06:47:07 PM
I'd guess you missed step 4...
Title: Re: [MOD] Dropdown options for custom database fields
Post by: sidharth186 on August 11, 2008, 09:24:03 PM
I'd guess you missed step 4...

Thanks V@no !!!
Its working now ...
Can you pls suggest some MOD for getting this custom field in the User Search also......I mean when we go to Edit Users in ACP, can we get this additional field there to search on its basis?

Thanks again for your timely reply
Title: Re: [MOD] Dropdown options for custom database fields
Post by: runway27r on October 01, 2008, 07:28:29 PM
Is there a way to get this MOD to work for Upload Fields? My needs are for that rather than user info.

THX
Paul
Title: Re: [MOD] Dropdown options for custom database fields
Post by: mawenzi on October 01, 2008, 07:38:36 PM
... the dropdown fields are also working on uploadform ...
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Sunny C. on October 22, 2008, 05:52:38 PM
Irgendwee habe ich da ein Problem, das was im Dropdown ausgewählt wurde, wird nicht angezeigt!
Folgendes habe ich gemacht:
--
Somehow, I have a problem because that is what the drop has been selected, will not be displayed!
I have done the following:

Open:
includes/db_field_definitions.php
Im Add:
$additional_user_fields['image_prefix'] = array($lang['image_prefix'], "dropdown", 0, array("prefix wurde nicht geaehlt", "4images 1.7.6", "Phpkit 1.6.0.3", "Phpkit 1.6.1", "Phpkit 1.6.4", "SMF 1.1.5", "SMF 1.1.6", "SMF 2.0 Beta", "WBB 3", "WBB 2" , "WBB 3 Lite", "Wbb 2 Lite", "Normal"), 0, 1, 5, 0);

Open:
lang/mylang/main.php
Im add:
$lang['image_prefix'] = "Prefix der Kategorie";

Open:
templates7mytemplate/member_uploadform,html
Im Added:
<select name="image_prefix" onkeypress="if(window.event.keyCode==13)this.form.submit();" />
    <option value="5">prefix wurde nicht geaehlt</option>
    <option value="6">4images 1.7.6</option>
    <option value="7">Phpkit 1.6.0.3</option>
    <option value="8">Phpkit 1.6.1</option>
    <option value="9">Phpkit 1.6.4</option>
    <option value="10">SMF 1.1.5</option>
    <option value="11">SMF 1.1.6</option>
    <option value="12">SMF 2.0 Beta</option>
    <option value="13">WBB 3</option>
    <option value="14">WBB 2</option>
    <option value="15">WBB 3 Lite</option>
    <option value="16">WBB 2 Lite</option>
    <option value="17">Normal</option>
  </select>
This is in Uploadform Displayed!!!

Open;:
templates/mytemplate/details.html
Im Added:
{image_prefix_dropdown}

And in my phpmyadmin:
Im added:
ALTER TABLE `4images_images` ADD `image_prefix` VARCHAR( 255 ) NOT NULL

Ich wähle beim Upload den gewünschten Prefix aus, doch in der Detailansicht wird es nicht angezeigt. Was ist denn falsch gelaufen?
--
I choose when you upload the desired prefix, but in the details view, it will not be displayed. What is wrong?
Title: Re: [MOD] Dropdown options for custom database fields
Post by: live@ct on June 24, 2009, 09:50:08 AM
For the vetsion 1.7.7 how can I make to  use the dropdown for image fields and user_field, the user_country, I have both in the user and images tables, but I dont know if I can use the same array for both because when some user try to register the user_country_dropdown works, but in the member_upload_form it not show the country_dropdown

I need to make a separate array or why it not showing in the upload form
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Sun Zaza on November 23, 2009, 02:04:18 PM
Hello,

I am trying to get some information from the database using the Dropdown option for custom database fields. It works almost, but because I am not a PHP programmer I need some support from you guys.

In the db_fields_definitions.php I use the following code:

Code: [Select]
$sql = "SELECT zu_players_name
             FROM ".ZU_PLAYERS_TABLE."
";
             $result = $site_db->query($sql);
while ($zu_players_row = $site_db->fetch_array($result)) {
     $zu_players_name = $zu_players_row['zu_players_name'];
         
}


And then I used $zu_players_name in this code:

Code: [Select]
$additional_zu_games_fields['zu_games__goals'] = array($lang['zu_games__goals'], "dropdown", 0, array($zu_players_name), 0, 0, 0, 0);

Almost there. The results is only the last name in the list. (Only 1 name)

I need some help to get all the names of the list.

Your help is appreciated,

Cruxy
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Rembrandt on November 23, 2009, 08:34:41 PM
...
Almost there. The results is only the last name in the list. (Only 1 name)

I need some help to get all the names of the list....

test it:
$zu_players_name .= $zu_players_row['zu_players_name'];

mfg Andi
Title: Re: [MOD] Dropdown options for custom database fields
Post by: V@nо on November 23, 2009, 10:21:48 PM
actually, you need save them into an array:
$zu_players_name[] = $zu_players_row['zu_players_name'];
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Sun Zaza on November 23, 2009, 10:25:46 PM
Thanks Rambrand & V@no.

The 2 solutions did not work for me. I used this one:

Code: [Select]
$zu_players_name[] = current($zu_players_row);
It works fine.

Thanks anyway for your help.
Cruxy
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Sun Zaza on December 01, 2009, 09:01:50 PM
Hello,

I have a question:

This is my code to get information from the database using the dropdown box for custom db field:

Code: [Select]
$sql = "SELECT zu_games_name
             FROM ".ZU_GAMES_TABLE."
";
             $result = mysql_query($sql);
$zu_games_name = array();
while ($zu_games_row = $site_db->fetch_array($result)) {
$zu_games_name[] = current($zu_games_row);
             $additional_zu_goals_fields['zu_goals_name'] = array($lang['zu_goals_name'], "dropdown", 0, $zu_games_name, 0, 0, 0, 0);
 }

My question is:

How can I get the ------------------ in the begining of each dropdown. I tried everything, but without success. Any please?

Many thanks in advance,
Cruxy
Title: Re: [MOD] Dropdown options for custom database fields
Post by: V@no on December 02, 2009, 02:34:11 AM
$zu_games_name = array("----------------------");
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Sun Zaza on December 02, 2009, 05:32:16 AM
I did not thought about this solution. It works perfect. Thankt a lot.
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Sunny C. on February 26, 2010, 08:28:58 PM
-> Google
The drop-down boxes are not stored in the "Edit Images". With each call you have to reset them. In the ACP, but the fields are saved and are on the option you have chosen as the last!

Die Dropdownfelder werden im Bereich "Edit Images" nicht gespeichert. Bei jedem Aufruf muss man diese neu setzen. Im ACP werden die Felder aber gespeichert und stehen auf der Option die man als letztes gewählt hat!
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Sunny C. on February 28, 2010, 12:02:58 PM
Ich weis nicht woran es liegt!
Aber im Editmages stehen die Dropdowns nicht auf der Option die man gewählt hatte, aber im ACP ist das so!
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Jan-Lukas on May 02, 2010, 07:17:42 PM
Der Code von der Version 1.6.7 ist komplett 1.7.7 tauglich, kann im ersten Posting editiert werden.

LG
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Sun Zaza on June 18, 2010, 10:43:49 AM
Hi,

After trying without any progress, I want to ask you guys about this issue.

I am using this code to get the name of the users (He is working fine):

Code: [Select]
<?php $sql "SELECT user_name
             FROM "
.USERS_TABLE."
 ORDER BY user_name ASC
 "
;
             
$result mysql_query($sql);
 $user_name = array("----------------------");
 while ($user_row $site_db->fetch_array($result)) {
 $user_name $user_name;
 $user_name[] = current($user_row);
             
$additional_test_fields['test_player'] = array($lang['test_player'], "dropdown"0$user_name0000);
 }
?>

The results is:

ADMIN
user1
user2
user3


Now I want to get also the user_id after the name of the user. Something like:

ADMIN (id=9)
user1 (id=1)
user2 (id=2)
user3 (id=3)



Could you help please?

Many thanks in advance,
Cruxy
Title: Re: [MOD] Dropdown options for custom database fields
Post by: V@no on June 18, 2010, 02:51:30 PM
<?php
$sql = "SELECT " . get_user_table_field("", "user_name") . get_user_table_field(",", "user_id") . "
        FROM ".USERS_TABLE."
        WHERE " . get_user_table_field("", "user_level") . " > " . GUEST ."
        ORDER BY " . get_user_table_field("", "user_name") . " ASC";
$result = $site_db->query($sql);
$user_name = array("----------------------");
while ($user_row = $site_db->fetch_array($result))
{
  $user_name[] = $user_row[$user_table_fields['user_name']] . " (ID=" . $user_row[$user_table_fields['user_id']] . ")";
}
$additional_test_fields['test_player'] = array($lang['test_player'], "dropdown", 0, $user_name, 0, 0, 0, 0);
?>


I don't know what is your code that receives the value from the dropdown, but I'd suggest use multidimention array instead:

<?php
$sql = "SELECT " . get_user_table_field("", "user_name") . get_user_table_field(",", "user_id") . "
        FROM ".USERS_TABLE."
        WHERE " . get_user_table_field("", "user_level") . " > " . GUEST ."
        ORDER BY " . get_user_table_field("", "user_name") . " ASC";
$result = $site_db->query($sql);
$user_name = array("----------------------");
while ($user_row = $site_db->fetch_array($result))
{
  $user_name[$user_row[$user_table_fields['user_id']]] = $user_row[$user_table_fields['user_name']] . " (id=" . $user_row[$user_table_fields['user_id']] . ")";
}
$additional_test_fields['test_player'] = array($lang['test_player'], "dropdown", 0, $user_name, 1, 0, 0, 0);
?>


Dropdown will return user_id
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Sun Zaza on June 18, 2010, 09:31:51 PM
Thanks V@no for the solution. It's works perfect, but I got another problem.

I want to show this format in the dropdown: user1 (ID= 1), but I want to save only the user_name in the database (user1).

Is that possible?

Title: Re: [MOD] Dropdown options for custom database fields
Post by: V@no on June 19, 2010, 01:53:01 AM
use my second code and then replace
  $user_name[$user_row[$user_table_fields['user_id']]] = $user_row[$user_table_fields['user_name']] . " (id=" . $user_row[$user_table_fields['user_id']] . ")";


with

  $user_name[$user_row[$user_table_fields['user_name']]] = $user_row[$user_table_fields['user_name']] . " (id=" . $user_row[$user_table_fields['user_id']] . ")";
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Sun Zaza on June 19, 2010, 08:16:56 PM
Hi V@no,

Because in the first time I got this error:

Code: [Select]
Fatal error: Call to undefined function get_user_table_field() in /hsphere/local/home/******/*******/includes/db_field_definitions.php on line 423
I used this code:

Code: [Select]
<?php $sql "SELECT user_name, user_id
        FROM "
.USERS_TABLE."        
        ORDER BY user_name ASC"
;
$result $site_db->query($sql);
$user_name = array("----------------------");
while (
$user_row $site_db->fetch_array($result))
{
  
$user_name[] = $user_row['user_name']." (ID=" $user_row['user_id'].")";  
}
$additional_test_fields['test_player'] = array($lang['test_player'], "dropdown"0$user_name0000);?>

Do you know why?



Title: Re: [MOD] Dropdown options for custom database fields
Post by: MrAndrew on July 17, 2010, 09:55:36 AM
Very strange. I use 1.7.7 version of my gallery. I have installed this mod for ver 1.7.6. Installed correct. But nothing to change? I have trying and trying... but {image_blablabla_dropdown} - not working and i see nothing. Please help me with this mod.

Thanks!
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Cambons on September 16, 2010, 03:40:51 AM
With 1.7.8 do ihave to do 1.7.6 + 1.7.7 or just 1.7.7?

Thank you!
Title: Re: [MOD] Dropdown options for custom database fields
Post by: V@no on September 16, 2010, 04:05:39 AM
There is no code for 1.7.7, so try do the 1.7.6
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Cambons on September 16, 2010, 04:07:22 AM
4images v1.7

i thought it was 1.7.7 for a moment.. sorry about that.

But still, should I do the 1.7.6 + 1.7  ( next steps? )

--

Edit nevermind dumb me, 1.7 = "1.7.0" so no point in doing that
Title: Re: [MOD] Dropdown options for custom database fields
Post by: V@no on September 16, 2010, 04:09:22 AM
no, just 1.7.6

I've added some notes regarding this on first page.
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Cambons on September 16, 2010, 04:11:02 AM
Yea sorry i'm dumb it took me a while to figure out 1.7 = 1.7.0 lol
Title: Re: [MOD] Dropdown options for custom database fields
Post by: MrAndrew on October 17, 2010, 11:05:21 AM
This MOD work fine for users table! But doesn`t work for images table..

How to show dropdown from images table?

Code: [Select]
  $sql = "SELECT image_aircraft
             FROM ".IMAGES_TABLE."
             ORDER BY image_aircraft DESC
";
             $result = mysql_query($sql);
$image_aircraft = array();
while ($image_row = $site_db->fetch_array($result)) {
$image_aircraft[] = current($image_row);
$additional_image_fields['image_aircraft'] = array($lang['image_aircraft'], "dropdown", 0, $image_aircraft, 0, 0, 0, 0);
 }

Nothing to show me  :(
Title: Dropdown options for custom database fields in the member_editprofile
Post by: Sun Zaza on November 12, 2011, 12:24:03 AM
Hello,

How can I use the dropdown options for custom database fields in the member_editprofile?

I am using thisl line on the file but without success:
Code: [Select]
<input type="dropdown" name="user_foot"  size="30" value="{user_foot}" class="input" />
Thanks in advance,
Title: Re: [MOD] Dropdown options for custom database fields
Post by: V@no on November 12, 2011, 03:15:32 AM
did you try use {user_foot_dropdown} (without any additional <input>)
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Sun Zaza on November 12, 2011, 09:42:17 AM
No, but now I did. Het is working. Thanks.

I just realize another problem, because I cannot update the database from the page member_editprofile.html.
I am talking here about everything (Not only the dropdown.

I will open a new topic.

Thank V@no
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Jan-Lukas on December 29, 2011, 08:37:37 PM
1.7.10 tauglich
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Pawel_el on January 31, 2014, 08:13:16 PM
If it works for version 1.7.10?
Title: Re: [MOD] Dropdown options for custom database fields
Post by: Jan-Lukas on January 31, 2014, 08:53:54 PM
1.7.10 tauglich

und mit Sicherheit auch 1.7.11
Title: Re: [MOD] Dropdown options for custom database fields
Post by: .Infecto on May 03, 2014, 01:48:06 AM
Wenn ich das so anlege
$additional_image_fields['image_filesize'] = array("Filesize", "dropdown", 0, array("n" => "---", "KB" => "KB", "MB" => "MB", "GB" => "GB"), 1, 0, 0, 0);
und auch so
$additional_user_fields['image_filesize'] = array("Filesize", "dropdown", 0, array("n" => "---", "KB" => "KB", "MB" => "MB", "GB" => "GB"), 1, 0, 0, 0);
wird mir das Feld nicht im ACP angezeigt...
Title: Re: [MOD] Dropdown options for custom database fields
Post by: finsterstubn on June 09, 2016, 03:34:41 PM
Hallo!

Hab folgendes Problem:

Ich will beim erfassen sprich beim member_uploadform.html auch dropdowns verwenden, komischer weise funktionierts bei member_editimage.html (siehe screenshot) bei ersteren aber nicht.

was könnte ich da falsch machen?

danke und lg
finsterstubn
Title: Re: [MOD] Dropdown options for custom database fields
Post by: nobby on June 09, 2016, 05:30:22 PM
Hallo,

musst mal Googeln  :wink: http://www.silent-fran.de/css/tutorial/aufklappmenue.html

und PHP http://www.selfphp.de/forum/showthread.php?t=24725

nobby
Title: Re: [MOD] Dropdown options for custom database fields
Post by: finsterstubn on June 09, 2016, 08:07:37 PM
Danke für die Antwort, steh aber scheinbar auf der leitung:) lg finsterstubn