Author Topic: Profil erweitern  (Read 128023 times)

0 Members and 1 Guest are viewing this topic.

Turboss

  • Guest
Profil erweitern
« on: October 23, 2005, 05:02:24 PM »
Gibt es ein Script, mit dem ich mehr Angaben in das UserProfil erstellen kann. Da wären z.b. Hobbys, Beruf etc.
Danke im voraus!!

Offline JensF

  • Addicted member
  • ******
  • Posts: 1.028
    • View Profile
    • http://www.terraristik-galerie.de
Re: Profil erweitern
« Reply #1 on: October 23, 2005, 06:03:03 PM »
Ich hab da mal was. Vielleicht hilft es dir...

Quote
Anleitung für zusätzliche Felder im Profil.

Beispiel für ein Zusatzfeld um seinen Namen einzutragen.



1. Datenbank Tabelle in 4images_users erstellen

Feld: user_fullname | Typ: Varchar | Länge 255

-------------------------

2. öffne Datei includes/db_field_definations.php

über ?> folgendes einfügen

$additional_user_fields['user_fullname'] = array($lang['fullname'], "text", 0);

-------------------------

3. öffne includes/page_header.php

suche

"charset" => $lang['charset'],

danach einfügen

"lang_fullname" => $lang['fullname'],

---------------------------

4. öffne lang/deine Sprache/main.php

vor ?> einfügen

$lang['fullname'] = "Richtiger Name:";

---------------------------

5. öffne templates/default/member_editprofile.html

an gewünschter Stelle folgendes einfügen

          <tr>
            <td class="row2"><b> - {lang_fullname}</b></td>
            <td class="row2">
              <input type="text" name="user_fullname"  size="30" value="{user_fullname}" class="input" />
            </td>
          </tr>

--------------------------

6. öffne templates/default/member_profile.html

an gewünschter Stelle folgendes einfügen

        <tr>
          <td class="row2"><b> - {lang_fullname}</b></td>
          <td class="row2">{user_fullname}</td>
        </tr>

--------------------------


Um das ganze dann auch gleich beim registrieren zu haben

öffne templates/default/register_form.html

an gewünschter Stelle einfügen

          <tr>
            <td class="row2"><b> - {lang_fullname}</b></td>
            <td class="row2">
              <input type="text" name="user_fullname"  size="30" value="{user_fullname}" class="input" />
            </td>
          </tr>

-----------------------------
Mit freundlichem Gruß
Jens Funk



-> Sorry for my bad English <-

Turboss

  • Guest
Re: Profil erweitern
« Reply #2 on: October 23, 2005, 08:56:08 PM »
Cool, das ging ja schnell!!
Vielen Dank, ich teste das gleich!







Prima - hat so geklappt, wie ich es mir gewünscht habe - danke!!!!

Michael

  • Guest
Re: Profil erweitern
« Reply #3 on: December 19, 2005, 12:13:25 PM »
Hallo,
würde das ganze auch als Profil Signatur funktionieren und auch entsprechend unter dem Kommentar ausgegeben werden?

Gruß, Michael

Offline Darkness2001

  • Full Member
  • ***
  • Posts: 151
    • View Profile
    • photo-galerie-online
Re: Profil erweitern
« Reply #4 on: December 19, 2005, 01:36:54 PM »
Hallo Michael,

also ich suche da auch schon lange und habe einiges ausprobiert.

Also unter den Kommentaren habe ich es bisher n9och nicht funktionstüchtig einbauen können.
Funkt. leider nicht (bei mir)

Grüße Darkness  :mrgreen:

Ps: Vielleicht hat ja jemand nen Tip!

Offline kim242

  • Newbie
  • *
  • Posts: 14
  • WOMAN AT WORK !
    • View Profile
    • KIM242 Fotocommunity
Re: Profil erweitern
« Reply #5 on: December 19, 2005, 03:59:30 PM »
super erklärt danke !!!!! :D

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: Profil erweitern
« Reply #6 on: December 19, 2005, 04:34:06 PM »
würde das ganze auch als Profil Signatur funktionieren und auch entsprechend unter dem Kommentar ausgegeben werden?

... na klar ...  :wink:

1. Schritt
wie oben von Jens erklärt ... ein zusätzliches Feld mit "user_signature" in der Tabelle "4images_users" anlegen. Wenn du das DreamBoard installiert hast, dann befindet sich diese Feld bereits in deiner User-Tabelle. Mit den anderen Schritten ist dann analog zu Jens Ausführungen zu verfahren ... .


2. Schritt
finde in details.php (hier Original-Code) nach --- Show Comments --- :
Code: [Select]
$sql = "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, c.comment_ip, c.comment_date".get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email").get_user_table_field(", u.", "user_showemail").get_user_table_field(", u.", "user_invisible").get_user_table_field(", u.", "user_joindate").get_user_table_field(", u.", "user_lastaction").get_user_table_field(", u.", "user_comments").get_user_table_field(", u.", "user_homepage").get_user_table_field(", u.", "user_icq").get_user_table_field(", u.", "user_id")"
und  füge .get_user_table_field(", u.", "user_signature") hinzu, wie folgt :
Code: [Select]
$sql = "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, c.comment_ip, c.comment_date".get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email").get_user_table_field(", u.", "user_showemail").get_user_table_field(", u.", "user_invisible").get_user_table_field(", u.", "user_joindate").get_user_table_field(", u.", "user_lastaction").get_user_table_field(", u.", "user_comments").get_user_table_field(", u.", "user_homepage").get_user_table_field(", u.", "user_icq").get_user_table_field(", u.", "user_id").get_user_table_field(", u.", "user_signature")"


3. Schritt
finde in details.php :
Code: [Select]
$site_template->register_vars(array(
        "comment_id" => $comment_row[$i]['comment_id'],
und füge unmittelbar davor folgendes ein :
Code: [Select]
$signature = format_text($comment_row[$i]['user_signature'], $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments']);
$sig = '<br><br>' . $signature ;
Optional :
wenn du das DreamBoard installiert hast, dann kannst du auch folgendes verwenden :
Code: [Select]
$signature = format_text($comment_row[$i]['user_signature'], $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments']);
      if ($boardconfig['alow_sig'] == 1) {
                        $sig = '<br><br>' . $signature ;
                          } else {
                        $sig = "";
                          }
so wird je nach deiner Einstellung im ACP -> Board die Signatur angezeigt oder auch nicht ... !


4. Schritt
finde in details.php :
Code: [Select]
"comment_user_ip" => $comment_user_ip,
und füge unmittelbar dahinter folgendes ein :
Code: [Select]
"comment_sig" => $sig,


5. Schritt
finde in comment_bit.html :
Code: [Select]
{comment_text}
und füge unmittelbar dahinter folgendes ein :
Code: [Select]
{comment_sig}

... das wars ...  :wink:
mawenzi

Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Michael

  • Guest
Re: Profil erweitern
« Reply #7 on: December 19, 2005, 04:40:13 PM »
WOW ... das nenne ich eine detaillierte Anleitung  :mrgreen:

Werde das heute im laufe des Abend mal testen.

DANKE  :D


Michael

  • Guest
Re: Profil erweitern
« Reply #8 on: December 19, 2005, 07:04:11 PM »
Schon bei dem ersten Schritt erhalte ich folgende Fehlermeldungen:

Code: [Select]
DB Error: Bad SQL Query: SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, c.comment_ip, c.comment_date, u.user_level, u.user_name, u.user_email, u.user_showemail, u.user_invisible, u.user_joindate, u.user_lastaction, u.user_comments, u.user_homepage, u.user_icq, u.user_id, i.user_id_last_vote, i.last_vote, i.last_rating, i.user_name_vote, i.image_photographer FROM 4images_comments c LEFT JOIN 4images_users u ON (u.user_id = c.user_id) WHERE c.image_id = 8599 ORDER BY c.comment_date ASC
Unknown table 'i' in field list

Das ganze soll ja in der details.php unter "show comments" rein, hier ein Ausschnitt:

Code: [Select]
//-----------------------------------------------------
//--- Show Comments -----------------------------------
//-----------------------------------------------------
if ($image_allow_comments == 1) {
  $sql = "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, c.comment_ip, c.comment_date".get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email").get_user_table_field(", u.", "user_showemail").get_user_table_field(", u.", "user_invisible").get_user_table_field(", u.", "user_joindate").get_user_table_field(", u.", "user_lastaction").get_user_table_field(", u.", "user_comments").get_user_table_field(", u.", "user_homepage").get_user_table_field(", u.", "user_icq")."
          FROM ".COMMENTS_TABLE." c
          LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = c.user_id)
          WHERE c.image_id = $image_id
          ORDER BY c.comment_date ASC";
  $result = $site_db->query($sql);

  $comment_row = array();
  while ($row = $site_db->fetch_array($result)) {
    $comment_row[] = $row;
  }
  $site_db->free_result($result);
  $num_comments = sizeof($comment_row);

  if (!$num_comments) {
    $comments = "<tr><td class=\"commentrow1\" colspan=\"2\">".$lang['no_comments']."</td></tr>";
  }
  else {
    $comments = "";
    $bgcounter = 0;
    for ($i = 0; $i < $num_comments; $i++) {
      $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;

      $comment_user_email = "";
      $comment_user_email_save = "";
      $comment_user_mailform_link = "";
      $comment_user_email_button = "";
      $comment_user_homepage_button = "";
      $comment_user_icq_button = "";
      $comment_user_profile_button = "";
      $comment_user_status_img = REPLACE_EMPTY;
      $comment_user_name = htmlspecialchars($comment_row[$i]['comment_user_name']);
      $comment_user_info = $lang['userlevel_guest'];

      $comment_user_id = $comment_row[$i]['user_id'];
      $user_row_comment = get_user_info($comment_user_id);

      if (isset($comment_row[$i][$user_table_fields['user_name']]) && $comment_user_id != GUEST) {
        $comment_user_name = htmlspecialchars($comment_row[$i][$user_table_fields['user_name']]);

        $comment_user_profile_link = !empty($url_show_profile) ? $site_sess->url(preg_replace("/{user_id}/", $comment_user_id, $url_show_profile)) : $site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$comment_user_id);
        $comment_user_profile_button = "<a href=\"".$comment_user_profile_link."\"><img src=\"".get_gallery_image("profile.gif")."\" border=\"0\" alt=\"".$comment_user_name."\" /></a>";

        $comment_user_status_img = ($comment_row[$i][$user_table_fields['user_lastaction']] >= (time() - 300) && ((isset($comment_row[$i][$user_table_fields['user_invisible']]) && $comment_row[$i][$user_table_fields['user_invisible']] == 0) || $user_info['user_level'] == ADMIN)) ? "<img src=\"".get_gallery_image("user_online.gif")."\" border=\"0\" alt=\"Online\" />" : "<img src=\"".get_gallery_image("user_offline.gif")."\" border=\"0\" alt=\"Offline\" />";

        $comment_user_homepage = (isset($comment_row[$i][$user_table_fields['user_homepage']])) ? format_url($comment_row[$i][$user_table_fields['user_homepage']]) : "";
        if (!empty($comment_user_homepage)) {
          $comment_user_homepage_button = "<a href=\"".$comment_user_homepage."\" target=\"_blank\"><img src=\"".get_gallery_image("homepage.gif")."\" border=\"0\" alt=\"".$comment_user_homepage."\" /></a>";
        }

        $comment_user_icq = (isset($comment_row[$i][$user_table_fields['user_icq']])) ? $comment_row[$i][$user_table_fields['user_icq']] : "";
        if (!empty($comment_user_icq)) {
          $comment_user_icq_button = "<a href=\"http://wwp.icq.com/scripts/search.dll?to=".$comment_user_icq."\" target=\"_blank\"><img src=\"http://web.icq.com/whitepages/online?icq=".$comment_user_icq."&img=5\" width=\"18\" height=\"18\" border=\"0\" alt=\"".$comment_user_icq."\" /></a>";
        }

        if (!empty($comment_row[$i][$user_table_fields['user_email']]) && (!isset($comment_row[$i][$user_table_fields['user_showemail']]) || (isset($comment_row[$i][$user_table_fields['user_showemail']]) && $comment_row[$i][$user_table_fields['user_showemail']] == 1))) {
          $comment_user_email = $comment_row[$i][$user_table_fields['user_email']];
          $comment_user_email_save = str_replace("@", " at ", $comment_row[$i][$user_table_fields['user_email']]);
          if (!empty($url_mailform)) {
            $comment_user_mailform_link = $site_sess->url(preg_replace("/{user_id}/", $comment_user_id, $url_mailform));
          }
          else {
            $comment_user_mailform_link = $site_sess->url(ROOT_PATH."member.php?action=mailform&amp;".URL_USER_ID."=".$comment_user_id);
          }
          $comment_user_email_button = "<a href=\"".$comment_user_mailform_link."\"><img src=\"".get_gallery_image("email.gif")."\" border=\"0\" alt=\"".$comment_user_email_save."\" /></a>";
        }

        if (!isset($comment_row[$i][$user_table_fields['user_level']]) || (isset($comment_row[$i][$user_table_fields['user_level']]) && $comment_row[$i][$user_table_fields['user_level']] == USER)) {
          $comment_user_info = $lang['userlevel_user'];
        }
        elseif ($comment_row[$i][$user_table_fields['user_level']] == ADMIN) {
          $comment_user_info = $lang['userlevel_admin'];
        }

        $comment_user_info .= "<br />";
        $comment_user_info .= (isset($comment_row[$i][$user_table_fields['user_joindate']])) ? "<br />".$lang['join_date']." ".format_date($config['date_format'], $comment_row[$i][$user_table_fields['user_joindate']]) : "";
        $comment_user_info .= (isset($comment_row[$i][$user_table_fields['user_comments']])) ? "<br />".$lang['comments']." ".$comment_row[$i][$user_table_fields['user_comments']] : "";
      }

      $comment_user_ip = ($user_info['user_level'] == ADMIN) ? $comment_row[$i]['comment_ip'] : "";

      $admin_links = "";
      if ($user_info['user_level'] == ADMIN) {
        $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=editcomment&amp;comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['edit']."</a>&nbsp;";
        $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=removecomment&amp;comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['delete']."</a>";
      }
      elseif ($is_image_owner) {
        $admin_links .= ($config['user_edit_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editcomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['edit']."</a>&nbsp;";
        $admin_links .= ($config['user_delete_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removecomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['delete']."</a>";
      }

      $site_template->register_vars(array(
        "comment_id" => $comment_row[$i]['comment_id'],
        "user_avatar_current" => ($config['avatar_use']) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($user_row_comment['user_avatar'] == "") ? "blank.gif" : $user_row_comment['user_avatar'])."\" name=\"icons\" border=\"0\" hspace=\"15\" alt=\"\">" : "",
        "comment_user_id" => $comment_user_id,
        "comment_user_status_img" => $comment_user_status_img,
        "comment_user_name" => $comment_user_name,
        "comment_user_info" => $comment_user_info,
        "comment_user_profile_button" => $comment_user_profile_button,
        "comment_user_email" => $comment_user_email,
        "comment_user_email_save" => $comment_user_email_save,
        "comment_user_mailform_link" => $comment_user_mailform_link,
        "comment_user_email_button" => $comment_user_email_button,
        "comment_user_homepage_button" => $comment_user_homepage_button,
        "comment_user_icq_button" => $comment_user_icq_button,
        "comment_user_ip" => $comment_user_ip,
        "comment_headline" => format_text($comment_row[$i]['comment_headline'], 0, $config['wordwrap_comments'], 0, 0),
        "comment_text" => format_text($comment_row[$i]['comment_text'], $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments']),
        "comment_date" => format_date($config['date_format']." ".$config['time_format'], $comment_row[$i]['comment_date']),
        "row_bg_number" => $row_bg_number,
        "admin_links" => $admin_links
      ));
      $comments .= $site_template->parse_template("comment_bit");
    } // end while
  } //end else
  $site_template->register_vars("comments", $comments);
  unset($comments);

das Problem liegt hier schon am:  .get_user_table_field(", u.", "user_signature").$additional_sql.
es werden neben der Fehlermeldung auch keinerlei Kommentare mehr angezeigt!

Gruß, Michael

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: Profil erweitern
« Reply #9 on: December 19, 2005, 08:35:04 PM »
@Michael,

1. ... der erste Schritt war die Datenbankerweiterung und die Eingabe über die member_profile.html ... ?
2. ... dein Bad SQL Query hat doch nichts mit dem Code aus Show Comments zu tun ... i.user_id_last_vote, i.last_vote, .... wo kommt denn das her ... ?
3. ... was sollen wir mit deinem Code --- Show Comments --- ?
4. ... habe es genau wie beschrieben bei mir eingebaut : hier zu sehen
5. ... bitte die Anleitung systematisch abarbeiten ... !


mawenzi

Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Michael

  • Guest
Re: Profil erweitern
« Reply #10 on: December 19, 2005, 09:54:20 PM »
Hallo Mawenzi,

sorry ich meinte ab Schritt 2.

Die Fehler treten auf sobald ich den 2. Schritt tätige, Schritt 1 funktioniert ohne Probleme und ich kann über das Kontrollzentrum auch eine Signatur eingeben.

Quote
3. ... was sollen wir mit deinem Code --- Show Comments --- ?

Du schreibst:
Quote
2. Schritt
finde in details.php :

Code:
$sql = "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS......

Genau das habe ich gesucht und entsprechend ersetzt, dieses steht in meiner details.php genau unter "show comments" und nur dort!
Ich habe das nun mehrmals ausprobiert und es kann gut sein das es bei mir nicht funktioniert da ich schon viele "Mods" mit eingebunden habe.

Fakt ist das bei Schritt 2 die Fehler, zumindest bei meinem Scribt, auftauchen.

Gruß, Michael

Offline Loda

  • Sr. Member
  • ****
  • Posts: 353
    • View Profile
    • Fotosucht Schweiz
Re: Profil erweitern
« Reply #11 on: December 19, 2005, 11:52:59 PM »
ich habe im schritt 3 die ";" semikolon am ende durch ein "," komma ersetzt.
dann ging es bei mir.

Michael

  • Guest
Re: Profil erweitern
« Reply #12 on: December 20, 2005, 12:05:45 AM »
BINGO ...

nun klappts auch mit dem Nachbarn  :mrgreen:

DANKE

Gruß, Michael

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: Profil erweitern
« Reply #13 on: December 20, 2005, 10:18:34 AM »
ich habe im schritt 3 die ";" semikolon am ende durch ein "," komma ersetzt.

... habt ihr den Code von Schritt 3 vor $site_template->register_vars... eingefügt ?

5. ... bitte die Anleitung systematisch abarbeiten ... !

@Michael ... dann klappst ...  :wink:

mawenzi
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline Loda

  • Sr. Member
  • ****
  • Posts: 353
    • View Profile
    • Fotosucht Schweiz
Re: Profil erweitern
« Reply #14 on: December 20, 2005, 10:22:04 AM »
hallo!
sorry.. das habe ich wohl überlesen..  :(
nächstes mal schaue mir das gründlicher an..
danke dir!