Suggestion: Admin ideas:
- bjornredtail
- Warbands Admin
- Posts: 821
- Joined: Tue Apr 20, 2004 12:07 am
- Contact:
Idea 1: A lookup player stats script. Would make administration life a bit easier, as I wouldn't have to open MySQL admin to look up stats.
0===)=B=j=o=r=n==R=e=d=t=a=i=l==>
Warbands Admin
"Program testing can be used to show the presence of bugs, but never to show their absence!"-Edsger W. Dijkstra
Warbands Admin
"Program testing can be used to show the presence of bugs, but never to show their absence!"-Edsger W. Dijkstra
quick and dirty hack
i know the code is the most disgusting abuse of copypaste spaghetti code ever to walk the face of this earth.. stfu already
/look0.php
/templates/prom/look0.html
i know the code is the most disgusting abuse of copypaste spaghetti code ever to walk the face of this earth.. stfu already
/look0.php
code: Select all
<?
include("header.php");
if ($users[disabled] != 2) TheEnd("");
if ($do_look) {
$users=loadUser($msg_dest);
$urace = loadRace($users[race]);
require_once('load_eras.php');
$uera = loadEra($users['era']);
$uclan = loadClan($users[clan]);
$ctags = loadClanTags();
//print_r($ctags);
if ($users[offtotal]) {
  $offsuccpercent = round($users[offsucc]/$users[offtotal]*100);
} else {
  $offsuccpercent = 0;
}
if ($users[deftotal]) {
  $defsuccpercent = round($users[defsucc]/$users[deftotal]*100);
} else {
  $defsuccpercent = 0;
}
$warquery_array = array();
$warquery = "SELECT num, empire, land, disabled, clan FROM $playerdb WHERE land>0 AND disabled != 3 AND land>0 ORDER BY num";
$warquery_result = @mysql_query($warquery);
while ($wardrop = @mysql_fetch_array($warquery_result)) {
$color = "normal";
if ($wardrop[num] == $users[num])
$color = "self";
elseif ($wardrop[land] == 0)
$color = "dead";
elseif ($wardrop[disabled] == 2)
$color = "admin";
elseif ($wardrop[disabled] == 3)
$color = "disabled";
elseif (($users[clan]) && ($wardrop[clan] == $users[clan]))
$color = "ally";
$warquery_array[] = array('num' => $wardrop['num'], 'color' => $color, 'name' => $wardrop['empire']);
}
$succpoint = 5;
$failpoint = 2;
$offexp = (($users[offsucc] * $succpoint) + (($users[offtotal] - $users[offsucc]) * $failpoint)) / (1000 * $succpoint);
$defexp = (($users[defsucc] * $succpoint) + (($users[deftotal] - $users[defsucc]) * $failpoint)) / (1000 * $succpoint);
$experience = floor($offexp*1000)+floor($defexp*1000);
$offpts = ($users[troop0] * $uera[o_troop0]) + ($users[troop1] * $uera[o_troop1]) + ($users[troop2] * $uera[o_troop2]) + ($users[troop3] * $uera[o_troop3]);
$defpts = ($users[troop0] * $uera[d_troop0]) + ($users[troop1] * $uera[d_troop1]) + ($users[troop2] * $uera[d_troop2]) + ($users[troop3] * $uera[d_troop3]);
$offpts = round($offpts * $urace[offense]);
$defpts = round(($defpts + ($users[towers] * $config[towers])) * $urace[defense]);
$size = calcSizeBonus($users[networth]);
$foodpro = round((5 * $users[freeland]) + ($users[farms] * 75) * $urace[farms]);
$foodcon = round((($users[troop0] * .05) + ($users[troop1] * .03) + ($users[troop2] * .02) + ($users[troop3] * .01) + ($users[wizards] * .25)) * $urace[food]);
        if($users['hero_peace'] == 3)
            $foodcon += ($users[peasants] * .004);
        else
            $foodcon += ($users[peasants] * .01);
        if ($users['hero_peace'] == 1)              // Demeter?
            $foodpro = round(1.5 * $foodpro);
$foodnet = $foodpro - $foodcon;
if ($users[clan])
$uclan = loadClan($users[clan]);
else $uclan[ally1] = $uclan[ally2] = $uclan[ally3] = $uclan[war1] = $uclan[war2] = $uclan[war3] = 0;
$income = round(((pci($users,$urace) * ($users[tax] / 100) * ($users[health] / 100) * $users[peasants]) + ($users[shops] * 500)) / $size);
$loanpayment = round($users[loan] / 200);
$expenses = round(($users[troop0] * 1) + ($users[troop1] * 2.5) + ($users[troop2] * 4) + ($users[troop3] * 7) + ($users[land] * 8));
$expbonus = round($expenses * ($urace[costs] - ($users[barracks] / $users[land])));
if ($expbonus > $expenses / 2)   // expenses bonus limit
$expbonus = round($expenses / 2);
$expenses -= $expbonus;
$netincome = $income - $expenses;
$savrate = $config[savebase] - $size;
$loanrate = $config[loanbase] + $size;
// All the stuff to be commas()'ed
$users[turnsused] = commas($users[turnsused]);
$users[cash] = commas($users[cash]);
$users[networth] = commas($users[networth]);
$users[peasants] = commas($users[peasants]);
$foodpro = commas($foodpro);
$foodcon = commas($foodcon);
$users[shops] = commas($users[shops]);
$users[homes] = commas($users[homes]);
$users[industry] = commas($users[industry]);
$users[barracks] = commas($users[barracks]);
$users[labs] = commas($users[labs]);
$users[farms] = commas($users[farms]);
$users[towers] = commas($users[towers]);
$users[freeland] = commas($users[freeland]);
$income = commas($income);
$expenses = commas($expenses);
$loanpayment = commas($loanpayment);
$users[savings] = commas($users[savings]);
$users[loan] = commas($users[loan]);
$users[troop0] = commas($users[troop0]);
$users[troop1] = commas($users[troop1]);
$users[troop2] = commas($users[troop2]);
$users[troop3] = commas($users[troop3]);
$users[wizards] = commas($users[wizards]);
$foodnet = returnCNum($foodnet, "", 0);
$netincome = returnCNum($netincome, "$", 0);
$off_percent = 0;
$def_percent = 0;
$pci = pci($users,$urace);
$uclan = loadClan($users[clan]);
$tags = array($ctags["$users[clan]"], $ctags["$uclan[ally1]"], $ctags["$uclan[ally2]"], $ctags["$uclan[ally3]"], $ctags["$uclan[war1]"], $ctags["$uclan[war2]"], $ctags["$uclan[war3]"], $ctags["$uclan[ally4]"], $ctags["$uclan[ally5]"], $ctags["$uclan[war4]"], $ctags["$uclan[war5]"]);
$z = 0;
while($z<sizeof($tags)) {
if($tags[$z] == "") $tags[$z] = "None";
$z++;
}
//print_r($tags);
if($users[offtotal]) $off_percent = round($users[offsucc]/$users[offtotal]*100);
if($users[deftotal]) $def_percent = round($users[defsucc]/$users[deftotal]*100);
$tpl->assign('uera', $uera);
$tpl->assign('users',$users);
$tpl->assign('urace', $urace);
$tpl->assign('tags', $tags);
$tpl->assign('pci', $pci);
$tpl->assign('foodpro', $foodpro);
$tpl->assign('foodcon', $foodcon);
$tpl->assign('income', $income);
$tpl->assign('expenses', $expenses);
$tpl->assign('loanpayment', $loanpayment);
$tpl->assign('savrate', $savrate);
$tpl->assign('foodnet', $foodnet);
$tpl->assign('netincome', $netincome);
$tpl->assign('loanrate', $loanrate);
$tpl->assign('offpts', commas($offpts));
$tpl->assign('defpts', commas($defpts));
$tpl->assign('experience', $experience);
$tpl->assign('off_percent', $off_percent);
$tpl->assign('def_percent', $def_percent);
$tpl->display('status.html');
$tpl->assign('drop', $warquery_array);
$tpl->assign('prof_target', $prof_target);
$tpl->display('look0.html');
$users=loadUser($users[num]);
}
TheEnd("");
?>
code: Select all
{literal}
<script language="JavaScript">
function updateMsgNames() {
msgnum = document.frmmsg.msg_dest_num.value;
nchanged = true
for (i = 0; i < document.frmmsg.msg_dest.options.length; i++) {
 if (document.frmmsg.msg_dest.options[i].value == msgnum) {
 document.frmmsg.msg_dest.options[i].selected = true;
 nchanged = false;
 }
}
if (nchanged) {
 document.frmmsg.do_message.disabled = true;
} else {
 document.frmmsg.do_message.disabled = false;
}
}
function updateMsgNums() {
document.frmmsg.msg_dest_num.value = document.frmmsg.msg_dest.value;
 document.frmmsg.do_message.disabled = false;
}
</script>
{/literal}
<form method="post" action="{$main}?look0{$authstr}" name="frmmsg">
<div>
lookup: <input type="text" value="{$prof_target}" name="msg_dest_num" size="3" maxlength="4" onChange=" updateMsgNames()">
<select name="msg_dest" onChange="updateMsgNums()" class="dkbg">
{section name=dropsel loop=$drop}
 <option value="{$drop[dropsel].num}" class="m{$drop[dropsel].color}"{if $prof_target == $drop[dropsel].num} selected {/if}>{$drop[dropsel].num} - {$drop[dropsel].name}</option>
{/section}
</select>
<input type="submit" name="do_look" value="sh0e">
</div>
</form>
Shoe, the cussing was un called for...
Formerly LordBrockFreak
http://www.audioscrobbler.com/user/Corban/
"We're closer now than we've ever been to finishing." ~The Beatles
http://www.audioscrobbler.com/user/Corban/
"We're closer now than we've ever been to finishing." ~The Beatles
where did i cuss?Corban wrote: Shoe, the cussing was un called for...
oh.. the acronym?
you have got to be kidding? especially because the use of it was a blatant self humiliating joke?
and stfu is now just a way of saying shut up on the internet?
how can anyone who has spent at least 10% of their life not living in a cave not realize the stfu is just a generically used term that no longer has much meaning as a cuss?
I think its still cussing... but maybe thats just me... I personally don't mind cussing that much... I just want to keep this site ok for all ages.
Formerly LordBrockFreak
http://www.audioscrobbler.com/user/Corban/
"We're closer now than we've ever been to finishing." ~The Beatles
http://www.audioscrobbler.com/user/Corban/
"We're closer now than we've ever been to finishing." ~The Beatles
http://www.acronymfinder.com/af-query.asp?String=exact&Acronym=stfu&Find=FindCorban wrote: I think its still cussing... but maybe thats just me... I personally don't mind cussing that much... I just want to keep this site ok for all ages.
you are assuming that the f is for a swear
but clearly it can mean a number of other things
in a school i highly doubt they would reprimand you for saying stfu
although you might get laughed out of school and forever be labelled with a l on your forehead
- Ruddertail
- Promi Diplomacy ate my homework...
- Posts: 4510
- Joined: Wed May 12, 2004 11:39 pm
- Location: Chances are, playing FAF.
- Contact:
- The Beatles
- Fear me for I am root
- Posts: 6285
- Joined: Tue May 24, 2005 8:12 pm
-
Members connected in real time