• [MOD] Dropdown options for custom database fields 4 0 5 1
Currently:  

Author Topic: [MOD] Dropdown options for custom database fields  (Read 199079 times)

0 Members and 1 Guest are viewing this topic.

Offline topdolla

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: [MOD] Dropdown options for custom database fields
« Reply #60 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

Offline The Sailor

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
Re: [MOD] Dropdown options for custom database fields
« Reply #61 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:
(^_^)

Offline The Sailor

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
Re: [MOD] Dropdown options for custom database fields
« Reply #62 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?
(^_^)

Offline Peppino

  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: [MOD] Dropdown options for custom database fields
« Reply #63 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
Gruß Marcus

Offline The Sailor

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
[REQ] Dropdown options for custom database fields for 1.7.4
« Reply #64 on: July 21, 2007, 04:14:10 PM »
hi all  :)


[MOD] Dropdown options for custom database fields

i need this mod  because there is some mods need it!  :!:
(^_^)

computer123

  • Guest
Re: [MOD] Dropdown options for custom database fields
« Reply #65 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

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] Dropdown options for custom database fields
« Reply #66 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);
      }
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

computer123

  • Guest
Re: [MOD] Dropdown options for custom database fields
« Reply #67 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???

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] Dropdown options for custom database fields
« Reply #68 on: August 14, 2007, 12:00:29 AM »
Quote
Try again (Something like that)

What is this something ??
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

computer123

  • Guest
Re: [MOD] Dropdown options for custom database fields
« Reply #69 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.


Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] Dropdown options for custom database fields
« Reply #70 on: August 14, 2007, 12:15:47 AM »
Hard respond when no exact text error message ...
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

computer123

  • Guest
Re: [MOD] Dropdown options for custom database fields
« Reply #71 on: August 14, 2007, 12:42:27 AM »
Here we go,  I just looked for it:

Please fill out the {field_name} field!


Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] Dropdown options for custom database fields
« Reply #72 on: August 14, 2007, 12:54:16 AM »
Which file ?
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

computer123

  • Guest
Re: [MOD] Dropdown options for custom database fields
« Reply #73 on: August 14, 2007, 01:04:35 AM »
member_editprofile.html

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] Dropdown options for custom database fields
« Reply #74 on: August 14, 2007, 01:58:29 AM »
Do step 1.1 - 4images v1.7.3 ?
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?