MAX_CHARS_CLANSIGN) {
return 'Clanzeichen sind ungültig: Summe aus beiden Teilen darf nicht größer als '.MAX_CHARS_CLANSIGN.' Zeichen sein!';
}
db_query('UPDATE clan SET clanz_pre = \''.$value1.'\', clanz_suff = \''.$value2.'\' where id = '.$clanid);
return NULL;
case 'Banner':
db_query('UPDATE clan SET banner = \''.$value1.'\' where id = '.$clanid);
return NULL;
case 'Info':
db_query('UPDATE clan SET Info = \''.$value1.'\' where id = '.$clanid);
return NULL;
case 'Background':
if(isClanBackgroundAvailable($clanid)) { db_query('UPDATE clan SET background = \''.$value1.'\' where id = '.$clanid) ;}
return NULL;
case 'Leadership':
$clan = getClan($clanid);
if($value1 == 0 && $rootlvl == 2){$value1 = 'null';}
else if($rootlvl == 1) { $value1 = $clan['leader']; }
if($value2 == 0){$value2 = 'null';}
// okay, are we allowed to change?? If we have max members, it is not allowed to remove the co_leader
$clan = getClan($clanid);
$members = getClanMembersCount($clanid);
$members_max = getMaximumMembers($clan['id']);
if($members_max == $members && $clan['leader'] != $clan['co_leader'] && ($value1 == $value2 || $value2 == 'null')) {
// Okay, actually there are the max amount of users in the clan
// it is now not possible to change to a leader only clan!!
return 'Es ist nicht möglich den Co-Leader zu ändern, da der clan die maximale Anzahl Member besitzt!';
}
if($rootlvl == 1){ // the co leader may only set the co leader XD
$sql = 'UPDATE clan SET co_leader = '.$value2.' where id = '.$clanid;
//echo $sql.' ';
db_query($sql);
} else if($rootlvl == 2) { // the leader may set the leader and the co leader
$sql = 'UPDATE clan SET leader = '.$value1.', co_leader = '.$value2.' where id = '.$clanid;
// echo $sql.' ';
db_query($sql);
}
return NULL;
case 'Member':
// okay, now apply the changes!! --> first filter the values of value2 that are in value1
$value2 = array_diff($value2, $value1);
$clan = getClan($clanid);
// now kick some asses ;)
foreach($value1 as $member) {
if($clan['leader'] == $member || $clan['coleader'] == $member) {
// we cannot kick the asses of the leaders!!
continue;
}
fireMember($user, $member);
}
updateAuthorizedClanfightCoordinators($clanid, $value2);
displayEdit($what, $clanid, $rootlvl);
return NULL;
default:
return 'Error!';
}
}
function displayEdit($what, $clanid, $rootlvl){
if($rootlvl < 1) {
$content = '