• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

optimize the pages Gesior

xLosT

Member
Joined
Jan 11, 2010
Messages
1,021
Reaction score
13
Location
Brasil, Rio Grande do Sul
is there anything I can do to the pages of Gesior load faster? See an example

Page Top 15 guilds

Page has been viewed times. Load time: 11.2003 seconds
 
PHP:
<?PHP
    $main_content .= '<div style="text-align: center; font-weight: bold;"><h2>Top 15 guilds on ' . $config['server']['serverName'] . '</h2></div>
<center><table border="0" cellspacing="1" cellpadding="4" width="80%">
    <tr bgcolor="'.$config['site']['vdarkborder'].'">
        <td width="10%"><b><font color=white><center>Pos</font></center></b></td>
        <td width="20%"><b><font color=white><center>Logo</center></b></font></td>
        <td width="30%"><b><font color=white><center>Guild Name</center></b></font></td>
        <td width="20%"><b><font color=white><center>Kills</center></b></font></td>
    </tr>';
$i = 0;
foreach($SQL->query('SELECT `g`.`id` AS `id`, `g`.`name` AS `name`,
    `g`.`logo_gfx_name` AS `logo`, COUNT(`g`.`name`) as `frags`
    FROM `killers` k
    LEFT JOIN `player_killers` pk ON `k`.`id` = `pk`.`kill_id`
    LEFT JOIN `players` p ON `pk`.`player_id` = `p`.`id`
    LEFT JOIN `guild_ranks` gr ON `p`.`rank_id` = `gr`.`id`
    LEFT JOIN `guilds` g ON `gr`.`guild_id` = `g`.`id`
   WHERE `k`.`unjustified` = 1 AND `k`.`final_hit` = 1
    GROUP BY `name`
    ORDER BY `frags` DESC, `name` ASC
    LIMIT 0, 15;') as $guild)
{
    $i++;
    $main_content .= '<tr bgcolor="' . (is_int($i / 2) ? $config['site']['lightborder'] : $config['site']['darkborder']). '">
        <td>            
            <center>'.$i.'</center>
        </td>
        <td>            
            <center><img src="guilds/' . ((!empty($guild['logo']) && file_exists('guilds/' . $guild['logo'])) ? $guild['logo'] : 'default_logo.gif') . '" width="64" height="64" border="0"/></center>
        </td>
        <td>
            <center><a href="?subtopic=guilds&action=show&guild=' . $guild['id'] . '">' . $guild['name'] . '</a></center>
        </td>
        <td>
            <center>' . $guild['frags'] . ' kills</center>
        </td>
    </tr>';
}
$main_content .= '</table><br />';
$main_content .= '<div style="text-align: right; font-size: 10;"></a></div>';
?>
 
Last edited:
There's nothing wrong with your script. It's just that it has to go through a lot of data.

total-war.org/?subtopic=topguilds @ 7 seconds to load the page.

total-war.org/?subtopic=whoisonline @ 0.04 seconds to load the page.
 
other pages
Page has been viewed times. Load time: 0.0078 seconds
Page has been viewed times. Load time: 0.0038 seconds
Page has been viewed times. Load time: 0.0042 seconds

- - - Updated - - -

ok ninja, and I wonder if it's possible to get that off my server off because of this, if someone abuses of pages?

- - - Updated - - -

I put it after my server crashed 3x already, even now
everything is off, then have to restart the vps
 
Last edited:
Back
Top