• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Gesior Layout

Calon

Experienced Member
Joined
Feb 6, 2009
Messages
1,070
Reaction score
21
well i was try to add on the right a 5 Best Players on exp

here is a pic of it
test.png - Speedy Share - upload your files here


i did it but i cant mange it in a right way, such as the style look, also when i click on the player name dosent go to the character information page, also the name of players looks like a big size it needs 2 lines. finally as well the background a dark so i've tried to put colors to makes it appear.
here is my layout.php
PHP:
	<div id="cnt-box4">
                <div id='menu'>
                    <div class='nav-top'>
                        <div class='text'>
                                Best Players
                        </div>
                        </div>
                        <div class='bg'>
						
<center>       <?php  

				$world_id = 0;
				$skills = $SQL->query('SELECT * FROM players WHERE players.world_id = '.$world_id.' AND players.deleted = 0 AND players.group_id < 2 ORDER BY level DESC, experience DESC LIMIT 5');
				$i = 1;
				echo('<table id="besty" cellpadding="1"><tr><td style="text-align: left;"><b><font color="yellow">Rank</b></font></td><td style="text-align: center;"><b><font color="yellow">Name</b></font></td><td style="text-align: center;"><b><font color="yellow">Level</b></font></td></tr>');
				foreach($skills as $skill)  
				{
					echo('<tr><td style="text-align: center;">'.$i.'.</td><td style="width:85px; text-align: center;">'.($skill['online']>0 ? "<font color=\"green\">".$skill['name']."</font>" : "<font color=\"red\">".$skill['name']."</font>").'</td><td style="text-align: center;"><font color="yellow">'.$skill['level'].'</font></td></tr>');
					
					$i++;
				}
				echo('</table>');
			  ?>
 </center>
       </div>
 
PHP:
<?php
    $players = $SQL->query('SELECT * FROM `players` WHERE `group_id` <  2 AND `deleted` = 0 AND `name` != "Account  Manager" ORDER BY `level` DESC, `experience` DESC LIMIT 10;');
    $i = 0;
    foreach($players as $player)
    {
        $i++;
        echo '<table id="besty" cellpadding="1"><tr><td class="yellow" style="text-align: left; font-weight: bold;">Rank</td><td class="yellow" style="text-align: center; font-weight: bold;">Name</td><td class="yellow" style="text-align: right; font-weight: bold;">Level</td></tr>';
        echo '<tr><td style="text-align: center;">'.$i.'.</td><td style="width:85px; text-align: center;"><a href="index.php?subtopic=characters&amp;name='.urlencode($player['name']).'">'.($player['online'] > 0 ? "<font color=\"green\">".$player['name']."</font>" : "<font color=\"red\">".$player['name']."</font>").'</a></td><td style="text-align: right;">'.$player['level'].'</td></tr>';
    }
    echo '</table>';
?>
 
the click thing works but what about the look style ?

Untitled1.png - Speedy Share - upload your files here
 
I see that I placed first echo in wrong place, and move it above foreach.

Looks like class="yellow" didn't work well, use font color instead. :p
 
i want to make it looks better got any idea ? i mean like a table or make the name size little small to be in one line or make the level under the name and make the rest space for the name, got it ?
 
Back
Top