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

[PHP] Support List

Kavvson

Gdy boli cie glowa wez
Joined
Jun 25, 2008
Messages
1,177
Reaction score
72
Location
Poland
PHP:
<style type="text/css"> 
        tr.over:hover { 
        background-color: lightgrey; 
        } 
		as {
		font-family:Verdana,Arial,Times New Roman,sans-serif;
        font-size:10pt;
		}
</style> 

<?php 
    if($groups = simplexml_load_file($config['site']['server_path'].'/data/XML/groups.xml') or die('<b>Could not load groups!</b>')) 
        foreach($groups->group as $g)   
            $groupList[(int)$g['id']] = $g['name']; 

    $list = $SQL->query("SELECT `name`, `online`, `group_id`, `world_id` FROM `players` WHERE `group_id` > 1 ORDER BY `group_id` DESC");
    $showed_players = 0;

	$main_content .= '<p style="color:#5A2800; font-family:Verdana,Arial,Times New Roman,sans-serif; font-size:10pt;">To report a violation of the Tibia Rules please use the "rule violation report" by pressing Ctrl+R in the game. Moreover, you may contact a gamemaster concerning general questions on rule violations or banishments at the gamemaster board. Please understand that you should not message gamemasters directly in the game. For general questions about Tibia please use the help channel (Ctrl+T) in the game to get help by a tutor.</p>';
    $group_id = 0;
    foreach($list as $gm)
    {
        if($group_id != (int)$gm['group_id']) 
        { 
            if($group_id != 0) 
                $main_content .= '</table><br />'; 
            $group_id = (int)$gm['group_id']; 
        } 

    $main_content .='

<table width="100%" cellspacing="1" cellpadding="4" border="0">
	
<tbody>

<tr bgcolor="#505050">

<td class="white" colspan="2"><b><div style="as">'.$groupList[(int)$gm['group_id']].'</div></b></td></tr>
<tr bgcolor="'.(is_int($showed_players++ / 2) ? $config['site']['darkborder'] : $config['site']['lightborder']).'" class="over">
<td width="100%"><nobr>1. '.$gm['name'].'</nobr></td><td>
<table cellspacing="0" cellpadding="0" border="0">
<FORM ACTION="?subtopic=characters" METHOD=post>

<input type="hidden" value="'.$gm['name'].'" name="name">
<input height="18" width="120" border="0" type="image" src="http://static.tibia.com/images/global/buttons/sbutton_view.gif" alt="View" name="View">
</tr></td></tr></table>
</tbody></table></form>';
	} 
	$main_content .= '</table>';
    ?>

2kmo8o.png


Can someone fix it? That it display it correct? When there is the same Group ID + the number before nick is growing 1,2 etc...
 
Back
Top