Author Topic: input date as additional field (Missing impossible request)  (Read 3676 times)

0 Members and 1 Guest are viewing this topic.

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
input date as additional field (Missing impossible request)
« on: January 19, 2010, 12:31:58 AM »
Hey guys,

This time I have a very difficult request:

Thanks to v@no we can use a dropdown box as an additional field, but what about showing a date input like choosing the image date in ADD IMAGE.

I believe there is a way to call  the function "show_date_input_row" from db_fields_definitions (You can find this function in admin_functions).

Am I asking something impossible?

I will hear it from you guys.

PS: Please let's take 4images to a higher level :wink:
Cruxy




UPDATE:

I believe I will do it myself. Almost done, but I think I need some help.
« Last Edit: January 19, 2010, 12:57:21 AM by cruxy »

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: input date as additional field (Missing impossible request)
« Reply #1 on: January 19, 2010, 01:11:33 AM »
Just use javascript and convert unix timestamp into human format... or use PHP in the templates. Don't need messing around in the code.

[EDIT]
never mind, I didn't take in account the saving to database routine...
Let us know about your progress ;)
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 Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: input date as additional field (Missing impossible request)
« Reply #2 on: January 19, 2010, 01:22:16 AM »
Messing with the code? It is almost done with 2 steps. Maybe with your help, it will be better. Check this out:

Open db_field_definition.php

Add:

$additional_image_fields['image_date2'] = array($lang['training_date2'], "input_date"0);


Open admin/admin_functions.php

after:

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



Add:

case "input_date":         
	
	
show_date_input_row($val[0], $field_name$value);
        break;



The problem now is the database save only the year (For example: 2010 or 1999)


Any help please?
Cruxy
« Last Edit: January 19, 2010, 11:44:16 AM by cruxy »