Quote:
Originally Posted by Sugoi na
That would actually be much better then my original idea. I hope you are willing to release it as an addon =)
Good work!
|
I fixed it up the ugly way. No plugins since there's no hooks in his add-on whatsoever, so i'm afraid you're gonna have to dig up the php files....
open up conquest.php
replace the whole
PHP Code:
if ($_REQUEST['do'] == 'enlist')
{
$totals = $vbulletin->db->query_first("SELECT COUNT(playerID) AS playerID, SUM(pGold) AS pGold, SUM(pTroops) AS pTroops
FROM ".TABLE_PREFIX."conquest_players AS conquest_players
");
if (!$totals['playerID']) { $totals['playerID'] = 1; }
if (!$totals['pGold']) { $totals['pGold'] = 1; }
if (!$totals['pTroops']) { $totals['pTroops'] = 1; }
$nations = $vbulletin->db->query_read("SELECT conquest_nations.*, COUNT(playerID) AS playerID, SUM(pGold) AS pGold, SUM(pTroops) AS pTroops
FROM ".TABLE_PREFIX."conquest_nations AS conquest_nations
LEFT JOIN ".TABLE_PREFIX."conquest_players AS conquest_players ON conquest_nations.nationID = conquest_players.nationID
GROUP BY conquest_nations.nationID
");
while ($nation = $vbulletin->db->fetch_array($nations))
{
if (file_exists($thumbdir.'/nations/'.$nation['nationID'].'.jpg')) { $imageE = true; } else { $imageE = false; }
$nation['AVGplayerID'] = number_format($nation['playerID'] / $totals['playerID'] * 100, 2);
$nation['AVGpGold'] = number_format($nation['pGold'] / $totals['pGold'] * 100, 2);
$nation['AVGpTroops'] = number_format($nation['pTroops'] / $totals['pTroops'] * 100, 2);
eval('$nationsHTML .= "' . fetch_template('conquest_enlist_bit') . '";');
}
$pageNAME = $vbphrase['conquest_enlist'];
eval('$conquestHTML .= "' . fetch_template('conquest_enlist') . '";');
$navbits[] = $pageNAME;
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('conquest_SHELL') . '");');
}
with
PHP Code:
if ($_REQUEST['do'] == 'enlist')
{
$totals = $vbulletin->db->query_first("SELECT COUNT(playerID) AS playerID, SUM(pGold) AS pGold, SUM(pTroops) AS pTroops
FROM ".TABLE_PREFIX."conquest_players AS conquest_players
");
if (!$totals['playerID']) { $totals['playerID'] = 1; }
if (!$totals['pGold']) { $totals['pGold'] = 1; }
if (!$totals['pTroops']) { $totals['pTroops'] = 1; }
$nations = $vbulletin->db->query_read("SELECT conquest_nations.*, COUNT(playerID) AS playerID, SUM(pGold) AS pGold, SUM(pTroops) AS pTroops
FROM ".TABLE_PREFIX."conquest_nations AS conquest_nations
LEFT JOIN ".TABLE_PREFIX."conquest_players AS conquest_players ON conquest_nations.nationID = conquest_players.nationID
GROUP BY conquest_nations.nationID
");
$nationsagain = $vbulletin->db->query_read("SELECT conquest_nations.*, COUNT(playerID) AS playerID, SUM(pGold) AS pGold, SUM(pTroops) AS pTroops
FROM ".TABLE_PREFIX."conquest_nations AS conquest_nations
LEFT JOIN ".TABLE_PREFIX."conquest_players AS conquest_players ON conquest_nations.nationID = conquest_players.nationID
GROUP BY conquest_nations.nationID
");
$totaleverything = array();
while($nation2 = $vbulletin->db->fetch_array($nationsagain))
{
$totaleverything[] = number_format((($nation2['playerID']) + ($nation2['pTroops'])) / ($totals['playerID'] + $totals['pTroops']) * 100, 2);
}
$id = 0;
while ($nation = $vbulletin->db->fetch_array($nations))
{
if(!($totaleverything[$id] >= 33))
{
if (file_exists($thumbdir.'/nations/'.$nation['nationID'].'.jpg')) { $imageE = true; } else { $imageE = false; }
$nation['AVGplayerID'] = number_format($nation['playerID'] / $totals['playerID'] * 100, 2);
$nation['AVGpGold'] = number_format($nation['pGold'] / $totals['pGold'] * 100, 2);
$nation['AVGpTroops'] = number_format($nation['pTroops'] / $totals['pTroops'] * 100, 2);
eval('$nationsHTML .= "' . fetch_template('conquest_enlist_bit') . '";');
}
$id ++;
}
$pageNAME = $vbphrase['conquest_enlist'];
eval('$conquestHTML .= "' . fetch_template('conquest_enlist') . '";');
$navbits[] = $pageNAME;
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('conquest_SHELL') . '");');
}
In this whole code i set it for 3 nations. Which means that if a nation is bigger than 33.33 percent it will not show on the enlist screen anymore.
You can change this setting here:
PHP Code:
if(!($totaleverything[$id] >= 33))
I know i fixed this up the ugly way, i'm sure the original maker will know a way to do this the good way. This was just my fast fix.