4images Forum & Community
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 20, 2018, 09:19:32 PM

Login with username, password and session length
Search:     Advanced search
You're looking for some 4images templates and styles? Then visit this thread to show websites with 4images templates to download.
Togle to toolbar
Translate this page with =>
Translate this page >
* Home Help Search Login Register
 
+  4images Forum & Community
|-+  4images Modifications / Modifikationen
| |-+  Mods & Plugins (Requests & Discussions) (Moderators: mawenzi, Rembrandt)
| | |-+  [TUT] Image Feld anlegen + Sortieren / Additional Image Field + Sorting
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: [TUT] Image Feld anlegen + Sortieren / Additional Image Field + Sorting  (Read 3784 times)
Sumale.my
Addicted member
******
Offline Offline

Posts: 1768

Thank You
-Given: 168
-Receive: 83

Neverdie


View Profile
« on: October 28, 2011, 01:51:45 PM »

-  Das Tutorial wurde von Ivan geschrieben. Ich möchte das Tutorial einmal etwas erweitern um auch zu erklären, wie es möglich ist weitere Felder zu ordnen.
- This tutorial was written by Ivan. I would like to extend the tutorial once more to explain how it is possible to arrange other fields.


-  Es gibt zwei Verschiedene Arten von Zusätzlichen Feldern
- There are two different types of additional fields

  • Images Fields / Bilder- Felder
  • User Fields / User Felder - Coming soon / kommt noch

-  In diesem Beispiel wird erklärt, wie ich ein zusätzliches Image Field anlegen kann. Das Text Feld ist einzeilig
und kann für verschiedene Eingaben wie z.b Photograph Copyright Hinweis eingesetzt werden.
- This example explains how I can create an additional image Field. The text box is one line
and for various inputs such as Photograph copyright notice may be used.

1) öffne / open includes/db_field_definitions.php
suche / search

oberhalb einfügen / add above
1
2
$additional_image_fields['table_info_photo'] = array($lang['table_info_photo'], "tableinfo"0)
$additional_image_fields['image_photograph'] = array($lang['image_photograph'], "text"0)

2) öffne lang/***/main.php
suche / search

oberhalb einfügen / add above
1
2
3
4
5
//-----------------------------------------------------
//--- Additional Fields -------------------------------
//-----------------------------------------------------
$lang['table_info_photo'] = "Photograph Infos";
$lang['image_photograph'] = "Photograph";
3) öffne / open templates/default/member_uploadform.html
füge in dem gewünschten Bereich dies hinzu / add in the desired range, this

Sprache / Language:
1
{lang_image_photograph}

Feld für die Eingabe: / Field for the input:
1
<input type="text" name="image_photograph" size="30" value="{image_photograph}" class="input" />

3a) öffne / open templates/default/details.html
füge in dem gewünschten Bereich dies hinzu / add in the desired range, this

Sprache / Language:
1
{lang_image_photograph}

Nur Anzeige / Show only
1
{image_photograph}

4) Gestaltung & Optionen / Design & Options
$additional_user_fields['image_photograph'] = array($lang['image_photograph'], "text", 0);

- Der rot markierte Text in diesem Fall "text" kann durch "textarea" oder "radio" oder durch  "tableinfo" ersetzt werden.
- The red highlighted text in this case "text" can be "textarea", or  "radio" or  "tableinfo" should be replaced

- Die grün makierte Zahl in diesem Fall 0 bestimmt ob das Feld ein Pflichtfeld sein soll oder nicht.
1 = Pflichtfeld
0 = Kein Pflichtfeld
- The green highlighted number 0 in this case is to be determined whether the field is a required field or not.
1 = required field
0 = Optional field

"text" Quelle: http://de.selfhtml.org/html/formulare/eingabe.htm#felder
- Einzeilige Eingabefelder dienen zur Aufnahme von einem oder wenigen Wörtern oder einer Zahl.
- One-line text boxes are used to hold one or a few words or a number

"textarea"
Quelle: http://de.selfhtml.org/html/formulare/eingabe.htm#bereiche
- Mehrzeilige Eingabefelder dienen zur Aufnahme von Kommentaren, Nachrichten usw.
- Multi-line text boxes are used to receive comments, messages, etc.

"radio" Quelle: http://de.selfhtml.org/html/formulare/auswahl.htm#radiobuttons
- Radio-Buttons sind eine Gruppe von beschrifteten Knöpfen, von denen der Anwender einen auswählen kann. Es kann immer nur einer der Radio-Buttons ausgewählt sein. Der Wert des ausgewählten Radio-Buttons wird beim Absenden des Formulars mit übertragen.
- Radio buttons are a group of labeled buttons, of which the user can select one. There can be only one of the radio buttons are selected. The value of the selected radio button is transmitted when sending the form with.

"tableinfo" Zusätzliche Felder abgrenzen / Additional fields delimit
- Mit "tableinfo" lassen sich Zusätzliche Felder abgrenzen beziehungsweise Kategorisieren
- With additional "tableinfo" can define additional fields or categorize

5)
- Damit die Funktion "tableinfo" auch funktioniert, muss diese erst dem System beigebracht werden
- Thus the "tableinfo" also works, it must first be taught the system

5a)
öffne / open admin/admin_functions.php
suche / search
1
2
3
4
5
function show_table_separator($title$colspan 2$anchor "") {
  global 
$bgcounter;
  echo 
"<tr class=\"tableseparator\">\n<td colspan=\"$colspan\"><a name=\"".$anchor."\"><b><span class=\"tableseparator\">".$title."</span></b></a></td>\n</tr>\n";
  
$bgcounter 0;
}
füge darunter / add after
1
2
3
4
5
6
7
8
9
10
11
12
function show_table_info_row($title$name$value 1) {
  global 
$HTTP_POST_VARS$lang;
  if (isset(
$HTTP_POST_VARS[$name])) {
    
$value $HTTP_POST_VARS[$name];
  }
  echo 
'
<tr class="tableseparator">
<td colspan="2"><a name=""><b><span class="tableseparator">'
.$title.'</span></b></a></td>

</tr>
'
;
}
suche / search
1
2
3
      case "radio":
        
show_radio_row($val[0], $field_name, ($value == "") ? $value);
        break;
füge darunter / add after
1
2
3
      case "tableinfo":
        
show_table_info_row($val[0], $field_name, ($value == "") ? $value);
        break;


6)
Datenbank Einträge
1
2
ALTER TABLE `4images_images` ADD `image_photograph` VARCHAR( 255 ) NOT NULL;
ALTER TABLE `4images_images` ADD `table_info_photo` VARCHAR( 255 ) NOT NULL;
1
2
ALTER TABLE `4images_images_temp` ADD `table_info_photo` VARCHAR( 255 ) NOT NULL;
ALTER TABLE `4images_images_temp` ADD `image_photograph` VARCHAR( 255 ) NOT NULL;

Follow members gave a thank to your post:
kitty999, , pwa

For this post, 3 members gave a thank you!
« Last Edit: November 12, 2013, 11:49:16 PM by Ben88b » Logged
kitty999
Newbie
*
Offline Offline

Posts: 17

Thank You
-Given: 1
-Receive: 0


View Profile WWW
« Reply #1 on: March 22, 2017, 06:25:15 PM »

First of all thank you for the tutorial.

Everything works fine but I was wondering how I could clean up the output?
For example: I have an additional field added to the upload form but when it's sent it adds <br /> after each line break. Ive noticed it does no do that with the 'image_description' variable so I'm just wondering where and how I would go about making my variable clean up like that.

Thank you very much for your time, I love the 4images script and have been working with it for a while, I even bought the bundle license
Logged

Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.194 seconds with 22 queries.