HEX
Server: LiteSpeed
System: Linux houston.panomity.com 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64
User: nudepix (1011)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /home/nudepix.eu/public_html/wp-content/themes/cpp/theme-options.php
<?php
add_action( 'admin_init', 'imwb_interest_theme_options_init' );
add_action( 'admin_menu', 'imwb_interest_theme_options_add_page' );

/**
 * Init plugin options to white list our options
 */
function imwb_interest_theme_options_init(){
	register_setting( 'imwb_interest_options', 'imwb_interest_theme_options', 'imwb_interest_theme_options_validate' );
	wp_register_style( 'imwb_interest-theme-options-stylesheet', get_template_directory_uri().'/admin_options_page.css' );
	wp_register_script( 'imwb_interest-theme-options-script', get_template_directory_uri().'/scripts/admin_options.js' );
}

/**
 * Load up the menu page
 */
function imwb_interest_theme_options_add_page() {

	$page = add_theme_page( __( 'Theme Options', 'imwb_interest' ), __( 'Theme Options', 'imwb_interest' ), 'edit_theme_options', 'imwb_interest_theme_options', 'imwb_interest_theme_options_do_page' );
	
	/* Using registered $page handle to hook stylesheet loading */
   add_action( 'admin_print_styles-' . $page, 'imwb_interest_admin_styles' );
   add_action( 'admin_print_scripts-' . $page, 'imwb_interest_admin_scripts' );
}

function imwb_interest_admin_styles() {
   wp_enqueue_style('imwb_interest-theme-options-stylesheet');
}

function imwb_interest_admin_scripts() {
   wp_enqueue_script('imwb_interest-theme-options-script');
}

/**
 * Returns the default options for Twenty Eleven.
 *
 */
function imwb_interest_get_default_theme_options() {
	$default_theme_options = array(
	   'faviconurl' => '',
  	   'ftrmsgloading' => 'Loading new posts...',
	   'ftrmsgdone' => 'No More Posts.',
	   'sneakylikebtn' => '1',
	   'homepostorder' => '0',
	   'excludepages' => '',
	   'excludecats' => '',
	   'hidepagemenu' => 'N',
	   'pagemenutype' => '0',
	   'hidecatmenu' => 'N',
	   'othercatmenu' => 'N',
	   'othercatmenutxt' => 'Everything',
	   'imgfields' => '',
	   'defimage1' => '',
 	   'defimage2' => '',
      'defimage3' => '',
		'hidenag' => 'N',
		'homesidebar' => '0',
		'postcontent' => 'T',
		'postchars' => '100',
		'commentstats' => '1',
		'showcomments' => '0',
		'commentcount' => '0',
		'commentbtn' => '1',
		'likebtn' => '1',
		'repinbtn' => '1',
		'pinopen' => 'N',
		'hideptnag' => 'N',
		'hidepttitle' => 'N',
		'hideptdetails' => 'N',
		'hideptcomments' => 'N',
		'ptlikebtn' => '1',
		'ptrepinbtn' => '1',
		'ptpinopen' => 'N',
		'pagesidebar' => '0',
		'pagesidebar1' => '1',
		'hidepgtitle' => 'N',
		'hidepgdetails' => 'N',
		'hidepgcomments' => 'N',
		'pglikebtn' => '1',
		'pgrepinbtn' => '1',
		'pgpinopen' => 'N'
	);

	return $default_theme_options;
}

$sidebar_options = array(
	'0' => array('label' => __('Off', 'imwb_interest')),
	'1' => array('label' => __('Left', 'imwb_interest')),
	'2' => array('label' => __('Right', 'imwb_interest'))
);

$yesno_options = array(
	'1' => array('label' => __('Yes', 'imwb_interest')),
	'0' => array('label' => __('No', 'imwb_interest'))
);

$pagemenu_options = array(
	'0' => array('label' => __('Page Menu', 'imwb_videopress')),
	'1' => array('label' => __('Custom Menu', 'imwb_videopress'))
);

/**
 * Create the options page
 */
function imwb_interest_theme_options_do_page() {
   global $sidebar_options, $yesno_options, $pagemenu_options;
   
	?>
	
	<div class="wrap">
	<div id="imwb_plugin_header">
	<a href="http://imwealthbuilders.com" target="_blank"><img src="<?php echo get_template_directory_uri(). '/images/imwblogo.png';?>"></a>
	<span id="imwb_plugin_header_link"><a href="http://imwealthbuilders.com/newplugins" target="_blank">Click Here To See Our Latest WP Plugins</a></span>
	<h2>Covert PinPress Theme</h2>
	<div style="clear: both"></div>
	</div>
   <?php if(isset($_REQUEST['page']) && $_REQUEST['page'] == 'imwb_interest_theme_options' && isset($_REQUEST['action']) && $_REQUEST['action'] == 'update') : ?>
      <div class="imwb_cabar_active_panel"><p><strong><?php _e( 'Options saved', 'imwb_interest' ); ?></strong></p></div>
   <?php endif; ?>
	<div id="imwb_plugin_options_editor">
		
		<?php screen_icon(); echo "<h2>" . __( 'Theme Options', 'imwb_interest' ) . ' - <small><a href="http://covertpinpress.com/help/std_help.html" target="_blank">Click Here For Help</a></small></h2>'; ?>

		<form method="post" action="" enctype="multipart/form-data">
			<?php settings_fields( 'imwb_interest_options' ); ?>
         <br>
         <table class="widefat">
          <thead>
           <tr>
            <th scope="col" colspan="2">General Options</th>
           </tr>
          </thead>
           <tbody style="display: table-row-group;">
 				<tr valign="top"><td width="350px"><?php _e( 'Favicon', 'imwb_interest' ); ?></td>
 					<td>
 						<input id="imwb_interest_theme_options[faviconurl]" class="regular-text" type="text" name="imwb_interest_theme_options[faviconurl]" value="<?php esc_attr_e( imwb_interest_get_option('faviconurl') ); ?>" />
 						<label class="description" for="imwb_interest_theme_options[faviconurl]"><?php _e( 'Favicon url [16x16]', 'imwb_interest' ); ?></label><br>
 						<input type="file" name="favicon_img"  id="favicon_img" />
 					</td>
 				</tr>
            <tr valign="top"><td width="350px"><?php _e( 'Message displayed in footer when loading posts', 'imwb_interest' ); ?></td>
            	<td>
            		<input id="imwb_interest_theme_options[ftrmsgloading]" class="regular-text" type="text" name="imwb_interest_theme_options[ftrmsgloading]" value="<?php esc_attr_e( imwb_interest_get_option('ftrmsgloading') ); ?>" />
            		<label class="description" for="imwb_interest_theme_options[ftrmsgloading]"></label><br>
            	</td>
            </tr>  				
            <tr valign="top"><td width="350px"><?php _e( 'Message displayed in footer when all posts have been shown', 'imwb_interest' ); ?></td>
            	<td>
            		<input id="imwb_interest_theme_options[ftrmsgdone]" class="regular-text" type="text" name="imwb_interest_theme_options[ftrmsgdone]" value="<?php esc_attr_e( imwb_interest_get_option('ftrmsgdone') ); ?>" />
            		<label class="description" for="imwb_interest_theme_options[ftrmsgdone]"></label><br>
            	</td>
            </tr> 	
            <tr><td width="350px"><?php _e( 'Use Sneaky Like Versus Standard Like', 'imwb_interest' ); ?></td>
            	 <td><select id="imwb_interest_theme_options[sneakylikebtn]" class="regular-text" type="text" name="imwb_interest_theme_options[sneakylikebtn]" />
            			<?php 
            			 foreach ($yesno_options as $key => $value) {
            			    $selected = (imwb_interest_get_option('sneakylikebtn') == $key) ? " selected" : "";
            			    echo "<option value='{$key}'{$selected}>{$value['label']}</option>";
            			 }
            			?>
            			</select>
            	</td>
            </tr>			
          </tbody>
 			</table>
 <br>
         <table class="widefat">
          <thead>
           <tr>
            <th scope="col" colspan="2">Navigation Menus</th>
           </tr>
          </thead>
           <tbody style="display: table-row-group;">
            <tr><td colspan="2"><strong><?php _e( 'Pages Menu', 'imwb_interest' ); ?></strong></td></tr>
            <tr><td width="350px"><?php _e( 'Hide Page Menu', 'imwb_interest' ); ?></td>
            	 <td><input id="imwb_interest_theme_options[hidepagemenu]" type="checkbox" name="imwb_interest_theme_options[hidepagemenu]" value="Y" <?php echo imwb_interest_get_option('hidepagemenu') == "Y" ? "checked='Yes'" : "" ?> />
            		
            	</td>
            </tr>
            <tr><td width="350px"><?php _e( 'Use Standard Page Menu or Custom Menu', 'imwb_interest' ); ?></td>
            	 <td>
                <select id="imwb_interest_theme_options[pagemenutype]" class="regular-text" type="text" name="imwb_interest_theme_options[pagemenutype]" />
                <?php 
                 foreach ($pagemenu_options as $key => $value) {
                    $selected = (imwb_interest_get_option('pagemenutype') == $key) ? " selected" : "";
                    echo "<option value='{$key}'{$selected}>{$value['label']}</option>";
                 }
                ?>
                </select>
            	</td>
            </tr>
            <tr class="pgmenutype_custom" <?php echo imwb_interest_get_option('pagemenutype') == '0' ? 'style="display: none;"' : ""; ?> ><td></td><td>Use the Appearance->Menus option to create/edit the custom menu</td></tr>
            
            <tr class="pgmenutype_std" <?php echo imwb_interest_get_option('pagemenutype') == '1' ? 'style="display: none;"' : ""; ?>><td width="350px"><?php _e( 'Pages to Exclude', 'imwb_interest' ); ?></td>
            	 <td><select size="10"  multiple="multiple"  style="width:340px; height:auto;" name="imwb_interest_theme_options[excludepages][]" id="imwb_interest_theme_options[excludepages]" >
				<?php
							$allpages = get_pages(  );
							$currentpages = explode(",", htmlspecialchars(imwb_interest_get_option('excludepages')) );

							foreach( $allpages as $singlepage )
							{
								echo "<option value='" . $singlepage->ID . "'";
								if( in_array($singlepage->ID , $currentpages ) )
								{
									echo " selected='selected' ";
								}
								echo " >" .  $singlepage->post_title . "</option>";
							}
							
				?></select>   <br>
				<a href="javascript:void(0)" onclick="imwb_ms_unselectAll(document.getElementById('imwb_interest_theme_options[excludepages]'))"><?php _e('Unselect All','imwb_interest'); ?></a>         	 
            	 </td>
            </tr>
            <tr><td colspan="2"><strong><?php _e( 'Category Menu', 'imwb_interest' ); ?></strong></td></tr>
            <tr><td width="350px"><?php _e( 'Hide Category Menu', 'imwb_interest' ); ?></td>
            	 <td><input id="imwb_interest_theme_options[hidecatmenu]" type="checkbox" name="imwb_interest_theme_options[hidecatmenu]" value="Y" <?php echo imwb_interest_get_option('hidecatmenu') == "Y" ? "checked='Yes'" : "" ?> />
            		
            	</td>
            </tr>
            <tr><td width="350px"><?php _e( 'Everything Categories Menu Option', 'imwb_videopress' ); ?></td>
            	 <td>Menu Text <input type="text" name="imwb_interest_theme_options[othercatmenutxt]" value="<?php echo esc_attr( imwb_interest_get_option('othercatmenutxt') ); ?>" size="30"/> - Don't Show <input id="imwb_interest_theme_options[othercatmenu]" type="checkbox" name="imwb_interest_theme_options[othercatmenu]" value="Y" <?php echo imwb_interest_get_option('othercatmenu') == "Y" ? "checked='Yes'" : "" ?> />
            	</td>
            </tr>  
            <tr><td width="350px"><?php _e( 'Categories to Exclude', 'imwb_interest' ); ?></td>
            	 <td><select size="10"  multiple="multiple"  style="width:340px; height:auto;" name="imwb_interest_theme_options[excludecats][]" id="imwb_interest_theme_options[excludecats]" >
				<?php
							$allcats = get_categories(array('hide_empty' => 0)  );
							$currentcats = explode(",", htmlspecialchars(imwb_interest_get_option('excludecats')) );

							foreach( $allcats as $singlecat )
							{
								echo "<option value='" . $singlecat->cat_ID . "'";
								if( in_array($singlecat->cat_ID , $currentcats ) )
								{
									echo " selected='selected' ";
								}
								echo " >" .  $singlecat->cat_name . "</option>";
							}
							
				?></select>   <br>
				<a href="javascript:void(0)" onclick="imwb_ms_unselectAll(document.getElementById('imwb_interest_theme_options[excludecats]'))"><?php _e('Unselect All','imwb_interest'); ?></a>         	 
            	 </td>
            </tr>
          </tbody>
 			</table>
 <br>
         <table class="widefat">
          <thead>
           <tr>
            <th scope="col" colspan="2">Images</th>
           </tr>
          </thead>
           <tbody style="display: table-row-group;">
            <tr><td colspan="2">For each post/page the theme will attempt to find the image to display. It does this by first using any custom fields specified, then the featured image if set, then any image attachment, then any embedded images in the post/page body. If no image is found the default images are used.</td>
            </tr>
            <tr><td width="350px"><?php _e( 'Custom Fields', 'imwb_interest' ); ?></td>
            	 <td><input id="imwb_interest_theme_options[imgfields]" class="regular-text" type="text" name="imwb_interest_theme_options[imgfields]" value="<?php esc_attr_e( imwb_interest_get_option('imgfields') ); ?>" />
            		<label class="description" for="imwb_interest_theme_options[imgfields]"><?php _e( 'Enter a comma seperated list of custom fields that contain images.', 'imwb_interest' ); ?></label>
            	</td>
            </tr>
            <tr><td width="350px"><?php _e( 'Default Image 1', 'imwb_interest' ); ?></td>
            	 <td><input id="imwb_interest_theme_options[defimage1]" class="regular-text" type="text" name="imwb_interest_theme_options[defimage1]" value="<?php esc_attr_e( imwb_interest_get_option('defimage1') ); ?>" />
            		<label class="description" for="imwb_interest_theme_options[defimage1]"><?php _e( 'Default Image 1, suggested width is 192 pixels', 'imwb_interest' ); ?></label><br>
            		<input type="file" name="default_img1"  id="default_img1" />
            	</td>
            </tr>
            <tr><td width="350px"><?php _e( 'Default Image 2', 'imwb_interest' ); ?></td>
            	 <td><input id="imwb_interest_theme_options[defimage2]" class="regular-text" type="text" name="imwb_interest_theme_options[defimage2]" value="<?php esc_attr_e( imwb_interest_get_option('defimage2') ); ?>" />
            		<label class="description" for="imwb_interest_theme_options[defimage2]"><?php _e( 'Default Image 2, suggested width is 192 pixels', 'imwb_interest' ); ?></label><br>
            		<input type="file" name="default_img2"  id="default_img2" />
            	</td>
            </tr>
            <tr><td width="350px"><?php _e( 'Default Image 3', 'imwb_interest' ); ?></td>
            	 <td><input id="imwb_interest_theme_options[defimage3]" class="regular-text" type="text" name="imwb_interest_theme_options[defimage3]" value="<?php esc_attr_e( imwb_interest_get_option('defimage3') ); ?>" />
            		<label class="description" for="imwb_interest_theme_options[defimage3]"><?php _e( 'Default Image 3, suggested width is 192 pixels', 'imwb_interest' ); ?></label><br>
            		<input type="file" name="default_img3"  id="default_img3" />
            	</td>
            </tr>
          </tbody>
 			</table>
 <br>
			<table class="widefat">
          <thead>
           <tr>
            <th scope="col" colspan="2">Home Page</th>
           </tr>
          </thead>
          <tbody style="display: table-row-group;">
            <tr><td width="350px"><?php _e( 'Hide Nag Bar', 'imwb_interest' ); ?></td>
					 <td><input id="imwb_interest_theme_options[hidenag]" type="checkbox" name="imwb_interest_theme_options[hidenag]" value="Y" <?php echo imwb_interest_get_option('hidenag') == "Y" ? "checked='Yes'" : "" ?> />
						
					</td>
				</tr>

				<tr valign="top"><td width="350px"><?php _e( 'Main Sidebar Widget', 'imwb_interest' ); ?></td>
					<td>
						<select id="imwb_interest_theme_options[homesidebar]" class="regular-text" type="text" name="imwb_interest_theme_options[homesidebar]" />
						<?php 
						 foreach ($sidebar_options as $key => $value) {
                      $selected = (imwb_interest_get_option('homesidebar') == $key) ? " selected" : "";
						    echo "<option value='{$key}'{$selected}>{$value['label']}</option>";
						 }
						?>
						</select>
					</td>
				</tr>
				
				<tr valign="top"><td width="350px"><?php _e( 'Post Content', 'imwb_interest' ); ?></td>
					<td><input id="imwb_interest_theme_options[postcontent]" type="radio" name="imwb_interest_theme_options[postcontent]" value="T" <?php echo imwb_interest_get_option('postcontent') == "T" ? "checked='Yes'" : "" ?> /> Show just the post title<br><input id="imwb_interest_theme_options[postcontent]" type="radio" name="imwb_interest_theme_options[postcontent]" value="F" <?php echo imwb_interest_get_option('postcontent') == "F" ? "checked='Yes'" : "" ?> /> Show full post text - Graphics will be removed from the content.<br class="clear">
					<input id="imwb_interest_theme_options[postcontent]" type="radio" name="imwb_interest_theme_options[postcontent]" value="E" <?php echo imwb_interest_get_option('postcontent') == "E" ? "checked='Yes'" : "" ?> /> Show the post excerpt - If no explicit excerpt for a post, an automatic excerpt of the first 55 words of content will be used<br>
					<input id="imwb_interest_theme_options[postcontent]" type="radio" name="imwb_interest_theme_options[postcontent]" value="C" <?php echo imwb_interest_get_option('postcontent') == "C" ? "checked='Yes'" : "" ?> /> Custom post excerpt - Show the first <input type="text" name="imwb_interest_theme_options[postchars]" value="<?php echo imwb_interest_get_option('postchars');?>" size=5 <?php echo imwb_interest_get_option('postcontent') != "C" ? "readonly" : "" ?>> characters of the post content.
					</td>
				</tr>
            <tr valign="top"><td width="350px"><?php _e( 'Show Comment Count', 'imwb_interest' ); ?></td>
            	<td>
            		<select id="imwb_interest_theme_options[commentstats]" class="regular-text" type="text" name="imwb_interest_theme_options[commentstats]" />
            		<?php 
            		 foreach ($yesno_options as $key => $value) {
                      $selected = (imwb_interest_get_option('commentstats') == $key) ? " selected" : "";
            		    echo "<option value='{$key}'{$selected}>{$value['label']}</option>";
            		 }
            		?>
            		</select>
            	</td>
            </tr>
            <tr valign="top"><td width="350px"><?php _e( 'Show Comments', 'imwb_interest' ); ?></td>
            	<td>
            		<select id="imwb_interest_theme_options[showcomments]" class="regular-text" type="text" name="imwb_interest_theme_options[showcomments]" />
            		<?php 
            		 foreach ($yesno_options as $key => $value) {
                      $selected = (imwb_interest_get_option('showcomments') == $key) ? " selected" : "";
            		    echo "<option value='{$key}'{$selected}>{$value['label']}</option>";
            		 }
            		?>
            		</select><span id="commentcount" <?php echo imwb_interest_get_option('showcomments') == 0 ? "style='display:none;'" : "" ?>> Show at most <input type="text" name="imwb_interest_theme_options[commentcount]" value="<?php echo imwb_interest_get_option('commentcount');?>" size=4> comments (0 = show all)</span>
            	</td>
            </tr>
            <tr>
            <td colspan="2"><strong>Social Buttons</strong></td>
            </tr>
            <tr><td width="350px"><?php _e( 'Show Comment Button', 'imwb_interest' ); ?></td>
            	 <td><select id="imwb_interest_theme_options[commentbtn]" class="regular-text" type="text" name="imwb_interest_theme_options[commentbtn]" />
            		<?php 
            		 foreach ($yesno_options as $key => $value) {
            		    $selected = (imwb_interest_get_option('commentbtn') == $key) ? " selected" : "";
            		    echo "<option value='{$key}'{$selected}>{$value['label']}</option>";
            		 }
            		?>
           			</select>
            	</td>
            </tr>
            <tr><td width="350px"><?php _e( 'Show Like Button', 'imwb_interest' ); ?></td>
            	 <td><select id="imwb_interest_theme_options[likebtn]" class="regular-text" type="text" name="imwb_interest_theme_options[likebtn]" />
            			<?php 
            			 foreach ($yesno_options as $key => $value) {
            			    $selected = (imwb_interest_get_option('likebtn') == $key) ? " selected" : "";
            			    echo "<option value='{$key}'{$selected}>{$value['label']}</option>";
            			 }
            			?>
            			</select>
            	</td>
            </tr>
            <tr><td width="350px"><?php _e( 'Show Repin Button', 'imwb_interest' ); ?></td>
            	 <td><select id="imwb_interest_theme_options[repinbtn]" class="regular-text" type="text" name="imwb_interest_theme_options[repinbtn]" />
            				<?php 
            				 foreach ($yesno_options as $key => $value) {
            				    $selected = (imwb_interest_get_option('repinbtn') == $key) ? " selected" : "";
            				    echo "<option value='{$key}'{$selected}>{$value['label']}</option>";
            				 }
            				?>
            				</select>
            						Open Pinterest in new window <input id="imwb_interest_theme_options[pinopen]" type="checkbox" name="imwb_interest_theme_options[pinopen]" value="Y" <?php echo imwb_interest_get_option('pinopen') == "Y" ? "checked='Yes'" : "" ?> />
            	</td>
            </tr>
          </tbody>
			</table>
<br>
			<table class="widefat">
         <thead>
          <tr>
           <th scope="col" colspan="2">Pages and Posts</th>
          </tr>
         </thead>
         <tbody style="display: table-row-group;">
         <tr><td width="350px"><?php _e( 'Hide Nag Bar', 'imwb_interest' ); ?></td>
         	 <td><input id="imwb_interest_theme_options[hideptnag]" type="checkbox" name="imwb_interest_theme_options[hideptnag]" value="Y" <?php echo imwb_interest_get_option('hideptnag') == "Y" ? "checked='Yes'" : "" ?> />
         		
         	</td>
         </tr>
         <tr valign="top"><td width="350px"><?php _e( 'Main Sidebar Widget', 'imwb_interest' ); ?></td>
         	<td>
         		<select id="imwb_interest_theme_options[pagesidebar]" class="regular-text" type="text" name="imwb_interest_theme_options[pagesidebar]" />
         		<?php 
         		 foreach ($sidebar_options as $key => $value) {
                   $selected = (imwb_interest_get_option('pagesidebar') == $key) ? " selected" : "";
         		    echo "<option value='{$key}'{$selected}>{$value['label']}</option>";
         		 }
         		?>
         		</select>
         	</td>
         </tr>
         <tr valign="top"><td width="350px"><?php _e( 'Post/Page Sidebar Widget', 'imwb_interest' ); ?></td>
         	<td>
         		<select id="imwb_interest_theme_options[pagesidebar1]" class="regular-text" type="text" name="imwb_interest_theme_options[pagesidebar1]" />
         		<?php 
         		 foreach ($sidebar_options as $key => $value) {
                   $selected = (imwb_interest_get_option('pagesidebar1') == $key) ? " selected" : "";
         		    echo "<option value='{$key}'{$selected}>{$value['label']}</option>";
         		 }
         		?>
         		</select>
         	</td>
         </tr>
           <tr><td colspan="2"><strong><?php _e( 'Posts', 'imwb_interest' ); ?></strong></td>
			  </tr>
           <tr><td width="350px"><?php _e( 'Hide Title', 'imwb_interest' ); ?></td>
            		 <td><input id="imwb_interest_theme_options[hidepttitle]" type="checkbox" name="imwb_interest_theme_options[hidepttitle]" value="Y" <?php echo imwb_interest_get_option('hidepttitle') == "Y" ? "checked='Yes'" : "" ?> />
            			
            		</td>
           </tr>
           <tr><td width="350px"><?php _e( 'Hide Pinned Details', 'imwb_interest' ); ?></td>
           		 <td><input id="imwb_interest_theme_options[hideptdetails]" type="checkbox" name="imwb_interest_theme_options[hideptdetails]" value="Y" <?php echo imwb_interest_get_option('hideptdetails') == "Y" ? "checked='Yes'" : "" ?> />
           			
           		</td>
           </tr>     
           <tr><td width="350px"><?php _e( 'Hide Comments', 'imwb_interest' ); ?></td>
            		 <td><input id="imwb_interest_theme_options[hideptcomments]" type="checkbox" name="imwb_interest_theme_options[hideptcomments]" value="Y" <?php echo imwb_interest_get_option('hideptcomments') == "Y" ? "checked='Yes'" : "" ?> />
            			
            		</td>
           </tr>     
           <tr><td width="350px"><?php _e( 'Show Like Button', 'imwb_interest' ); ?></td>
           	 <td><select id="imwb_interest_theme_options[ptlikebtn]" class="regular-text" type="text" name="imwb_interest_theme_options[ptlikebtn]" />
           			<?php 
           			 foreach ($yesno_options as $key => $value) {
           			    $selected = (imwb_interest_get_option('ptlikebtn') == $key) ? " selected" : "";
           			    echo "<option value='{$key}'{$selected}>{$value['label']}</option>";
           			 }
           			?>
           			</select>
           	</td>
           </tr>
           <tr><td width="350px"><?php _e( 'Show Repin Button', 'imwb_interest' ); ?></td>
           	 <td><select id="imwb_interest_theme_options[ptrepinbtn]" class="regular-text" type="text" name="imwb_interest_theme_options[ptrepinbtn]" />
           				<?php 
           				 foreach ($yesno_options as $key => $value) {
           				    $selected = (imwb_interest_get_option('ptrepinbtn') == $key) ? " selected" : "";
           				    echo "<option value='{$key}'{$selected}>{$value['label']}</option>";
           				 }
           				?>
           				</select>
           				Open Pinterest in new window <input id="imwb_interest_theme_options[ptpinopen]" type="checkbox" name="imwb_interest_theme_options[ptpinopen]" value="Y" <?php echo imwb_interest_get_option('ptpinopen') == "Y" ? "checked='Yes'" : "" ?> />
           	</td>
           </tr>
                        
            </tr>
              <tr><td colspan="2"><strong><?php _e( 'Pages', 'imwb_interest' ); ?></strong></td>
              </tr>
              <tr><td width="350px"><?php _e( 'Hide Title', 'imwb_interest' ); ?></td>
               		 <td><input id="imwb_interest_theme_options[hidepgtitle]" type="checkbox" name="imwb_interest_theme_options[hidepgtitle]" value="Y" <?php echo imwb_interest_get_option('hidepgtitle') == "Y" ? "checked='Yes'" : "" ?> />
               			
               		</td>
              </tr>
              <tr><td width="350px"><?php _e( 'Hide Pinned Details', 'imwb_interest' ); ?></td>
              		 <td><input id="imwb_interest_theme_options[hidepgdetails]" type="checkbox" name="imwb_interest_theme_options[hidepgdetails]" value="Y" <?php echo imwb_interest_get_option('hidepgdetails') == "Y" ? "checked='Yes'" : "" ?> />
              			
              		</td>
              </tr>     
              <tr><td width="350px"><?php _e( 'Hide Comments', 'imwb_interest' ); ?></td>
               		 <td><input id="imwb_interest_theme_options[hidepgcomments]" type="checkbox" name="imwb_interest_theme_options[hidepgcomments]" value="Y" <?php echo imwb_interest_get_option('hidepgcomments') == "Y" ? "checked='Yes'" : "" ?> />
               			
               		</td>
              </tr>                  
           <tr><td width="350px"><?php _e( 'Show Like Button', 'imwb_interest' ); ?></td>
           	 <td><select id="imwb_interest_theme_options[pglikebtn]" class="regular-text" type="text" name="imwb_interest_theme_options[pglikebtn]" />
           			<?php 
           			 foreach ($yesno_options as $key => $value) {
           			    $selected = (imwb_interest_get_option('pglikebtn') == $key) ? " selected" : "";
           			    echo "<option value='{$key}'{$selected}>{$value['label']}</option>";
           			 }
           			?>
           			</select>
           	</td>
           </tr>
           <tr><td width="350px"><?php _e( 'Show Repin Button', 'imwb_interest' ); ?></td>
           	 <td><select id="imwb_interest_theme_options[pgrepinbtn]" class="regular-text" type="text" name="imwb_interest_theme_options[pgrepinbtn]" />
           				<?php 
           				 foreach ($yesno_options as $key => $value) {
           				    $selected = (imwb_interest_get_option('pgrepinbtn') == $key) ? " selected" : "";
           				    echo "<option value='{$key}'{$selected}>{$value['label']}</option>";
           				 }
           				?>
           				</select>
           				Open Pinterest in new window <input id="imwb_interest_theme_options[pgpinopen]" type="checkbox" name="imwb_interest_theme_options[pgpinopen]" value="Y" <?php echo imwb_interest_get_option('pgpinopen') == "Y" ? "checked='Yes'" : "" ?> />
           	</td>
           </tr>
          </tbody>
         </table>
			<p class="submit">
				<input type="submit" class="button-primary" value="<?php _e( 'Save Options', 'imwb_interest' ); ?>" />
			</p>
		</form>
		<iframe src="http://imwealthbuilders.com/wp_squeeze/promote.php?aid=0" width="815px" height="800px"></iframe>
	</div>
  </div>
	<?php
}

/**
 * Sanitize and validate input. Accepts an array, return a sanitized array.
 */

function imwb_interest_theme_options_validate( $input ) {
   $output = imwb_interest_get_default_theme_options();
   
   foreach ($input as $key => $value) {
      if($key == "postchars") 
         $input[$key] = is_numeric($value) ? $value : 100;
      else if($key == "excludepages")  
         $input[$key] = implode(',', $value);
      else if($key == "excludecats")  
         $input[$key] = implode(',', $value);
      
         
		$output[$key] = trim($input[$key]);
	}
 
  	return $output;
 }


// See if were saving options
if(isset($_REQUEST['page']) && $_REQUEST['page'] == 'imwb_interest_theme_options' && isset($_REQUEST['action']) && $_REQUEST['action'] == 'update') {

   // Deal with file uploads
   // favicon
   if ((($_FILES["favicon_img"]["type"] == "image/gif")
     || ($_FILES["favicon_img"]["type"] == "image/jpeg")
     || ($_FILES["favicon_img"]["type"] == "image/png")
     || ($_FILES["favicon_img"]["type"] == "image/jpeg")
     || ($_FILES["favicon_img"]["type"] == "image/pjpeg")
     || ($_FILES["favicon_img"]["type"] == "image/x-icon"))
     && ($_FILES["favicon_img"]["size"] > 0) &&  ($_FILES["favicon_img"]["error"] == 0))
   {
   	  $path = wp_upload_dir();
   	  if( !file_exists(  $path['path'] ) )
   	  {
   			mkdir(  $path['path'] );  
   	  }
   	  $logopath=  $path['path'] . "/" . $_FILES["favicon_img"]["name"];
   	  if( file_exists(  $logopath ) )
   	  {
   			unlink( $logopath); 
   	  }
   
        move_uploaded_file( $_FILES["favicon_img"]["tmp_name"],  $logopath);
   	  $_REQUEST['imwb_interest_theme_options']['faviconurl'] =  $path['url'] . "/" . $_FILES["favicon_img"]["name"] ;
  }
  
   // default images
   if ((($_FILES["default_img1"]["type"] == "image/gif")
     || ($_FILES["default_img1"]["type"] == "image/jpeg")
     || ($_FILES["default_img1"]["type"] == "image/png")
     || ($_FILES["default_img1"]["type"] == "image/jpeg")
     || ($_FILES["default_img1"]["type"] == "image/pjpeg")
     || ($_FILES["default_img1"]["type"] == "image/x-icon"))
     && ($_FILES["default_img1"]["size"] > 0) &&  ($_FILES["default_img1"]["error"] == 0))
   {
   	  $path = wp_upload_dir();
   	  if( !file_exists(  $path['path'] ) )
   	  {
   			mkdir(  $path['path'] );  
   	  }
   	  $logopath=  $path['path'] . "/" . $_FILES["default_img1"]["name"];
   	  if( file_exists(  $logopath ) )
   	  {
   			unlink( $logopath); 
   	  }
   
        move_uploaded_file( $_FILES["default_img1"]["tmp_name"],  $logopath);
   	  $_REQUEST['imwb_interest_theme_options']['defimage1'] =  $path['url'] . "/" . $_FILES["default_img1"]["name"] ;
  }
   if ((($_FILES["default_img2"]["type"] == "image/gif")
     || ($_FILES["default_img2"]["type"] == "image/jpeg")
     || ($_FILES["default_img2"]["type"] == "image/png")
     || ($_FILES["default_img2"]["type"] == "image/jpeg")
     || ($_FILES["default_img2"]["type"] == "image/pjpeg")
     || ($_FILES["default_img2"]["type"] == "image/x-icon"))
     && ($_FILES["default_img2"]["size"] > 0) &&  ($_FILES["default_img2"]["error"] == 0))
   {
   	  $path = wp_upload_dir();
   	  if( !file_exists(  $path['path'] ) )
   	  {
   			mkdir(  $path['path'] );  
   	  }
   	  $logopath=  $path['path'] . "/" . $_FILES["default_img2"]["name"];
   	  if( file_exists(  $logopath ) )
   	  {
   			unlink( $logopath); 
   	  }
   
        move_uploaded_file( $_FILES["default_img2"]["tmp_name"],  $logopath);
   	  $_REQUEST['imwb_interest_theme_options']['defimage2'] =  $path['url'] . "/" . $_FILES["default_img2"]["name"] ;
  }
 if ((($_FILES["default_img3"]["type"] == "image/gif")
   || ($_FILES["default_img3"]["type"] == "image/jpeg")
   || ($_FILES["default_img3"]["type"] == "image/png")
   || ($_FILES["default_img3"]["type"] == "image/jpeg")
   || ($_FILES["default_img3"]["type"] == "image/pjpeg")
   || ($_FILES["default_img3"]["type"] == "image/x-icon"))
   && ($_FILES["default_img3"]["size"] > 0) &&  ($_FILES["default_img3"]["error"] == 0))
 {
 	  $path = wp_upload_dir();
 	  if( !file_exists(  $path['path'] ) )
 	  {
 			mkdir(  $path['path'] );  
 	  }
 	  $logopath=  $path['path'] . "/" . $_FILES["default_img3"]["name"];
 	  if( file_exists(  $logopath ) )
 	  {
 			unlink( $logopath); 
 	  }
 
      move_uploaded_file( $_FILES["default_img3"]["tmp_name"],  $logopath);
 	  $_REQUEST['imwb_interest_theme_options']['defimage3'] =  $path['url'] . "/" . $_FILES["default_img3"]["name"] ;
}
   // Save options
   $updatedOptions = imwb_interest_theme_options_validate($_REQUEST['imwb_interest_theme_options']);
   update_option('imwb_interest_theme_options', $updatedOptions);
   
}
?>