Beispiel #1
0
    if (defined('DEV_AUTOEXPORT') and DEV_AUTOEXPORT) {
        //figure out the products of the phrases processed.
        $products = array();
        foreach (array_keys($vbulletin->GPC['rvt']) as $varname) {
            $products[$vbulletin->GPC['prod']["{$varname}"]] = 1;
        }
        foreach (array_keys($vbulletin->GPC['def']) as $varname) {
            if ($vbulletin->GPC['def']["{$varname}"] != $vbulletin->GPC['phr']["{$varname}"]) {
                $products[$vbulletin->GPC['prod']["{$varname}"]] = 1;
            }
        }
        $products = array_keys($products);
        //export those products;
        require_once DIR . '/includes/functions_filesystemxml.php';
        foreach ($products as $product) {
            autoexport_write_language($vbulletin->GPC['dolanguageid'], $product);
        }
    }
    define('CP_REDIRECT', "language.php?do=edit&dolanguageid=" . $vbulletin->GPC['dolanguageid'] . "&fieldname=" . $vbulletin->GPC['fieldname'] . "&page=" . $vbulletin->GPC['pagenumber']);
    print_stop_message('saved_language_successfully');
}
// #############################################################################
// #############################################################################
// ##########################################################################
if ($_POST['do'] == 'upload') {
    ignore_user_abort(true);
    $vbulletin->input->clean_array_gpc('p', array('title' => TYPE_STR, 'serverfile' => TYPE_STR, 'anyversion' => TYPE_BOOL, 'readcharset' => TYPE_BOOL));
    $vbulletin->input->clean_array_gpc('f', array('languagefile' => TYPE_FILE));
    ($hook = vBulletinHook::fetch_hook('admin_language_import')) ? eval($hook) : false;
    // got an uploaded file?
    // do not use file_exists here, under IIS it will return false in some cases
Beispiel #2
0
            print_stop_message('there_is_already_phrase_named_x', $vbulletin->GPC['varname']);
        }
    }
    if ($vbulletin->GPC['ismaster']) {
        if ($vbulletin->debug and !$vbulletin->GPC['t']) {
            /*insert query*/
            $db->query_write("\n\t\t\t\tINSERT INTO " . TABLE_PREFIX . "phrase\n\t\t\t\t\t(languageid, varname, text, fieldname, product, username, dateline, version)\n\t\t\t\tVALUES\n\t\t\t\t\t(-1,\n\t\t\t\t\t'" . $db->escape_string($vbulletin->GPC['varname']) . "',\n\t\t\t\t\t'" . $db->escape_string($vbulletin->GPC['text'][0]) . "',\n\t\t\t\t\t'" . $db->escape_string($vbulletin->GPC['fieldname']) . "',\n\t\t\t\t\t'" . $db->escape_string($vbulletin->GPC['product']) . "',\n\t\t\t\t\t'" . $db->escape_string($vbulletin->userinfo['username']) . "',\n\t\t\t\t\t" . TIMENOW . ",\n\t\t\t\t\t'" . $db->escape_string($full_product_info[$vbulletin->GPC['product']]['version']) . "')\n\t\t\t");
        }
        unset($vbulletin->GPC['text'][0]);
        if (defined('DEV_AUTOEXPORT') and DEV_AUTOEXPORT) {
            require_once DIR . '/includes/functions_filesystemxml.php';
            $products_to_export = array($vbulletin->GPC['product']);
            if (isset($old_product['product'])) {
                $products_to_export[] = $old_product['product'];
            }
            autoexport_write_language(-1, $products_to_export);
        }
    }
    foreach ($vbulletin->GPC['text'] as $_languageid => $txt) {
        $_languageid = intval($_languageid);
        if (!empty($txt) or $txt == '0') {
            /*insert query*/
            $db->query_write("\n\t\t\t\tINSERT INTO " . TABLE_PREFIX . "phrase\n\t\t\t\t\t(languageid, varname, text, fieldname, product, username, dateline, version)\n\t\t\t\tVALUES\n\t\t\t\t\t({$_languageid},\n\t\t\t\t\t'" . $db->escape_string($vbulletin->GPC['varname']) . "',\n\t\t\t\t\t'" . $db->escape_string($txt) . "',\n\t\t\t\t\t'" . $db->escape_string($vbulletin->GPC['fieldname']) . "',\n\t\t\t\t\t'" . $db->escape_string($vbulletin->GPC['product']) . "',\n\t\t\t\t\t'" . $db->escape_string($vbulletin->userinfo['username']) . "',\n\t\t\t\t\t" . TIMENOW . ",\n\t\t\t\t\t'" . $db->escape_string($full_product_info[$vbulletin->GPC['product']]['version']) . "')\n\t\t\t");
        }
    }
    build_language();
    define('CP_REDIRECT', "phrase.php?fieldname=" . $vbulletin->GPC['sourcefieldname'] . "&page=" . $vbulletin->GPC['pagenumber'] . "&pp=" . $vbulletin->GPC['perpage']);
    print_stop_message('saved_phrase_x_successfully', $vbulletin->GPC['varname']);
}
// #############################################################################
if ($_REQUEST['do'] == 'add' or $_REQUEST['do'] == 'edit') {