View file load/info.php

File size: 3.77Kb
<?php
//////////////////////////////////
include('func/format.php');
include('verh.php');
include('conf.php');
//////////////////////////////////
function top_dir($dirname)
{
  $pos = StrPos('@'.$dirname,'/');
  if($pos)
  {
    $pos = STRRPOS($dirname,'/');
    $str = SUBSTR($dirname,0,$pos);
  }
  else { $str = '..'; }
  $l = StrLen($str);
  $one = SubStr($str,0,1);
  if($one=='/') $strn = SubStr($str,1); else $strn=$str;
  $l = StrLen($strn);
  $two = SubStr($strn,$l-1,1);
  if($two=='/') $strok = SubStr($strn,0,$l-1); else $strok=$strn;
  return $strok;
}

function rsh($fname)
{
  $pos = StrPos('@'.$fname,'.');
  if($pos)
  {
    $ps = Strrpos($fname,'.');
    $rsh_name = substr($fname,$ps+1);
  }
  else
  { $rsh_name = ''; }
  return $rsh_name;
}
if($ver=='html') print '<div class="header">Info</div><br/>';
if($ver=='wml') print '';

if(IsSet($f) && IsSet($d) && (is_file("./$d/$f")))
{
  $fname = "./$d/$f";
  $rsh = rsh($f);
  $size = ceil(filesize($fname)/1000);
  $info = date("d.m.y",filectime($fname));
  print "Файл: $f<br/>Размер: $size кб<br/>Закачан: $info<br/><br/>";
  if($rsh!='jpg' && $rsh!='png' && $rsh!='gif' && $rsh!='jar' && $rsh!='jad')
  {
    print "<img src=\"save.gif\" alt=\".\"/> <a href=\"".str_replace('./','',$fname)."\">Скачать</a><br/>";
    print 'Прямая ссылка:<br/>'.$script_path.'/'.$d.'/'.$f.'<br/>';
    print "<input name=\"url\" value=\"$script_path/$d/$f\"/><br/>";
  }
  if($rsh=='jpg' || $rsh=='png' || $rsh=='gif')
  {
    print 'Выберите разрешение:<br/>
	    -><a href="picture.php?pic='.$fname.'&amp;w=101&amp;h=80">101x80</a><br/>
	    -><a href="picture.php?pic='.$fname.'&amp;w=128&amp;h=128">128x128</a><br/>
	    -><a href="picture.php?pic='.$fname.'&amp;w=128&amp;h=160">128x160</a><br/>
	    -><a href="picture.php?pic='.$fname.'&amp;w=176&amp;h=220">176x220</a><br/>
	    -><a href="picture.php?pic='.$fname.'&amp;w=240&amp;h=320">240x320</a><br/>
	    -><a href="picture.php?pic='.$fname.'&amp;w=320&amp;h=320">320x320</a><br/><br/>
	    <a href="picture.php?pic='.$fname.'">Оригинал</a><br/><br/>';
    print "<img src=\"save.gif\" alt=\".\"/> <a href=\"".str_replace('./','',$fname)."\">Скачать</a><br/>";
    print 'Прямая ссылка:<br/>'.$script_path.'/'.$d.'/'.$f.'<br/>';
    print "<input name=\"url\" value=\"$script_path/$d/$f\"/><br/><br/>";
  }
  if($rsh=='jar' || $rsh=='jad')
  {
    $info_name = str_replace('.jad','.jar',$fname);
    if(file_exists($info_name.'.cmt')) { $com_count = count(file($info_name.'.cmt')); } else { $com_count = 0; }
    if(file_exists($info_name.'.info')) { $java_info = strip_tags(implode(file($info_name.'.info'))); } else { $java_info = 'Нет Описания'; }
    print "Описание:<br/>$java_info<br/><br/>";
    print "<a href=\"com.php?f=$fname\">Комментарии ($com_count)</a><br/><br/>";
    print "<img src=\"save.gif\" alt=\".\"/> <a href=\"$fname\">Скачать</a><br/>";
    print 'Прямая ссылка:<br/>'.$script_path.'/'.$d.'/'.$f.'<br/>';
    print "<input name=\"url\" value=\"$script_path/$d/$f\"/><br/><br/>";

  }
}
else
{
  print 'Файл не найден<br/><br/>';
}

print "<a href=\"index.php?d=$d&amp;ver=$ver\">Назад</a><br/>";
print '---<br/><a href="index.php">Загрузки</a><br/>';
if($ver=='wml') print '<br/>wml|<a href="'.$SCRIPT_NAME."?f=$f&amp;d=$d&amp;ver=html".'">html</a><br/>';
if($ver=='html') print '<div class="footers"><a href="'.$SCRIPT_NAME."?d=$d&amp;f=$f&amp;ver=wml".'">wml</a>|html</div>';
if($ver=='html') print '<div class="news"><a href="http://'.$main.'">'.$main_title.'</a></div>';
if($ver=='wml') print '<a href="http://'.$main.'">'.$main_title.'</a>';
include('niz.php');
?>