Fabio 0 Report post Posted December 26, 2003 moin also ich hab neue profil felder angelegen mit der funktion im acp aber ich schaff es nicht das sie in der profil anzeige angezeigt werden die variabel heißt doch {$author[field_x]} wenn ich das im profil einbaue wird nichts angezeigt .... kann mir da mal kurz jemand helfen? mfg fabio Share this post Link to post
Helge 192 Report post Posted December 26, 2003 Damit es im Profil angezeigt wird musst du nur bei den Custom Profile Fields bei den Einstellungen oder beim Erstellen bei Hide from the member's profile? auf "No" stellen. Dann wirds im Profil angezeigt. Share this post Link to post
Fabio 0 Report post Posted December 26, 2003 ist auf no so weit war ich auch schon... aber es wird nicht angezeigt also wollte ich es manuel eintragen ... Share this post Link to post
Andy 0 Report post Posted December 26, 2003 hm... ich weiß jetzt nicht genau wo ich bei Dir ansetzen soll, daher fang ich auch nochmal ganz von vorne an Also, hast Du das ganze mal so wie hier in der Anleitung beschrieben gemacht ? Normalerweise sollte das eigentlich wenn Du Dich an diese Anleitung hälst absolut super funktionieren :) Share this post Link to post
Fabio 0 Report post Posted December 26, 2003 ja ich kenn die anleitung .... aber das funktioniert nicht mehr aus irgendeinen grund... es wir nicht mehr im profil angezeigt .. also wollte ich es manuel eintragen aber es wir nichts angezeigt... mit der variabel von oben Share this post Link to post
Stefan 0 Report post Posted December 26, 2003 Hast du am Skin was geändert? Schau mal in der skin_profil.php nach, ob die rot markierte Stelle noch vorhanden ist. <td width='50%' valign='top' class="plainborder"> <table cellspacing="1" cellpadding='6' width='100%'> <tr> <td align='center' colspan='2' class='maintitle'>{$ibforums->lang['info']}</td> </tr> <tr> <td class="row3" width='30%' valign='top'><b>{$ibforums->lang['homepage']}</b></td> <td align='left' width='70%' class='row1'>{$info['homepage']}</td> </tr> <tr> <td class="row3" valign='top'><b>{$ibforums->lang['birthday']}</b></td> <td align='left' class='row1'>{$info['birthday']}</td> </tr> <tr> <td class="row3" valign='top'><b>{$ibforums->lang['location']}</b></td> <td align='left' class='row1'>{$info['location']}</td> </tr> <tr> <td class="row3" valign='top'><b>{$ibforums->lang['interests']}</b></td> <td align='left' class='row1'>{$info['interests']}</td> </tr> <!--{CUSTOM.FIELDS}--> </table> </td> Share this post Link to post
Fabio 0 Report post Posted December 26, 2003 thx das war es..... wäre ich nie darauf gekommen.... noch eine frage warum sagst du immer die php seiten z.b. skin_profil.php wenn man es ja auch in den templers ändern kann? Share this post Link to post
Andy 0 Report post Posted December 26, 2003 Stefan, und auch ich, sowie viele andere User ändern die Skin Dateien lieber "manuell" mit einem Editor, anstelle mit dem Template System vom ACP aus. Ich markiere dann mal das Thema als erledigt, oder hattest Du noch ne Frage ? :D Share this post Link to post
Stefan 0 Report post Posted December 26, 2003 Stimmt, denn die Änderungen über die PHP-Dateien gehen viel schneller als wenn man sich über das ACP zu der Stelle hangelt. Außerdem verschwinden die Änderungen bei einer Synchronisation der Datenbank mit den PHP Dateien nicht. Also ich persönlich würde, solange man keinen aktivierten Safe-Mode hat, immer den Weg über die PHP Dateien vorziehen. Ist aber Geschmacksache. :) Share this post Link to post
Fabio 0 Report post Posted December 26, 2003 naja mir dauert das hochladen zu lange... und der code ist mir zu komplex in denn php dateien aber ansonsten ist was wahres drann .. thx Share this post Link to post
Stefan 0 Report post Posted December 26, 2003 Hab ja gesagt, das es Geschmacksache ist. Solange es niemanden stört, das ich halt die Skindatei angebe und nicht den Weg übers ACP. ;) Share this post Link to post
Fabio 0 Report post Posted December 26, 2003 Ich markiere dann mal das Thema als erledigt, oder hattest Du noch ne Frage ? naja .. ja es gibt noch was ... hat aber nur indireck was damit zu tun ,aber ich wollte kein neues thema aufmachen... also ich hab ja die neuen profil felder erstellt sie werden jetzt im ucp bei kontaktinformationen angezeigt , aber ich will das sie auf einer extra seite im ucp einzustellen sind könnt ihr mir erklären was ich mache muss wenn ich jetzt n neue seite und einen link in der leiste machen will? Share this post Link to post
Stefan 0 Report post Posted December 26, 2003 Da muß man einige Änderungen an der UCP.php vornehmen, damit man das realisieren kann. Ich schau es mir morgen mal an, dann kann ich dir ggf, eine Lösung geben. So auf die Schnelle kann man das nicht bewerkstelligen. ;) Share this post Link to post
Fabio 0 Report post Posted December 26, 2003 Danke das wäre nett von dir. Share this post Link to post
Fabio 0 Report post Posted December 27, 2003 und hast du heute zeit gefunden für mein problem? Share this post Link to post
Stefan 0 Report post Posted December 27, 2003 Die Jugend von heute, einfach keine Geduld mehr. Datei UCP.php Suchen: case 'setinternalavatar': $this->lib->set_internal_avatar(); break; Darunter einfügen: case '60': $this->custom_personal(); break; case '61': $this->do_custom_personal(); break; Suchen: //*******************************************************************/ //| PERSONAL: //| //| Displays the personal info form //*******************************************************************/ function personal() { global $ibforums, $DB, $std, $print; //----------------------------------------------- // Check to make sure that we can edit profiles.. //----------------------------------------------- if (empty($ibforums->member['g_edit_profile'])) { $std->Error( array( 'LEVEL' => 1, 'MSG' => 'cant_use_feature' ) ); } //----------------------------------------------- // Format the birthday drop boxes.. //----------------------------------------------- $date = getdate(); $day = "<option value='0'>--</option>"; $mon = "<option value='0'>--</option>"; $year = "<option value='0'>--</option>"; for ( $i = 1; $i < 32; $i++ ) { $day .= "<option value='$i'"; $day .= $i == $this->member['bday_day'] ? "selected>$i</option>" : ">$i</option>"; } for ( $i = 1; $i < 13; $i++ ) { $mon .= "<option value='$i'"; $mon .= $i == $this->member['bday_month'] ? "selected>{$ibforums->lang['month'.$i]}</option>" : ">{$ibforums->lang['month'.$i]}</option>"; } $i = $date['year'] - 1; $j = $date['year'] - 100; for ( $i; $j < $i; $i-- ) { $year .= "<option value='$i'"; $year .= $i == $this->member['bday_year'] ? "selected>$i</option>" : ">$i</option>"; } //----------------------------------------------- // Custom profile fields stuff //----------------------------------------------- $required_output = ""; $optional_output = ""; $field_data = array(); $DB->query("SELECT * from ibf_pfields_content WHERE member_id='".$ibforums->member['id']."'"); while ( $content = $DB->fetch_row() ) { foreach($content as $k => $v) { if ( preg_match( "/^field_(\d+)$/", $k, $match) ) { $field_data[ $match[1] ] = $v; //break; } } } $DB->query("SELECT * from ibf_pfields_data WHERE fedit=1 ORDER BY forder"); while( $row = $DB->fetch_row() ) { $form_element = ""; if ( $row['freq'] == 1 ) { $ftype = 'required_output'; } else { $ftype = 'optional_output'; } if ( $row['ftype'] == 'drop' ) { $carray = explode( '|', trim($row['fcontent']) ); $d_content = ""; foreach( $carray as $entry ) { $value = explode( '=', $entry ); $ov = trim($value[0]); $td = trim($value[1]); if ($ov !="" and $td !="") { $d_content .= ($field_data[$row['fid']] == $ov) ? "<option value='$ov' selected>$td</option>\n" : "<option value='$ov'>$td</option>\n"; } } if ($d_content != "") { $form_element = $this->html->field_dropdown( 'field_'.$row['fid'], $d_content ); } } else if ( $row['ftype'] == 'area' ) { $form_element = $this->html->field_textarea( 'field_'.$row['fid'], $field_data[$row['fid']] ); } else { $form_element = $this->html->field_textinput( 'field_'.$row['fid'], $field_data[$row['fid']] ); } ${$ftype} .= $this->html->field_entry( $row['ftitle'], $row['fdesc'], $form_element ); } //----------------------------------------------- // Format the interest / location boxes //----------------------------------------------- $this->member['location'] = $this->parser->unconvert( $this->member['location'] ); $this->member['interests'] = $this->parser->unconvert( $this->member['interests'] ); $this->member['key'] = $this->md5_check; //----------------------------------------------- // Suck up the HTML and swop some tags if need be //----------------------------------------------- $this->output .= $this->html->personal_panel($this->member); if ( ($ibforums->vars['post_titlechange']) and ($this->member['posts'] > $ibforums->vars['post_titlechange']) ) { $t_html = $this->html->member_title($this->member['title']); $this->output = preg_replace( "/<!--\{MEMBERTITLE\}-->/", $t_html, $this->output ); } $t_html = $this->html->birthday($day, $mon, $year); $this->output = preg_replace( "/<!--\{BIRTHDAY\}-->/", $t_html, $this->output ); //----------------------------------------------- // Add in the custom fields if we need to. //----------------------------------------------- if ($required_output != "") { $this->output = str_replace( "<!--{REQUIRED.FIELDS}-->", $this->html->required_title()."\n".$required_output.$this->html->required_end(), $this->output ); } if ($optional_output != "") { $this->output = str_replace( "<!--{OPTIONAL.FIELDS}-->", "\n".$optional_output, $this->output ); } $this->page_title = $ibforums->lang['t_welcome']; $this->nav = array( "<a href='".$this->base_url."act=UserCP&CODE=00'>".$ibforums->lang['t_title']."</a>" ); } function do_personal() { // Hand it straight to our library to keep this code clean and compact. $this->lib->do_profile(); } Ersetzen durch: //*******************************************************************/ //| PERSONAL: //| //| Displays the personal info form //*******************************************************************/ function personal() { global $ibforums, $DB, $std, $print; //----------------------------------------------- // Check to make sure that we can edit profiles.. //----------------------------------------------- if (empty($ibforums->member['g_edit_profile'])) { $std->Error( array( 'LEVEL' => 1, 'MSG' => 'cant_use_feature' ) ); } //----------------------------------------------- // Format the birthday drop boxes.. //----------------------------------------------- $date = getdate(); $day = "<option value='0'>--</option>"; $mon = "<option value='0'>--</option>"; $year = "<option value='0'>--</option>"; for ( $i = 1; $i < 32; $i++ ) { $day .= "<option value='$i'"; $day .= $i == $this->member['bday_day'] ? "selected>$i</option>" : ">$i</option>"; } for ( $i = 1; $i < 13; $i++ ) { $mon .= "<option value='$i'"; $mon .= $i == $this->member['bday_month'] ? "selected>{$ibforums->lang['month'.$i]}</option>" : ">{$ibforums->lang['month'.$i]}</option>"; } $i = $date['year'] - 1; $j = $date['year'] - 100; for ( $i; $j < $i; $i-- ) { $year .= "<option value='$i'"; $year .= $i == $this->member['bday_year'] ? "selected>$i</option>" : ">$i</option>"; } //----------------------------------------------- // Format the interest / location boxes //----------------------------------------------- $this->member['location'] = $this->parser->unconvert( $this->member['location'] ); $this->member['interests'] = $this->parser->unconvert( $this->member['interests'] ); $this->member['key'] = $this->md5_check; //----------------------------------------------- // Suck up the HTML and swop some tags if need be //----------------------------------------------- $this->output .= $this->html->personal_panel($this->member); if ( ($ibforums->vars['post_titlechange']) and ($this->member['posts'] > $ibforums->vars['post_titlechange']) ) { $t_html = $this->html->member_title($this->member['title']); $this->output = preg_replace( "/<!--\{MEMBERTITLE\}-->/", $t_html, $this->output ); } $t_html = $this->html->birthday($day, $mon, $year); $this->output = preg_replace( "/<!--\{BIRTHDAY\}-->/", $t_html, $this->output ); $this->page_title = $ibforums->lang['t_welcome']; $this->nav = array( "<a href='".$this->base_url."act=UserCP&CODE=00'>".$ibforums->lang['t_title']."</a>" ); } function do_personal() { // Hand it straight to our library to keep this code clean and compact. $this->lib->do_profile(); } //*******************************************************************/ //| Custom PERSONAL: //| //| Displays the personal info form //*******************************************************************/ function custom_personal() { global $ibforums, $DB, $std, $print; //----------------------------------------------- // Check to make sure that we can edit profiles.. //----------------------------------------------- if (empty($ibforums->member['g_edit_profile'])) { $std->Error( array( 'LEVEL' => 1, 'MSG' => 'cant_use_feature' ) ); } //----------------------------------------------- // Custom profile fields stuff //----------------------------------------------- $required_output = ""; $optional_output = ""; $field_data = array(); $DB->query("SELECT * from ibf_pfields_content WHERE member_id='".$ibforums->member['id']."'"); while ( $content = $DB->fetch_row() ) { foreach($content as $k => $v) { if ( preg_match( "/^field_(\d+)$/", $k, $match) ) { $field_data[ $match[1] ] = $v; //break; } } } $DB->query("SELECT * from ibf_pfields_data WHERE fedit=1 ORDER BY forder"); while( $row = $DB->fetch_row() ) { $form_element = ""; if ( $row['freq'] == 1 ) { $ftype = 'required_output'; } else { $ftype = 'optional_output'; } if ( $row['ftype'] == 'drop' ) { $carray = explode( '|', trim($row['fcontent']) ); $d_content = ""; foreach( $carray as $entry ) { $value = explode( '=', $entry ); $ov = trim($value[0]); $td = trim($value[1]); if ($ov !="" and $td !="") { $d_content .= ($field_data[$row['fid']] == $ov) ? "<option value='$ov' selected>$td</option>\n" : "<option value='$ov'>$td</option>\n"; } } if ($d_content != "") { $form_element = $this->html->field_dropdown( 'field_'.$row['fid'], $d_content ); } } else if ( $row['ftype'] == 'area' ) { $form_element = $this->html->field_textarea( 'field_'.$row['fid'], $field_data[$row['fid']] ); } else { $form_element = $this->html->field_textinput( 'field_'.$row['fid'], $field_data[$row['fid']] ); } ${$ftype} .= $this->html->field_entry( $row['ftitle'], $row['fdesc'], $form_element ); } $this->member['key'] = $this->md5_check; //----------------------------------------------- // Suck up the HTML and swop some tags if need be //----------------------------------------------- $this->output .= $this->html->custom_personal_panel($this->member); //----------------------------------------------- // Add in the custom fields if we need to. //----------------------------------------------- if ($required_output != "") { $this->output = str_replace( "<!--{REQUIRED.FIELDS}-->", $this->html->required_title()."\n".$required_output.$this->html->required_end(), $this->output ); } if ($optional_output != "") { $this->output = str_replace( "<!--{OPTIONAL.FIELDS}-->", "\n".$optional_output, $this->output ); } $this->page_title = $ibforums->lang['t_welcome']; $this->nav = array( "<a href='".$this->base_url."act=UserCP&CODE=00'>".$ibforums->lang['t_title']."</a>" ); } function do_custom_personal() { // Hand it straight to our library to keep this code clean and compact. $this->lib->do_custom_profile(); } Teil 2 folgt sofort, da ich sonst hier mit der Textbox durcheinander komme. ;) Share this post Link to post
Stefan 0 Report post Posted December 27, 2003 Teil 2: Datei usercp_functions.php Suchen: function do_profile() { global $ibforums, $DB, $std, $print, $HTTP_POST_VARS; //---------------------------------- // Check for bad entry //---------------------------------- if ($HTTP_POST_VARS['act'] == "") { $std->Error( array( 'LEVEL' => 1, 'MSG' => 'complete_form' ) ); } //------------------------------------- // Nawty, Nawty! //------------------------------------- if ($ibforums->input['auth_key'] != $this->class->md5_check ) { $std->Error( array( 'LEVEL' => 1, 'MSG' => 'del_post') ); } //---------------------------------- // Custom profile field stuff //---------------------------------- $custom_fields = array(); $DB->query("SELECT * from ibf_pfields_data WHERE fedit=1"); while ( $row = $DB->fetch_row() ) { if ($row['freq'] == 1) { if ($HTTP_POST_VARS[ 'field_'.$row['fid'] ] == "") { $std->Error( array( 'LEVEL' => 1, 'MSG' => 'complete_form' ) ); } } if ($row['fmaxinput'] > 0) { if (strlen($HTTP_POST_VARS[ 'field_'.$row['fid'] ]) > $row['fmaxinput']) { $std->Error( array( 'LEVEL' => 1, 'MSG' => 'cf_to_long', 'EXTRA' => $row['ftitle'] ) ); } } $custom_fields[ 'field_'.$row['fid'] ] = str_replace( '<br>', "\n", $ibforums->input[ 'field_'.$row['fid'] ] ); } //+-------------------- if ( (strlen($HTTP_POST_VARS['Interests']) > $ibforums->vars['max_interest_length']) and ($ibforums->vars['max_interest_length']) ) { $std->Error( array( 'LEVEL' => 1, 'MSG' => 'int_too_long' ) ); } //+-------------------- if ( (strlen($HTTP_POST_VARS['Location']) > $ibforums->vars['max_location_length']) and ($ibforums->vars['max_location_length']) ) { $std->Error( array( 'LEVEL' => 1, 'MSG' => 'loc_too_long' ) ); } //+-------------------- if (strlen($HTTP_POST_VARS['WebSite']) > 150) { $std->Error( array( 'LEVEL' => 1, 'MSG' => 'web_too_long' ) ); } //+-------------------- if (strlen($HTTP_POST_VARS['Photo']) > 150) { $std->Error( array( 'LEVEL' => 1, 'MSG' => 'photo_too_long' ) ); } //+-------------------- if ( ($HTTP_POST_VARS['ICQNumber']) && (!preg_match( "/^(?:\d+)$/", $HTTP_POST_VARS['ICQNumber'] ) ) ) { $std->Error( array( 'LEVEL' => 1, 'MSG' => 'not_icq_number' ) ); } //---------------------------------- // make sure that either we entered // all calendar fields, or we left them // all blank //---------------------------------- $c_cnt = 0; foreach ( array('day','month','year') as $v ) { if (!empty($ibforums->input[$v])) { $c_cnt++; } } if ( ($c_cnt > 0) and ($c_cnt != 3) ) { $std->Error( array( 'LEVEL' => 1, 'MSG' => 'calendar_not_all' ) ); } if ( ! preg_match( "#^http://#", $ibforums->input['WebSite'] ) ) { $ibforums->input['WebSite'] = 'http://'.$ibforums->input['WebSite']; } //---------------------------------- // Start off our array //---------------------------------- $set = array( 'website' => $ibforums->input['WebSite'], 'icq_number' => $ibforums->input['ICQNumber'], 'aim_name' => $ibforums->input['AOLName'], 'yahoo' => $ibforums->input['YahooName'], 'msnname' => $ibforums->input['MSNName'], 'integ_msg' => $ibforums->input['integ_msg'], 'location' => $ibforums->input['Location'], 'interests' => $ibforums->input['Interests'], 'bday_day' => $ibforums->input['day'], 'bday_month' => $ibforums->input['month'], 'bday_year' => $ibforums->input['year'], ); //---------------------------------- // check to see if we can enter a member title // and if one is entered, update it. //---------------------------------- if ( (isset($ibforums->input['member_title'])) and ( isset($ibforums->vars['post_titlechange']) ) and ( $this->class->member['posts'] >= $ibforums->vars['post_titlechange']) ) { $set['title'] = $ibforums->input['member_title']; } //---------------------------------- // Update the DB //---------------------------------- $set_string = $DB->compile_db_update_string($set); $DB->query("UPDATE ibf_members SET $set_string WHERE id='".$this->class->member['id']."'"); //---------------------------------- // Save the profile stuffy wuffy //---------------------------------- if ( count($custom_fields) > 0 ) { // Do we already have an entry in the content table? $DB->query("SELECT member_id FROM ibf_pfields_content WHERE member_id='".$ibforums->member['id']."'"); $test = $DB->fetch_row(); if ( $test['member_id'] ) { // We have it, so simply update $db_string = $DB->compile_db_update_string($custom_fields); $DB->query("UPDATE ibf_pfields_content SET $db_string WHERE member_id='".$ibforums->member['id']."'"); } else { $custom_fields['member_id'] = $ibforums->member['id']; $db_string = $DB->compile_db_insert_string($custom_fields); $DB->query("INSERT INTO ibf_pfields_content (".$db_string['FIELD_NAMES'].") VALUES(".$db_string['FIELD_VALUES'].")"); } } //-------------------------------------------- // Use sync module? //-------------------------------------------- if ( USE_MODULES == 1 ) { $set['id'] = $ibforums->member['id']; $this->class->modules->register_class(&$this); $this->class->modules->on_profile_update($set, $custom_fields); } // Return us! $print->redirect_screen( $ibforums->lang['profile_edited'], "act=UserCP&CODE=01" ); } Ersetzen durch: function do_profile() { global $ibforums, $DB, $std, $print, $HTTP_POST_VARS; //---------------------------------- // Check for bad entry //---------------------------------- if ($HTTP_POST_VARS['act'] == "") { $std->Error( array( 'LEVEL' => 1, 'MSG' => 'complete_form' ) ); } //------------------------------------- // Nawty, Nawty! //------------------------------------- if ($ibforums->input['auth_key'] != $this->class->md5_check ) { $std->Error( array( 'LEVEL' => 1, 'MSG' => 'del_post') ); } //+-------------------- if ( (strlen($HTTP_POST_VARS['Interests']) > $ibforums->vars['max_interest_length']) and ($ibforums->vars['max_interest_length']) ) { $std->Error( array( 'LEVEL' => 1, 'MSG' => 'int_too_long' ) ); } //+-------------------- if ( (strlen($HTTP_POST_VARS['Location']) > $ibforums->vars['max_location_length']) and ($ibforums->vars['max_location_length']) ) { $std->Error( array( 'LEVEL' => 1, 'MSG' => 'loc_too_long' ) ); } //+-------------------- if (strlen($HTTP_POST_VARS['WebSite']) > 150) { $std->Error( array( 'LEVEL' => 1, 'MSG' => 'web_too_long' ) ); } //+-------------------- if (strlen($HTTP_POST_VARS['Photo']) > 150) { $std->Error( array( 'LEVEL' => 1, 'MSG' => 'photo_too_long' ) ); } //+-------------------- if ( ($HTTP_POST_VARS['ICQNumber']) && (!preg_match( "/^(?:\d+)$/", $HTTP_POST_VARS['ICQNumber'] ) ) ) { $std->Error( array( 'LEVEL' => 1, 'MSG' => 'not_icq_number' ) ); } //---------------------------------- // make sure that either we entered // all calendar fields, or we left them // all blank //---------------------------------- $c_cnt = 0; foreach ( array('day','month','year') as $v ) { if (!empty($ibforums->input[$v])) { $c_cnt++; } } if ( ($c_cnt > 0) and ($c_cnt != 3) ) { $std->Error( array( 'LEVEL' => 1, 'MSG' => 'calendar_not_all' ) ); } if ( ! preg_match( "#^http://#", $ibforums->input['WebSite'] ) ) { $ibforums->input['WebSite'] = 'http://'.$ibforums->input['WebSite']; } //---------------------------------- // Start off our array //---------------------------------- $set = array( 'website' => $ibforums->input['WebSite'], 'icq_number' => $ibforums->input['ICQNumber'], 'aim_name' => $ibforums->input['AOLName'], 'yahoo' => $ibforums->input['YahooName'], 'msnname' => $ibforums->input['MSNName'], 'integ_msg' => $ibforums->input['integ_msg'], 'location' => $ibforums->input['Location'], 'interests' => $ibforums->input['Interests'], 'bday_day' => $ibforums->input['day'], 'bday_month' => $ibforums->input['month'], 'bday_year' => $ibforums->input['year'], ); //---------------------------------- // check to see if we can enter a member title // and if one is entered, update it. //---------------------------------- if ( (isset($ibforums->input['member_title'])) and ( isset($ibforums->vars['post_titlechange']) ) and ( $this->class->member['posts'] >= $ibforums->vars['post_titlechange']) ) { $set['title'] = $ibforums->input['member_title']; } //---------------------------------- // Update the DB //---------------------------------- $set_string = $DB->compile_db_update_string($set); $DB->query("UPDATE ibf_members SET $set_string WHERE id='".$this->class->member['id']."'"); //-------------------------------------------- // Use sync module? //-------------------------------------------- if ( USE_MODULES == 1 ) { $set['id'] = $ibforums->member['id']; $this->class->modules->register_class(&$this); $this->class->modules->on_profile_update($set, $custom_fields); } // Return us! $print->redirect_screen( $ibforums->lang['profile_edited'], "act=UserCP&CODE=01" ); } function do_custom_profile() { global $ibforums, $DB, $std, $print, $HTTP_POST_VARS; //---------------------------------- // Check for bad entry //---------------------------------- if ($HTTP_POST_VARS['act'] == "") { $std->Error( array( 'LEVEL' => 1, 'MSG' => 'complete_form' ) ); } //------------------------------------- // Nawty, Nawty! //------------------------------------- if ($ibforums->input['auth_key'] != $this->class->md5_check ) { $std->Error( array( 'LEVEL' => 1, 'MSG' => 'del_post') ); } //---------------------------------- // Custom profile field stuff //---------------------------------- $custom_fields = array(); $DB->query("SELECT * from ibf_pfields_data WHERE fedit=1"); while ( $row = $DB->fetch_row() ) { if ($row['freq'] == 1) { if ($HTTP_POST_VARS[ 'field_'.$row['fid'] ] == "") { $std->Error( array( 'LEVEL' => 1, 'MSG' => 'complete_form' ) ); } } if ($row['fmaxinput'] > 0) { if (strlen($HTTP_POST_VARS[ 'field_'.$row['fid'] ]) > $row['fmaxinput']) { $std->Error( array( 'LEVEL' => 1, 'MSG' => 'cf_to_long', 'EXTRA' => $row['ftitle'] ) ); } } $custom_fields[ 'field_'.$row['fid'] ] = str_replace( '<br>', "\n", $ibforums->input[ 'field_'.$row['fid'] ] ); } //---------------------------------- // Save the profile stuffy wuffy //---------------------------------- if ( count($custom_fields) > 0 ) { // Do we already have an entry in the content table? $DB->query("SELECT member_id FROM ibf_pfields_content WHERE member_id='".$ibforums->member['id']."'"); $test = $DB->fetch_row(); if ( $test['member_id'] ) { // We have it, so simply update $db_string = $DB->compile_db_update_string($custom_fields); $DB->query("UPDATE ibf_pfields_content SET $db_string WHERE member_id='".$ibforums->member['id']."'"); } else { $custom_fields['member_id'] = $ibforums->member['id']; $db_string = $DB->compile_db_insert_string($custom_fields); $DB->query("INSERT INTO ibf_pfields_content (".$db_string['FIELD_NAMES'].") VALUES(".$db_string['FIELD_VALUES'].")"); } } // Return us! $print->redirect_screen( $ibforums->lang['profile_edited'], "act=UserCP&CODE=60" ); } So, letztes Posting enthält dann die Skinänderungen. ;) Share this post Link to post
Stefan 0 Report post Posted December 27, 2003 So, nun noch die Skinänderungen. Datei skin_ucp.php In der Funktion personal_panel kannst du die beiden Zeilen <!--{REQUIRED.FIELDS}--> und <!--{OPTIONAL.FIELDS}--> entfernen. Nun noch vor } ?> folgendes einfügen function custom_personal_panel($Profile) { global $ibforums; return <<<EOF <form action="{$ibforums->base_url}auth_key={$Profile['key']}" method="post" name='theForm'> <input type='hidden' name='act' value='UserCP' /> <input type='hidden' name='CODE' value='61' /> <!--{REQUIRED.FIELDS}--> <div class='pformstrip'>{$ibforums->lang['profile_title']}</div> <table width='100%'> <!--{OPTIONAL.FIELDS}--> <tr> <td class='pformstrip' align='center' colspan='2'><input type="submit" value="{$ibforums->lang['submit_profile']}" class='forminput' /></td> </tr> </table> </form> EOF; } Suchen: · <a href='{$base_url}act=UserCP&CODE=photo'>{$ibforums->lang['m_change_photo']}</a><br /> Darunter einfügen: · <a href='{$base_url}act=UserCP&CODE=60'>{$ibforums->lang['mod_custom_profile']}</a><br /> Dann in der Datei lang_ucp.php noch folgendes einfügen: $lang['mod_custom_profile'] = "Wie auch immer du den Menüpunkt nennen willst"; Oder bei anderer Schreibweise des Arrays 'mod_custom_profile' => "Wie auch immer du den Menüpunkt nennen willst", Hab alles ausgiebig getestet und funktioniert bei mir auf dem lokalen Webserver ohne Probleme. :) Share this post Link to post
Fabio 0 Report post Posted December 27, 2003 Thx für die mühe aber irgendwo ist bei mir noch n fehler drin ... denn der neue link im ucp verweist mich auf die ucp startseite und nicht auf die zusätzliche profilseite.... Share this post Link to post
Stefan 0 Report post Posted December 27, 2003 Hast du diese Codezeilen eingefügt? case '60': $this->custom_personal(); break; case '61': $this->do_custom_personal(); break; Share this post Link to post
Fabio 0 Report post Posted December 27, 2003 hmm er hat die veränderde datei bei mir irgendwie nicht gespeichert ... mein fehler p.s. die datei heist nicht UCP.php sondern UserCp.php Share this post Link to post
Stefan 0 Report post Posted December 27, 2003 p.s. die datei heist nicht UCP.php sondern UserCp.php Ja, so Fehler können passieren, wenn man mich hetzt. Aber du hast ja anscheinend doch die richtige Datei gefunden und solange der geänderte Quelltext funktioniert, sollte man mir den Irrtum verzeihen. :P Share this post Link to post
Fabio 0 Report post Posted December 27, 2003 sry ich wollte dich nicht hetzen.. Aber nochmal danke für deine hilfe Share this post Link to post