Timed Redirect

<?php
//Timed Redirect
$visitor_ip = $_SERVER['REMOTE_ADDR'];
$current_time = time();
$launch_time = 1288589400;//Oct 31 11:30pm MST
$test_launch_time = 1288283536;//Change to whatever for testing

$ips_with_access = array('74.92.210.128','76.25.18.23');//IP's with access

if($current_time < $launch_time){
foreach($ips_with_access as $ips){
if($visitor_ip == $ips) $have_access = true;
}
if(!$have_access) header('Location: http://hyperspatial.com');//Redirect page
}
?>

WPMU get blog id

function lmc_get_band_description($subdomain){
global $wpdb;
$path = $subdomain . str_replace('http://','.', get_blog_option(1,'siteurl'));
$lmcb_band_id = $wpdb->get_results("SELECT * FROM wp_blogs WHERE domain = '$path'");
echo $lmcb_band_id[0]->blog_id;
}

Options table for DB

<?php

//Setup DB
function lmcb_create_db_table(){
global $wpdb;
$lmcb_db_version = "1.0";

$table_name = $wpdb->prefix . "band_info";
if($wpdb->get_var("show tables like '$table_name'") != $table_name) {

$sql = "CREATE TABLE " . $table_name . " (
id mediumint(9) NOT NULL AUTO_INCREMENT,
option_name VARCHAR(150) NOT NULL,
option_value TEXT NOT NULL,
UNIQUE KEY id (id)
);";

require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
dbDelta($sql);
add_option("lmcb_db_version", $lmcb_db_version);

//Band Options
$band_info_options = array('main_image','description');
foreach($band_info_options as $option){
$wpdb->insert($table_name, array('option_name' => $option, 'option_value' => ''));
}
}
}

add_action('init','lmcb_create_db_table');

function lmcb_to_band_info_db(){
global $wpdb;

$table_name = $wpdb->prefix . "band_info";
foreach($_POST as $key => $value){
$wpdb->update($table_name, array('option_value' => $value), array('option_name' => $key));
}
}

?>

Switch Themes

//Option 1
switch_theme('twentyten','twentyten');

//Option 2

update_option('current_theme','twentyten');
update_option('template','twentyten');
update_option('stylesheet','twentyten');

Theme Activated

function first_run_options() {
$check = get_option('theme_name_activation_check');

if ( $check != "set" ) {
// DO INITIALISATION STUFF

// Add marker so it doesn't run in future
add_option('theme_name_activation_check', "set");
}
}
add_action('wp_head', 'first_run_option');

function delete_stuff() {
delete_option('theme_name_activation_check');
}

add_action('switch_theme', 'delete_stuff');

Id3v2 get mp3 data

//The main classes are available for download below in a zip file

//This additional snippet is an array of the 147 genres

$genre_arr = array("Blues","Classic Rock","Country","Dance","Disco","Funk","Grunge","Hip-Hop","Jazz","Metal","New Age","Oldies","Other","Pop","R&B","Rap","Reggae","Rock","Techno","Industrial","Alternative","Ska","Death Metal","Pranks","Soundtrack","Euro-Techno","Ambient","Trip-Hop","Vocal","Jazz+Funk","Fusion","Trance","Classical","Instrumental","Acid","House","Game","Sound Clip","Gospel","Noise","AlternRock","Bass","Soul","Punk","Space","Meditative","Instrumental Pop","Instrumental Rock","Ethnic","Gothic","Darkwave","Techno-Industrial","Electronic","Pop-Folk","Eurodance","Dream","Southern Rock","Comedy","Cult","Gangsta","Top 40","Christian Rap","Pop/Funk","Jungle","Native American","Cabaret","New Wave","Psychadelic","Rave","Showtunes","Trailer","Lo-Fi","Tribal","Acid Punk","Acid Jazz","Polka","Retro","Musical","Rock & Roll","Hard Rock","Folk","Folk-Rock","National Folk","Swing","Fast Fusion","Bebob","Latin","Revival","Celtic","Bluegrass","Avantgarde","Gothic Rock","Progressive Rock","Psychedelic Rock","Symphonic Rock","Slow Rock","Big Band","Chorus","Easy Listening","Acoustic","Humour","Speech","Chanson","Opera","Chamber Music","Sonata","Symphony","Booty Bass","Primus","Porn Groove","Satire","Slow Jam","Club","Tango","Samba","Folklore","Ballad","Power Ballad","Rhythmic Soul","Freestyle","Duet","Punk Rock","Drum Solo","Acapella","Euro-House","Dance Hall");

Browser Detection

if(strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome')) echo 'Chrome';
if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE')) echo 'IE';
if(strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox')) echo 'Firefox';