• 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!

Can you help for pages snake game

Jean Dark

Member
Joined
Jan 6, 2019
Messages
30
Reaction score
13
Location
Egypt
$topSnake = $SQL->query('SELECT name, highscore, lookbody, lookfeet, lookhead, looklegs, looktype, lookaddons FROM snake WHERE group_id = 1 AND account_id != 1 ORDER BY highscore DESC LIMIT 30');

$bgcount = 0;
$number_of_rows = 0;

foreach ($topSnake as $member) {
$bgcount++;
$number_of_rows++;
if(is_int($bgcount / 2)):
$bgcolor = $config['site']['darkborder'];
else:
$bgcolor = $config['site']['lightborder'];
endif;

$main_content .= '<tr bgcolor="'.$bgcolor.'">
<td style="text-align: center;">'.$number_of_rows.'</td>
<td style="text-align: center;"><img style="margin-top: -45px; margin-left: -40px;" src="outfit.php?id='.$member['looktype'].'&addons='.$member['lookaddons'].'&head='.$member['lookhead'].'&body='.$member['lookbody'].'&legs='.$member['looklegs'].'&feet='.$member['lookfeet'].'" width="65" height="65" /></td>
<td style="text-align: center;"><a href="?subtopic=characters&name='.$member['name'].'">'.$member['name'].'</a></td>
<td style="text-align: center;"><div class="progress"><span class="text">'.$member['highscore'].'</span></div></td>
</tr>';
};


--
-- Table structure for table snake
--

CREATE TABLE IF NOT EXISTS snake (
id mediumint(9) NOT NULL,
player_id int(11) NOT NULL,
highscore smallint(6) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

--
-- Dumping data for table snake
--
 

Attachments

Solution
Try
PHP:
<?php
    $topSnake = $SQL->query('
        SELECT `players`.`name`, 
            `snake`.`highscore`,
            `players`.`lookbody`,
            `players`.`lookfeet`, 
            `players`.`lookhead`, 
            `players`.`looklegs`, 
            `players`.`looktype`, 
            `players`.`lookaddons` 
        FROM `players`
        LEFT JOIN `snake`
        ON `players`.`id` = `snake`.`player_id`
        WHERE 
            `players`.`group_id` < 4 AND `snake`.`highscore` > 0
        ORDER BY 
            `snake`.`highscore`
        DESC LIMIT 30
    ');

    $bgcount = 0;
    foreach ($topSnake as $member) {
        $bgcount++;
        if(is_int($bgcount / 2)) {
            $bgcolor = $config['site']['darkborder']...

Snavy

Bakasta
Senator
Joined
Apr 1, 2012
Messages
1,244
Solutions
71
Reaction score
546
Location
Hell
--
-- Table structure for table snake
--

CREATE TABLE IF NOT EXISTS snake (
id mediumint(9) NOT NULL,
player_id int(11) NOT NULL,
highscore smallint(6) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

--
-- Dumping data for table snake
--
Ah! Good ol' (stolenFromMahmoudsEvoleraDP) snake by Sir Snavy the II.

Try this
PHP:
<?php
    $topSnake = $SQL->query('
        SELECT `players`.`name`, 
            `snake`.`highscore`,
            `players`.`lookbody`,
            `players`.`lookfeet`, 
            `players`.`lookhead`, 
            `players`.`looklegs`, 
            `players`.`looktype`, 
            `players`.`lookaddons` 
        FROM `players`
        LEFT JOIN `snake`
        ON `players`.`id` = `snake`.`player_id`
        WHERE 
            `players`.`group_id` < 4 
        ORDER BY 
            `snake`.`highscore` DESC
        LIMIT 30
    ');

    $bgcount = 0;
    foreach ($topSnake as $member) {
        $bgcount++;
        if(is_int($bgcount / 2)) {
            $bgcolor = $config['site']['darkborder'];
        } else {
            $bgcolor = $config['site']['lightborder'];
        }

        $main_content .= '
            <tr bgcolor="'.$bgcolor.'">
                <td style="text-align: center;"><img style="margin-top: -45px; margin-left: -40px;" src="outfit.php?id='.$member['looktype'].'&addons='.$member['lookaddons'].'&head='.$member['lookhead'].'&body='.$member['lookbody'].'&legs='.$member['looklegs'].'&feet='.$member['lookfeet'].'" width="65" height="65" /></td>
                <td style="text-align: center;"><a href="?subtopic=characters&name='.$member['name'].'">'.$member['name'].'</a></td>
                <td style="text-align: center;"><div class="progress"><span class="text">'.$member['highscore'].'</span></div></td>
            </tr>
        ';
    }
?>
 

Snavy

Bakasta
Senator
Joined
Apr 1, 2012
Messages
1,244
Solutions
71
Reaction score
546
Location
Hell
Try
PHP:
<?php
    $topSnake = $SQL->query('
        SELECT `players`.`name`, 
            `snake`.`highscore`,
            `players`.`lookbody`,
            `players`.`lookfeet`, 
            `players`.`lookhead`, 
            `players`.`looklegs`, 
            `players`.`looktype`, 
            `players`.`lookaddons` 
        FROM `players`
        LEFT JOIN `snake`
        ON `players`.`id` = `snake`.`player_id`
        WHERE 
            `players`.`group_id` < 4 AND `snake`.`highscore` > 0
        ORDER BY 
            `snake`.`highscore`
        DESC LIMIT 30
    ');

    $bgcount = 0;
    foreach ($topSnake as $member) {
        $bgcount++;
        if(is_int($bgcount / 2)) {
            $bgcolor = $config['site']['darkborder'];
        } else {
            $bgcolor = $config['site']['lightborder'];
        }

        $main_content .= '
            <tr bgcolor="'.$bgcolor.'">
                <td style="text-align: center;"><img style="margin-top: -45px; margin-left: -40px;" src="outfit.php?id='.$member['looktype'].'&addons='.$member['lookaddons'].'&head='.$member['lookhead'].'&body='.$member['lookbody'].'&legs='.$member['looklegs'].'&feet='.$member['lookfeet'].'" width="65" height="65" /></td>
                <td style="text-align: center;"><a href="?subtopic=characters&name='.$member['name'].'">'.$member['name'].'</a></td>
                <td style="text-align: center;"><div class="progress"><span class="text">'.$member['highscore'].'</span></div></td>
            </tr>
        ';
    }
?>
 
Solution
Top