4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started 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:
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:
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:
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:
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:
else {
$additional_field_array[$key.'_yes'] = "";
$additional_field_array[$key.'_no'] = " checked=\"checked\"";
}
}
:flag-en: Replace with:
:flag-de: ersetze mit:
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
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:
case "radio":
show_radio_row($val[0], $field_name, ($value == "") ? 1 : $value);
break;
:flag-en: Insert below:
:flag-de: füge darunter ein:
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
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:
else {
$value = (isset($HTTP_POST_VARS[$key])) ? htmlspecialchars(stripslashes(trim($HTTP_POST_VARS[$key]))) : "";
}
Replace both of them with:
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:
else {
$value = (isset($HTTP_POST_VARS[$key])) ? format_text(stripslashes(trim($HTTP_POST_VARS[$key]))) : $image_row[$key];
}
Insert above both of them:
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:
else {
$value = (isset($HTTP_POST_VARS[$key])) ? htmlspecialchars(trim($HTTP_POST_VARS[$key])) : $user_info[$key];
}
Replace with:
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:
else {
$value = (isset($HTTP_POST_VARS[$key])) ? format_text(trim($HTTP_POST_VARS[$key]), 2) : $user_info[$key];
}
Insert above:
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:
else {
$additional_field_array[$key.'_yes'] = "";
$additional_field_array[$key.'_no'] = " checked=\"checked\"";
}
}
Replace with:
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:
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:
case "radio":
show_radio_row($val[0], $field_name, ($value == "") ? 1 : $value);
break;
Insert below:
case "dropdown":
show_user_dropdown_row($field_name, $val, $value);
break;
Step 4.2
At the end, above closing ?> insert:
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:
$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 ] ----------
$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:
<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>
$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:
<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>
$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:
<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>
-
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
-
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.
-
Hey V@no,
is it possible to show the selected value in member_editprofile.html?
-
sorry, I dont understand your question.
-
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:
-
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
-
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
-
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?:
$additional_user_fields['user_state'] = array($lang['user_state'], "dropdown", 0, array("Madrid", "Barcelona", "Valencia", " ......","......","etc"), 1, 0, 0, 0);
-
correct
and, for better "viewing" u can put every state on a new line, or load the list into an external variable:
$var = array("Madrid",
"Barcelona",
"Valencia",
" ......",
"......",
"etc"
);
$additional_user_fields['user_state'] = array($lang['user_state'], "dropdown", 0, $var, 1, 0, 0, 0);
-
Hi V@no I did what u told me but with the list of countries and I get this error:
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/ascanio/domains/girlsandgirls.
My country list is this:
$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);
-
"Middle East"'
-
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.
-
...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?
-
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.
-
What would the drop down look like in the uploadform.html template?
-
See... I want the field required, but that initial --- entry is being accepted.
-
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)
-
Isn't working :(
Nothing I try with that db_field_definitions.php even gets put into the database :(
-
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:
-
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?
-
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:
$additional_user_fields['user_gender'] = array($lang['user_gender'], "dropdown", 0, $lang['user_gender_array'], 0, 1, 5, 0);
main.php:
$lang['user_gender_array'] = array("---", "male", "female");
-
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:
$additional_user_fields['user_gender'] = array($lang['user_gender'], "dropdown", 0, $lang['user_gender_array'], 0, 1, 5, 0);
main.php:
$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?
-
it depence on how u save the information into the database.
I'd suggest to use multi-dimention arrays: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.)
-
it depence on how u save the information into the database.
I'd suggest to use multi-dimention arrays: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...
-
something like:
$lang['user_gender_array'][$user_info['user_gender']]
-
wait, now i'm confused.
Step by step.
from includes/db_field_definitions.php
I add
$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
$lang['user_gender_array'] = array("0" => "------", "1" => "Male", "2" => "Female");
I add in the french main.php
$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...
$lang['user_gender_array'][$user_info['user_gender']]
doesn't make sense to me. I'm sorry.
-
actualy in members_profile.html u should not change anything...update your pforile again and it should be ok.
-
hmmm....
I use this in my template {user_gender} and it displays '1'...?
-
I need make checkbox for custom database fields. Like this: <input type="checkbox" name="checkbox" value="checkbox">
Please, help me. Thanks
-
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.
-
4images does not support custom fields for comments
-
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
-
$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
-
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
-
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.
-
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?
-
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
else {
$value = (isset($HTTP_POST_VARS[$key])) ? htmlspecialchars(stripslashes(trim($HTTP_POST_VARS[$key]))) : $image_row[$key];
}
There is also
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
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] : "");
}
-
How do you show member genders in their profile page ? I have been looking through FAQ and other boards but there is nothing
-
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
<img src="{template_url}/images/{user_gender}.gif">
i hope this help you !
-
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
$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
-
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.
$additional_user_fields['user_gender'] = array($lang['user_gender'], "dropdown", 1, array("---", "Male", "Female"), 1);
-
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
-
seems this mod needs an update so it becomes compatibel with 1.7.2 :)
else {
$value = (isset($HTTP_POST_VARS[$key])) ? htmlspecialchars(stripslashes(trim($HTTP_POST_VARS[$key]))) : "";
}
Can't be found anymore
-
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!
-
Is there a way to make it compatible with 1.7.2?
sabba
-
Is there a way to make it compatible with 1.7.2?
sabba
Any luck?
The problem seems to be member.php
-
Will the MOD go in Version 1.7.2,too ???
Funktioniert dieser MOD auch in Version 1.7.2 ????
-
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!
-
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
-
V@no pls. reply to my query...to add this feature to my 1.7.3 4images gallery
-
Ok, I've added v1.7.3 support
-
Thankyou very very much V@no, :D , i am too happy with your generousity
-
Weird...
I get this warning:
Warning: Undefined index: image_place in register.php on line 376
image_place is the custom field I created and this is line 376:
$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.
-
Nevermind, I managed another way to use custom dropdowns...
-
thanks v@no for this very useful and perfectly working modification ...
-
Oh, yes, a BIG thanks to V@no for all his help and support here, no doubt about that.
-
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:
-
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!
-
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
-
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
-
it did't work with 1.7.4 i didnt find the first code:
$value = (isset($HTTP_POST_VARS[$key])) ? htmlspecialchars(stripslashes(trim($HTTP_POST_VARS[$key]))) : "";
in member.php :roll:
-
it did't work with 1.7.4 i didnt find the first code:
$value = (isset($HTTP_POST_VARS[$key])) ? htmlspecialchars(stripslashes(trim($HTTP_POST_VARS[$key]))) : "";
in member.php :roll:
can anyone help me with that please?
-
Hello!
I´ve a problem
In the db_fields_definitions i add the following line
$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
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
-
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! :!:
-
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):
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
-
In demand from some - I respond.
(once - member.php)
else {
$value = (isset($HTTP_POST_VARS[$key])) ? format_text(stripslashes(trim($HTTP_POST_VARS[$key]))) : $image_row[$key];
}
Add before:
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);
}
-
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???
-
Try again (Something like that)
What is this something ??
-
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.
-
Hard respond when no exact text error message ...
-
Here we go, I just looked for it:
Please fill out the {field_name} field!
-
Which file ?
-
member_editprofile.html
-
Do step 1.1 - 4images v1.7.3 ?
-
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!
-
Post in topic all diff report foreach users ... how can no if problem with MOD and no user ? :mrgreen:
-
For dropdown Male, Female, ---, who is:
ALTER TABLE 4images_images ADD images_sex...... ?¿?¿?¿
-
Sorry ... I no get last reply ...
what is question with code ?
-
$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 .......? ? ?
-
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).
-
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 .....
-
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. ;)
When raising one photo to specify continent: Europe, Asia .....
This ... I no get question ...
-
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 (); \ "": "";
-
Is keypress variable exist in uploadform ? If no ... must add it. ;)
-
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:
-
Sorry for last post ... $keypress is in functions ... please post exact error message is say on screen.
-
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.
-
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!
-
Bitte für version 1.7.6 im ersten Posting nachtragen
dieses ist in der 1.7.6 nur 1x vorhanden
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
-
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!
-
4images v1.7.6
Step 1
:flag-en: Open members.php
:flag-de: Öffne members.php
:flag-en: search:
:flag-de: suche:
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:
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:
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:
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:
else {
$additional_field_array[$key.'_yes'] = "";
$additional_field_array[$key.'_no'] = " checked=\"checked\"";
}
}
:flag-en: Replace with:
:flag-de: ersetze mit:
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
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:
case "radio":
show_radio_row($val[0], $field_name, ($value == "") ? 1 : $value);
break;
:flag-en: Insert below:
:flag-de: füge darunter ein:
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
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";
}
-
Thanks, first post edited.
-
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!
-
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
-
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:
<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:
$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!
-
@ Kai, @ Detlef,
Kannst Du bitte im ersten Posting Step. 4.1 editieren ?
natürlich muss das nicht
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
-
@ Jan-Lukas: Ok, 1st post edited.
-
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:
<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:
$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!
-
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
-
I'd guess you missed step 4...
-
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
-
Is there a way to get this MOD to work for Upload Fields? My needs are for that rather than user info.
THX
Paul
-
... the dropdown fields are also working on uploadform ...
-
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?
-
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
-
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:
$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:
$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
-
...
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
-
actually, you need save them into an array:
$zu_players_name[] = $zu_players_row['zu_players_name'];
-
Thanks Rambrand & V@no.
The 2 solutions did not work for me. I used this one:
$zu_players_name[] = current($zu_players_row);
It works fine.
Thanks anyway for your help.
Cruxy
-
Hello,
I have a question:
This is my code to get information from the database using the dropdown box for custom db field:
$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
-
$zu_games_name = array("----------------------");
-
I did not thought about this solution. It works perfect. Thankt a lot.
-
-> 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!
-
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!
-
Der Code von der Version 1.6.7 ist komplett 1.7.7 tauglich, kann im ersten Posting editiert werden.
LG
-
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):
<?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_name, 0, 0, 0, 0);
}?>
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
-
<?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
-
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?
-
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']] . ")";
-
Hi V@no,
Because in the first time I got this error:
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:
<?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_name, 0, 0, 0, 0);?>
Do you know why?
-
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!
-
With 1.7.8 do ihave to do 1.7.6 + 1.7.7 or just 1.7.7?
Thank you!
-
There is no code for 1.7.7, so try do the 1.7.6
-
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
-
no, just 1.7.6
I've added some notes regarding this on first page.
-
Yea sorry i'm dumb it took me a while to figure out 1.7 = 1.7.0 lol
-
This MOD work fine for users table! But doesn`t work for images table..
How to show dropdown from images table?
$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 :(
-
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:
<input type="dropdown" name="user_foot" size="30" value="{user_foot}" class="input" />
Thanks in advance,
-
did you try use {user_foot_dropdown} (without any additional <input>)
-
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
-
1.7.10 tauglich
-
If it works for version 1.7.10?
-
1.7.10 tauglich
und mit Sicherheit auch 1.7.11
-
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...
-
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
-
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
-
Danke für die Antwort, steh aber scheinbar auf der leitung:) lg finsterstubn