Folgende Warnungen sind aufgetreten:
Warning [2] Undefined array key 0 - Line: 1640 - File: showthread.php PHP 8.2.18 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php 1640 errorHandler->error_callback
/showthread.php 915 buildtree
Warning [2] Undefined array key "dateline" - Line: 1000 - File: inc/functions_post.php PHP 8.2.18 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions_post.php 1000 errorHandler->error_callback
/inc/functions_post.php 834 get_post_attachments
/showthread.php 916 build_postbit
Warning [2] Undefined array key "dateline" - Line: 1000 - File: inc/functions_post.php PHP 8.2.18 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions_post.php 1000 errorHandler->error_callback
/inc/functions_post.php 834 get_post_attachments
/showthread.php 916 build_postbit
Warning [2] Undefined array key "dateline" - Line: 1000 - File: inc/functions_post.php PHP 8.2.18 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions_post.php 1000 errorHandler->error_callback
/inc/functions_post.php 834 get_post_attachments
/showthread.php 916 build_postbit




Themabewertung:
  • 0 Bewertung(en) - 0 im Durchschnitt
  • 1
  • 2
  • 3
  • 4
  • 5
Pflichtfelder entfernen
#2
Hi, sorry für die lange Freischaltungsdauer aber das Forum hat mir nicht angezeigt, dass hier ein Beitrag auf die Freischaltung wartet. Bin eher durch Zufall darauf gestoßen.

Ich habe das für Dich mal durchgeführt und mit der aktuellen Version (0.6.9.3) getestet. Du kannst das jetzt auf zwei Arten lösen. Entweder Du lädst Dir die von mir veränderten Dateien in diesem Beitrag herunter und überspielst Deine eigenen damit. Dann solltest Du aber zuerst auf die 0.6.9.3 aktualisieren. Oder Du führst die Schritte manuell durch.

Wenn Du alles angepasst, oder die Dateien überschrieben hast, kannst Du mit der Variable
Code:
$email_is_necessary = 1;
steuern ob eine eMail benötigt wird, oder nicht. Wenn ja, dann wird die eMail auf Gültigkeit geprüft. Wird keine eMail und auch sonst keine weiteren Informationen angegeben, wird die Zeile unter der Nachricht komplett ausgeblendet, denn sie wäre ja sonst leer.

1 = eMail wird benötigt
0 = eMail wird nicht benötigt

Angepasste Dateien:
.png   space.png (Größe: 112 Bytes / Downloads: 10.306)
Manuell: Gehe wie folgt vor, um Dein Vorhaben zu realisieren (0.6.9.3).

1. Ersetze folgende Zeilen
Code:
275 // if you want the email field to be not necessary, just outcomment next line with "//"
276 if (!check_mail($_POST['email'])) { $errorcode = 4; }
mit
Code:
275 // set the next variable to "0" if you want the email field not to be necessary
276 $email_is_necessary = 1;
2. Ersetze folgende Zeilen
Code:
290 // if you want the email field to be not necessary, just outcomment next line with "//"
291 if (!$_POST['email']) { $errorcode = 2; }
mit
Code:
290 if (!$_POST['email'])
291    {
292    if ($email_is_necessary == 1)
293        {
294        $errorcode = 2;
295        }
296    }
297 elseif ($_POST['email'])
298    {
299    if (!check_mail($_POST['email'])) { $errorcode = 4; }
300    }
Somit wäre die Überprüfung schon mal wie von Dir gewünscht. Jetzt müssen wir noch die Handhabung in der index.php ändern, damit es so angezeigt wird, wie Du es haben willst. Gehe dazu wie folgt vor:

1. Ersetze
Code:
260 // find out if the user wants his email to be shown
261 if ($entry[$i]['user_show_email'] != 0)
262    {
263    if ($settings['spam_protection'] == 1)
264        {
265        $entry_email_path = "email.php?id=".$entry[$i]['ID'];
266        $entry_email_pic = "images/iconsets/".$settings['iconset_path']."/email.png";
267        $entry_email_text = $lang['email_yes'];
268        }
269    else
270        {
271        $entry_email_path = "mailto:".$entry[$i]['email'];
272        $entry_email_pic = "images/iconsets/".$settings['iconset_path']."/email.png";
273        $entry_email_text = $lang['email_yes'];
274        }
275    }
276 else
277    {
278        $entry_email_path = "email.php?id=denied";
279        $entry_email_pic = "images/iconsets/".$settings['iconset_path']."/email_error.png";
280        $entry_email_text = $lang['email_no'];
281    }
mit
Code:
264 // check if email is set
265 if ($entry[$i]['email'])
266    {
267    // find out if the user wants his email to be shown
268    if ($entry[$i]['user_show_email'] != 0)
269        {
270        if ($settings['spam_protection'] == 1)
271            {
272            $entry_email_path = "email.php?id=".$entry[$i]['ID'];
273            $entry_email_pic = "images/iconsets/".$settings['iconset_path']."/email.png";
274            $entry_email_text = $lang['email_yes'];
275            }
276        else
277            {
278            $entry_email_path = "mailto:".$entry[$i]['email'];
279            $entry_email_pic = "images/iconsets/".$settings['iconset_path']."/email.png";
280            $entry_email_text = $lang['email_yes'];
281            }
282        }
283    else
284        {
285        $entry_email_path = "email.php?id=denied";
286        $entry_email_pic = "images/iconsets/".$settings['iconset_path']."/email_error.png";
287        $entry_email_text = $lang['email_no'];
288        }
289    }
290 else
291    {
292    $email = "";
293    }
2. Ersetze
Code:
257 if ($entry[$i]['city'] == "") { $city = ""; }
258 if ($entry[$i]['hp'] == "") { $hp = ""; }
259 if ($entry[$i]['icq'] == "") { $icq = ""; }
260 if ($entry[$i]['aim'] == "") { $aim = ""; }
261 if ($entry[$i]['msn'] == "") { $msn = ""; }
mit
Code:
257 $info_icons = 5;
258
259 if ($entry[$i]['city'] == "") { $city = ""; }
260 if ($entry[$i]['hp'] == "") { $hp = ""; $info_icons--; }
261 if ($entry[$i]['icq'] == "") { $icq = ""; $info_icons--; }
262 if ($entry[$i]['aim'] == "") { $aim = ""; $info_icons--; }
263 if ($entry[$i]['msn'] == "") { $msn = ""; $info_icons--; }
3. Füge nach Zeile Nr. 252 folgendes ein:
Code:
253 $info = $content_index_entry_info;
4. Ersetze
Code:
342 // fill template with other templates if set
343 $page_entry[$i] = template("TEMPLATE_ENTRY_CITY", $city, $page_entry[$i]);
344 $page_entry[$i] = template("TEMPLATE_ENTRY_MESSAGE", $message, $page_entry[$i]);
345 $page_entry[$i] = template("TEMPLATE_ENTRY_EMAIL", $email, $page_entry[$i]);
346 $page_entry[$i] = template("TEMPLATE_ENTRY_HP", $hp, $page_entry[$i]);
347 if ($settings['gravatar_position'] == 0) {
348 $page_entry[$i] = template("ENTRY_GRAVATAR_LEFT", $gravatar, $page_entry[$i]);
349 $page_entry[$i] = template("ENTRY_GRAVATAR_RIGHT", "", $page_entry[$i]);
350 $page_entry[$i] = template("GRAVATAR_CSS", "entry_message_gravatar_left", $page_entry[$i]); }
351 else {
352 $page_entry[$i] = template("ENTRY_GRAVATAR_LEFT", "", $page_entry[$i]);
353 $page_entry[$i] = template("ENTRY_GRAVATAR_RIGHT", $gravatar, $page_entry[$i]);
354 $page_entry[$i] = template("GRAVATAR_CSS", "entry_message_gravatar_right", $page_entry[$i]); }
355 $page_entry[$i] = template("TEMPLATE_ENTRY_ICQ", $icq, $page_entry[$i]);
356 $page_entry[$i] = template("TEMPLATE_ENTRY_AIM", $aim, $page_entry[$i]);
357 $page_entry[$i] = template("TEMPLATE_ENTRY_MSN", $msn, $page_entry[$i]);
358 $page_entry[$i] = template("TEMPLATE_ENTRY_COMMENT", $comment, $page_entry[$i]);
mit
Code:
342 // fill template with other templates if set
343 if ($info_icons > 0)
344    {
345    $page_entry[$i] = template("TEMPLATE_ENTRY_INFO", $info, $page_entry[$i]);
346    $page_entry[$i] = template("TEMPLATE_ENTRY_EMAIL", $email, $page_entry[$i]);
347    $page_entry[$i] = template("TEMPLATE_ENTRY_HP", $hp, $page_entry[$i]);
348    $page_entry[$i] = template("TEMPLATE_ENTRY_ICQ", $icq, $page_entry[$i]);
349    $page_entry[$i] = template("TEMPLATE_ENTRY_AIM", $aim, $page_entry[$i]);
350    $page_entry[$i] = template("TEMPLATE_ENTRY_MSN", $msn, $page_entry[$i]);
351    }
352 elseif ($info_icons == 0)
353    {
354    $page_entry[$i] = template("TEMPLATE_ENTRY_INFO", "", $page_entry[$i]);
355    }
356 $page_entry[$i] = template("TEMPLATE_ENTRY_CITY", $city, $page_entry[$i]);
357 $page_entry[$i] = template("TEMPLATE_ENTRY_MESSAGE", $message, $page_entry[$i]);
358 if ($settings['gravatar_position'] == 0) {
359 $page_entry[$i] = template("ENTRY_GRAVATAR_LEFT", $gravatar, $page_entry[$i]);
360 $page_entry[$i] = template("ENTRY_GRAVATAR_RIGHT", "", $page_entry[$i]);
361 $page_entry[$i] = template("GRAVATAR_CSS", "entry_message_gravatar_left", $page_entry[$i]); }
362 else {
363 $page_entry[$i] = template("ENTRY_GRAVATAR_LEFT", "", $page_entry[$i]);
364 $page_entry[$i] = template("ENTRY_GRAVATAR_RIGHT", $gravatar, $page_entry[$i]);
365 $page_entry[$i] = template("GRAVATAR_CSS", "entry_message_gravatar_right", $page_entry[$i]); }
366 $page_entry[$i] = template("TEMPLATE_ENTRY_COMMENT", $comment, $page_entry[$i]);
Öffne als nächstes die "includes/load_templates.inc.php" und füge NACH Zeile 45 folgendes hinzu:
Code:
46 if (file_exists("templates/".$settings['template_path']."/main/index_entry_info.tpl")) { $content_index_entry_info = file_get_contents("templates/".$settings['template_path']."/main/index_entry_info.tpl"); } else { echo "<center><span class='errormessage'>(404) Missing file: templates/".$settings['template_path']."/main/index_entry_info.tpl - Incomplete template in use! If you are using your own template, and you updated to a newer version of MGB shortly, check changes in the main template 'mgbModern'.</span></center><br>"; }
Öffne die "templates/mgbModern/main/index_entry.tpl" und schneide folgendes aus:
Code:
    <tr>
        <td class="entry_info" colspan="3">{TEMPLATE_ENTRY_EMAIL}{TEMPLATE_ENTRY_HP}{TEMPLATE_ENTRY_ICQ}{TEMPLATE_ENTRY_AIM}{TEMPLATE_ENTRY_MSN}</td>
    </tr>
füge dafür das hier an der selben Stelle ein:
Code:
{TEMPLATE_ENTRY_INFO}
Erstelle anschließend im selben Verzeichnis eine neue Datei namens "index_entry_info.tpl" und füge dort das ausgeschnittene wieder ein.

Öffne nun folgende Dateien
Code:
index_entry_aim.tpl
index_entry_email.tpl
index_entry_hp.tpl
index_entry_icq.tpl
index_entry_msn.tpl
und füge jeweils an das ENDE der Datei folgendes hinzu:
Code:
<img src="images/iconsets/{ICONSET_PATH}/space.png" alt="" title="" height="16" width="5">
Anschließend lädst Du Dir noch diese Datei herunter und kopierst sie in das default iconset Verzeichnis.
.zip   mgb_ohne_email_erforderlichkeit.zip (Größe: 17,64 KB / Downloads: 282)

Das sollte es dann eigentlich gewesen sein. Hoffe ich. Bei mir funktioniert es. Sollte dann so aussehen:
.png   mgb.png (Größe: 17,96 KB / Downloads: 10.306)
Zitieren


Nachrichten in diesem Thema

Möglicherweise verwandte Themen…
Thema Verfasser Antworten Ansichten Letzter Beitrag
  Wie kann ich die Eingabefelder entfernen? Bianca77 6 17.363 10.10.2013, 16:00:43
Letzter Beitrag: mopzz
  Mailfehler entfernen fabian86 5 11.717 08.09.2012, 15:16:47
Letzter Beitrag: fabian86
  Pflichtfelder player2000 14 13.349 18.02.2012, 21:15:35
Letzter Beitrag: mopzz
  Entfernen der Buttons "Kontakt" und "Administration" strass 1 2.934 17.01.2009, 11:05:50
Letzter Beitrag: mopzz

Gehe zu:


Benutzer, die gerade dieses Thema anschauen: 2 Gast/Gäste