Ich schnick das iwie net, hab nun schon nen halben tag rmprobiert, ich poste hier etz mal den code und hoffe das mir jemand des rätsels lösung übermittelt^^
##
###
####
##### UserRang ermitteln
function userrang ($post,$uid) {
global $global_user_rang_array, $allgAr;
if (!isset($global_user_rang_array[$uid])) {
if (!isset($global_user_rang_array)) {
$global_user_rang_array = array();
}
$sql = "SELECT * FROM `prefix_ranks` WHERE `bez` LIKE '" . $allgAr['SR_GRB'] . "' LIMIT 1";
$query = db_query($sql);
$GuestRank = !$query || db_num_rows($query) === 0 ? false : db_fetch_assoc($query);
$GuestName = empty($allgAr['SR_GRB']) ? 'Gast' : $allgAr['SR_GRB'];
$get_rRang = $GuestRank;
if ( empty($uid) ) {
$rRang = $GuestName;
$Guest = true;
if ( is_array($GuestRank) ) {
$rRang = '<span class="' . str_replace(' ', '_', $rRang) . '"' . ( !empty($GuestRank['color']) && $allgAr['SR_C'] == 0 ? ' style="color: ' . $GuestRank['color'] . ';"' : '' ) . '>' . $rRang . '</span>';
}
if ( is_array($GuestRank) && !empty($GuestRank['rimg']) ) {
$rRang .= '<br />' . '<img src="' . $GuestRank['rimg'] . '" />';
}
} else {
$get_rRang = db_fetch_assoc(db_query("SELECT bez, rimg, color FROM prefix_user LEFT JOIN prefix_ranks ON prefix_ranks.id = prefix_user.spezrank WHERE prefix_user.id = ".$uid),0);
$rRang = '<span class="' . str_replace(' ', '_', $get_rRang['bez']) . '"' . ( !empty($get_rRang['color']) && $allgAr['SR_C'] == 0 ? ' style="color: ' . $get_rRang['color'] . ';"' : '' ) . '>' . $get_rRang['bez'] . '</span>';
if ( !empty($get_rRang['rimg']) ) {
$rRang .= '<br />' . '<img src="' . $get_rRang['rimg'] . '" />';
}
}
if ( empty($rRang) ) {
$post = ( $post == 0 ? 1 : $post );
$get_rRang = db_fetch_assoc(db_query("SELECT * FROM `prefix_ranks` WHERE spez = 0 AND min <= ".$post." ORDER BY min DESC LIMIT 1"),0);
$rRang = '<span class="' . str_replace(' ', '_', $get_rRang['bez']) . '"' . ( !empty($get_rRang['color']) ? ' style="color: ' . $get_rRang['color'] . ';"' : '' ) . '>' . $get_rRang['bez'] . '</span>';
if ( !empty($get_rRang['rimg']) ) {
$rRang .= '<br />' . '<img src="' . $get_rRang['rimg'] . '" />';
}
} elseif ( $rRang != $GuestName && !isset($Guest) ) {
$rRang = '<i><b>'.$rRang.'</b></i>';
}
$global_user_rang_array[$uid] = $rRang;
}
return ($global_user_rang_array[$uid]);
}
Danke schonmal
Zuletzt modifiziert von Arikarion am 24.10.2011 - 15:45:13