aGaCMS,
http://koenig.h2m.ru/pictures.php
пойдет?
$pg = $_SERVER['PHP_SELF'];
if (isset($_GET['img'])) {
$img = str_replace('ts', 'big', $_GET['img']);
$url = 'http://pixfree.ru/' . $img;
header('Content-Type: image/jpeg');
echo file_get_contents($url);
}
$url = 'http://pixfree.ru/';
$str = file_get_contents($url);
$str = mb_convert_encoding($str, 'HTML-ENTITIES', 'cp-1251');
preg_match_all('|<div class="menuNav"><a href="category/(.*)/"><img border="0" src="i/ico_arrow.gif" width="22" height="11">(.*)</a></div>|sU', $str, $res);
$arr_url = array_combine($res[1], $res[2]);
if (isset($_GET['cat'])) {
$p = isset($_GET['p']) ? intval($_GET['p']) : 1;
$url .= 'category/' . $_GET['cat'] . '/page' . $p . '.html';
$str = file_get_contents($url);
$str = mb_convert_encoding($str, 'HTML-ENTITIES', 'cp-1251');
preg_match_all('|<td bgcolor="#D7D7D7" colspan="2"><a href= "wallpapers/(.*).html" target="_blank"><img border="0" src="(.*)" alt="(.*)" width="150" height="200" style="border: 1 solid #C0C0C0"></a></td>|sU', $str, $img_url);
preg_match_all('|<td colspan="2">(.*)</td>|sU', $str, $name);
$name = str_replace(array('<h3>', '</h3>'), '' , $name[1]);
$arr_name = array_combine($img_url[1], $name);
$arr_img = array_combine($img_url[1], $img_url[2]);
preg_match_all('|<td colspan="3" align="center" class="clsLink3">(.*)</td>|sU', $str, $nav);
$nav = str_replace(array('/page', 'category/', '.html'), array('&p=', $pg . '?cat=', ''), $nav[1][0]);
echo '<table><tr><th colspan="3">' . $arr_url[$_GET['cat']] . '</th></tr><tr>';
$i=0;
foreach ($arr_img as $k => $v) {
if (($i%3)==0 && $i!=0) {
echo '</tr><tr>';
}
echo '<td><a href="' . $pg . '?cat=' . $_GET['cat'] . '&img=' . $v . '"><img src="http://pixfree.ru/' . $v . '" alt="img" /><br/>' . $arr_name[$k] . '</a></td>' . PHP_EOL;
$i++;
}
echo '</tr></table>';
echo '<div>' . $nav . '</div>';
echo '<div><a href="' . $pg . '">' . mb_convert_encoding('К выбору категорий', 'HTML-ENTITIES', 'UTF-8') . '</a></div>';
}
if (empty($_GET)) {
foreach ($arr_url as $k => $v) {
echo '<div><a href="' . $pg . '?cat=' . $k . '">' . $v . '</a></div>' . PHP_EOL;
}
}