Author Topic: Adding Description Lines  (Read 9434 times)

0 Members and 1 Guest are viewing this topic.

Offline runway27r

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • Wings Over Philadelphia
Adding Description Lines
« on: September 28, 2008, 07:54:09 PM »
I'd like to know if there is a way of adding multiple Description Lines. I run an aviation site and would like to have a description line for Model, Airport, Date, etc.
When someone submits a photo now there is only one description choice.

Any help appreciated.


Paul

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: Adding Description Lines
« Reply #1 on: September 28, 2008, 08:06:59 PM »
Hello and welcome to 4images forum.

Do you mean additional image fields? so when one upload an image they have one field to enter description, one field to enter model, and so on?
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 runway27r

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • Wings Over Philadelphia
Re: Adding Description Lines
« Reply #2 on: September 28, 2008, 08:18:42 PM »
Hello and welcome to 4images forum.

Do you mean additional image fields? so when one upload an image they have one field to enter description, one field to enter model, and so on?

Yes, exactly.

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: Adding Description Lines
« Reply #3 on: September 28, 2008, 09:02:53 PM »
Step 1
Add new field in 4images_images and 4images_images_temp tables (use phpmyadmin if you can). If you don't know how to add new table fields, you'll probably need google around ;)
As an example we'll call your new field as image_model (you can name it as you wish as long as you use that name in all steps)

Step 2
Open includes/db_field_definition.php
above closing ?> insert:
$additional_image_fields['image_model'] = array($lang['image_model'], "textarea"0);

(if you want simple input field not textarea in ACP (Admin Control Panel), replace word textarea with text)

Step 3
Open lang/<your language>/main.php and insert at the end, above closing ?>
$lang['image_model'] = "Model";

Step 4
In details.html template use {lang_image_model} (this tag will show text you entered in Step 3) and {image_model} (this tag will show text that was saved in image_model field for the image).
If you don't want to show anything if image_model field is empty (nothing is saved in there), you can use conditional tags:
Code: [Select]
{if image_model} ... this will be showed if image_model is NOT empty ... {endif image_model}
{ifno image_model} ... this will be showed if image_model IS empty ... {endifno image_model}

Step 5
In member_uploadform.html template add something like:
Code: [Select]
          <tr>
            <td class="row2" valign="top"><b>{lang_image_model}</b></td>
            <td class="row2">
              <textarea cols="30" class="textarea" rows="10" wrap="VIRTUAL" name="image_model">{image_model}</textarea>
            </td>
          </tr>
« Last Edit: September 30, 2008, 02:16:49 AM by V@no »
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 runway27r

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • Wings Over Philadelphia
Re: Adding Description Lines
« Reply #4 on: September 29, 2008, 12:15:37 AM »
Thanks, it seems to have done what I wanted !


Paul

Offline runway27r

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • Wings Over Philadelphia
Re: Adding Description Lines
« Reply #5 on: September 30, 2008, 12:26:25 AM »
One snag I found today. After I validate a users photo, it doesn't add the new fields. In other words, when the photo is viewed the new fields remain blank. Even though data was entered in them. Any thoughts?


THX
Paul

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: Adding Description Lines
« Reply #6 on: September 30, 2008, 01:36:21 AM »
can you confirm that data in new fields present or not in the database before you validate?

P.S. just realized I forgot mention that new fields must also be added into 4images_images_temp table.
I've updated my post above.
« Last Edit: September 30, 2008, 02:16:21 AM by V@no »
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 runway27r

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • Wings Over Philadelphia
Re: Adding Description Lines
« Reply #7 on: September 30, 2008, 05:57:02 PM »
That fixed it.

And to make sure I'm reading the right thread. I also want to add a drop down men u in one of the fields. I believe this is the right thread?

http://www.4homepages.de/forum/index.php?topic=7112.0


Thanks Once Again

Paul

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: Adding Description Lines
« Reply #8 on: October 01, 2008, 01:51:59 AM »
Yes, that's the one (unless there is something new I don't know about..)
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)