Example #1
0
function devfmt_Initializate()
{
    global $DevFmt_Config, $DevFmt_SuppLangs, $table_prefix, $wpdb;
    devfmt_ReadConfig();
    if (isset($DevFmt_Config['version'])) {
        switch (devfmt_Version($DevFmt_Config['version'])) {
            case 2009000001029:
                // none
            // none
            case 2009000001030:
                // none
            // none
            case 2009000001031:
                // none
            // none
            case 2009000001032:
                // none
            // none
            case 2009000001033:
                // none
            // none
            case 2011000001034:
                // none
            // none
            case 2011000001035:
                // none
            // none
            case 2011000001036:
                // none
            // none
            case 2012000001037:
                // none
            // none
            case 2012000001038:
                // none
            // none
            case 2012000001039:
                // none
        }
    } else {
        if ($wpdb->get_var("show tables like '" . $table_prefix . "devfmt_config'") != "") {
            $DevFmt_Config = $wpdb->get_row("SELECT * FROM `{$table_prefix}devfmt_config`", ARRAY_A);
            $DevFmt_Config['version'] = devfmt_Version();
            $DevFmt_SuppLangs = $wpdb->get_results("SELECT * FROM `{$table_prefix}devfmt_supplangs`", ARRAY_A);
            $FavLangs = array();
            foreach ($DevFmt_SuppLangs as $Lang) {
                if ($Lang['fav']) {
                    $FavLangs[] = $Lang['langname'];
                }
            }
            $DevFmt_Config["favLangs"] = $FavLangs;
            $wpdb->query("drop table `{$table_prefix}devfmt_config`");
            $wpdb->query("drop table `{$table_prefix}devfmt_supplangs`");
        } else {
            $DevFmt_Config["favLangs"] = array();
            $DevFmt_Config['devfmtcss'] = devfmt_DefaultPublicCSSBlue();
            $DevFmt_Config['displaylinenumbers'] = "1";
            $DevFmt_Config['usedevformat'] = "1";
            $DevFmt_Config['parsepre'] = "1";
            $DevFmt_Config['showtools'] = "1";
            $DevFmt_Config['hookrss2'] = "1";
            $DevFmt_Config['copyclipboartext'] = 'copy code';
            $DevFmt_Config['geshilangpath'] = DEVFMT_GESHIPATH;
            if (DIRECTORY_SEPARATOR == '\\') {
                // win server
                $DevFmt_Config['geshilangpath'] = str_replace("\\\\", "\\", $DevFmt_Config['geshilangpath']);
            }
            $DevFmt_Config['useajaxparse'] = "0";
        }
        devfmt_UpdateConfig();
    }
}
Example #2
0
function devfmt_ReadConfigAndLangs()
{
    devfmt_ReadConfig();
    devfmt_ReadSupportedLangs();
}
Example #3
0
function devfmt_publicHeader()
{
    global $DevFmt_Config;
    devfmt_ReadConfig();
    if ($DevFmt_Config['linkjquery']) {
        echo "<script type='text/javascript' src='" . get_option('siteurl') . "/wp-includes/js/jquery/jquery.js?ver=1.2.6'></script>\n";
    }
    devfmt_commonHeader();
    echo "<script type='text/javascript' src='" . DEVFMT_URL . "devfmt_public.js?ver=" . devfmt_Version() . "'></script>\n";
    devfmt_DevFmtCSS();
}