function sd3NewTableResolve($text) { return $text; } try { if (UserManager::isLogged() && UserManager::hasRole(APPLICATION_ID)) { switch ($_SERVER['REQUEST_METHOD']) { case 'POST': $result = array(); $id_text = $_POST['id_text']; $author = UserManager::getUsername(); $new_text = $_POST['new_text']; $status = $_POST['status']; $comment = sqlite_escape_string($_POST['comment']); $time = time(); $new_text = textClean($new_text); $new_text = sqlite_escape_string($new_text); $new_text2 = sd3NewTableResolve($new_text); $db = new SQLite3(SQLITE_FILENAME); $query = "INSERT OR REPLACE INTO trans VALUES('{$id_text}', '{$author}', '{$new_text}', '{$new_text2}', '{$status}', '{$time}', '{$comment}')"; $db->query($query); $db->close(); unset($db); $updateDate = @date('d/m/Y, G:i', $time); $result['updateDate'] = $updateDate; echo json_encode($result); break; default: header('HTTP/1.1 405 Method Not Allowed'); exit; }
} return $char; } $id_text = $_POST['id_text']; $source = $_POST['text']; $source = str_replace('{02}{00}', '', $source); $boxes = explode('{f5}', $source); foreach ($boxes as $box) { $text = explode('{f3} ', $box); if (count($text) == 1) { $text = explode('{f2} ', $box); } $text[0] = textClean($text[0]); $boxProperties = ys3BoxPropertiesCalculator($text[0]); $paddingTop = 8 + $boxProperties['top'] * 8; $paddingLeft = 8 + $boxProperties['left'] * 8; $width = $paddingLeft + 8 + $boxProperties['width'] * 8; echo '<div class="box-test"><div class="box-test-container" style="border-right: solid 1px yellow; width: ' . $width . 'px; padding-top: ' . $paddingTop . 'px; padding-left: ' . $paddingLeft . 'px;">'; $cleanedText = textClean($text[1]); $cleanedText = ys3TextClean($cleanedText); $lines = explode('{fe}', $cleanedText); foreach ($lines as $line) { $line = preg_split('//u', $line, -1, PREG_SPLIT_NO_EMPTY); for ($i = 0; $i < count($line); $i++) { $char = ys3TextDecoder($line[$i]); echo '<img class="tile-8x16 ys3-' . $char . '" src="./images/preview/placeholder-8x16.png">'; } echo '<br />'; } echo '</div></div>'; }
$source = $text[0]; $textWithoutProps = $text[1]; } else { $textWithoutProps = $text[0]; } $cleanedSource = textClean($source); $boxProperties = ys4BoxPropertiesCalculator($cleanedSource); $paddingTop = 8 + $boxProperties['top'] * 8; $paddingLeft = 8 + $boxProperties['left'] * 8; $width = $paddingLeft + 8 + $boxProperties['width'] * 12; if ($id_text >= 1277 && $id_text < 1294 || $id_text >= 975 && $id_text < 977 || $id_text == 987) { echo '<style> .box-dialog-' . $i . ' .tile { background-color: ' . $boxProperties['color'] . '; } </style>'; echo '<div class="box-introduction box-introduction-' . $i . '"><div class="box-introduction-container" style="border-right: solid 1px yellow; width: ' . $width . 'px; padding-top: ' . $paddingTop . 'px; padding-left: ' . $paddingLeft . 'px;">'; } else { echo '<style> .box-dialog-' . $i . ' .tile { background-color: ' . $boxProperties['color'] . '; } </style>'; echo '<div class="box-dialog box-dialog-' . $i . '"><div class="box-dialog-container" style="border-right: solid 1px yellow; width: ' . $width . 'px; padding-top: ' . $paddingTop . 'px; padding-left: ' . $paddingLeft . 'px;">'; } $cleanedText = textClean($textWithoutProps); $cleanedText = ys4TextClean($cleanedText); $lines = explode('{fe}', $cleanedText); foreach ($lines as $line) { $line = preg_split('//u', $line, -1, PREG_SPLIT_NO_EMPTY); for ($i = 0; $i < count($line); $i++) { $char = ys4TextDecoder($line[$i]); $class = isset($map2[$char]) ? 'tile' . $map2[$char] . 'x16' : 'tile4x16'; echo '<img class="tile ' . $class . ' ys4-' . $char . '" src="./images/preview/placeholder-8x16.png">'; } echo '<br />'; } echo '</div></div>'; }
} elseif ($props == '{05}{10}{16}') { $max_chars = 22; } elseif ($props == '{04}{14}{18}') { $max_chars = 24; } return array('max_chars' => $max_chars); } function brandishTextClean($text) { $text = preg_replace('/\\{04\\}/', 'XXX', $text); $text = preg_replace('/\\{..\\}/', '', $text); return $text; } $id_text = $_POST['id_text']; $source = $_POST['text']; $cleanedSource = textClean($source); $boxProperties = brandishBoxPropertiesCalculator($cleanedSource); $max_chars = $boxProperties['max_chars']; if ($id_text >= 102 && $id_text <= 151) { echo '<div class="box-sign"><div class="box-sign-container">'; $cleanedText = brandishTextClean($cleanedSource); for ($i = 0; $i < 10; $i++) { $line = mb_substr($cleanedText, 16 * $i, 16); $line = preg_split('//u', $line, -1, PREG_SPLIT_NO_EMPTY); for ($k = 0; $k < count($line); $k++) { $char = $line[$k]; $key = array_search($char, $table); if ($key !== false) { echo '<img class="tile-8x8 brandish-font1-' . $key . '" src="./images/preview/placeholder-8x8.png" />'; } else { echo '<img class="tile-8x8" src="./images/preview/placeholder-8x8.png" />';