<?php
define('_IN_JOHNCMS', 1);
require_once ('../incfiles/core.php');


$i = $_GET['i'];
$url = 'http://yuklama.ru/qiziqarli/'.(!empty($i) ? $i : '').'';
$out = '';
define('UA', 'Opera/9.60 (J2ME/MIDP; Opera Mini/4.2.14912/812; U; ru) Presto/2.4.15');
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_USERAGENT, UA);
curl_setopt($curl, CURLINFO_HEADER_OUT, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_REFERER, 'http://yuklama.ru/qiziqarli/');
$res = curl_exec($curl);
curl_close($curl);

 preg_match_all('|<div class="phdr">(.*)</div><div class="menu">(.*)</div>(.*)</div>|Us', $res, $down);

$down[2]=str_replace('src="/str/ximg.php','src="'.$home.'/qiziqarli/ximg.php',$down[2]);
if (!empty($down[1][0]))
{
$count = count($down[1]);
$i = 0;
while ($i < $count)
{
$out .= '<div class="phdr">'.$down[1][$i].'</div><div class="menu">'.$down[2][$i].'  '.$down[3][$i].'</div></div>';

$i++;
}
}
else
{
$out .= 'Пусто';
}
 preg_match('|<div class="phdr"><b>(.*)</b></div>|Us', $res, $title); 
$textl = $title[1];
require_once ('../incfiles/head.php'); 


 echo '<div class="menu">« <a href="'.$home.'/qiziqarli/">Qiziqarli yangiliklarga qaytish</a></div>';
 
 echo $out;
 
 echo '<div class="menu">« <a href="'.$home.'/qiziqarli/">Qiziqarli yangiliklarga qaytish</a></div>';
 


include '../incfiles/end.php';
?>