%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /www/old2/_music/
Upload File :
Create Path :
Current File : /www/old2/_music/fb.php

<?php
  header("Content-type: application/octet-stream");
  header("Content-disposition: attachment; filename=".str_replace(" ", '_', $_POST['name']).".fb2");
  $head = '<?xml version="1.0" encoding="UTF-8"'.'?'.'>
<FictionBook xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.gribuser.ru/xml/fictionbook/2.0">
  <description>
    <title-info>
      <genre></genre>
      <author>
        <first-name></first-name>
        <middle-name></middle-name>
        <last-name></last-name>
      </author>
      <book-title></book-title>
    </title-info>
  </description>
  <body xmlns:fb="http://www.gribuser.ru/xml/fictionbook/2.0" xmlns:xlink="http://www.w3.org/1999/xlink">
    <section>'."\r\n";

  $foot = '    </section>
  </body>
</FictionBook>'; 

    

    $con = file("http://books.varak.net/conv.ini");

    $conv = array();

    foreach($con as $c)

    {

      $r = explode('|', $c);

      $conv[] = array(trim($r[0]), trim($r[1]));

    }
    $conv[] = array("\\'", "'");
    $conv[] = array("\\\"", "\"");

    unset($con);

    

      $lines = explode("\n", $_POST['text']);

      echo $head;

      $empty = 0;

      foreach($lines as $line)

      {

        $line = trim($line);

        if($line == "")

        {

          if($empty > 2) 

          {

            continue; // Povolim max tri prazdne radky po sobe

          }

          $empty++;

        }

        else $empty = 0;

        // Nahrazovani

        foreach($conv as $c)

        {

          $line = str_replace($c[0], $c[1], $line);

        }
        echo "      <p>$line</p>\r\n";
      }
      echo $foot;

?>

Zerion Mini Shell 1.0