Author Topic: How to add more field to 4images_images and 4images_users  (Read 12772 times)

0 Members and 1 Guest are viewing this topic.

Offline Thaibinh

  • Pre-Newbie
  • Posts: 3
    • View Profile
How to add more field to 4images_images and 4images_users
« on: December 05, 2002, 01:38:40 AM »
I have read "db_field_definitions.php", but I still confuse where (what file) to put the line code  "$additional_user_fields['user_adress'] = array($lang['user_adress'], "text", 1);" in.


Example: I want to add some more field names below to images user profile, image:
- height
- weight
- location


Please show me in detials. Thanks.

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
Same file
« Reply #1 on: December 05, 2002, 02:13:49 AM »
The lines go into the very same file db_field_definitions.php  Look at the bottom of the file for these lines:
Code: [Select]
// Example for additional image fields:
//$additional_image_fields['image_photographer'] = array($lang['image_photographer'], "text", 1);

// Example for additional user fields
//$additional_user_fields['user_adress'] = array($lang['user_adress'], "text", 1);

These are examples and are "commented out".  The two forward slash characters that start the lines tell php to not process those lines.  So if you want a location field, your line would look something like this:
Code: [Select]
$additional_image_fields['location'] = array($lang['location'], "text", 1);

Offline Thaibinh

  • Pre-Newbie
  • Posts: 3
    • View Profile
How to add more field to 4images_images and 4images_users
« Reply #2 on: December 05, 2002, 09:39:39 AM »
Thanks...

Okies... you mean if I want file name "height" for user profile, then I just leave a code "$additional_user_fields['height'] = array($lang['height'], "text", 1)" in db_field_definitions.php file and $lang['height'] in main.php. That is all ???

Offline Thaibinh

  • Pre-Newbie
  • Posts: 3
    • View Profile
How to add more field to 4images_images and 4images_users
« Reply #3 on: December 05, 2002, 10:22:23 AM »
thank Chris,

but I still confuse. In file "db_field_definitions.php" . I don't know these go to: (where I can place these code)

$additional_user_fields['%column_name%'] = array("%field_description%", "%admin_field_type%", %is_required%);

%column_name% string
......

Thanks.

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
How to add more field to 4images_images and 4images_users
« Reply #4 on: December 05, 2002, 10:25:07 AM »
See http://www.4homepages.de/forum/index.php?topic=747.msg3277#msg3277

This is an explanation for additional image fields. Works the same for user fields.

Jan
« Last Edit: April 01, 2005, 09:01:52 PM by V@no »
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Spadver

  • Guest
Re: How to add more field to 4images_images and 4images_users
« Reply #5 on: April 01, 2005, 08:36:15 PM »
See http://www.4homepages.de/forum/viewtopic.php?p=3277#3277

This is an explanation for additional image fields. Works the same for user fields.

Jan

1. The link is dead. :(
Is it possible to restore it?

2. Suppose I have a new field - "price".
How I can place this field in short listing of images? I mean, for example, index.php (or categories.php).

Thank you.

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: How to add more field to 4images_images and 4images_users
« Reply #6 on: April 01, 2005, 09:02:01 PM »
I've fixed the link.
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)

Spadver

  • Guest
Re: How to add more field to 4images_images and 4images_users
« Reply #7 on: April 01, 2005, 09:46:17 PM »
I've fixed the link.

Thank you!
I will try.

Спасибо, Вано!
Как я понял я определил таг, который могу использовать в шаблоне?

Spadver

  • Guest
Re: How to add more field to 4images_images and 4images_users
« Reply #8 on: April 01, 2005, 10:08:52 PM »

2. Suppose I have a new field - "price".
How I can place this field in short listing of images? I mean, for example, index.php (or categories.php).


One must edit templates/YOUR_TEMPLATE_NAME/thumbnail_bit.html
for example
Quote
<b>{image_name}</b> {if image_is_new}<sup class="new">{lang_new}</sup>{endif image_is_new}
<br /> {image_price}
<br />