Реклама | Adv
  • Rotator
  • Rotator
  • Rotator
  • Rotator
  • Rotator
  • Rotator
  • Rotator
  • Rotator
  • Rotator
  • Rotator
  • Rotator
  • Rotator
  • Rotator
  • Rotator
Сообщения форума
Реклама | Adv
Список клана, обновлено до версии АПИ 2.0

Пример можно посмотреть здесь

Не забудьте изменить $clan_id = '1'; на id вашего клана

<?php
header("Content-type: text/html; charset=utf-8");
$clan_id = '1';
if(! $new = file_get_contents("http://api.worldoftanks.ru/wgn/clans/info/?application_id=54b29552a32dd5f3ade861259e38a368&clan_id=".$clan_id)){
die('Немогу выполнить запрос к API WG, обратитесь в саппорт хостинга');
}
$new = json_decode($new,TRUE);
//print_r($new);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Список клана</title>

<style>
table.tablesorter {
font-family:arial;
background-color: #CDCDCD;
margin:10px 0pt 15px;
font-size: 8pt;
width: 100%;
text-align: left;
}
table.tablesorter thead tr th, table.tablesorter tfoot tr th {
background-color: #e6EEEE;
border: 1px solid #FFF;
font-size: 8pt;
padding: 4px;
}
table.tablesorter thead tr .header {
background-image: url(bg.gif);
background-repeat: no-repeat;
background-position: center right;
cursor: pointer;
}
table.tablesorter tbody td {
color: #3D3D3D;
padding: 4px;
background-color: #FFF;
vertical-align: top;
}
table.tablesorter tbody tr.odd td {
background-color:#F0F0F6;
}
table.tablesorter thead tr .headerSortUp {
background-image: url('data:image/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjB+gC+jP2ptn0WskLQA7');
}
table.tablesorter thead tr .headerSortDown {
background-image: url('data:image/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjI8Bya2wnINUMopZAQA7');
}
table.tablesorter thead tr .headerSortDown, table.tablesorter thead tr .headerSortUp {
background-color: #8dbdd8;
}
</style>
<script type="text/javascript" src="//ajax.aspnetcdn.com/ajax/jQuery/jquery-1.11.2.min.js"></script>
<script type="text/javascript" src="//cdn.ucb.org.br/Scripts/tablesorter/jquery.tablesorter.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
// теперь по умолчанию у нас всегда будет запускаться виджет зебра
$.tablesorter.defaults.widgets = ['zebra'];
// теперь по умолчанию всегда будем сортировать по первой колонке
$.tablesorter.defaults.sortList = [[0,0]];
// вызов плагина
$("table").tablesorter();
});
</script>
<style>
.num {
font-size: 17px;
font-weight: bold;
}
</style>
</head>
<body>
<div align="center">
<table class="tablesorter" cellspacing="1" style="width: 1000px;">
<thead>
<tr>
<th>Имя</th>
<th>ID</th>
<th>Состоит в клане</th>
<th>Дней в клане</th>
<th>Звание</th>
</tr>
</thead>
<tbody>
<?php foreach($new['data'][$clan_id]['members'] as $val){
$new_time = date('Y.m.d',$val['joined_at']);
?>
<tr>
<td><a href="https://wot-news.com/stat/pstat/ru/<?php echo $val['account_name']; ?>"
target="_blank"><?php echo $val['account_name']; ?></a></td>
<td><?php echo $val['account_id']; ?></td>
<td><?php echo $new_time; ?></td>
<td><?php echo round((strtotime(date("Y-m-d H:i:s")) - $val['joined_at'])/(3600*24)); ?></td>
<td><?php echo $val['role_i18n']; ?></td>
</tr>
<?php } ?>
</tbody>
</table>
<p class="num">Всего игроков: <?php echo $new['data'][$clan_id]['members_count'] ?></p>
</div>
</body>
</html>
Реклама | Adv