File size: 4.38Kb
<?php
#-----------------------------------------------------#
# **** WAP-MOTORS AutoDetect XHTML/WML **** #
#-----------------------------------------------------#
# Original Made by : VANTUZ #
# E-mail : [email protected] #
# Site : http://pizdec.ru #
# WAP-Site : http://visavi.net #
# ICQ : 36-44-66 #
#-----------------------------------------------------#
# AutoDetect Made by : X-ray (Юрий) #
# E-mail : [email protected] #
# Site : http://zugdidi.us #
# WAP-Site : http://geowap.mobi #
#-----------------------------------------------------#
# Вы не имеете право вносить изменения в код скрипта #
#-----------------------------------------------------#
require_once"../template/start.php";
require_once"../template/regglobals.php";
require_once"../template/config.php";
require_once"../template/functions.php";
require_once"../template/maincore.php";
require_once"../template/antidos.php";
require_once"../template/cookies.php";
require_once"../template/gzip.php";
require_once"../template/header.php";
require_once"../template/referer.php";
include_once"../themes/$config_themes/index.php";
$text = file("../local/profil/$log.prof");
if ($text!=""){
$udata = explode(":||:",$text[0]);
$provlog=trim($udata[0]);
$provpar=trim($udata[1]);
$privat=trim($udata[10]);}
echo'<img src="../images/img/partners.gif" alt=""> Новости сайта<br><br>';
if ($_SESSION['log']!="" && md5($_SESSION['par'])!="" && md5($_SESSION['par'])==$provpar && $_SESSION['log']==$provlog ) {
if($udata[10]>0){
echo'<img src="../images/img/mail.gif" alt=""> <b><a href="../pages/privat.php?'.$detect_wap.''.SID.'"><font color="red">Приватное сообщение! ('.$privat.')</font></a></b><br>';}}
$file = file("../local/news.dat");
$total = count($file);
if (empty($_GET['start'])) $start = 0;
else $start = $_GET['start'];
if ($total < $start + $config_postnews){ $end = $total; }
else {$end = $start + $config_postnews; }
for ($i = $start; $i < $end; $i++){
$file = file("../local/news.dat");
$file = array_reverse($file);
$data = explode("|",$file[$i]);
$i2=round($i+1);
$data[1]=eregi_replace("((https?|ftp)://[[:alnum:]_=/-]+(\\.[[:alnum:]_=/-]+)*(/[[:alnum:]+&._=/~%#]*(\\?[[:alnum:]?+&_=/%#]*)?)?)", "<a href='\\1'>\\1</a>", $data[1]);
$data[6]=preg_replace ("|[\r\n]+|si","",$data[6]);
if(!empty($data[1])){
echo'<div class=b><img src="../images/img/files.gif" alt=""> ';
echo'<b>'.$data[0].'</b><small> ('.$data[2].' - '.$data[3].')</small></div>'.$data[1].'<br>Разместил: '.$data[4].' <br>';
echo'<a href="komm.php?id='.$data[5].'&'.$detect_wap.''.SID.'">Коментарии</a>';
$filek = file("../local/datakomm/$data[5].dat");
$totalk = count($filek);
$totalk=$totalk-1;
$data1 = explode("|",$filek[$totalk]);
echo '('.(int)$data1[5].')';
echo"<br>";} else { echo"<br>Новостей еще нет!<br>";}
}
echo'<hr>';
if ($start != 0) {echo '<a href="index.php?start='.($start - $config_postnews).'&'.$detect_wap.''.SID.'"><-Назад </a> ';}else{echo'<-Назад ';}
echo'|';
if ($total > $start + $config_postnews) {echo ' <a href="index.php?start='.($start + $config_postnews).'&'.$detect_wap.''.SID.'"> Далее-></a>';}else{echo' Далее->';}
$ba=ceil($total/$config_postnews);
$ba2=$ba*$config_postnews-$config_postnews;
if($total>0){
echo'<br><hr>Страницы:';
$asd=$start-($config_postnews*3);
$asd2=$start+($config_postnews*4);
if($asd<$total && $asd>0){echo ' <a href="index.php?start=0&'.$detect_wap.''.SID.'">1</a> ... ';}
for($i=$asd; $i<$asd2;)
{
if($i<$total && $i>=0){
$ii=floor(1+$i/$config_postnews);
if ($start==$i) {
echo ' <b>'.$ii.'</b>';
}
else {
echo ' <a href="index.php?start='.$i.'&'.$detect_wap.''.SID.'">'.$ii.'</a>';
}}
$i=$i+$config_postnews;}
if($asd2<$total){echo ' ... <a href="index.php?start='.$ba2.'&'.$detect_wap.''.SID.'">'.$ba.'</a>';}
}
echo'<br><a href="../index.php?'.$detect_wap.''.SID.'">На главную</a> ';
include_once"../themes/$config_themes/foot.php";
?>