<?php

//By FlySelf

defined('_IN_JOHNCMS') or die('Error: restricted access');

$contents = contents('http://wap.weather.mail.ru/near.xhtml?city=' . $id);
$contents = preg_replace('/<\!DOCTYPE(.*?)<h2>/si', '<h2>', $contents);
$contents = preg_replace('/<p>&#032;<\/p>(.*?)<\/html>/si', '</div><div class="phdr"><a href="index.html">Главная</a></div>', $contents);
$contents = preg_replace('/\/([a-z0-9]+)\.xhtml\?city=([0-9]+)/si', '\1_\2.html', $contents);
$contents = strtr($contents, array('<h2>' => '<div class="phdr"><b>', '</h2>' => '</b></div><div class="list1">', '<div class="tah t70">' => '</div><div><div class="list2">'));

echo $contents;

?>