Das ist jetzt alles was bei mir dort drin steht:
<?php
# Copyright by Manuel Staechele
# 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) {
$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)) {
echo '<label style="float:left; width:35%;">'.$r['show'].'</label><input type="text" name="profilefields['.$r['id'].']" value="'.$r['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 Zeit ALLE Felder die der Benutzer im Adminbereich unter
# Profilefields sortieren kann an ... is eigentlich total easy ;-)...
function profilefields_show ($uid) {
$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 FROM prefix_profilefields WHERE func < 4 ORDER BY pos");
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 );
$l .= '<tr><td height="25" width="28%">'.$r['show'].'</td><td height="25">'.$str.'</td></tr>';
} elseif ( $r['func'] == 2 && $r['show'] !== "Kontakt" ) {
$l .= '<tr><td colspan="2" height="25" width=\"300\" style="padding-left:5px;"><u><b>• '.$r['show'].'</u></b></td></tr>';
} 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 );
}
}
}
return ( $l );
}
function profilefields_show_spez_posten ($value,$uid) {
global $lang;
return ( profilefields_show_echo_standart ( $lang['posten'], ((!empty($value) AND file_exists('include/images/profilmod/posten/'.$value))?'<img src="include/images/profilmod/posten/'.$value.'" alt="'.$value.'" title="'.$value.'" />':'') ) );
}
function profilefields_show_spez_clanlogo ($value,$uid) {
global $lang;
return ( profilefields_show_echo_standart ( $lang['clanlogo'], ((!empty($value) AND file_exists('include/images/profilmod/clanlogos/'.$value))?'<img src="include/images/profilmod/clanlogos/'.$value.'" alt="'.$value.'" title="'.$value.'" />':'') ) );
}
function profilefields_show_spez_cpubild ($value,$uid) {
global $lang;
return ( profilefields_show_echo_standart ( $lang['cpubild'], ((!empty($value) AND file_exists('include/images/profilmod/cpubild/'.$value))?'<img src="include/images/profilmod/cpubild/'.$value.'" alt="'.$value.'" title="'.$value.'" />':'') ) );
}
function profilefields_show_spez_gpubild ($value,$uid) {
global $lang;
return ( profilefields_show_echo_standart ( $lang['gpubild'], ((!empty($value) AND file_exists('include/images/profilmod/grafikbild/'.$value))?'<img src="include/images/profilmod/grafikbild/'.$value.'" alt="'.$value.'" title="'.$value.'" />':'') ) );
}
# hier kommen die speziellen funktionen hin...
##
###
function profilefields_show_spez_geschlecht ($value,$uid) {
global $lang;
$ar = array ( 0 => $lang['itdoesntmatter'], 1 => $lang['male'], 2 => $lang['female'] );
return ( profilefields_show_echo_standart ( $lang['sex'], $ar[$value] ) );
}
function profilefields_show_spez_status ($value,$uid) {
global $lang;
return ( profilefields_show_echo_standart ( $lang['status'], ($value?'aktiv':'inaktiv') ) );
}
function profilefields_show_spez_usergallery ($value,$uid) {
global $allgAr, $lang;
if ($allgAr['forum_usergallery'] == 1) {
return ( profilefields_show_echo_standart ( 'Usergallery', '<a href="index.php?user-usergallery-'.$uid.'">ansehen</a>' ) );
}
}
function profilefields_show_spez_homepage ($value,$uid) {
global $lang;
return ( profilefields_show_echo_standart ( $lang['homepage'], (empty($value)?'':'<a href="'.$value.'" target="_blank">'.$value.'</a>') ) );
}
function profilefields_show_spez_opt_mail ($value,$uid) {
global $lang;
return ( profilefields_show_echo_standart ( $lang['mail'], ($value?'<a href="index.php?user-mail-'.$uid.'">'.$lang['send'].'</a>':'') ) );
}
function profilefields_show_spez_opt_pm ($value,$uid) {
global $lang;
return ( profilefields_show_echo_standart ( $lang['privatemessages'], ($value?'<a href="index.php?forum-privmsg-new=0&empfid='.$uid.'">'.$lang['send'].'</a>':'') ) );
}
function profilefields_show_spez_sig ($value,$uid) {
global $lang;
return ( profilefields_show_echo_standart ( $lang['signature'], bbcode($value) ) );
}
function profilefields_show_spez_staat ($value,$uid) {
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.'" />':'') ) );
}
###
##
# help funcs
function get_nationality_array () {
$ar = array();
$br = array(); $br['na.gif'] = 'na.gif';
$o = opendir ( 'include/images/flags' );
while ( $f = readdir ( $o ) ) {
if ( $f != '.' AND $f != '..' ) {
$ar[$f] = $f;
$ar[$f] = ereg_replace(".gif","",$ar[$f]);
}
}
asort ($ar);
$ar = array_merge ( $br, $ar );
return ( $ar );
}
function get_clanlogo_array () {
$ar = array();
$o = opendir ( 'include/images/profilmod/clanlogos' );
while ( $f = readdir ( $o ) ) {
if ( $f != '.' AND $f != '..' ) {
$ar[$f] = $f;
}
}
return ( $ar );
}
function get_cpubild_array () {
$ar = array();
$o = opendir ( 'include/images/profilmod/cpubild' );
while ( $f = readdir ( $o ) ) {
if ( $f != '.' AND $f != '..' ) {
$ar[$f] = $f;
}
}
return ( $ar );
}
function get_gpubild_array () {
$ar = array();
$o = opendir ( 'include/images/profilmod/grafikbild' );
while ( $f = readdir ( $o ) ) {
if ( $f != '.' AND $f != '..' ) {
$ar[$f] = $f;
}
}
return ( $ar );
}
function get_posten_array () {
$ar = array();
$o = opendir ( 'include/images/profilmod/posten' );
while ( $f = readdir ( $o ) ) {
if ( $f != '.' AND $f != '..' ) {
$ar[$f] = $f;
}
}
return ( $ar );
}
function profilefields_show_spez_freunde ($value, $uid) {
$dif = date('Y-m-d H:i:s', time() - 60);
$sql = db_query("SELECT a.fid as aktfid, b.id, b.name, b.staat, IF(c.uptime > '$dif','online','offline') as status
FROM `prefix_friends` a
LEFT JOIN `prefix_user` b ON a.fid = b.id
LEFT JOIN `prefix_online` c ON a.fid = c.uid AND c.sid = (SELECT sid FROM `prefix_online` WHERE uid = aktfid ORDER BY uptime DESC LIMIT 1)
WHERE a.uid = $uid ORDER BY status DESC");
if (db_num_rows($sql) > 0) {
$content = '<table class="border" cellspacing="1" cellpadding="1" border="0" width="100%">';
while ($r = db_fetch_object($sql)) {
if (!empty($r->staat) AND file_exists('include/images/flags/' . $r->staat)) {
$flagg = '<img src="include/images/flags/' . $r->staat . '" alt="' . $r->staat . '" border="0">';
} else {
$flagg = '';
}
$flag = '<img src="include/images/icons/' . $r->status . '.gif" alt="' . $r->status . '" title="' . $r->status . '" border="0" />' . $flagg;
$content .= '<tr class="Cmite"><td>' . $flag . ' <a href="index.php?user-details-' . $r->id . '">' . $r->name . '</a></td></tr>';
}
$content .= '</table>';
} else {
$content = '';
}
return profilefields_show_echo_standart ('Freunde' , $content);
};
function profilefields_show_echo_standart ( $k, $v ) {
return ( '<tr><td class="Cmite">'.$k.'</td><td class="Cnorm">'.$v.'</td></tr>' );
}
?>
! Bitte Code im vorgesehenen Tag [code] setzen. Siehe
über dem Eingabefeld.
BBCode Hilfe. Gruß Lord|S.
!
Zuletzt modifiziert von Lord|Schirmer am 05.01.2013 - 00:47:30