$players_content .= "</table>"; $cap_content = "<table class=mt width=100%>". "<tr align=center height=30><th>Топ-5 по очкам</th><th>Топ-5 по турнирам</th></tr><tr>". "<td><table width=100%>$top_by_points</table></td>". "<td><table width=100%>$top_by_tours</table></td></tr>"; $cap_content .= "</tr></table>"; $filter_content = "<table class=mt width=100%>". "<tr align=center height=30>". "<th>Выбрать лигу:</th>"; for ($i = 0; $i < count($leagues); $i++) { $filter_content .= "<th style='background:".$lcolors[$i]."'>". "<a class=ab href='#".$leagues[$i]."'>".$leagues[$i]."</a></th>"; } $filter_content .= "<th style='text-align:right;padding:3'>Последнее обновление: <b>".intToDate($max_date)."</b></th>". "</tr>". "</table>"; $elapsed_time = number_format(microtime(true) - $start_time, 3); $m = memoryUsage($_m); $_m = $_m > 0 ? " (memory before the script run: <b>$start_memory</b>)" : ""; $end_content .= '<table>'. '<tr><td colspan=2 align=center>Данные собраны с сайта: <a href="http://or.rttf.ru">http://or.rttf.ru</a></td></tr>'. '<tr>'. //'<td class=p1 valign=bottom>Memory usage: <b>'.$m.'</b>'.$_m.' ('.$elapsed_time.' s)</td>'. //'<td colspan=3 align=center valign=bottom> © <a target=_blank class=ab href="http://www.rttf.ru/user/27981">Гарус Игорь</a> (aabzac)</td>'. '</tr></table>'; echo '<table class=frame width=70%>'. "<tr><td>$filter_content</td></tr>".
if ($tour > 0) { echo "cup_id = $cup_id, tour = $tour<br>"; $lines = file("http://or.rttf.ru/tournaments/$tour"); $search = false; $date = ""; $query_nicks = ""; $query_games = ""; $count = 0; $count_players = 0; foreach ($lines as $line) { $line = iconv("UTF-8", "WINDOWS-1251", $line); if (strpos($line, "<h1>") > -1 && $date == "") { $date = substr($line, strpos($line, "<h1>") + 4); $date = substr($date, 0, strpos($date, " ")); $date = dateToInt($date); echo "date = $date, ".intToDate($date)."<br>"; } if (strpos($line, '<table class="players">') > -1) { $search = true; $plId = 0; $plName = ""; $plRating = -1000; $plPlace = 0; } if (strpos($line, 'Количество участников:</td><td>') > -1) { $count_players = sstr($line, 'Количество участников:</td><td>', '<'); echo "count_players = $count_players<br><br>"; } if ($search) { if (strpos($line, "</table>") > -1) break;