<?php
$z=$_GET['z'];
if($z == 'index'){$z='';}
$url="http://m.onlysms.net/$z";
include'curl.php';
$name=name($file);
// $name=str_replace(']','',$name);
// $name=str_replace('[','<img src="http://jatt.nazuka.net//tpl/style/images/arr.gif"/> ',$name);
// $name=str_replace('-','<img src="http://jatt.nazuka.net//tpl/style/images/arr.gif"/> ',$name);
include "inc/init.php";
include "header.php";
if($name){echo '<div class="title">'.$name.'</div>';}else{echo '<div class="title">Sms Collection</div>';}
if (!preg_match("/smslist/i", "$url")){
$file=preg_replace('@href=(.*?)"http:\/\/m.onlysms.net\/@','href="?get-z=',$file);
$file=preg_replace('@href="@','href="?get-z=',$file);
$file=preg_replace("@href='@","href='?get-z=\/tag@",$file);
$file=preg_replace('@http:\/\/m.onlysms.net\/@','',$file);
$file=preg_replace('@smslist\/@is','smslist/lang/B/',$file);
$file=str_replace('"smslist','"?get-z=/smslist',$file);
///////////////////// smslists ////////////////
$matches = array();
$regex = '~get-z=\/smsl(.*?)</a>~i';
preg_match_all($regex, $file, $matches);
foreach ($matches[1] as $img){
$img=str_replace('">','.html">',$img);
echo '<div class="content"><img src="http://jatt.nazuka.net//thumb.php?w=45&src=L3RwbC9zdHlsZS9pbWFnZXMvZm9sZGVyLnBuZw=="> <a href="/Sms/smsl'.$img.'</a></div>';}
////////////////// cates //////////////////
$matches = array();
$regex = '~get-z=\/tag(.*?)</a>~i';
preg_match_all($regex, $file, $matches);
foreach ($matches[1] as $img){
$img=str_replace('">','.html">',$img);
echo '<div class="content"><img src="http://jatt.nazuka.net//thumb.php?w=45&src=L3RwbC9zdHlsZS9pbWFnZXMvZm9sZGVyLnBuZw=="> <a href="/Sms/tag'.$img.'</a></div>';}
}else{
$file =str_replace("\n", "", $file);
$file=str_replace('By%20-%20m.OnlySMS.net','',$file);
$file=str_replace('/smslist','?get-z=smslist/lang/B',$file);
$file=str_replace('<img class="absmiddle" height="16" width="16" src="/images/next.png" alt="Next" />',' next >>',$file);
$file=str_replace('<img class="absmiddle" height="16" width="16" src="/images/previous.png" alt="Previous" />',' << prev ',$file);
$matches = array();
$regex = '~<p class="sms">(.*?)<\/p>~is';
preg_match_all($regex, $file, $matches);
foreach ($matches[1] as $img){
$img=str_replace('<br/>
','<br/>',$img);
$cimg=str_replace('<br/>','
',$img);
$cimg=urlencode($cimg);
echo '<div class="content">» '.$img.' <hr/><center><a href="http://m.facebook.com/home.php?p='.$cimg.'%0A%0AFrom: '.$set->url.'">Share FB</a> | <a href="sms:?body='.$cimg.'%0A%0AFrom: '.$set->url.'">Forword it</a></center></div>';}
$matches = array();
$regex = '~<div class="pgn">(.*?)<\/div>~is';
preg_match_all($regex, $file, $matches);
foreach ($matches[1] as $img){$img=str_replace('next >>','next >>',$img);
$img=str_replace('?get-z=','http://jatt.nazuka.net/Sms/',$img);
$img=str_replace('">','.html">',$img);
$img=str_replace('<< prev','<< prev',$img);
$img=str_replace('lang/B/lang/B/','lang/B/',$img);
echo "<div class='pages'><center><b>$img</b></center></div>";};
}
function name($file){
$metter ='~<h1>(.*?)</h1>~i';
preg_match_all($metter,$file,$match);
foreach($match[1] as $name);
return $name;
}
include "footer.php";
?>