Ejemplo n.º 1
0
try_get($_COOKIE, 'fontsize', $fontsize, '16');
echo $fontsize;
?>
');
	$("select[name='fontname']").val('<?php 
try_get($_COOKIE, 'fontname', $fontname, 'Arial');
echo $fontname;
?>
');
	$("input[name='topColor']").val('<?php 
try_get($_COOKIE, 'topColor', $topColor, '#FFFFF9');
echo $topColor;
?>
');
	$("input[name='botColor']").val('<?php 
try_get($_COOKIE, 'botColor', $botColor, '#F9FFF9');
echo $botColor;
?>
');
});

</script>
<style type="text/css">
html { width: 100%; height: 100%; background: url("background.svg") no-repeat center center fixed; background-size: cover; }
body { font-family: 'Noto Sans', sans-serif; margin: 0px; padding: 0px; color: #595959; }
.page { width: 800px; margin: 25px auto; background-color: rgb(220, 220, 220); background-color: rgba(220, 220, 220, 0.75); }
h1 { background-color: #595959; color: #999999; padding: 3px 15px; }
h2 { background-color: #909090; color: #CCCCCC; padding: 3px 15px; }
h3 { padding: 3px 15px; }
p { padding: 0; margin: 20px 30px; }
.error { margin: 20px; border: 1px solid #909090; }
Ejemplo n.º 2
0
// Display page ?
if (!try_get($_POST, 'send', $send) || $send != 'yes') {
    sendHTML();
}
// set cookies
try_get($_POST, 'fontname', $fontname, 'Arial');
try_get($_POST, 'fontsize', $fontsize, '16');
try_get($_POST, 'topColor', $topColor, '#FFFFF9');
try_get($_POST, 'botColor', $botColor, '#F9FFF9');
set_infinite_cookie('fontname', $fontname);
set_infinite_cookie('fontsize', $fontsize);
set_infinite_cookie('topColor', $topColor);
set_infinite_cookie('botColor', $botColor);
// Process
if (!DEBUG2SRT2ASS) {
    if (!try_get($_FILES, 'top', $top) || $top['error'] !== 0 || !try_get($_FILES, 'bot', $bot) || $bot['error'] !== 0) {
        sendHTML('Error while uploading. Try again.');
    }
    $outputName = preg_replace('/(\\.[a-zA-Z]{2,3})?\\.srt$/', '.ass', $bot['name']);
    $contentTop = file_get_contents($top['tmp_name']);
    $contentBot = file_get_contents($bot['tmp_name']);
} else {
    $outputFile = 'file:///volume1/web/2srt2ass2/Hannibal.ass';
    $contentTop = file_get_contents('file:///volume1/web/2srt2ass2/Hannibal.en.srt');
    $contentBot = file_get_contents('file:///volume1/web/2srt2ass2/Hannibal.fr.srt');
}
getStyles($fontname, $fontsize, $topColor, $botColor, $styles, $stylesKeys);
cleanSRT($contentTop);
cleanSRT($contentBot);
$tree = array(array('start' => '00:00:01.00', 'end' => '00:00:03.00', 'type' => 'Mid', 'text' => 'Merged with 2SRT2ASS\\N(http://pas-bien.net/2srt2ass/)'));
parseAndAddSRT($contentTop, $tree, 'Top');