1)); $options = get_option('tanish'); # defaults if( ! isset($options['showauthors']) ) $options['showauthors'] = 1; if( ! isset($options['mainbgimage']) ) $options['mainbgimage'] = 'None'; if( ! isset($options['iewarn' ]) ) $options['iewarn' ] = 0; # end defaults update_option('tanish', $options); # setup admin menu add_action('admin_menu', 'tanish_admin_menu'); if ( function_exists('register_sidebar') ) add_sidebars(); //------------------------------------------------------------------------------- function tanish_admin_menu() { add_theme_page('Tanish Options', 'Tanish Options', 'edit_themes', "Audacity of Tanish", 'tanish_options'); } //------------------------------------------------------------------------------- function tanish_options() { global $options, $mainbgimages; if( $_POST['action'] == 'save' ) save_options(); print "

Keep up with Audacity of Tanish

Follow on Ahren Code blog or Twitter, or join the Facebook Page.

General




Background Image



"; $ctr = 1; foreach( $mainbgimages as $image ) { if( $ctr > 0 && ($ctr % 3) == 0 ) print "

\n"; $ctr++; $checked = ""; if( $options['mainbgimage'] == $image ) $checked = "checked"; print ""; if( $image == "None" || $image == "Random" ) print $image; else print "$image"; print "      "; } print "


Icons courtesy of: Tutorial9 (Designer: ilovecolors), JONASRASKDESIGN, VisualPharm, Pixel Mixer, C9 Design Rinoa icons, Icojoy, midtone design
"; } function save_options() { global $_POST, $options; $options['showauthors'] = ( isset($_POST['showauthors']) ) ? 1 : 0; $options['iewarn'] = ( isset($_POST['iewarn' ]) ) ? 1 : 0; $options['mainbgimage'] = ( isset($_POST['mainbgimage']) ) ? $_POST['mainbgimage'] : "None"; update_option('tanish', $options); print "

Tanish Settings saved.

"; } //------------------------------------------------------------------------------ function add_sidebars() { register_sidebar(array( 'name' => 'bottombarleft', 'before_widget' => "
", 'before_title' => "

" . " ", 'after_title' => "

", 'after_widget' => "
", )); register_sidebar(array( 'name' => 'bottombarcenter', 'before_widget' => "
", 'before_title' => "

" . " ", 'after_title' => "

", 'after_widget' => "
", )); register_sidebar(array( 'name' => 'bottombarright', 'before_widget' => "
", 'before_title' => "

" . " ", 'after_title' => "

", 'after_widget' => "
", )); } ?>