Example #1
0
function ShowInitialForm()
{
    global $MyFilename, $Source, $SourceType, $RewrapParagraphs, $BreakOnChapter, $TargetType, $TitleOfDoc, $SourceForge, $filedata, $urldata, $UncompressedDoc, $TitleOfBasicFile;
    echo "<br>\n";
    ShowDownloadLinks();
    ?>
<form action="<?php 
    echo $MyFilename;
    ?>
" method="post" enctype="multipart/form-data">
<input type=hidden name=action value="convert">
<table border=1 align=center cellpadding=5 cellspacing=0>
  <tr>
    <td align=right><b>Source:</b></td>
    <td><?php 
    if (!$SourceForge) {
        ?>
      <input type=radio name="Source" value="URL"<?php 
        if (!isset($Source) || $Source != 'File') {
            echo ' checked';
        }
        ?>
>
      URL:  <input type=input name=urldata size=60<?php 
        if (isset($urldata)) {
            echo ' value="' . htmlspecialchars($urldata) . '"';
        }
        ?>
><br>
      <?php 
    }
    ?>
      
      <input type=radio name="Source" value="File"<?php 
    if (isset($Source) && $Source == 'File' || $SourceForge) {
        echo ' checked';
    }
    ?>
>
      File:  <input type=file name=filedata size=45<?php 
    if (isset($filedata)) {
        echo ' value="' . htmlspecialchars($filedata) . '"';
    }
    ?>
>
      
      <?php 
    if ($SourceForge) {
        ?>
      <br>
      <i>(Sourceforge does not allow downloading from URLs, but Twister
      does support it.)</i><?php 
    }
    ?>
</td>
  </tr>
  <tr>
    <td align=right><b>Source Type:</b></td>
    <td><input type=radio name="SourceType" value="HTML"<?php 
    if (!isset($SourceType) || $SourceType != 'Text' && $SourceType != 'Gutenberg') {
        echo ' checked';
    }
    ?>
>
      HTML<br>
      <br>
      
      <input type=radio name="SourceType" value="Text"<?php 
    if (isset($SourceType) && $SourceType == 'Text') {
        echo ' checked';
    }
    ?>
>
      Text<br>
      &nbsp; &nbsp; &nbsp;<input type=checkbox name="RewrapParagraphs"<?php 
    if (isset($RewrapParagraphs) && $RewrapParagraphs) {
        echo ' checked';
    }
    ?>
>
      Rewrap paragraphs<br>
      <br>
      
      <input type=radio name="SourceType" value="Gutenberg"<?php 
    if (isset($SourceType) && $SourceType == 'Gutenberg') {
        echo ' checked';
    }
    ?>
>
      Project Gutenberg Text (<a href="http://promo.net/pg">What is 
      this?</a>)<br>
      &nbsp; &nbsp; &nbsp;Create a new DOC file every 
      <input type=text name="BreakOnChapter" size=4 value="<?php 
    if (isset($BreakOnChapter)) {
        settype($BreakOnChapter, 'integer');
        echo htmlspecialchars($BreakOnChapter);
    } else {
        echo '0';
    }
    ?>
"> chapters<br>
      &nbsp; &nbsp; &nbsp;<i>(Use 0 to disable)
      
      </td>
  </tr>
  <tr>
    <td align=right><b>Convert Into:</b></td>
    <td><input type=radio name="TargetType" value="DOC"<?php 
    if (!isset($TargetType) || $TargetType != 'SmallBASIC') {
        echo ' checked';
    }
    ?>
> DOC<br>
      &nbsp; &nbsp; &nbsp;DOC Title:
      <input type=text name="TitleOfDoc" value="<?php 
    if (isset($TitleOfDoc)) {
        echo htmlspecialchars($TitleOfDoc);
    }
    ?>
">
      <br>
      &nbsp; &nbsp; &nbsp;<input type=checkbox name="UncompressedDoc">
      Don't compress DOC file (faster to convert, larger file)
      <br><br>

      <input type=radio name="TargetType" value="SmallBASIC"<?php 
    if (isset($TargetType) && $TargetType == 'SmallBASIC') {
        echo ' checked';
    }
    ?>
> SmallBASIC<br>
      &nbsp; &nbsp; &nbsp;Name of File:
      <input type=text name="TitleOfBasicFile" value="<?php 
    if (isset($TitleOfBasicFile)) {
        echo htmlspecialchars($TitleOfBasicFile);
    }
    ?>
">
      </td>
  </tr>
  <tr>
    <td colspan=2 align=center><input type=submit value="Convert File!"></td>
  </tr>
</table>
</form>
<?php 
    TinyFooter();
}
Example #2
0
<p>When using this test, make sure to have a freshly loaded copy of the file
on your palm and make sure that the first program to open it is your DOC
reader.  If you don't, the database can be altered and you would be getting
inaccurate results.</p>

<p>For instance, if you create a DOC file with embedded bookmarks and you
run it through AportisDOC, it will scan the file and create stored
bookmarks.  Then, if you open it with another DOC reader, you might think
that embedded bookmarks are supported, even if the program only supports
stored bookmarks.</p>

<p>The easiest way to avoid being tricked is to just download and HotSync a
new copy of the test for each type of bookmark for each DOC reader you wish
to test.</p>
<?php 
    TinyFooter();
    ?>
</body></html>
<?php 
    exit;
}
if ($Stored) {
    $pdb = new PalmDoc("Stored Bookmark Test");
} else {
    $pdb = new PalmDoc("Embedded Bookmark Test");
}
if ($Stored) {
    $ThisTest = "stored";
    $OtherTest = "embedded";
    $UcFirst = "Stored";
} else {