function spritz_install() { require_once ABSPATH . 'wp-admin/includes/upgrade.php'; add_option('spritz_admin_email', '*****@*****.**'); add_option('spirtz_exclude', SPRITZ__EXCLUDE); add_option('content_region_include', SPRITZ__INCLUDE); add_option('spritz_start_text', 'Please Wait'); add_option('spritz_end_text', 'The End'); add_option('spritz_flyout_display_type', 'tab'); add_option('popup_position', 'left'); add_option('activate_spritz_reader_content_types', get_all_post()); add_option('include_spritz_reader_onfollowing_certain_post', 'Y'); add_option('include_spritz_reader_on_following', get_all_post()); add_option('automatically_put_the_spritz_reader_at_the_top_of_my_content', 'Y'); }
$cmd = $_REQUEST['cmd']; // Switch statement to handle different type of commands switch ($cmd) { // case 1 add a post case 1: add_post($_REQUEST['user'], $_REQUEST['content'], $_REQUEST['category']); break; // case 2 get post from a particular user // case 2 get post from a particular user case 2: get_user_post($_REQUEST['user']); break; // Get all post // Get all post case 3: get_all_post(); break; // Get a given amount of recent post // Get a given amount of recent post case 4: $num = 10; get_recent_post($num); break; // Get all post from a given category // Get all post from a given category case 5: get_post_by_category($category); break; default: break; }