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


PHP bb_delete_option函数代码示例

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


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

示例1: private_forums_upgrade_4_0

function private_forums_upgrade_4_0()
{
    $private_forums_options = array();
    $forum_access_private_forums = bb_get_option('forum_access_private_forums');
    $private_forums_options['private_forums'] = $forum_access_private_forums ? $forum_access_private_forums : array();
    $private_forums_options['failure_msg'] = bb_get_option('forum_access_failure_msg');
    $private_forums_options['hide_show_flag'] = bb_get_option('forum_access_private_forums_option');
    $private_forums_options['user_role'] = "MEMBER";
    $private_forums_options['private_text'] = bb_get_option('forum_access_private_text');
    $private_forums_options['version'] = 40;
    bb_delete_option('forum_access_private_forums');
    bb_delete_option('forum_access_failure_msg');
    bb_delete_option('forum_access_private_forums_option');
    bb_delete_option('forum_access_private_text');
    bb_update_option('private_forums_options', $private_forums_options);
}
开发者ID:abc2mit,项目名称:abc2mit.github.io,代码行数:16,代码来源:private-forums.php

示例2: thanks_admin_page_process

function thanks_admin_page_process()
{
    global $_POST;
    if (isset($_POST['thanks_option_submit'])) {
        bb_update_option('thanks_voting', $_POST['thanks_voting']);
        bb_update_option('thanks_output_none', $_POST['thanks_output_none']);
        bb_update_option('thanks_output_one', $_POST['thanks_output_one']);
        bb_update_option('thanks_output_many', $_POST['thanks_output_many']);
        bb_update_option('thanks_position', $_POST['thanks_position']);
        bb_update_option('thanks_voters', $_POST['thanks_voters']);
        bb_update_option('thanks_voters_prefix', $_POST['thanks_voters_prefix']);
        bb_update_option('thanks_voters_suffix', $_POST['thanks_voters_suffix']);
    }
    if (isset($_POST['thanks_option_reset'])) {
        bb_delete_option('thanks_voting');
        bb_delete_option('thanks_output_none');
        bb_delete_option('thanks_output_one');
        bb_delete_option('thanks_output_many');
        bb_delete_option('thanks_success');
        bb_delete_option('thanks_position');
        bb_delete_option('thanks_voters');
        bb_delete_option('thanks_voters_prefix');
        bb_delete_option('thanks_voters_suffix');
    }
    if (isset($_POST['thanks_remove_all'])) {
        $opt = bb_get_option("thanks_posts");
        for ($i = 0; $i < count($opt); $i++) {
            $post_id = $opt[$i];
            bb_delete_postmeta($post_id, "thanks");
        }
        bb_delete_option("thanks_posts");
        bb_delete_option('thanks_voting');
        bb_delete_option('thanks_output_none');
        bb_delete_option('thanks_output_one');
        bb_delete_option('thanks_output_many');
        bb_delete_option('thanks_success');
        bb_delete_option('thanks_position');
        bb_delete_option('thanks_voters');
        bb_delete_option('thanks_voters_prefix');
        bb_delete_option('thanks_voters_suffix');
    }
}
开发者ID:achorg,项目名称:DH-Answers,代码行数:42,代码来源:thanks-admin.php

示例3: bb_upgrade_1030

function bb_upgrade_1030()
{
    if (($dbv = bb_get_option_from_db('bb_db_version')) && $dbv >= 1058) {
        return;
    }
    $admin_email = bb_get_option('admin_email');
    if ($admin_email) {
        bb_update_option('from_email', $admin_email);
    }
    bb_delete_option('admin_email');
    bb_update_option('bb_db_version', 1058);
    return 'Done moving admin_email to from_email: ' . __FUNCTION__;
}
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:13,代码来源:functions.bb-upgrade.php

示例4: bb_ksd_configuration_page_process

function bb_ksd_configuration_page_process()
{
    if ('post' == strtolower($_SERVER['REQUEST_METHOD']) && $_POST['action'] == 'update-akismet-settings') {
        bb_check_admin_referer('options-akismet-update');
        $goback = remove_query_arg(array('invalid-akismet', 'updated-akismet'), wp_get_referer());
        if (!isset($_POST['akismet_stats'])) {
            $_POST['akismet_stats'] = false;
        }
        if (true === (bool) $_POST['akismet_stats']) {
            bb_update_option('akismet_stats', 1);
        } else {
            bb_delete_option('akismet_stats');
        }
        if ($_POST['akismet_key']) {
            $value = stripslashes_deep(trim($_POST['akismet_key']));
            if ($value) {
                if (bb_akismet_verify_key($value)) {
                    bb_update_option('akismet_key', $value);
                } else {
                    $goback = add_query_arg('invalid-akismet', 'true', $goback);
                    bb_safe_redirect($goback);
                    exit;
                }
            } else {
                bb_delete_option('akismet_key');
            }
        } else {
            bb_delete_option('akismet_key');
        }
        $goback = add_query_arg('updated-akismet', 'true', $goback);
        bb_safe_redirect($goback);
        exit;
    }
    if (!empty($_GET['updated-akismet'])) {
        bb_admin_notice(__('<strong>Settings saved.</strong>'));
    }
    if (!empty($_GET['invalid-akismet'])) {
        bb_admin_notice(__('<strong>The key you attempted to enter is invalid. Reverting to previous setting.</strong>'), 'error');
    }
    global $bb_admin_body_class;
    $bb_admin_body_class = ' bb-admin-settings';
}
开发者ID:laiello,项目名称:cartonbank,代码行数:42,代码来源:akismet.php

示例5: foreach

    // Deal with advanced user database checkbox when it isn't checked
    if (!isset($_POST['user_bbdb_advanced'])) {
        $_POST['user_bbdb_advanced'] = false;
    }
    foreach ((array) $_POST as $option => $value) {
        if (!in_array($option, array('_nxtnonce', '_nxt_http_referer', 'action', 'submit'))) {
            $option = trim($option);
            $value = is_array($value) ? $value : trim($value);
            $value = stripslashes_deep($value);
            if (($option == 'nxt_siteurl' || $option == 'nxt_home') && !empty($value)) {
                $value = rtrim($value, " \t\n\r\v/") . '/';
            }
            if ($value) {
                bb_update_option($option, $value);
            } else {
                bb_delete_option($option);
            }
        }
    }
    if ($action == 'update-users') {
        bb_apply_nxt_role_map_to_orphans();
    }
    $goback = add_query_arg('updated', $action, nxt_get_referer());
    bb_safe_redirect($goback);
    exit;
}
switch (@$_GET['updated']) {
    case 'update-users':
        bb_admin_notice(__('<strong>User role mapping saved.</strong>'));
        break;
    case 'update-options':
开发者ID:nxtclass,项目名称:NXTClass,代码行数:31,代码来源:options-nxtclass.php

示例6: bb_update_option

             bb_update_option($option, $value);
         } else {
             bb_delete_option($option);
         }
     }
 }
 $mod_rewrite = (string) bb_get_option('mod_rewrite');
 $goback = remove_query_arg(array('updated', 'notapache', 'notmodrewrite'), wp_get_referer());
 // Make sure mod_rewrite is possible on the server
 if (!$is_apache) {
     bb_delete_option('mod_rewrite_writable');
     $goback = add_query_arg('notapache', 'true', $goback);
     bb_safe_redirect($goback);
     exit;
 } elseif ('0' !== $mod_rewrite && !apache_mod_loaded('mod_rewrite', true)) {
     bb_delete_option('mod_rewrite_writable');
     bb_update_option('mod_rewrite', '0');
     $goback = add_query_arg('notmodrewrite', 'true', $goback);
     bb_safe_redirect($goback);
     exit;
 }
 $file_target_rules = array();
 $file_target_exists = false;
 $file_target_writable = true;
 if (file_exists($file_target)) {
     if (is_readable($file_target)) {
         $file_target_rules = explode("\n", implode('', file($file_target)));
     }
     $file_target_exists = true;
     if (!is_writable($file_target)) {
         $file_target_writable = false;
开发者ID:laiello,项目名称:cartonbank,代码行数:31,代码来源:options-permalinks.php

示例7: bb_get_transient

/**
 * Get the value of a transient
 *
 * If the transient does not exist or does not have a value, then the return value
 * will be false.
 * 
 * @since 1.0
 * @package bbPress
 * @subpackage Transient
 *
 * @param string $transient Transient name. Expected to not be SQL-escaped
 * @return mixed Value of transient
 */
function bb_get_transient($transient)
{
    global $_bb_using_ext_object_cache, $bbdb;
    if ($_bb_using_ext_object_cache) {
        $value = nxt_cache_get($transient, 'transient');
    } else {
        $transient_option = '_transient_' . $bbdb->escape($transient);
        $transient_timeout = '_transient_timeout_' . $bbdb->escape($transient);
        $timeout = bb_get_option($transient_timeout);
        if ($timeout && $timeout < time()) {
            bb_delete_option($transient_option);
            bb_delete_option($transient_timeout);
            return false;
        }
        $value = bb_get_option($transient_option);
    }
    return apply_filters('transient_' . $transient, $value);
}
开发者ID:nxtclass,项目名称:NXTClass,代码行数:31,代码来源:functions.bb-meta.php

示例8: delete

 function delete($option)
 {
     return bb_delete_option(BP_Options::prefix() . $option);
 }
开发者ID:nxtclass,项目名称:NXTClass,代码行数:4,代码来源:class.bp-options.php

示例9: bb_update_option

    } else {
        bb_update_option('bb_active_theme', $theme);
    }
    do_action('bb_activate_theme_' . $theme);
    wp_redirect(bb_get_uri('bb-admin/themes.php', array('activated' => 1, 'name' => urlencode($name)), BB_URI_CONTEXT_HEADER + BB_URI_CONTEXT_BB_ADMIN));
    exit;
}
if (isset($_GET['activated'])) {
    $theme_notice = bb_admin_notice(sprintf(__('<strong>Theme "%s" activated</strong>'), esc_attr($_GET['name'])));
}
if (!in_array($activetheme, $themes)) {
    if ($activetheme == BB_DEFAULT_THEME) {
        remove_action('bb_admin_notices', $theme_notice);
        bb_admin_notice(__('<strong>Default theme is missing.</strong>'), 'error');
    } else {
        bb_delete_option('bb_active_theme');
        remove_action('bb_admin_notices', $theme_notice);
        bb_admin_notice(__('<strong>Theme not found.  Default theme applied.</strong>'), 'error');
    }
}
function bb_admin_theme_row($theme, $position)
{
    $theme_directory = bb_get_theme_directory($theme);
    $theme_data = file_exists($theme_directory . 'style.css') ? bb_get_theme_data($theme) : false;
    $screen_shot = file_exists($theme_directory . 'screenshot.png') ? esc_url(bb_get_theme_uri($theme) . 'screenshot.png') : false;
    $activation_url = bb_get_uri('bb-admin/themes.php', array('theme' => urlencode($theme)), BB_URI_CONTEXT_A_HREF + BB_URI_CONTEXT_BB_ADMIN);
    $activation_url = esc_url(bb_nonce_url($activation_url, 'switch-theme'));
    if (1 === $position || 0 === $position) {
        echo '<tr>';
    }
    ?>
开发者ID:danielcoats,项目名称:schoolpress,代码行数:31,代码来源:themes.php

示例10: li_configuration_page_process

function li_configuration_page_process()
{
    if ('post' == strtolower($_SERVER['REQUEST_METHOD']) && $_POST['action'] == 'update-li-settings') {
        bb_check_admin_referer('options-liconnect-update');
        $li_app_id = trim($_POST['li_app_id']);
        $li_secret = trim($_POST['li_secret']);
        bb_update_option('li_app_id', $li_app_id);
        bb_update_option('li_secret', $li_secret);
        if (!isset($_POST['li_displayname_from']) || $_POST['li_displayname_from'] < 0 || $_POST['li_displayname_from'] > 2) {
            $_POST['li_displayname_from'] = 0;
        }
        bb_update_option('li_displayname_from', intval($_POST['li_displayname_from']));
        if (!isset($_POST['li_get_jquery']) || true !== (bool) $_POST['li_get_jquery']) {
            bb_delete_option('li_get_jquery');
        } else {
            bb_update_option('li_get_jquery', 1);
        }
        if (!isset($_POST['li_allow_useredit']) || true !== (bool) $_POST['li_allow_useredit']) {
            bb_delete_option('li_allow_useredit');
        } else {
            bb_update_option('li_allow_useredit', 1);
        }
        if (!isset($_POST['li_request_email']) || true !== (bool) $_POST['li_request_email']) {
            bb_delete_option('li_request_email');
        } else {
            bb_update_option('li_request_email', 1);
        }
        if (!isset($_POST['li_hide_post_login']) || true !== (bool) $_POST['li_hide_post_login']) {
            bb_delete_option('li_hide_post_login');
        } else {
            bb_update_option('li_hide_post_login', 1);
        }
        bb_admin_notice(__('Configuration saved.'));
    }
}
开发者ID:nma,项目名称:linkedin-connect,代码行数:35,代码来源:connect.php

示例11: database

                    Now, please go to your forums, set a user as keymaster, login as that user and directly go to <a href="w2bc.php?mode=topics">converting topics to replies</a>.
                    Note that old logins won't work, you would have to edit your database (you can still try logging in as the WordPress administrator).
                </li>

            </ol>

            <?php 
            break;
        }
        // Logout the user as it won't have any good privileges for us to do the work
        bb_clear_auth_cookie();
        // Login the keymaster
        bb_set_auth_cookie($user->ID);
        // Delete the wp table prefix and wp roles map options
        bb_delete_option('wp_table_prefix');
        bb_delete_option('wp_roles_map');
        // Set the current user
        bb_set_current_user($user->ID);
        ?>

            <li>
                User roles have been successfully mapped based on the user role mapping option.
                Now, you can only login into your bbPress forums by the WordPress credentials.
                For the time being, you have been logged in as the first available keymaster (from the database) (Username: <?php 
        echo $user->user_login;
        ?>
, User ID: <?php 
        echo $user->ID;
        ?>
).
            </li>
开发者ID:markc,项目名称:wordpress-to-bbpress-converter,代码行数:31,代码来源:w2bc.php

示例12: mass_edit

function mass_edit()
{
    if (!bb_current_user_can('browse_deleted')) {
        die(__("Now how'd you get here?  And what did you think you'd be doing?"));
    }
    add_action('bb_get_option_page_topics', 'mass_edit_topic_limit', 250);
    global $bbdb, $bb_post_cache, $bb_user_cache, $bb_posts, $bb_post, $page, $mass_edit_options;
    if (isset($_GET['mass_edit_reset'])) {
        bb_delete_option('mass_edit_options');
        wp_redirect(remove_query_arg(array('mass_edit_options', 'mass_edit_reset')));
    }
    if (!empty($_POST['mass_edit_save_options'])) {
        $mass_edit_options['mass_edit_columns'] = implode(",", array_unique(array_map('trim', explode(",", strtolower(stripslashes($_POST['mass_edit_columns'] . ", checkbox , excerpt , name , meta , actions"))))));
        $mass_edit_options['mass_edit_css'] = stripslashes($_POST['mass_edit_css']);
        bb_update_option('mass_edit_options', $mass_edit_options);
        wp_redirect(remove_query_arg(array('mass_edit_options', 'mass_edit_reset')));
        // may not work since headers are already sent
    }
    echo '<div style="text-align:right;margin-bottom:-1.5em;">';
    if (isset($_GET['mass_edit_options'])) {
        echo '[ <a href="' . bb_get_admin_tab_link("mass_edit") . '&mass_edit_reset=1">Reset To Defaults</a> ]';
    } else {
        echo '[ <a href="' . bb_get_admin_tab_link("mass_edit") . '&mass_edit_options=1">Settings</a> ]';
    }
    echo '</div>';
    echo "<h2><a style='color:black;border:0;text-decoration:none;' href='" . bb_get_admin_tab_link("mass_edit") . "'>" . __('Mass Edit') . "</a></h2>";
    if (!isset($mass_edit_options)) {
        $mass_edit_options = bb_get_option('mass_edit_options');
    }
    if (!isset($mass_edit_options['mass_edit_columns']) || is_array($mass_edit_options['mass_edit_columns'])) {
        $mass_edit_options['mass_edit_columns'] = "checkbox , excerpt , name , meta , actions";
        bb_update_option('mass_edit_options', $mass_edit_options);
    }
    $mass_edit_columns = explode(",", strtolower($mass_edit_options['mass_edit_columns']));
    array_walk($mass_edit_columns, create_function('&$arr', '$arr=trim($arr);'));
    if (isset($_GET['mass_edit_options'])) {
        ?>
	<form action="<?php 
        echo bb_get_admin_tab_link("mass_edit");
        ?>
" method="post" id="mass-edit-options">
	
	<fieldset><legend><strong>Mass Edit Column Order</strong> - default: checkbox , excerpt , name , meta , actions</legend>
	<input name="mass_edit_columns" id="mass_edit_columns" type="text" size="50" value="<?php 
        echo $mass_edit_options['mass_edit_columns'];
        ?>
" />
	<span style="padding-left:2em;" class=submit><input class=submit type="submit" name="mass_edit_save_options" value="<?php 
        _e('Save Options');
        ?>
 &raquo;"  /></span>
	</fieldset>
		
	<fieldset><legend><b>Mass Edit CSS</b></legend>
	<textarea name="mass_edit_css" id="mass_edit_css" cols="100" rows="10"><?php 
        echo $mass_edit_options['mass_edit_css'];
        ?>
</textarea>
	</fieldset>
	</form>
	<br clear=both />
	<hr />
	<?php 
    }
    /*	
    	add_filter( 'get_topic_where', 'no_where' ); add_filter( 'get_topic_link', 'bb_make_link_view_all' );	
    	$bb_post_query = new BB_Query_Form( 'post',array( 'post_status' => 0, 'count' => true ));
    	$bb_posts =& $bb_post_query->results; 	$total = $bb_post_query->found_rows;
    */
    if (!empty($_POST['mass_edit_delete_posts'])) {
        bb_check_admin_referer('mass-edit-bulk-posts');
        $i = 0;
        $bbdb->hide_errors();
        // bbPress still has some db function issues with topic delete/undelete
        foreach ($_POST['mass_edit_delete_posts'] as $bb_post_id) {
            // Check the permissions on each
            $bb_post_id = (int) $bb_post_id;
            // $bb_post_id = $bbdb->get_var("SELECT post_id FROM $bbdb->posts WHERE post_id = $bb_post");
            // $authordata = bb_get_usermeta( $bbdb->get_var("SELECT poster_id FROM $bbdb->posts WHERE ID = $bb_post_id") );
            if (bb_current_user_can('delete_posts', $bb_post_id)) {
                if (!empty($_POST['mass_edit_spam_button'])) {
                    bb_delete_post($bb_post_id, 2);
                }
                if (!empty($_POST['mass_edit_delete_button'])) {
                    bb_delete_post($bb_post_id, 1);
                }
                if (!empty($_POST['mass_edit_undelete_button'])) {
                    bb_delete_post($bb_post_id, 0);
                }
                ++$i;
            }
        }
        $bbdb->show_errors();
        // bbPress still has some db function issues with topic delete/undelete
        // $bbdb->flush();
        // global $bb_cache,$bb_post_cache, $bb_topic_cache;  unset($bb_cache); unset($bb_post_cache); unset($bb_topic_cache);
        echo '<div  id="message" class="updated fade" style="clear:both;"><p>';
        if (!empty($_POST['mass_edit_spam_button'])) {
            printf(__('%s posts marked as spam.'), $i);
        }
//.........这里部分代码省略.........
开发者ID:achorg,项目名称:DH-Answers,代码行数:101,代码来源:mass-edit-admin.php


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