Пример #1
0
    $_SESSION['missingTranslations'] = $localize->GetMissingTranslations();
}
foreach ($_SESSION['translations'] as $constant => $value) {
    $value = isset($_SESSION['missingTranslations'][$constant]) && $_SESSION['langs'][$_SESSION['ccode']]['direction'] == 'rtl' ? '<span dir="' . Localize::_FALLBACK_DIRECTION . '">' . $value . '</span>' : $value;
    define($constant, $value);
}
// If localization just changed, urldecode everything in $_GET that was encoded by http_build_query()
if (isset($_GET['ccode'])) {
    foreach ($_GET as $k => $v) {
        $_GET[$k] = urldecode($v);
    }
}
// Instantiate converter class and populate vars/arrays
$converter = new VideoConverter();
$videoHosts = $converter->GetVideoHosts();
$uniqueFtypes = $ftypes = $converter->GetConvertedFileTypes();
$editableFtypes = array();
$fileExts = array();
$mimeTypes = array();
$checkedExt = current(array_keys($ftypes));
array_walk($ftypes, function ($ftype, $key) use(&$editableFtypes, &$fileExts, &$checkedExt, &$mimeTypes) {
    if (isset($ftype['jPlayerName']) && !isset($editableFtypes[$ftype['fileExt']])) {
        $editableFtypes[$ftype['fileExt']] = isset($ftype['modernizrType']) ? $ftype['modernizrType'] : '';
    }
    $fileExts[$key] = $ftype['fileExt'];
    if (isset($ftype['checked'])) {
        $checkedExt = $key;
    }
    $mimeTypes[$key] = $ftype['mimeType'];
});
// If bookmarklet conversion, then refresh page to initialize session cookie
Пример #2
0
<?php

session_start();
header('Access-Control-Allow-Origin: *');
// Autoload class files
spl_autoload_register(function ($className) {
    if (!class_exists($className)) {
        include '../' . $className . '.class.php';
    }
});
// Instantiate converter class
$converter = new VideoConverter();
$ftypes = $converter->GetConvertedFileTypes();
$output = '';
foreach ($ftypes as $key => $ftype) {
    $output .= '<input type="radio" value="' . $key . '" name="ftype" ';
    $output .= isset($ftype['checked']) ? 'checked="checked" ' : '';
    $output .= '/>.' . $ftype['fileExt'];
    $output .= isset($ftype['quality']) ? ' (' . $ftype['quality'] . 'kb)' : '';
    $output .= $ftype != end($ftypes) ? ' &nbsp;' : '';
}
$output .= '<input type="hidden" name="bookmarklet" value="1" />';
echo $output . "^^^" . (int) Config::_SSL_ENABLED;