Hello, Hello we meet again today I have for you something interesting, from what I know a lot of people that is looking for and so gives
Please rep++, comment and add like
Please rep++, comment and add like
Okey, The first step:
Open your htdocs and go to images. Create folder
Code:
Flags
Code:
brazil.png, england.png, poland.png, sweden.png
or download a parcel flags: MEGAUPLOAD - The leading online storage and file delivery service
Make in your htdocs "language.php" and paste this code:
PHP:
<?php
$players = $SQL->query("SELECT `level`, `account_id` FROM `players`;")->fetchAll(); $countriesCount = 0; $countriesTop = $config["languages"];
foreach ($countriesTop as $countryName => $countryFile) $countriesTop[$countryName] = 0;
foreach ($players as $playerData)
{
$accountData = $SQL->query("SELECT `location` FROM `accounts` WHERE `id` = \"".$playerData["account_id"]."\";")->fetch();
$countriesTop[$accountData["location"]] += $playerData["level"];
}
arsort($countriesTop); $countCountries = 0;
$main_content .= '<div class="NewsHeadline">
<div class="NewsHeadlineBackground" style="background-image:url(' . $layout_name . '/images/news/newsheadline_background.gif)">
<table border="0">
<tr>
<td style="text-align: center; font-weight: bold;">
<font color="white"><center>Best Countries</center></font>
</td>
</tr>
</table>
</div>
</div>
<table border="0" cellspacing="3" cellpadding="4" width="100%">
<tr>';
foreach ($countriesTop as $countriesName => $countriesCount)
{
$countCountries = $countCountries + 1;
$backgroundColor = is_int($playerCount / 2) ? $config["site"]["darkborder"] : $config["site"]["lightborder"]; $playerCount++;
if ($countCountries <= 3)
{
$backgroundColor = is_int($countCountries / 2) ? $config["site"]["darkborder"] : $config["site"]["lightborder"];
$main_content .= "<td bgcolor=\"".$backgroundColor."\" width=\"33%\"><center><img src=\"/images/flags/".$config["languages"][$countriesName]."\"><h2 style=\"margin-bottom:-10px;\">".$countriesName."</h2><br><font style=\"color:red; font-size:16pt; font-weight:bold;\">#".$countCountries."</font><br><br><font style=\"font-weight:bold; font-size:12pt;\">Points: ".$countriesCount."</font></center>";
$main_content .= "<table border=\"0\" cellspacing=\"1\" cellpadding=\"4\" width=\"100%\" style=\"border:1px solid #5f4d41;\">"; $playerCount = 0;
$playerData = $SQL->query("SELECT `name`, `level` FROM `players` WHERE `account_id` IN (SELECT `id` FROM `accounts` WHERE `location` = \"".$countriesName."\") ORDER BY `level`;")->fetchAll();
$count = 0; for($i = 0; $i <= 5; $i++)
{
$player = $playerData[$i];
$backgroundColor2 = is_int($count / 2) ? $config["site"]["darkborder"] : $config["site"]["lightborder"]; $count++;
if (isset($player["level"]) and isset($player["name"]))
$main_content .= "<tr bgcolor=\"".$backgroundColor2."\"><td><a href=\"?subtopic=characters&name=".urlencode($player["name"])."\">".$player["name"]."</a><b> [level ".$player["level"]."]</b></td></tr>";
else
$main_content .= "<tr bgcolor=\"".$backgroundColor2."\"><td> </td></tr>";
}
$main_content .= "</table></td>";
if ($countContries == 3) $main_content .= "</tr></table>";
}
else
{
if ($countCountries >= $config["site"]["maxlangs"] or $countriesCount == 0) break;
if ($countCountries == 4) $main_content .= "<table border=\"0\" cellspacing=\"1\" cellpadding=\"4\" width=\"100%\"><tr bgcolor=\"".$config['site']['vdarkborder']."\"><td class=\"white\" width=\"100%\" colspan=\"3\"><b>Best Countries on ".$config["server"]["serverName"]."</b></td></tr>";
$main_content .= "<tr bgcolor=\"".$backgroundColor."\"><td width=\"10%\"><center><font style=\"color:red; font-size:16pt; font-weight:bold;\">#".$countCountries."</font></center></td><td width=\"30%\"><img src=\"/images/flags/".$config["languages"][$countriesName]."\" style=\"float:left; margin-top:8px; margin-left:5px;\"><h2> ".$countriesName."</h2></td><td width=\"60%\">";
$playerData = $SQL->query("SELECT `name`, `level` FROM `players` WHERE `account_id` IN (SELECT `id` FROM `accounts` WHERE `location` = \"".$countriesName."\") ORDER BY `level`;")->fetchAll();
for($i = 0; $i <= 5; $i++)
{
$player = $playerData[$i];
if (isset($player["level"]) and isset($player["name"]))
$main_content .= "<a href=\"?subtopic=characters&name=".urlencode($player["name"])."\">".$player["name"]."</a><b> [level ".$player["level"]."]</b> ";
}
$main_content .= "</td></tr>";
}
}
$main_content .= "</table>";
?>
Next step is edit "index.php":
You must find this code:
PHP:
$time_start = microtime_float();
And paste under:
PHP:
////BEST COUNTERS////
function lang($str) { return $str; }
////BEST COUNTERS////
Editions index part 2:
Find this code:
PHP:
include('config-and-functions.php');
And under paste it:
PHP:
////BEST COUNTERS////
include("config/languages.php");
////BEST COUNTERS////
Index editions part 3:
You must add your new bookmark to index.php so we open it and paste this code:
PHP:
case "language":
$topic = "Best Countries"; $subtopic = "language";
include("language.php");
break;
I already see the effects of
Next step
Open yours createaccounts.php and paste this code below the form for entering an address or where you prefer (This action select your Country)
PHP:
$main_content .= "<tr><td width=\"150px\"><b>Location: </b></td><td colspan=\"2\"><select name=\"reg_lang\" style=\"width:228px;\">";
foreach ($config["languages"] as $langName => $langIcon)
$main_content .= "<option value=\"".$langName."\">".$langName."</option>";
$main_content .= "</select></td></tr>";
Next Step
Open your Config.php and paste this code(This option shows maximum number counters on the site):
PHP:
////Best Counters////
$config["site"]["maxlangs"] = 5; // maximum number of other countries on the site, with the three first
////Best Counters////
The last point
Adding the code to latestnews.php So open it and find:
PHP:
if($action == "") {
And paste under this code:
PHP:
//// Best Counters Start////
$players = $SQL->query("SELECT `level`, `account_id` FROM `players`;")->fetchAll(); $countriesCount = 0; $countriesTop = $config["languages"];
foreach ($countriesTop as $countryName => $countryFile) $countriesTop[$countryName] = 0;
foreach ($players as $playerData)
{
$accountData = $SQL->query("SELECT `location` FROM `accounts` WHERE `id` = \"".$playerData["account_id"]."\";")->fetch();
$countriesTop[$accountData["location"]] += $playerData["level"];
}
arsort($countriesTop); $countCountries = 0;
$main_content = "<table border=\"0\" cellspacing=\"1\" cellpadding=\"4\" width=\"100%\"><tr bgcolor=\"".$config['site']['vdarkborder']."\"><td class=\"white\" width=\"100%\" colspan=\"3\"><b>Best Countries on ".$config["server"]["serverName"]." - TOP3!</b></td></tr><tr>";
foreach ($countriesTop as $countriesName => $countriesCount)
{
$countCountries = $countCountries + 1;
if ($countCountries > 3) break;
$backgroundColor = is_int($playerCount / 2) ? $config["site"]["darkborder"] : $config["site"]["lightborder"]; $playerCount++;
$backgroundColor = is_int($countCountries / 2) ? $config["site"]["darkborder"] : $config["site"]["lightborder"];
$main_content .= "<td bgcolor=\"".$backgroundColor."\" width=\"33%\"><center><img src=\"/images/flags/".$config["languages"][$countriesName]."\"><h2 style=\"margin-bottom:-10px;\">".$countriesName."</h2><br><font style=\"color:red; font-size:16pt; font-weight:bold;\">#".$countCountries."</font><br><br><font style=\"font-weight:bold; font-size:12pt;\"></font></center>";
$main_content .= "<table border=\"0\" cellspacing=\"1\" cellpadding=\"4\" width=\"100%\" style=\"border:1px solid #5f4d41;\">"; $playerCount = 0;
$playerData = $SQL->query("SELECT `name`, `level` FROM `players` WHERE `account_id` IN (SELECT `id` FROM `accounts` WHERE `location` = \"".$countriesName."\") ORDER BY `level`;")->fetchAll();
$count = 0; for($i = 0; $i <= 5; $i++)
{
$player = $playerData[$i];
$backgroundColor2 = is_int($count / 2) ? $config["site"]["darkborder"] : $config["site"]["lightborder"]; $count++;
}
$main_content .= "</table></td>";
if ($countContries == 3) $main_content .= "</tr></table>";
}
$main_content .= "</tr></table>";
//// Best Counters end//// //
The end result on latest news