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

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

0 Members and 1 Guest are viewing this topic.

Offline cipriansamoila

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

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Dropdown options for custom database fields
« Reply #31 on: August 08, 2005, 06:55:26 AM »
4images does not support custom fields for comments
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline cipriansamoila

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


Offline iban

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

Offline cipriansamoila

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

Offline Santhosh

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

Offline soyola

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

Offline soyola

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: [MOD] Dropdown options for custom database fields
« Reply #37 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] : "");
      }


Offline soyola

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

Offline Stoleti

  • Hero Member
  • *****
  • Posts: 574
    • View Profile
Re: [MOD] Dropdown options for custom database fields
« Reply #39 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 !

Offline soyola

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

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Dropdown options for custom database fields
« Reply #41 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);
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline glitzer

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • over 7000 E-Cards
Re: [MOD] Dropdown options for custom database fields
« Reply #42 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

Offline BartAfterDark

  • Hero Member
  • *****
  • Posts: 520
    • View Profile
Re: [MOD] Dropdown options for custom database fields
« Reply #43 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
« Last Edit: March 03, 2006, 10:38:40 AM by BartAfterDark »

Offline killerwhale65

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