Реклама | Adv
  • Rotator
  • Rotator
  • Rotator
  • Rotator
  • Rotator
  • Rotator
  • Rotator
  • Rotator
  • Rotator
  • Rotator
  • Rotator
  • Rotator
  • Rotator
  • Rotator
Сообщения форума
Реклама | Adv
Автор: Я(Edrard)

Я немного переделал скрипт, с учетом всех предложений и пожеланий, не только тех которые были здесь, но и на официальном форуме. Добавил сигнатуры от emem.ru, имена стали ссылками на офф статистику, добавил Количество дней в клане, и счетчик количества игроков в клане. А вы уже дальше удаляйте что вам ненужно.

Как всегда, пример можете посмотреть тут - https://wot-news.com/1/1.php

Обсудить можно тут


<?php
header
("Content-type: text/html; charset=utf-8");
$clan_id ='1';
$request ="GET /uc/clans/".$clan_id."/members/?type=table HTTP/1.0\r\n";
$request.="Accept: text/html, */*\r\n";
$request.="User-Agent: Mozilla/3.0 (compatible; easyhttp)\r\n";
$request.="X-Requested-With: XMLHttpRequest\r\n";
$request.="Host: challenge.worldoftanks.ru\r\n";
$request.="Connection: Keep-Alive\r\n";
$request.="\r\n";

$wot_host="challenge.worldoftanks.ru";

$fp = fsockopen("challenge.worldoftanks.ru", 80, $errno, $errstr, 60);
if (!$fp){
echo "$errstr ($errno)<br>\n";
} else {
fwrite($fp, $request);
$page ='';
while (!feof($fp)){
$page .= fgets($fp, 4096);
}
fclose($fp);
}
preg_match_all("/{\"request_data\":(.*?),\"result\":\"success\"}/", $page, $matches);
$new =(json_decode($matches[0][0], true));
?>
<!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>

<link rel="stylesheet" href="http://tablesorter.ru/docs/css/jq.css" type="text/css" media="print, projection, screen" />
<link rel="stylesheet" href="http://tablesorter.ru/themes/blue/style.css" type="text/css" media="print, projection, screen" />
<script type="text/javascript" src="http://tablesorter.ru/jquery-latest.js"></script>
<script type="text/javascript" src="http://tablesorter.ru/jquery.tablesorter.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>
<th>Сигнатура и статистика</th>
</tr>
</thead>
<tbody>
<?php foreach($new['request_data']['items'] as $val){
$date
= explode('.',$val['member_since']);
$new_time = $date['2'].'.'.$date['1'].'.'.$date['0']
?>
<tr>
<td><a href="http://challenge.worldoftanks.ru/uc/accounts/<?php echo $val['account_id']; ?>-<?php echo $val['name']; ?>"
target="_blank"><?php echo $val['name']; ?></a></td>
<td><?php echo $val['account_id']; ?></td>
<td><?php echo $new_time; ?></td>
<td><?php echo floor((time()- mktime(0, 0, 0, $date['1'], $date['0'], $date['2']))/(3600*24)); ?></td>
<td><?php echo $val['role']; ?></td>
<td align="center"><a href="http://emem.ru/WoT/history/<?php echo $val['name']; ?>/" target="_blank">
<img src="http://emem.ru/WoT/stat/<?php echo $val['account_id']; ?>/sv22-default.png"
alt="<?php echo $val['name']; ?>" title="Просмотреть подробную статистику игрока
<?php echo $val['name']; ?>"></a></td>
</tr>
<?php } ?>
</tbody>
</table>
<p class="num">Всего игроков: <?php echo count($new['request_data']['items']) ?></p>
</div>
</body>
</html>
Реклама | Adv