Просмотр файла biblioteka/shm.dat

Размер файла: 2.93Kb
for ($i=0; $i<$am; $i++) {
  $fstr= explode("|", $abs[$i]); // Получаем строку-список
  if ($fstr[0]===$a) break;
}
$aut= $fstr[1]; // Получить автора

for ($i=0; $i<$am; $i++){ // Список авторов
  $tmp= explode("|", trim($abs[$i]));
  if ($tmp[1]===$aut) {
    if ($tmp[2]!=="") {
      $saut= explode("==", $tmp[2]);
      @$ml[0][$saut[0]]++; // $making list
      $num[0][$saut[0]]= $tmp[0];
    $genre[0][$saut[0]]= $tmp[5];
} else {
      $ml[1][$tmp[3]]= filesize($tmp[4]);
      $num[1][$tmp[3]]=$tmp[0];
      $genre[1][$tmp[3]]= $tmp[5];
    }
  }
}

if (isset($ml[0])) $t1= count($ml[0]); else $t1= 0;
if (isset($ml[1])) $t2= count($ml[1]); else $t2= 0;

if (!isset($start)) $start= 0;
$c= 0;
$wml.= "<small><b>[".$aut."]</b><br/>\n";

if (isset($ml[0])) {
  ksort($ml[0]);
  if ($t1!==0) if ($start<$t1) $wml.= "<b>:СЕРИАЛЫ:</b><br/>\n";
  foreach ($ml[0] as $k=>$v) {
    if ($c>=$start && $c<$start+$AUTORSPP) {
      $wml.= "-".$k."<b> [".$genre[0][$k]."]</b> (<a href=\"$PHP_SELF?cmd=ShS&amp;a=".$num[0][$k]."&amp;sz=".@$sz."&amp;dcs=".@$dcs."\">".$v."</a>)<br/>";
    }
    $c++;
  }
}

if ($c<$start+$AUTORSPP)
if (isset($ml[1])) {
  ksort($ml[1]);
  $wml.= "<b>Книги:</b><br/>\n";
  foreach ($ml[1] as $k=>$v) {
    if ($c>=$start && $c<$start+$AUTORSPP) {
      $wml.= "--<a href=\"$PHP_SELF?cmd=Rd&amp;a=".$num[1][$k]."&amp;sz=".@$sz."&amp;dcs=".@$dcs."\">".$k."</a><b> [".$genre[1][$k]."]</b>(".$v." байт)<br/>";
    }
    $c++;
  }
}

if ($start>0) $s1= "<a href=\"$PHP_SELF?cmd=ShM&amp;a=".$a."&amp;sz=".$sz."&amp;start=".($start-$AUTORSPP)."&amp;dcs=".@$dcs."\">&lt;&lt;|</a>"; else $s1="";
if ($start+$AUTORSPP<$t1+$t2) $s2= "<a href=\"$PHP_SELF?cmd=ShM&amp;a=".$a."&amp;sz=".$sz."&amp;start=".($start+$AUTORSPP)."&amp;dcs=".@$dcs."\">|&gt;&gt; </a>"; else $s2="";
$wml.= $s1.$s2;
//if ($s1==="" && $s2==="") ; else $wml.="<br/>\n";
if ($s1.$s2!=="") $wml.="<br/>\n";

$wml.= "</small>- - -<br/>";
if ($aut!="Разное") {
switch ($aut[0]):
  case "А": $a= 1;break;
  case "Б": $a= 2;break;
  case "В": $a= 3;break;
  case "Г": $a= 4;break;
  case "Д": $a= 5;break;
  case "Е": $a= 6;break;
  case "Ё": $a= 7;break;
  case "Ж": $a= 8;break;
  case "З": $a= 9;break;
  case "И": $a= 10;break;
  case "Й": $a= 11;break;
  case "К": $a= 12;break;
  case "Л": $a= 13;break;
  case "М": $a= 14;break;
  case "Н": $a= 15;break;
  case "О": $a= 16;break;
  case "П": $a= 17;break;
  case "Р": $a= 18;break;
  case "С": $a= 19;break;
  case "Т": $a= 20;break;
  case "У": $a= 21;break;
  case "Ф": $a= 22;break;
  case "Х": $a= 23;break;
  case "Ц": $a= 24;break;
  case "Ч": $a= 25;break;
  case "Ш": $a= 26;break;
  case "Щ": $a= 27;break;
  case "Э": $a= 28;break;
  case "Ю": $a= 29;break;
  case "Я": $a= 30;
endswitch;

$wml.= "<a href=\"$PHP_SELF?cmd=ShA&amp;a=".$a."&amp;sz=".@$sz."&amp;dcs=".@$dcs."\">Авторы</a><br/>";
}
$wml.= "<a href=\"$PHP_SELF?dcs=".@$dcs."\">Алфавит</a><br/>";