View file load/main/news.php

File size: 5.75Kb
<?php
/*
Автор: Evgenij made in AZOV 
E-mail: [email protected] (Всем вопросы и тех. поддержка)
Запрещенно!!: добавлять данный скрипт в бесплатные архивы!!, продавать!!, Меняться на форумах и т.д и т.п!!, без моего согласия:) 
*/
include "cfg.php";/////Настройки
$substr_count = substr_count($dirr,"$Obmennik");
if(($substr_count!=0)&&($substr_count!="")) {$this_file=$this_file_obmennik;} 


$kolichestvo="10";
list($msec,$sec)=explode(chr(32),microtime()); 
$HeadTime=$sec+$msec; 
list($startif,$endif) = explode('.',$filename);

$namefile=str_replace('_',' ',$namefile);
list($filename,$endif) = explode('.',$filename);
$endif='.'.$endif;
$dp=substr($dirr,1);
$extu = explode('/',$dp);
$extu = $extu[count($extu)-1];
$ddirruu=substr_count($extu,"!");
if($ddirruu==2)   {$namefile=$startif;} else {$namefile=latrus($startif);}
if($ver==0) {$header ='<?xml version = "1.0" encoding = "UTF-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru">
<head>
<title>'.$title.'</title><link rel="stylesheet" href="'.$dir_style.'/'.$style.'" type="text/css"/>
<meta http-equiv="Content-Type" content="application/vnd.wap.xhtml+xml; charset=utf-8" />
</head><body>';
} else {$header ='<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE wml PUBLIC "-//PHONE.COM//DTD WML 1.3//EN" "http://www.phone.com/dtd/wml13.dtd"><wml><card id="Menu" title="'.$title.'"><p align="left">';}
if($ver==0) {header ("Content-type: application/xhtml+xml; charset=utf-8");} else { header ("Content-type:text/vnd.wap.wml; charset=utf-8");}
print $header;
$siska='&amp;sh='.$sh.'';
if($ver==0) {print '<div class="top">';}



echo "<a href=\"news.php?filename=$filename$endif&amp;dirr=$dirr&amp;style=$style&amp;ver=$ver\">Обновить</a>|
<a href=\"../$this_file?filename=$filename$endif&amp;dirr=$dirr&amp;style=$style&amp;ver=$ver$siska\">Пред.стр.</a>|
<a href=\"../$this_file?down=1&amp;s=$filename$endif&amp;a=$dp/\">Скачать:$namefile$endif</a>"; 
if($ver==0) {print '</div>';} else { print '<br/>------<br/>';}
if($ver==0) {print '<div class="block"><form action="news_add.php?filename='.$filename.$endif.'&amp;dirr='.$dirr.'&amp;style='.$style.'&amp;ver='.$ver.'" method="post">';} print 'Имя:<br/><input type="text" name="name" maxlength="40" value=""/>
<br/>Коммент:<br/><input type="text" name="msg" maxlength="40" value=""/>';
if($ver==0) {print '<br/><input type="submit" value="Написать"/></form></div>';}
else {print '<br/><anchor title="ok">Написать<go href="news_add.php?filename='.$filename.$endif.'&amp;dirr='.$dirr.'&amp;style='.$style.'&amp;ver='.$ver.'" method="post"><postfield name="name" value="$name"/><postfield name="msg" value="$msg"/></go></anchor>';}
if($ver==0) {$dd='<div class="bottom">'; $dd1='</div>' ;}  else {$dd='<br/>'; $dd1='<br/>';}
$file =file("news/$filename$endif.dat");
if(!empty($file)) {
 print ''.$dd.'Все комменты';
$filew = @file("news/$filename$endif.dat");
$totalw = count($filew);
$totalw=$totalw-1;
$dw = explode("|",$filew[$totalw]);
echo '<b>('.$dw[5].')</b>:'.$dd1.'';
print '';} else {

 print ''.$dd.'Kомментов нет :('.$dd1.'';}
if($ver==0) {print '<div class="block">';}
$file = @file("news/$filename$endif.dat");
$total = count($file);    
if (empty($_GET['start'])) $start = 0;
else $start = $_GET['start'];
if ($total < $start + $kolichestvo){ $end = $total; }
else {$end = $start + $kolichestvo; }
for ($i = $start; $i < $end; $i++){
$file = @file("news/$filename$endif.dat");
$file = array_reverse($file);
$data = explode("|",$file[$i]);
$i2=round($i+1);
if(!empty($data[1]))
{if($ver==0) {$ss='<div class="text">'; $ss1='</div>';}  else {$ss='------<br/>'; $ss1='';}
echo"$ss
<b>$data[4]</b> ($data[2] $data[3])<br/>$data[1]<br/> $ss1";
} else { echo" ";}}
if($ver==0) {print '</div><div class="bottomn">';}  else {print '------<br/>';}
if ($start != 0) {echo '<a href="news.php?start='.($start - 10).'&amp;filename='.$filename.'&amp;style='.$style.'&amp;ver='.$ver.'">Назад</a> |  ';}else{echo'';}
if ($total > $start + $kolichestvo) {echo '<a href="news.php?start='.($start + 10).'&amp;filename='.$filename.'&amp;style='.$style.'&amp;ver='.$ver.'">Далее</a>';}
else{echo'';}
$style_this=substr($style,0,-4);$style_this=latrus($style_this); $style_this=str_replace('_',' ',$style_this);
if($ver==0) {print '</div><div class="copy">';}  else {print '<br/>';}
if($ver==0){ $gg=1; $ggg='wml'; $ggg1='xhtml<a href="news.php?filename='.$filename.$endif.'&amp;dirr='.$dirr.'&amp;style='.$style.'&amp;ver='.$ver.$siska.'&amp;sm=yes">('.$style_this.')*</a>';} else {$gg=0; $ggg='xhtml('.$style_this.')'; $ggg1='wml';}
print 'Версия сайта: <a href="news.php?filename='.$filename.$endif.'&amp;dirr='.$dirr.'&amp;style='.$style.'&amp;ver='.$gg.$siska.'">'.$ggg.'</a> | '.$ggg1.'';
if($ver==0) {if($sm=="yes") {print '<form action ="news.php?filename='.$filename.$endif.'&amp;dirr='.$dirr.'&amp;style='.$style.'&amp;ver='.$ver.$siska.'" method="post">
Стиль:<select name="style" multiple="false">';
$dir = opendir ("../main/css"); 
while ($style = readdir ($dir)) 
{if (( $style != ".") && ($style != "..") && ($style != ".htaccess"))
{$style_this=substr($style,0,-4); $style_this=latrus($style_this);$style_this=str_replace('_',' ',$style_this); print '<option value="'.$style.'">'.$style_this.'</option>';}}
print '</select>';   
closedir ($dir);
print '<input type="submit" name="go" value="&#183;&#183;&#187; "></input></form>';}}
if($ver==0) {$end='</div></body></html>';}else {
$end='</p>
</card>
</wml>';} 
print $end;
?>