function fu_process_submit($fu = '') { if ('' == $fu) { return; } $cats = fu_post('categories'); $nonce = fu_request('_wpnonce'); // grrr...while testing nonces I iinvalidated it. // if (wp_verify_nonce($nonce, 'fu-submit-article')) { $fu['post_category'] = $cats; // } else { // $post = ''; // $post['error'] = "Naughty Naughty"; // $post['nonce'] = $nonce; // } $post = ''; $post['post_content'] = $fu['post_content'] . '<div class="post-snippet">' . $fu['post-snippet'] . '</div>'; foreach (array('post_title', 'post_category') as $as) { $post[$as] = $fu[$as]; } global $current_user; $post['post_author'] = $current_user->ID; $post['post_status'] = current_user_can('publish_posts') ? 'publish' : 'pending'; $sf = 1; //wp_insert_post($post); if ($sf) { $fu['message'] = "Success"; //update_post_meta($sf, 'link', $fu['snippet-url']); //update_post_meta($sf, 'snippet', $fu['post-snippet']); } else { $fu['error'] = "There was a problem saving the post"; } //update_option('fu-submit-article-' . $nonce, $fu); wp_redirect(get_bloginfo('url') . '/submit-an-article?a=y&t=' . $nonce); }
fu_add_new_user($myfu); } } elseif ('dontdoit' == $myact) { //$anotherfu->dontdoit(); } elseif ('dontdothiseither' == $myact) { //$fu->grrr(); //$fu->dontdoiteither(); } elseif ('dontdothisone' == $myact) { //$fu->dontdothisone(); //$fu->deletemysession(); } elseif ('comment_vote' == $mygetfu) { // if some parameter is set do some function for intense debate's comment_vote $fu->comment_vote(); // vals retrieved from js. } elseif ('caring' == $sharing) { $fu->sharing(fu_post('who'), fu_post('type'), fu_post('what')); } // Flush rules needs to be flushed per subdomain //if (!get_option('fu_flushed_rules')) { // add_filter('init', array(&$fu, 'flush_rules')); // update_option('fu_flushed_rules', 1); //} function fu_add_new_user($fu = false) { //echo "wtf?"; require_once '../../../wp-includes/registration.php'; global $blog_id; $email = sanitize_email($fu['email']); //$current_site = get_current_site(); $pass = $fu['password']; $user_id = email_exists($email);