当前位置: 首页>>代码示例>>PHP>>正文


PHP remove_remarks函数代码示例

本文整理汇总了PHP中remove_remarks函数的典型用法代码示例。如果您正苦于以下问题:PHP remove_remarks函数的具体用法?PHP remove_remarks怎么用?PHP remove_remarks使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了remove_remarks函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: hs_install

function hs_install()
{
    global $CONFIG, $thisplugin, $lang_plugin_highslide_install;
    require 'plugins/highslide/include/init.inc.php';
    if ($_POST['submit'] == $lang_plugin_highslide_install['button_install']) {
        if (!isset($CONFIG['highslide_enable'])) {
            require 'include/sql_parse.php';
            $query = "INSERT INTO " . $CONFIG['TABLE_CONFIG'] . " VALUES ('highslide_enable', '1');";
            cpg_db_query($query);
            // create table
            $db_schema = $thisplugin->fullpath . '/schema.sql';
            $sql_query = fread(fopen($db_schema, 'r'), filesize($db_schema));
            $sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query);
            $sql_query = remove_remarks($sql_query);
            $sql_query = split_sql_file($sql_query, ';');
            foreach ($sql_query as $q) {
                cpg_db_query($q);
            }
            // Put default setting
            $db_schema = $thisplugin->fullpath . '/basic.sql';
            $sql_query = fread(fopen($db_schema, 'r'), filesize($db_schema));
            $sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query);
            $sql_query = remove_remarks($sql_query);
            $sql_query = split_sql_file($sql_query, ';');
            foreach ($sql_query as $q) {
                cpg_db_query($q);
            }
        }
        return true;
    } else {
        return 1;
    }
}
开发者ID:phill104,项目名称:branches,代码行数:33,代码来源:codebase.php

示例2: final_extract_install

function final_extract_install()
{
    global $CONFIG, $lang_plugin_final_extract, $lang_plugin_final_extract_config, $thisplugin;
    require 'plugins/final_extract/configuration.php';
    require 'include/sql_parse.php';
    if (!isset($CONFIG['fex_enable'])) {
        $query = "INSERT INTO " . $CONFIG['TABLE_CONFIG'] . " VALUES ('fex_enable', '1');";
        cpg_db_query($query);
        // create table
        $db_schema = $thisplugin->fullpath . '/schema.sql';
        $sql_query = fread(fopen($db_schema, 'r'), filesize($db_schema));
        $sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query);
        $sql_query = remove_remarks($sql_query);
        $sql_query = split_sql_file($sql_query, ';');
        foreach ($sql_query as $q) {
            cpg_db_query($q);
        }
        // Put default setting
        $db_schema = $thisplugin->fullpath . '/basic.sql';
        $sql_query = fread(fopen($db_schema, 'r'), filesize($db_schema));
        $sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query);
        $sql_query = remove_remarks($sql_query);
        $sql_query = split_sql_file($sql_query, ';');
        foreach ($sql_query as $q) {
            cpg_db_query($q);
        }
    }
    return true;
}
开发者ID:phill104,项目名称:branches,代码行数:29,代码来源:codebase.php

示例3: newsletter_install

function newsletter_install()
{
    global $CONFIG, $newsletter_installation, $thisplugin, $USER_DATA, $lang_plugin_newsletter;
    // Create the super cage
    $superCage = Inspekt::makeSuperCage();
    $newsletter_installation = 1;
    require 'include/sql_parse.php';
    // Perform the database changes
    $db_schema = $thisplugin->fullpath . '/schema.sql';
    $sql_query = fread(fopen($db_schema, 'r'), filesize($db_schema));
    $sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query);
    $sql_query = preg_replace('/ADMIN_EMAIL/', $CONFIG['gallery_admin_email'], $sql_query);
    $sql_query = preg_replace('/ADMIN_USERNAME/', $USER_DATA['user_name'], $sql_query);
    $sql_query = preg_replace('/COPPERMINE_SITE_NAME/', $CONFIG['gallery_name'], $sql_query);
    $sql_query = remove_remarks($sql_query);
    $sql_query = split_sql_file($sql_query, ';');
    foreach ($sql_query as $q) {
        cpg_db_query($q);
    }
    // Set the plugin config defaults
    $plugin_config_defaults = array('plugin_newsletter_guest_subscriptions' => '0', 'plugin_newsletter_salutation_for_guests' => 'Dear subscriber,', 'plugin_newsletter_from_email' => $CONFIG['gallery_admin_email'], 'plugin_newsletter_from_name' => $USER_DATA['user_name'], 'plugin_newsletter_mails_per_page' => '1', 'plugin_newsletter_page_refresh_delay' => '10', 'plugin_newsletter_admin_menu_links' => '1', 'plugin_newsletter_visitor_menu_links' => '2', 'plugin_newsletter_retries' => '2', 'plugin_newsletter_default_on_register' => '0');
    foreach ($plugin_config_defaults as $key => $value) {
        if (!$CONFIG[$key]) {
            $CONFIG[$key] = $value;
        }
    }
    if ($superCage->post->keyExists('submit')) {
        newsletter_configuration_submit();
        return true;
    } else {
        return 1;
    }
}
开发者ID:phill104,项目名称:branches,代码行数:33,代码来源:codebase.php

示例4: update_history_install

function update_history_install()
{
    $superCage = Inspekt::makeSuperCage();
    global $CONFIG, $lang_plugin_update_history_config, $thisplugin;
    require 'plugins/update_history/include/init.inc.php';
    if ($superCage->post->getAlnum('submit') == $lang_plugin_update_history_config['button_install']) {
        require 'include/sql_parse.php';
        //if(!isset($CONFIG['fex_enable'])) {
        //	$query="INSERT INTO ".$CONFIG['TABLE_CONFIG']." VALUES ('fex_enable', '1');";
        //	cpg_db_query($query);
        // create table
        $db_schema = $thisplugin->fullpath . '/schema.sql';
        $sql_query = fread(fopen($db_schema, 'r'), filesize($db_schema));
        $sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query);
        $sql_query = remove_remarks($sql_query);
        $sql_query = split_sql_file($sql_query, ';');
        foreach ($sql_query as $q) {
            cpg_db_query($q);
        }
        // Put default setting
        $db_schema = $thisplugin->fullpath . '/basic.sql';
        $sql_query = fread(fopen($db_schema, 'r'), filesize($db_schema));
        $sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query);
        $sql_query = remove_remarks($sql_query);
        $sql_query = split_sql_file($sql_query, ';');
        foreach ($sql_query as $q) {
            cpg_db_query($q);
        }
        //}
        return true;
    } else {
        return 1;
    }
}
开发者ID:phill104,项目名称:branches,代码行数:34,代码来源:codebase.php

示例5: social_bookmarks_install

function social_bookmarks_install()
{
    global $CONFIG, $social_bookmarks_installation, $thisplugin, $USER_DATA, $lang_plugin_social_bookmarks;
    // Create the super cage
    $superCage = Inspekt::makeSuperCage();
    $social_bookmarks_installation = 1;
    require 'include/sql_parse.php';
    // Perform the database changes
    $db_schema = $thisplugin->fullpath . '/schema.sql';
    $sql_query = fread(fopen($db_schema, 'r'), filesize($db_schema));
    $sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query);
    $sql_query = remove_remarks($sql_query);
    $sql_query = split_sql_file($sql_query, ';');
    foreach ($sql_query as $q) {
        cpg_db_query($q);
    }
    // Set the plugin config defaults
    $plugin_config_defaults = array('plugin_social_bookmarks_position' => '2', 'plugin_social_bookmarks_visibility' => '2', 'plugin_social_bookmarks_greyout' => '0', 'plugin_social_bookmarks_layout' => '2', 'plugin_social_bookmarks_columns' => '5', 'plugin_social_bookmarks_smart_language' => '1', 'plugin_social_bookmarks_admin_menu' => '0');
    foreach ($plugin_config_defaults as $key => $value) {
        if (!$CONFIG[$key]) {
            $CONFIG[$key] = $value;
        }
    }
    if ($superCage->post->keyExists('submit')) {
        social_bookmarks_configuration_submit();
        return true;
    } else {
        return 1;
    }
}
开发者ID:phill104,项目名称:branches,代码行数:30,代码来源:codebase.php

示例6: avmaker_configure

function avmaker_configure($stop = true)
{
    global $errors, $CONFIG;
    require 'include/sql_parse.php';
    $db_update = 'plugins/avmaker/sql/basic.sql';
    $sql_query = fread(fopen($db_update, 'r'), filesize($db_update));
    // Update table prefix
    $sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query);
    $sql_query = remove_remarks($sql_query);
    $sql_query = split_sql_file($sql_query, ';');
    ?>
        <h2>Performing Database Updates<h2>
        <table class="maintable">

    <?php 
    foreach ($sql_query as $q) {
        echo "<tr><td class='debug_text' style='color: black;'>\r\n\t\t{$q}\r\n\t\t</td>";
        if (mysql_query($q)) {
            echo "<td class='debug_text' style='color: green;'>OK</td></tr>";
        } else {
            echo "<td class='debug_text' style='color: black;'>Already Done</td></tr>";
        }
    }
    echo "</table>";
    if ($stop) {
        echo <<<EOT

        <form action="{$_SERVER['REQUEST_URI']}" method="post">
            <input type="submit" value="Go!" name="submit" />
        </form>
EOT;
    }
}
开发者ID:phill104,项目名称:branches,代码行数:33,代码来源:codebase.php

示例7: external_edit_install

function external_edit_install()
{
    global $CONFIG, $thisplugin;
    require 'include/sql_parse.php';
    // Perform the database changes
    $db_schema = $thisplugin->fullpath . '/schema.sql';
    $sql_query = fread(fopen($db_schema, 'r'), filesize($db_schema));
    $sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query);
    $sql_query = remove_remarks($sql_query);
    $sql_query = split_sql_file($sql_query, ';');
    foreach ($sql_query as $q) {
        cpg_db_query($q);
    }
    return true;
}
开发者ID:phill104,项目名称:branches,代码行数:15,代码来源:codebase.php

示例8: captcha_install

function captcha_install()
{
    global $CONFIG, $lang_plugin_captcha;
    require 'plugins/captcha/include/init.inc.php';
    require 'include/sql_parse.php';
    // create table
    $db_schema = 'plugins/captcha/schema.sql';
    $sql_query = fread(fopen($db_schema, 'r'), filesize($db_schema));
    $sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query);
    $sql_query = remove_remarks($sql_query);
    $sql_query = split_sql_file($sql_query, ';');
    foreach ($sql_query as $q) {
        cpg_db_query($q);
    }
    return true;
}
开发者ID:alencarmo,项目名称:OCF,代码行数:16,代码来源:codebase.php

示例9: potd_install

function potd_install()
{
    global $CONFIG, $thisplugin, $lang_plugin_potd_config;
    require 'plugins/potd/include/init.inc.php';
    if ($_POST['submit'] == $lang_plugin_potd_config['button_done']) {
        require 'include/sql_parse.php';
        $db_schema = $thisplugin->fullpath . '/schema.sql';
        $sql_query = fread(fopen($db_schema, 'r'), filesize($db_schema));
        $sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query);
        $sql_query = remove_remarks($sql_query);
        $sql_query = split_sql_file($sql_query, ';');
        foreach ($sql_query as $q) {
            cpg_db_query($q);
        }
        return true;
    } else {
        return 1;
    }
}
开发者ID:phill104,项目名称:branches,代码行数:19,代码来源:codebase.php

示例10: sql_import

function sql_import($sql)
{
    $ci = get_instance();
    $sql = file_get_contents($sql);
    $sql = remove_remarks($sql);
    $delimiter = ";";
    $tokens = explode($delimiter, $sql);
    $sql = "";
    $matches = array();
    $token_count = count($tokens);
    for ($i = 0; $i < $token_count; $i++) {
        if ($i != $token_count - 1 || strlen($tokens[$i] > 0)) {
            $total_quotes = preg_match_all("/'/", $tokens[$i], $matches);
            $escaped_quotes = preg_match_all("/(?<!\\\\)(\\\\\\\\)*\\\\'/", $tokens[$i], $matches);
            $unescaped_quotes = $total_quotes - $escaped_quotes;
            if ($unescaped_quotes % 2 == 0) {
                $ci->db->query($tokens[$i]);
                $tokens[$i] = "";
            } else {
                $temp = $tokens[$i] . $delimiter;
                $tokens[$i] = "";
                $complete_stmt = false;
                for ($j = $i + 1; !$complete_stmt && $j < $token_count; $j++) {
                    $total_quotes = preg_match_all("/'/", $tokens[$j], $matches);
                    $escaped_quotes = preg_match_all("/(?<!\\\\)(\\\\\\\\)*\\\\'/", $tokens[$j], $matches);
                    $unescaped_quotes = $total_quotes - $escaped_quotes;
                    if ($unescaped_quotes % 2 == 1) {
                        $ci->db->query($temp . $tokens[$j]);
                        $tokens[$j] = "";
                        $temp = "";
                        $complete_stmt = true;
                        $i = $j;
                    } else {
                        $temp .= $tokens[$j] . $delimiter;
                        $tokens[$j] = "";
                    }
                }
            }
        }
    }
}
开发者ID:rodino25,项目名称:tsv2,代码行数:41,代码来源:sql_import_helper.php

示例11: copperad_install

function copperad_install()
{
    global $CONFIG, $lang_plugin_copperad, $lang_plugin_copperad_config, $thisplugin;
    require 'plugins/copper_ad/include/init.inc.php';
    if ($_POST['submit'] == $lang_plugin_copperad_config['button_install']) {
        if (!isset($CONFIG['cpa_enable'])) {
            require 'include/sql_parse.php';
            $query = "INSERT INTO " . $CONFIG['TABLE_CONFIG'] . " VALUES ('cpa_enable', '1');";
            cpg_db_query($query);
            // Copy needed file and ADV directory ===If you can't CHMODE you gallery then comment these line 40~46 and after installation copy "banner.php.sample" and "bannermgr.php.sample" to your gallery root and remove ".sample" extention.
            copy($thisplugin->fullpath . "/banner.php.sample", "banner.php") or cpg_die(ERROR, $lang_plugin_copperad_config['permission'], __FILE__, __LINE__);
            copy($thisplugin->fullpath . "/bannermgr.php.sample", "bannermgr.php") or cpg_die(ERROR, $lang_plugin_copperad_config['permission'], __FILE__, __LINE__);
            mkdir('adv') or cpg_die(ERROR, $lang_plugin_copperad_config['permission'], __FILE__, __LINE__);
            mkdir('adv/pic') or cpg_die(ERROR, $lang_plugin_copperad_config['permission'], __FILE__, __LINE__);
            mkdir('adv/flash') or cpg_die(ERROR, $lang_plugin_copperad_config['permission'], __FILE__, __LINE__);
            copy($thisplugin->fullpath . "/adv/pic/copperad.jpg", "adv/pic/copperad.jpg") or cpg_die(ERROR, $lang_plugin_copperad_config['permission'], __FILE__, __LINE__);
            copy($thisplugin->fullpath . "/adv/flash/copperad.swf", "adv/flash/copperad.swf") or cpg_die(ERROR, $lang_plugin_copperad_config['permission'], __FILE__, __LINE__);
            // create table
            $db_schema = $thisplugin->fullpath . '/schema.sql';
            $sql_query = fread(fopen($db_schema, 'r'), filesize($db_schema));
            $sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query);
            $sql_query = remove_remarks($sql_query);
            $sql_query = split_sql_file($sql_query, ';');
            foreach ($sql_query as $q) {
                cpg_db_query($q);
            }
            // Put default setting
            $db_schema = $thisplugin->fullpath . '/basic.sql';
            $sql_query = fread(fopen($db_schema, 'r'), filesize($db_schema));
            $sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query);
            $sql_query = remove_remarks($sql_query);
            $sql_query = split_sql_file($sql_query, ';');
            foreach ($sql_query as $q) {
                cpg_db_query($q);
            }
        }
        return true;
    } else {
        return 1;
    }
}
开发者ID:phill104,项目名称:branches,代码行数:41,代码来源:codebase.php

示例12: multi_install

function multi_install()
{
    global $CONFIG, $thisplugin;
    if (isset($_POST['langs'])) {
        require 'include/sql_parse.php';
        $langStr = implode(',', $_POST['langs']);
        // create table
        $db_schema = $thisplugin->fullpath . '/schema.sql';
        $sql_query = fread(fopen($db_schema, 'r'), filesize($db_schema));
        $sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query);
        $sql_query = remove_remarks($sql_query);
        $sql_query = split_sql_file($sql_query, ';');
        $sql_query[] = "REPLACE INTO {$CONFIG['TABLE_CONFIG']} (name, value) VALUES ('mod_active_lang', '{$langStr}')";
        foreach ($sql_query as $q) {
            cpg_db_query($q);
        }
        return true;
    } else {
        return 1;
    }
}
开发者ID:phill104,项目名称:branches,代码行数:21,代码来源:codebase.php

示例13: foreach

 $mysql_access_host_array[] = $serverip;
 foreach ($mysql_access_host_array as $mysql_access_host) {
     $db_root->query('GRANT ALL PRIVILEGES ON `' . $db_root->escape(str_replace('`', '', $mysql_database)) . "`.* TO '" . $db_root->escape($mysql_unpriv_user) . "'@'" . $db_root->escape($mysql_access_host) . "' IDENTIFIED BY 'password'");
     $db_root->query("SET PASSWORD FOR '" . $db_root->escape($mysql_unpriv_user) . "'@'" . $db_root->escape($mysql_access_host) . "' = PASSWORD('" . $db_root->escape($mysql_unpriv_pass) . "')");
 }
 $db_root->query('FLUSH PRIVILEGES;');
 $mysql_access_host = implode(',', $mysql_access_host_array);
 status_message('green', 'OK');
 //now a new database and the new syscp-unprivileged-mysql-account have been created and we can fill it now with the data.
 status_message('begin', $lng['install']['testing_new_db']);
 $db = new db($mysql_host, $mysql_unpriv_user, $mysql_unpriv_pass, $mysql_database);
 status_message('green', 'OK');
 status_message('begin', $lng['install']['importing_data']);
 $db_schema = './syscp.sql';
 $sql_query = @file_get_contents($db_schema, 'r');
 $sql_query = remove_remarks($sql_query);
 $sql_query = split_sql_file($sql_query, ';');
 for ($i = 0; $i < sizeof($sql_query); ++$i) {
     if (trim($sql_query[$i]) != '') {
         $result = $db->query($sql_query[$i]);
     }
 }
 status_message('green', 'OK');
 status_message('begin', 'System Servername...');
 if (validate_ip($_SERVER['SERVER_NAME'], true) !== false) {
     status_message('red', $lng['install']['servername_should_be_fqdn']);
 } else {
     status_message('green', 'OK');
 }
 //now let's change the settings in our settings-table
 status_message('begin', $lng['install']['changing_data']);
开发者ID:markc,项目名称:syscp,代码行数:31,代码来源:install.php

示例14: annotate_page_start

function annotate_page_start()
{
    global $CONFIG, $lang_meta_album_names, $valid_meta_albums;
    require_once './plugins/annotate/init.inc.php';
    $annotate_init_array = annotate_initialize();
    $lang_plugin_annotate = $annotate_init_array['language'];
    $annotate_icon_array = $annotate_init_array['icon'];
    $superCage = Inspekt::MakeSuperCage();
    $note = $superCage->get->keyExists('note') ? $superCage->get->getRaw('note') : $superCage->cookie->getRaw($CONFIG['cookie_name'] . 'note');
    $lang_meta_album_names['lastnotes'] = $lang_plugin_annotate['lastnotes'];
    $lang_meta_album_names['shownotes'] = $lang_plugin_annotate['shownotes'] . " '{$note}'";
    $valid_meta_albums[] = 'lastnotes';
    $valid_meta_albums[] = 'shownotes';
    $superCage = Inspekt::makeSuperCage();
    if ($superCage->get->getAlpha('plugin') == "annotate" && $superCage->get->keyExists('delete_orphans')) {
        global $CONFIG;
        require_once './plugins/annotate/init.inc.php';
        $annotate_init_array = annotate_initialize();
        $lang_plugin_annotate = $annotate_init_array['language'];
        $annotate_icon_array = $annotate_init_array['icon'];
        load_template();
        pageheader($lang_plugin_annotate['delete_orphaned_entries']);
        if (version_compare(cpg_phpinfo_mysql_version(), '4.1', '>=')) {
            // we can use subqueries here
            cpg_db_query("DELETE FROM {$CONFIG['TABLE_PREFIX']}plugin_annotate WHERE pid NOT IN (SELECT pid FROM {$CONFIG['TABLE_PICTURES']})");
        } else {
            $result = cpg_db_query("SELECT pid FROM {$CONFIG['TABLE_PICTURES']}");
            $pids = array();
            while ($row = mysql_fetch_row($result)) {
                $pids[] = $row[0];
            }
            $pids = implode(",", $pids);
            mysql_free_result($result);
            // cpg_db_query can cause browser to crash if debug output is enabled
            mysql_query("DELETE FROM {$CONFIG['TABLE_PREFIX']}plugin_annotate WHERE pid NOT IN ({$pids})");
        }
        $count = mysql_affected_rows();
        if ($count == 1) {
            $count_output = $lang_plugin_annotate['1_orphaned_entry_deleted'];
        } else {
            $count_output = sprintf($lang_plugin_annotate['x_orphaned_entries_deleted'], $count);
        }
        starttable('-1', $annotate_icon_array['delete'] . $lang_plugin_annotate['delete_orphaned_entries']);
        echo <<<EOT
        <tr>
            <td class="tableb">
                {$count_output}
            </td>
        </tr>
EOT;
        endtable();
        pagefooter();
        exit;
    }
    if ($superCage->get->getAlpha('plugin') == "annotate" && $superCage->get->keyExists('import')) {
        global $CONFIG;
        require_once './plugins/annotate/init.inc.php';
        $annotate_init_array = annotate_initialize();
        $lang_plugin_annotate = $annotate_init_array['language'];
        $annotate_icon_array = $annotate_init_array['icon'];
        load_template();
        pageheader($lang_plugin_annotate['import']);
        starttable('-1', $annotate_icon_array['import'] . $lang_plugin_annotate['import']);
        if ($superCage->get->keyExists('do') && $CONFIG['plugin_annotate_import'] != "1") {
            if (!mysql_query("SELECT user_time FROM {$CONFIG['TABLE_PREFIX']}notes")) {
                cpg_db_query("INSERT INTO {$CONFIG['TABLE_PREFIX']}plugin_annotate (pid, posx, posy, width, height, note, user_id, user_time) \n                              SELECT pid, posx, posy, width, height, note, user_id, UNIX_TIMESTAMP() FROM {$CONFIG['TABLE_PREFIX']}notes");
            } else {
                cpg_db_query("INSERT INTO {$CONFIG['TABLE_PREFIX']}plugin_annotate (pid, posx, posy, width, height, note, user_id, user_time) \n                              SELECT pid, posx, posy, width, height, note, user_id, user_time FROM {$CONFIG['TABLE_PREFIX']}notes");
            }
            echo '<tr><td class="tableb">' . sprintf($lang_plugin_annotate['import_success'], mysql_affected_rows()) . '</td></tr>';
            cpg_db_query("INSERT INTO {$CONFIG['TABLE_CONFIG']} (name, value) VALUES ('plugin_annotate_import', '1')");
        } else {
            $notes_to_import = mysql_result(cpg_db_query("SELECT COUNT(*) FROM {$CONFIG['TABLE_PREFIX']}notes"), 0);
            if (!$notes_to_import) {
                echo '<tr><td class="tableb">' . sprintf($lang_plugin_annotate['import_found'], $notes_to_import) . '</td></tr>';
            } elseif ($CONFIG['plugin_annotate_import'] == "1") {
                echo '<tr><td class="tableb">' . $lang_plugin_annotate['imported_already'] . '</td></tr>';
            } else {
                echo '<tr><td class="tableb">' . sprintf($lang_plugin_annotate['import_found'], $notes_to_import) . ' <a href="index.php?plugin=annotate&import&do" class="admin_menu">' . $lang_plugin_annotate['import'] . '</a></td></tr>';
            }
        }
        endtable();
        pagefooter();
        exit;
    }
    if ($superCage->get->getAlpha('plugin') == "annotate" && $superCage->get->keyExists('update_database')) {
        global $CONFIG;
        require_once './plugins/annotate/init.inc.php';
        $annotate_init_array = annotate_initialize();
        $lang_plugin_annotate = $annotate_init_array['language'];
        $annotate_icon_array = $annotate_init_array['icon'];
        load_template();
        pageheader($lang_plugin_annotate['update_database']);
        require 'include/sql_parse.php';
        $db_schema = './plugins/annotate/update.sql';
        $sql_query = fread(fopen($db_schema, 'r'), filesize($db_schema));
        $sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query);
        $sql_query = remove_remarks($sql_query);
        $sql_query = split_sql_file($sql_query, ';');
        foreach ($sql_query as $q) {
//.........这里部分代码省略.........
开发者ID:phill104,项目名称:branches,代码行数:101,代码来源:codebase.php

示例15: standard_upgrader

 /**
  * The standard upgrader
  * This parses the requested sql file for database upgrade
  * Most upgrades will use this function
  */
 function standard_upgrader()
 {
     global $roster;
     $ver = str_replace('.', '', $this->versions[$this->index]);
     $db_structure_file = ROSTER_LIB . 'dbal' . DIR_SEP . 'structure' . DIR_SEP . 'upgrade_' . $ver . '.sql';
     if (file_exists($db_structure_file)) {
         // Parse structure file and create database tables
         $sql = @fread(@fopen($db_structure_file, 'r'), @filesize($db_structure_file));
         $sql = preg_replace('#renprefix\\_(\\S+?)([\\s\\.,]|$)#', $roster->db->prefix . '\\1\\2', $sql);
         $sql = remove_remarks($sql);
         $sql = parse_sql($sql, ';');
         $sql_count = count($sql);
         for ($i = 0; $i < $sql_count; $i++) {
             $roster->db->query($sql[$i]);
         }
         unset($sql);
     } else {
         roster_die('Could not obtain SQL structure/data', $roster->locale->act['upgrade_wowroster']);
     }
     $roster->db->query("UPDATE `" . $roster->db->table('config') . "` SET `config_value` = '" . ROSTER_VERSION . "' WHERE `id` = '4' LIMIT 1;");
     $roster->db->query("ALTER TABLE `" . $roster->db->table('config') . "` ORDER BY `id`;");
     return;
 }
开发者ID:Sajaki,项目名称:wowroster_dev,代码行数:28,代码来源:upgrade.php


注:本文中的remove_remarks函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。