Ich möchte ein Profilfeld anlegen in dem der User ein Link einfügen kann z. B. zu seiner ESL-Player-Seite aber irgendwie funktioniert das nicht.
Wie könnte man so was reallisieren ?
Hier kann eine Notiz zum Merk-Eintrag hinzugefügt werden (optional)
Geschlossen |
function profilefields_show_spez_homepage ($value,$uid) { global $lang; return ( profilefields_show_echo_standart ( $lang['esllink'], (empty($value)?'':'<a href="'.$value.'" target="_blank">'.$value.'</a>') ) ); }eingefügt.
if ( empty ($_POST['submit']) ) { $design->header(); $abf = 'SELECT email,wohnort,homepage,esllink,aim,msn,icq,yahoo,avatar,status,staat,gebdatum,sig,opt_pm_popup,opt_pm,opt_mail,geschlecht,spezrank FROM `prefix_user` WHERE id = "'.$_SESSION['authid'].'"';und den
# statische felder speichern db_query("UPDATE prefix_user SET homepage = '".get_homepage(escape($_POST['homepage'], 'string'))."', esllink = '".get_homepage(escape($_POST['esllink'], 'string'))."', wohnort = '".escape($_POST['wohnort'], 'string')."', icq = '".escape($_POST['icq'], 'string')."', msn = '".escape($_POST['msn'], 'string')."', yahoo = '".escape($_POST['yahoo'], 'string')."', ".$avatar_sql_update." aim = '".escape($_POST['aim'], 'string')."', staat = '".escape($_POST['staat'], 'string')."', geschlecht = '".escape($_POST['geschlecht'], 'string')."', status = '".escape($_POST['status'], 'string')."', opt_mail = '".escape($_POST['opt_mail'], 'string')."', opt_pm = '".escape($_POST['opt_pm'], 'string')."', opt_pm_popup = '".escape($_POST['opt_pm_popup'], 'string')."', gebdatum = '".get_datum(escape($_POST['gebdatum'], 'string'))."', sig = '".substr(escape($_POST['sig'], 'string'),0,$allgAr['forum_max_sig'])."' WHERE id = ".$_SESSION['authid'] );ergänzt
function profilefields_show_spez_esllink ($value,$uid) { return ( profilefields_show_echo_standart ( 'Link zum ESL Profil', (empty($value)?'':'<a href="'.$value.'" target="_blank">'.$value.'</a>') ) ); }
if ( $r['func'] == 1 ) { $str = @db_result ( db_query ("SELECT val FROM prefix_userfields WHERE uid = ".$uid." AND fid = ".$r['id']) , 0 ); $l .= '<tr><td class="Cmite">'.$r['show'].'</td><td class="Cnorm">'.$str.'</td></tr>'; } elseif ( $r['func'] == 2 ) {folgenden Code verwenden
if ( $r['func'] == 1 ) { $str = @db_result ( db_query ("SELECT val FROM prefix_userfields WHERE uid = ".$uid." AND fid = ".$r['id']) , 0 ); if ( function_exists ( 'profilefields_show_spez_'.$r['show'] ) ) { $l .= call_user_func ( 'profilefields_show_spez_'.$r['show'], $str, $uid ); } else { $l .= '<tr><td class="Cmite">'.$r['show'].'</td><td class="Cnorm">'.$str.'</td></tr>'; } } elseif ( $r['func'] == 2 ) {
function profilefields_show_spez_esllink ($value,$uid) { return ( profilefields_show_echo_standart ( 'Link zum ESL Profil', (empty($value)?'':'<a href="'.((substr($value,0,7) == 'http://' ? '':'http://').$value.'" target="_blank">'.$value.'</a>') ) ); }
<?php # Copyright by Manuel # Support www.ilch.de defined ('main') or die ( 'no direct access' ); function profilefields_functions2 () { $ar = array ( 1 => 'Feld', 2 => 'Kategorie' ); return ($ar); } function profilefields_functions () { $ar = array ( 1 => 'Feld', 2 => 'Kategorie', 3 => 'Angezeigt', 4 => 'Versteckt' ); return ($ar); } # Felder zum aendern anzeigen. function profilefields_change ($uid) { $i = 0; $i1 = 1; $test = false; $q = db_query("SELECT id, `show`, val, func FROM prefix_profilefields LEFT JOIN prefix_userfields ON prefix_userfields.fid = prefix_profilefields.id AND prefix_userfields.uid = ".$uid." WHERE func != 3 ORDER BY pos ASC"); while ( $r = db_fetch_assoc($q)) { $check[$i1] = $r; if($i){ if($check[$i]['func'] == 1){echo '<label style="float:left; width:40%;">'.$check[$i]['show'].'</label><input type="text" name="profilefields['.$check[$i]['id'].']" value="'.$check[$i]['val'].'"><br />';} if($check[$i]['func'] == 2){ if($check[$i1]['func'] == 1){ if($test){ echo '</fieldset>'; }else{$test = true;} echo '<fieldset><legend>'.$check[$i]['show'].'</legend> <br />'; } } } $i++; $i1++; } if($check[$i]['func'] == 1){echo '<label style="float:left; width:40%;">'.$check[$i]['show'].'</label><input type="text" name="profilefields['.$check[$i]['id'].']" value="'.$check[$i]['val'].'"><br />';} } # Felder die uebermittelt wurden speichern. function profilefields_change_save ($uid) { $q = db_query("SELECT id, `show`, val FROM prefix_profilefields LEFT JOIN prefix_userfields ON prefix_userfields.fid = prefix_profilefields.id AND prefix_userfields.uid = ".$uid." WHERE func = 1 ORDER BY pos"); while ( $r = db_fetch_assoc($q)) { if ( isset($_REQUEST['profilefields'][$r['id']]) ) { $v = $_REQUEST['profilefields'][$r['id']]; } else { $v = ''; } if ( $r['val'] == '' AND $v != '' ) { db_query("INSERT INTO prefix_userfields (fid,uid,val) VALUES (".$r['id'].",".$uid.",'".$v."')"); } elseif ( $r['val'] != '' AND $v == '' ) { db_query("DELETE FROM prefix_userfields WHERE fid = ".$r['id']." AND uid = ".$uid); } elseif ( $r['val'] != '' AND $v != '' AND $r['val'] != $v ) { db_query("UPDATE prefix_userfields SET val = '".$v."' WHERE fid = ".$r['id']." AND uid = ".$uid); } } } # Diese Funktion Zeigt ALLE Felder die der Benutzer im Adminbereich unter # Profilefields sortieren kann an ... is eigentlich total easy ;-)... function profilefields_show ($uid, $posmind, $posmax, $breite = 70) { if($posmax < $posmind){ return 'Error: falsche werte in den vars $postmind und $postmax!'; } global $allgAr; $zelle = '<td width="'.$breite.'%"'; $l = ''; $a = array (); $q = db_query("SHOW COLUMNS FROM prefix_user"); while ($r = db_fetch_assoc($q)) { $a[$r['Field']] = $r['Field']; } $q = db_query("SELECT id, `show`, func, pos FROM prefix_profilefields WHERE func < 4 AND pos >".$posmind." AND pos <".$posmax." ORDER BY pos ASC") OR die('verdammter mist1'); while ( $r = db_fetch_assoc($q)) { if ( $r['func'] == 1 ) { $str = @db_result ( db_query ("SELECT val FROM prefix_userfields WHERE uid = ".$uid." AND fid = ".$r['id']) , 0 ); if ( function_exists ( 'profilefields_show_spez_'.$r['show'] ) ) { $l .= call_user_func ( 'profilefields_show_spez_'.$r['show'], $str, $uid ); } else { $l .= '<tr><td width="30%" class="Cmite">'.$r['show'].'</td>'.$zelle.' class="Cnorm">'.$str.'</td></tr>'."\n"; } } elseif ( $r['func'] == 2 ) { return 'Achtung: in der funktion profilefields_show in der datei Profilfields.php ist ein fehler aufgetreten. <br> Fehler = Es wurde ein Menutitel angefordert, was aber nicht passieren sollte.'; } elseif ( $r['func'] == 3 ) { $str = ''; if (isset($a[$r['show']])) { $str = @db_result ( db_query ("SELECT `".$r['show']."` FROM prefix_user WHERE id = ".$uid) , 0 ); } if ( function_exists ( 'profilefields_show_spez_'.$r['show'] ) ) { $l .= call_user_func ( 'profilefields_show_spez_'.$r['show'], $str, $uid, $zelle); } elseif ($r['show'] != 'opt_pm_popup') { $l .= '<tr><td width="30%" class="Cmite">'.ucfirst($r['show']).'</td>'.$zelle.' class="Cnorm">'.$str.'</td></tr>'."\n"; } } } return ( $l ); } # hier kommen die speziellen funktionen hin... ## ### function profilefields_show_spez_geschlecht ($value,$uid,$colspan) { global $lang; $ar = array ( 0 => $lang['itdoesntmatter'], 1 => $lang['male'], 2 => $lang['female'] ); return ( profilefields_show_echo_standart ( $lang['sex'], $ar[$value] , $colspan) ); } function profilefields_show_spez_status ($value,$uid,$colspan) { global $lang; return ( profilefields_show_echo_standart ( $lang['status'], ($value?'aktiv':'inaktiv'), $colspan) ); } function profilefields_show_spez_usergallery ($value,$uid,$colspan) { global $allgAr, $lang; if ($allgAr['forum_usergallery'] == 1) { return ( profilefields_show_echo_standart ( 'Usergallery', '<a href="index.php?user-usergallery-'.$uid.'">ansehen</a>', $colspan) ); } } function profilefields_show_spez_homepage ($value,$uid,$colspan) { global $lang; return ( profilefields_show_echo_standart ( $lang['homepage'], (empty($value)?'':'<a href="'.$value.'" target="_blank">'.$value.'</a>'), $colspan) ); } function profilefields_show_spez_ESLTeamLink ($value,$uid) { return ( profilefields_show_echo_standart ( 'ESL Team Link', (empty($value)?'':'<a href="'.$value.'" target="_blank">'.$value.'</a>') ) ); } function profilefields_show_spez_opt_mail ($value,$uid,$colspan) { global $lang; return ( profilefields_show_echo_standart ( $lang['mail'], ($value?'<a href="index.php?user-mail-'.$uid.'">'.$lang['send'].'</a>':''), $colspan) ); } function profilefields_show_spez_opt_pm ($value,$uid,$colspan) { global $lang; return ( profilefields_show_echo_standart ( $lang['privatemessages'], ($value?'<a href="index.php?forum-privmsg-new=0&empfid='.$uid.'">'.$lang['send'].'</a>':''), $colspan) ); } function profilefields_show_spez_sig ($value,$uid,$colspan) { global $lang; return ( profilefields_show_echo_standart ( $lang['signature'], bbcode($value),$colspan) ); } function profilefields_show_spez_staat ($value,$uid,$colspan) { global $lang; return ( profilefields_show_echo_standart ( $lang['state'], ((!empty($value) AND file_exists('include/images/flags/'.$value))?'<img src="include/images/flags/'.$value.'" alt="'.$value.'" title="'.$value.'" />':''), $colspan) ); } function profilefields_show_spez_wohnort ($value,$uid,$colspan) { $mapcname=@db_result ( db_query ("SELECT `cname` FROM prefix_map WHERE uid = ".$uid) , 0 ); if(!empty($mapcname)){$value.=($value=='' ? $mapcname :'').' <a href="?map-uid-'.$uid.'">Karte</a>';} return ( profilefields_show_echo_standart ( 'Wohnort', $value, $colspan ) ); } ### ## # help funcs function get_nationality_array () { $ar = array(); $o = opendir ( 'include/images/flags' ); while ( $f = readdir ( $o ) ) { if ( $f != '.' AND $f != '..' ) { $ar[$f] = $f; } } return ( $ar ); } function profilefields_show_echo_standart ( $k, $v, $colspan ) { return ( '<tr><td width="30%" class="Cmite">'.$k.'</td>'.$colspan.' class="Cnorm">'.$v.'</td></tr>'."\n" ); } ?>
$abf = 'SELECT email,esllink,wohnort,homepage,aim,msn,icq,yahoo,avatar,status,staat,gebdatum,sig,opt_pm_popup,opt_pm,opt_mail,geschlecht,spezrank FROM `prefix_user` WHERE id = "'.$_SESSION['authid'].'"';
esllink= '".get_homepage(escape($_POST['esllink'], 'string'))."',
Geschlossen | ||
Zurück zu Allgemein |