"") { $sql="SELECT name,login,clanrank FROM ".db_prefix("accounts")." WHERE acctid=$whoacctid LIMIT 1"; $result=db_query($sql); $row=db_fetch_assoc($result); $who = $row['login']; $whoname = $row['name']; if ($setrank>""){ $args = modulehook("clan-setrank", array("setrank"=>$setrank, "login"=>$who, "name"=>$whoname, "acctid"=>$whoacctid, "clanid"=>$session['user']['clanid'], "oldrank"=>$row['clanrank'])); if (!(isset($args['handled']) && $args['handled'])) { $sql = "UPDATE " . db_prefix("accounts") . " SET clanrank=GREATEST(0,least({$session['user']['clanrank']},$setrank)) WHERE login='$who'"; db_query($sql); debuglog("Player {$session['user']['name']} changed rank of {$whoname} to {$setrank}.", $whoacctid); } } } $remove = httpget('remove'); if ($remove>""){ $sql = "SELECT name,login,clanrank FROM " . db_prefix("accounts") . " WHERE acctid='$remove'"; $row = db_fetch_assoc(db_query($sql)); $args = modulehook("clan-setrank", array("setrank"=>0, "login"=>$row['login'], "name"=>$row['name'], "acctid"=>$remove, "clanid"=>$session['user']['clanid'], "oldrank"=>$row['clanrank'])); $sql = "UPDATE " . db_prefix("accounts") . " SET clanrank=".CLAN_APPLICANT.",clanid=0,clanjoindate='0000-00-00 00:00:00' WHERE acctid='$remove' AND clanrank<={$session['user']['clanrank']}"; db_query($sql); debuglog("Player {$session['user']['name']} removed player {$row['login']} from {$claninfo['clanname']}.", $remove); //delete unread application emails from this user. //breaks if the applicant has had their name changed via //dragon kill, superuser edit, or lodge color change require_once("lib/safeescape.php"); $subj = safeescape(serialize(array($apply_short, $row['name']))); $sql = "DELETE FROM " . db_prefix("mail") . " WHERE msgfrom=0 AND seen=0 AND subject='$subj'"; db_query($sql); } $sql = "SELECT name,login,acctid,clanrank,laston,clanjoindate,dragonkills,level FROM " . db_prefix("accounts") . " WHERE clanid={$claninfo['clanid']} ORDER BY clanrank DESC ,dragonkills DESC,level DESC,clanjoindate"; $result = db_query($sql); rawoutput("
$rank | $name | $lev | $dk | $jd | $lo | ".($session['user']['clanrank']>CLAN_MEMBER?"$ops | ":"")."
"); output_notl($ranks[$row['clanrank']]); rawoutput(" | "); $link = "bio.php?char=".$row['acctid']."&ret=".urlencode($_SERVER['REQUEST_URI']); rawoutput("", true); addnav("", $link); output_notl("`&%s`0", $row['name']); rawoutput(""); rawoutput(" | "); output_notl("`^%s`0",$row['level']); rawoutput(" | "); output_notl("`\$%s`0",$row['dragonkills']); rawoutput(" | "); output_notl("`3%s`0",$row['clanjoindate']); rawoutput(" | "); output_notl("`#%s`0",reltime(strtotime($row['laston']))); rawoutput(" | "); if ($session['user']['clanrank']>CLAN_MEMBER){ rawoutput("");
if ($row['clanrank']<$session['user']['clanrank'] && $row['clanrank'] | ");
}
rawoutput("