示例#1
0
{
    return !empty($_POST[$name]) ? $_POST[$name] : $_GET[$name];
}
switch ($action) {
    case 'save_categories':
        require_once 'inc/include_wp.php';
        $nonce = $_REQUEST['_wpnonce'];
        if (!wp_verify_nonce($nonce, 'wordbb_save_categories')) {
            die;
        }
        $cat_forums = $_POST['wordbb_cat_forums'];
        if (!isset($cat_forums) || !is_array($cat_forums)) {
            die;
        }
        foreach ($cat_forums as $id => $cat_forum) {
            wordbb_bridge(WORDBB_CAT, $id, $cat_forum, WORDBB_WP);
        }
        if (!$ajax) {
            wp_redirect(get_bloginfo('wpurl') . '/wp-admin/edit.php?page=wordbb-categories');
        }
        break;
    case 'bridge_post':
        require_once 'inc/include_wp.php';
        $post = wordbb_get_arg('post');
        if (!isset($post)) {
            die;
        }
        $nonce = $_REQUEST['_wpnonce'];
        if (!wp_verify_nonce($nonce, 'wordbb_bridge_post_' . $post)) {
            die;
        }
示例#2
0
文件: wordbb.php 项目: KeanePW/WordBB
function wordbb_admin_users_update()
{
    if (isset($_GET['wordbb_users'])) {
        $wordbb_users = $_GET['wordbb_users'];
    } else {
        $wordbb_users = false;
    }
    if (!$wordbb_users) {
        return;
    }
    foreach ($wordbb_users as $id => $wordbb_user) {
        $mybb_user = wordbb_get_user_info_by_username($wordbb_user);
        if (!empty($mybb_user)) {
            wordbb_bridge(WORDBB_USER, $id, $mybb_user->uid, WORDBB_WP);
        } else {
            wordbb_bridge(WORDBB_USER, $id, '', WORDBB_WP);
        }
    }
}