fseek($handle, 59); $contents = fread($handle, 1); if (ord($contents) != 0x3) { echo 'File Problem - Doesn\'t seem to be a Equation File<br>'; echo '<a href="index.php">Back to main menu</a>'; echo '<h2>Open a file</h2>'; echo '<form enctype="multipart/form-data" action="82y-txt-converter.php" method="post">'; echo '<input type="hidden" name="MAX_FILE_SIZE" value="5000000" />'; echo 'Open a TI Equation File (82y): <input name="userfile" type="file" /> <input type="submit" value="Open">'; echo '</form>'; include "bottom.php"; die; } fseek($handle, 11); $contents = fread($handle, 40); $TIComment = VireZeroTerminaux($contents); fseek($handle, 61); $contents = ord(fread($handle, 1)); if ($contents < 0x1a) { $TIName = 'Y' . ($contents - 0xf == 0xa ? 0 : $contents - 0xf); } else { if ($contents < 0x2c) { $TIName = ($contents - 0x1f & 1 == 1 ? 'X' : 'Y') . ($contents - 0x1f == 0xa ? 0 : ceil(($contents - 0x1f) / 2)) . 'T'; } else { if ($contents < 0x45) { $TIName = 'r' . ($contents - 0x3f == 0xa ? 0 : $contents - 0x3f); } else { if ($contents == 0x80) { $TIName = "u"; } else { if ($contents == 0x81) {
$contents = ''; $count = 0; $contents = fread($handle, 8); $TIHeader = ''; $TIHeader = $contents == '**TI89**' ? "89" : ''; $TIHeader = $contents == '**TI92**' ? "92" : ''; $TIHeader = $contents == '**TI92P*' ? "92P" : ''; fseek($handle, 10); $contents = fread($handle, 8); $TIFolder = VireZeroTerminaux($contents); fseek($handle, 18); $contents = fread($handle, 40); $TIComment = VireZeroTerminaux($contents); fseek($handle, 64); $contents = fread($handle, 8); $TIName = VireZeroTerminaux($contents); fseek($handle, 73); $contents = fread($handle, 1); $TIStoreTypeN = ord($contents); $StoreTypes = array("RAM", 'RAM Locked', 'Archive'); $TIStoreType = $StoreTypes[$TIStoreTypeN]; fseek($handle, 86); $contents = fread($handle, 1); $TempBin = ord($contents); $contents = fread($handle, 1); $TextLength = $TempBin * 256 + ord($contents); fseek($handle, 90); $contents = nl2br(htmlspecialchars(fread($handle, $TextLength - 3))); $text = $contents; /* for ($i=0; $i<strlen($contents); $i++) {