cat_name; $thecatname=str_replace("&","&",$thecatname); $catdlist[$catforlist->cat_ID] = $thecatname; } $categories_tmp = array_unshift($catdlist, "Select a category:"); $pathtothemetemplate = get_bloginfo('template_directory'); $menuicoantisnews=TEMPLATEPATH . '/images/antisnewsico.png'; $PageMetaSettings=__("Page Meta Settings","Antisnews"); $GoogleAnalyticsSettings=__("Google Analytics Settings","Antisnews"); $BlogNameTaglineSettings=__("Blog Name and Tagline Settings","Antisnews"); $AdsSettings=__("Ads Settings","Antisnews"); $MiscellaneousSidebarSettings=__("Miscellaneous Sidebar Settings","Antisnews"); $StickyPostsSettings=__("Sticky Post Settings","Antisnews"); $HorizontalNavigationMenuSettings=__("Horizontal Navigation Menu Settings","Antisnews"); $FeaturedSliderSettings=__("Featured Category 1 Slider Settings","Antisnews"); $FeaturedCategory2Options=__("Featured Category 2 Options","Antisnews"); $CustomLatestPostsRecentCommentsSettings=__("Custom Latest Posts and Recent Comments Settings","Antisnews"); $FeaturedCategory3Options=__("Featured Category 3 Options","Antisnews"); $FeaturedCategory4Options=__("Featured Category 4 Options","Antisnews"); $FeaturedCategory5Options=__("Featured Category 5 Options","Antisnews"); $FeaturedCategory6Options=__("Featured Category 6 Options","Antisnews"); $FeaturedCategory7Options=__("Featured Category 7 Options","Antisnews"); $StandardThumbnailSettings=__("Standard Thumbnail Settings","Antisnews"); $CommentFormSettings=__("Comment Form Settings","Antisnews"); $StandardConfigurationOptions=__("Standard Configuration Options","Antisnews"); if( file_exists(TEMPLATEPATH.'/antisnews_css_styling_tool.php') ) { include (TEMPLATEPATH . '/antisnews_css_styling_tool.php'); } if ( function_exists('register_sidebar') ) register_sidebars(1,array( 'name'=>'Magazine Sidebar Home One', 'before_widget' => '
', 'before_title' => 'The theme tries to assist with minor SEO. You can enter default meta keywords for your site here
", "optionid" => $themeoptionsprefix."_metakeywords", "selectoptiondef" => "", "optiontype" => "text"), array("optionname" => "Default meta description", "optiondescription" => "The theme tries to assist with minor SEO. You can enter default meta description for your site here
", "optionid" => $themeoptionsprefix."_metadescription", "selectoptiondef" => "", "optiontype" => "text"), array("optionname" => "Deactivate Theme Meta", "optiondescription" => "If you are using an SEO plugin you might need to deactivate the theme meta tags for your plugin to work.
", "optionid" => $themeoptionsprefix."_deactivatethememeta", "selectoptiondef" => "Select an option:", "optiontype" => "select", "options" => $activatedeactivate), ); $googleanalyticsoptions = array ( array("optionname" => "$GoogleAnalyticsSettings", "optiontype" => "heading"), array("optionname" => "Site Tracking Code Example: Google Analytics", "optiondescription" => "Using Goolge Analytics? You can enter your code above.
", "optionid" => $themeoptionsprefix."_sitetrackingcode", "selectoptiondef" => "", "optiontype" => "textarea"), ); $standardconfigops = array ( array("optionname" => "$StandardConfigurationOptions", "optiontype" => "heading"), array("optionname" => "Operation Mode", "optiondescription" => "Tutorial runs the home page in tutorial mode and Live runs it in active mode. So to learn how to use the theme set to Tutorial, and when you have setup your options and categories switch to Live.
", "optionid" => $themeoptionsprefix."_operationmode", "selectoptiondef" => "Magazine Off", "optiontype" => "select", "options" => $operationmodeops), ); $logotaglineoptions = array ( array("optionname" => "$BlogNameTaglineSettings", "optiontype" => "heading"), array("optionname" => "Site Logo", "optiondescription" => "You can replace the text title with a logo by entering the logo URL here Note:include http://
", "optionid" => $themeoptionsprefix."_sitelogo", "selectoptiondef" => "", "optiontype" => "text"), array("optionname" => "Show/Hide Tagline", "optiondescription" => "Select hide if you prefer to hide the site tagline
", "optionid" => $themeoptionsprefix."_style_showhide_tagline", "selectoptiondef" => "show", "optiontype" => "select", "options" => $showhidearr), array("optionname" => "Tagline position", "optiondescription" => "Move tagline to the left right or center
", "optionid" => $themeoptionsprefix."_style_position_tagline", "selectoptiondef" => "left", "optiontype" => "select", "options" => $leftrightcenterops), ); $adsettingsoptions = array ( array("optionname" => "Ads Settings", "optiontype" => "heading"), array("optionname" => "Show/Hide leaderboard Space", "optiondescription" => "Select hide to hide or show to display the leaderboard content space under the date/search bar
", "optionid" => $themeoptionsprefix."_showhideleader", "selectoptiondef" => "hide", "optiontype" => "select", "options" => $showhidearr), array("optionname" => "Leaderboard Space Content", "optiondescription" => "Content for the leaderboard space under the date/search bar
", "optionid" => $themeoptionsprefix."_leadercode", "selectoptiondef" => "", "optiontype" => "textarea"), array("optionname" => "Leaderboard content text position", "optiondescription" => "Select left to align leaderboard content to left or center to align to center
", "optionid" => $themeoptionsprefix."_showhideleadercontentposition", "selectoptiondef" => "$sop:", "optiontype" => "select", "options" => $textalignlc), array("optionname" => "Ad code for single page posts", "optiondescription" => "If using positions left or right best to use 200 by 200 ads. For other positions best to use 468 by 60 ads
", "optionid" => $themeoptionsprefix."_singlepageadsensecode", "selectoptiondef" => "", "optiontype" => "textarea"), array("optionname" => "Position for single page post ads", "optiondescription" => "Left will float left, right will float right - 6 position options
", "optionid" => $themeoptionsprefix."_singlepageadsenseposition", "selectoptiondef" => "Select Option:", "optiontype" => "select", "options" => $singlepageadsensepositions), ); $miscellaneoussidebaroptions = array ( array("optionname" => "$MiscellaneousSidebarSettings", "optiontype" => "heading"), array("optionname" => "Sidebar One Position", "optiondescription" => "Select 1 to move Sidebar One to left or 2 for right. Does not apply on homepage
", "optionid" => $themeoptionsprefix."_sidebarpos", "selectoptiondef" => "2", "optiontype" => "select", "options" => $sidebarpos), array("optionname" => "Share Widget", "optiondescription" => "Select hide to conceal the share icons widget box in the post sidebar
", "optionid" => $themeoptionsprefix."_hideshareicons", "selectoptiondef" => "show", "optiontype" => "select", "options" => $showhidearr), array("optionname" => "More From Category", "optiondescription" => "Select hide to conceal the 'more from this category' widget box in the post sidebar
", "optionid" => $themeoptionsprefix."_hidemorefromcategory", "selectoptiondef" => "show", "optiontype" => "select", "options" => $showhidearr), array("optionname" => "More From Category Title", "optiondescription" => "Change header text from Sticky Posts.
", "optionid" => $themeoptionsprefix."_morefromthiscattitle", "selectoptiondef" => "More from category", "optiontype" => "text"), array("optionname" => "More from category number of posts", "optiondescription" => "How many excerpts to show?
", "optionid" => $themeoptionsprefix."_morefromthiscathowmany", "selectoptiondef" => "5", "optiontype" => "text"), array("optionname" => "More from category show excerpt text", "optiondescription" => "Only title is shown by default. If you want to include excerpt text select show.
", "optionid" => $themeoptionsprefix."_morefromthiscatshowexcerpt", "selectoptiondef" => "show", "optiontype" => "select", "options" => $hideshowarr), array("optionname" => "Excerpt Length", "optiondescription" => "Increase or decrease character length to control appearance.
", "optionid" => $themeoptionsprefix."_morefromthiscatexcerptlength", "selectoptiondef" => "120", "optiontype" => "text"), array("optionname" => "More from category excerpt thumbnail", "optiondescription" => "If you prefer no thumbnail with the More from category excerpt select hide to conceal thumbnails.
", "optionid" => $themeoptionsprefix."_morefromthiscatshowthumb", "selectoptiondef" => "show", "optiontype" => "select", "options" => $showhidearr), array("optionname" => "Thumbnail height", "optiondescription" => "Increase or decrease thumbnail height.
", "optionid" => $themeoptionsprefix."_morefromthiscatthumbheight", "selectoptiondef" => "75", "optiontype" => "text"), array("optionname" => "Thumbnail width", "optiondescription" => "Increase or decrease thumbnail width.
", "optionid" => $themeoptionsprefix."_morefromthiscatthumbwidth", "selectoptiondef" => "75", "optiontype" => "text"), ); $stickypostssettings = array ( array("optionname" => "$StickyPostsSettings", "optiontype" => "heading"), array("optionname" => "Sticky Posts Title", "optiondescription" => "Change header text from Sticky Posts.
", "optionid" => $themeoptionsprefix."_stickytitle", "selectoptiondef" => "Sticky Posts", "optiontype" => "text"), array("optionname" => "Excerpt Length", "optiondescription" => "Increase or decrease character length to control appearance.
", "optionid" => $themeoptionsprefix."_stickyexcerptlength", "selectoptiondef" => "120", "optiontype" => "text"), ); $horizontalnavigationmenuoptions = array ( array("optionname" => "$HorizontalNavigationMenuSettings", "optiontype" => "heading"), array("optionname" => "Show/Hide Add Post Link", "optiondescription" => "Selecting show will display an Add Post link in your homepage menu that you can click to have quick access for adding new posts. Only you will be able to see the link
", "optionid" => $themeoptionsprefix."_hideaddpostlink", "selectoptiondef" => "hide", "optiontype" => "select", "options" => $showhidearr), array("optionname" => "Menu pages or categories", "optiondescription" => "The horizontal navigation menu shows your pages by default. If you prefer categories switch to categories", "optionid" => $themeoptionsprefix."_pagesorcategories", "selectoptiondef" => "pages", "optiontype" => "select", "options" => $pagesorcategoriesarr), array("optionname" => "Pages/Categories exclude IDs", "optiondescription" => "If there are pages or categories you want to exclude from the horizontal menu (depending on which of the two you are using) enter the IDs of the pages or categories that should be excluded. Separate with comma.
", "optionid" => $themeoptionsprefix."_pagecatidstoexclude", "selectoptiondef" => "", "optiontype" => "text"), ); $featuredslideroptions = array ( array("optionname" => "$FeaturedSliderSettings", "optiontype" => "heading"), array("optionname" => "Featured Category 1 for slideshow", "optiondescription" => "Select your main featured category for the slideshow.
", "optionid" => $themeoptionsprefix."_featuredcat", "selectoptiondef" => "Select Category:", "optiontype" => "select", "options" => $catdlist), array("optionname" => "Number of Featured Posts to show", "optiondescription" => "You can set the number of featured posts to show in the featured slideshow.
", "optionid" => $themeoptionsprefix."_numpostsfeatured", "selectoptiondef" => "5", "optiontype" => "select", "options" => $numfeaturedpostsarr), array("optionname" => "Deactivate Slideshow", "optiondescription" => "This will turn off the slider and default to a single static image from the slideshow featured category.
", "optionid" => $themeoptionsprefix."_deactivateslideshow", "selectoptiondef" => "activate", "optiontype" => "select", "options" => $activatedeactivate), ); $featured2options = array ( array("optionname" => "$FeaturedCategory2Options", "optiontype" => "heading"), array("optionname" => "Featured Category 2", "optiondescription" => "Select your second featured category.
", "optionid" => $themeoptionsprefix."_featuredcat2", "selectoptiondef" => "Select Category:", "optiontype" => "select", "options" => $catdlist), array("optionname" => "Excerpt Length", "optiondescription" => "Increase or decrease character length to control appearance.
", "optionid" => $themeoptionsprefix."_featuredcat2excerptlength", "selectoptiondef" => "120", "optiontype" => "text"), ); $featured3options = array ( array("optionname" => "$FeaturedCategory3Options", "optiontype" => "heading"), array("optionname" => "Featured Category 3", "optiondescription" => "Select your third featured category.
", "optionid" => $themeoptionsprefix."_featuredcat3", "selectoptiondef" => "Select Category:", "optiontype" => "select", "options" => $catdlist), array("optionname" => "Excerpt Length", "optiondescription" => "Increase or decrease character length to control appearance.
", "optionid" => $themeoptionsprefix."_featuredcat3excerptlength", "selectoptiondef" => "175", "optiontype" => "text"), ); $featured4options = array ( array("optionname" => "$FeaturedCategory4Options", "optiontype" => "heading"), array("optionname" => "Featured Category 4", "optiondescription" => "Select your fourth featured category.
", "optionid" => $themeoptionsprefix."_featuredcat4", "selectoptiondef" => "Select Category:", "optiontype" => "select", "options" => $catdlist), array("optionname" => "Excerpt Length", "optiondescription" => "Increase or decrease character length to control appearance.
", "optionid" => $themeoptionsprefix."_featuredcat4excerptlength", "selectoptiondef" => "90", "optiontype" => "text"), ); $featured5options = array ( array("optionname" => "$FeaturedCategory5Options", "optiontype" => "heading"), array("optionname" => "Featured Category 5", "optiondescription" => "Select your fifth featured category.
", "optionid" => $themeoptionsprefix."_featuredcat5", "selectoptiondef" => "Select Category:", "optiontype" => "select", "options" => $catdlist), array("optionname" => "Excerpt Length", "optiondescription" => "Increase or decrease character length to control appearance.
", "optionid" => $themeoptionsprefix."_featuredcat5excerptlength", "selectoptiondef" => "175", "optiontype" => "text"), ); $featured6options = array ( array("optionname" => "$FeaturedCategory6Options", "optiontype" => "heading"), array("optionname" => "Featured Category 6", "optiondescription" => "Select your fifth featured category.
", "optionid" => $themeoptionsprefix."_featuredcat6", "selectoptiondef" => "Select Category:", "optiontype" => "select", "options" => $catdlist), array("optionname" => "Excerpt Length", "optiondescription" => "Increase or decrease character length to control appearance.
", "optionid" => $themeoptionsprefix."_featuredcat6excerptlength", "selectoptiondef" => "90", "optiontype" => "text"), ); $featured7options = array ( array("optionname" => "$FeaturedCategory7Options", "optiontype" => "heading"), array("optionname" => "Featured Category 7", "optiondescription" => "Select your sixth featured category.
", "optionid" => $themeoptionsprefix."_featuredcat7", "selectoptiondef" => "Select Category:", "optiontype" => "select", "options" => $catdlist), array("optionname" => "Excerpt Length Left", "optiondescription" => "Increase or decrease character length to control appearance.
", "optionid" => $themeoptionsprefix."_featuredcat7excerptlength1", "selectoptiondef" => "275", "optiontype" => "text"), array("optionname" => "Excerpt Length Right", "optiondescription" => "Increase or decrease character length to control appearance.
", "optionid" => $themeoptionsprefix."_featuredcat7excerptlength2", "selectoptiondef" => "123", "optiontype" => "text"), ); $customsidebarelementoptions = array ( array("optionname" => "$CustomLatestPostsRecentCommentsSettings", "optiontype" => "heading"), array("optionname" => "Hide Custom Latest Topics", "optiondescription" => "The package comes with a custom latest topics in Sidebar Two. Select hide if you prefer to hide it.
", "optionid" => $themeoptionsprefix."_hidecustomlatesttopics", "selectoptiondef" => "show", "optiontype" => "select", "options" => $showhidearr), array("optionname" => "Hide Custom Latest Comments", "optiondescription" => "The package comes with a custom latest comments in Sidebar Two. Select hide if you prefer to hide it.
", "optionid" => $themeoptionsprefix."_hidecustomlatestcomments", "selectoptiondef" => "show", "optiontype" => "select", "options" => $showhidearr), array("optionname" => "Position for sidebar 2 widgets", "optiondescription" => "If not hiding the custom recent topics and custom recent comments you can decide if to show your dragged widgets on top of the packaged sidebar elements or below them. Choose 1 for top or 2 for bottom.
", "optionid" => $themeoptionsprefix."_sidebar2widgetspos", "selectoptiondef" => "2", "optiontype" => "select", "options" => $sidebar2widgetspos), array("optionname" => "Number of items for Custom Latest Topics", "optiondescription" => "If using the customized Latest Topics in sidebar select how many to display
", "optionid" => $themeoptionsprefix."_numlatesttopics", "selectoptiondef" => "5", "optiontype" => "select", "options" => $numfeaturedarr), array("optionname" => "Number of items for Custom Recent Comments ", "optiondescription" => "If using the customized Recent Comments in sidebar select how many to display
", "optionid" => $themeoptionsprefix."_numrecentcomments", "selectoptiondef" => "5", "optiontype" => "select", "options" => $numfeaturedarr), array("optionname" => "Latest Topics Title", "optiondescription" => "Change header text from Latest Topics.
", "optionid" => $themeoptionsprefix."_latesttopicstitle", "selectoptiondef" => "Latest Topics", "optiontype" => "text"), array("optionname" => "Latest Topics hide excerpt text", "optiondescription" => "If you prefer to only have the title in the latest topics excerpts you can select hide to conceal the excerpt text.
", "optionid" => $themeoptionsprefix."_latesttopicsshowexcerpt", "selectoptiondef" => "show", "optiontype" => "select", "options" => $showhidearr), array("optionname" => "Recent Comments Title", "optiondescription" => "Change header text from Recent Comments.
", "optionid" => $themeoptionsprefix."_recentcommentstitle", "selectoptiondef" => "Recent Comments", "optiontype" => "text"), array("optionname" => "Recent Comments title phrase", "optiondescription" => "Where it says author 'had this to say' in custom comment list you can change 'had this to say' to whatever you prefer. Enter 'none' (without the quotes) for no text.
", "optionid" => $themeoptionsprefix."_recentcommentstitlephrase", "selectoptiondef" => "had this to say", "optiontype" => "text"), array("optionname" => "Recent Comments read the post text", "optiondescription" => "Where it says author 'Read the post' under custom comments list you can change 'Read the post' to whatever you prefer.
", "optionid" => $themeoptionsprefix."_recentcommentsreadposttext", "selectoptiondef" => "Read the post", "optiontype" => "text"), array("optionname" => "Comments order", "optiondescription" => "Select ASC for lowest to highest or DESC for highest to lowest
", "optionid" => $themeoptionsprefix."_recentcommentsdisplayorder", "selectoptiondef" => "ASC", "optiontype" => "select", "options" => $displayorder), array("optionname" => "Recent comments hide excerpt text", "optiondescription" => "If you prefer to only have the title in the latest topics excerpts you can select hide to conceal the excerpt text.
", "optionid" => $themeoptionsprefix."_recentcommentsshowexcerpt", "selectoptiondef" => "show", "optiontype" => "select", "options" => $showhidearr), array("optionname" => "Latest Topics excerpt length", "optiondescription" => "Increase or decrease character length to control appearance.
", "optionid" => $themeoptionsprefix."_latesttopicsexcerptlength", "selectoptiondef" => "120", "optiontype" => "text"), array("optionname" => "Recent comments excerpt length", "optiondescription" => "Increase or decrease character length to control appearance.
", "optionid" => $themeoptionsprefix."_recentcommentsexcerptlength", "selectoptiondef" => "120", "optiontype" => "text"), ); $generalthumbnailoptions = array ( array("optionname" => "$StandardThumbnailSettings", "optiontype" => "heading"), array("optionname" => "State of default no image thumbnail", "optiondescription" => "If you prefer not to use a no image thumbnail for posts that have no image change state to off
", "optionid" => $themeoptionsprefix."_noimagethumbnailstate", "selectoptiondef" => "on", "optiontype" => "select", "options" => $onoffops), array("optionname" => "Pre-clean thumb URL", "optiondescription" => "Some installations have problems with the TimThumb cropping script. If your thumbnails don't show select on to pre clean the thumbnail url before it gets passed to the TimThumb to be cropped. This sometimes resolves the problem.
", "optionid" => $themeoptionsprefix."_precleanthumburl", "selectoptiondef" => "", "optiontype" => "select", "options" => $offonops), array("optionname" => "Archive/Search excerpt length", "optiondescription" => "Excerpt length for search results and archive pages
", "optionid" => $themeoptionsprefix."_archivesearchexcerptlength", "selectoptiondef" => "275", "optiontype" => "text"), array("optionname" => "Image Zoom Crop", "optiondescription" => "Select 1 to zoom in on image and crop part or 0 to crop full image
", "optionid" => $themeoptionsprefix."_featuredcatimageszoomcrop", "selectoptiondef" => "1", "optiontype" => "select", "options" => $zoomcropops), array("optionname" => "Image Quality", "optiondescription" => "Modify value as needed to adjust image quality
", "optionid" => $themeoptionsprefix."_featuredcatimagesquality", "selectoptiondef" => "95", "optiontype" => "text"), ); $commentformoptions = array ( array("optionname" => "$CommentFormSettings", "optiontype" => "heading"), array("optionname" => "Comment form on Post Pages", "optiondescription" => "Do you want posts of the type Page to have a comment form?
", "optionid" => $themeoptionsprefix."_commentsonpage", "selectoptiondef" => "Select yes or no:", "optiontype" => "select", "options" => $commentsonpage), ); function get_antisnewsoptions() { $mypsoptions=array(); global $themeoptionsprefix; $pstandoptions=get_option($themeoptionsprefix.'_theme_options'); $ppremoptions=get_option($themeoptionsprefix.'_css_style_options'); foreach ($pstandoptions as $pstandoption) { if(isset($pstandoption['optionid']) && !empty($pstandoption['optionid'])) { $mypsoptions[$pstandoption['optionid']]=$pstandoption['selectoptiondef']; } } foreach ($ppremoptions as $ppremoption) { if(isset($ppremoption['optionid']) && !empty($ppremoption['optionid'])) { $mypsoptions[$ppremoption['optionid']] = $ppremoption['selectoptiondef']; } } return $mypsoptions; } function get_ppremoption($psoptionid) { $psopval=''; global $themeoptionsprefix; $cssoptions=$AntisnewsOptions[$themeoptionsprefix.'_css_style_options']; foreach ($cssoptions as $cssoption) { if($cssoption['optionid'] == $psoptionid) { $mypsoptions[]=array("optionname" => $cssoption['optionname'], "optiondescription" => $cssoption['optiondescription'], "optionid" => $cssoption['optionid'], "selectoptiondef" => $cssoption['selectoptiondef'], "optiontype" => $cssoption['optiontype'], "options" => $cssoption['options']); } } if(isset($mypsoptions) && !empty($mypsoptions)) { foreach($mypsoptions as $mypsoptions) { $psopval=$mypsoptions['selectoptiondef']; } } return $psopval; } function get_myoptionsarray($whichpremiumoptions) { global $themeoptionsprefix; $AntisnewsOptions=get_antisnewsoptions(); $mywhichoptions=array(); foreach ($whichpremiumoptions as $optionvalue) { if(isset($optionvalue['optionid']) && !empty($optionvalue['optionid'])) { if(!isset($optionvalue['options']) || empty($optionvalue['options'])) { $optionvalue['options']=''; } $whichpremiumoptionval = $AntisnewsOptions[$optionvalue['optionid']]; $mywhichoptions[]=array("optionname" => $optionvalue['optionname'], "optiondescription" => $optionvalue['optiondescription'], "optionid" => $optionvalue['optionid'], "selectoptiondef" => $whichpremiumoptionval, "optiontype" => $optionvalue['optiontype'], "options" => $optionvalue['options']); } } return $mywhichoptions; } function get_def_opt_val($c12_premiumoptions,$optionvalue) { $psopval=''; foreach ($c12_premiumoptions as $c12_premiumoption) { if(isset($c12_premiumoption['optionid']) && !empty($c12_premiumoption['optionid'])) { if($c12_premiumoption['optionid'] == $optionvalue) { $psopval=$c12_premiumoption['selectoptiondef']; } } } return $psopval; } check_for_options(); function check_for_options() { $AntisnewsOptions=get_antisnewsoptions(); global $themeoptionsprefix,$metaoptions,$googleanalyticsoptions,$logotaglineoptions,$adsettingsoptions,$miscellaneoussidebaroptions,$stickypostssettings,$horizontalnavigationmenuoptions,$featuredslideroptions,$featured2options,$featured3options,$featured4options,$featured5options,$featured6options,$featured7options,$generalthumbnailoptions,$commentformoptions,$customsidebarelementoptions,$standardconfigops; $mydefoptions=array_merge($metaoptions,$googleanalyticsoptions,$logotaglineoptions,$adsettingsoptions,$miscellaneoussidebaroptions,$stickypostssettings,$horizontalnavigationmenuoptions,$featuredslideroptions,$featured2options,$featured3options,$featured4options,$featured5options,$featured6options,$featured7options,$generalthumbnailoptions,$commentformoptions,$customsidebarelementoptions,$standardconfigops); $mythemeoptions=$themeoptionsprefix.'_theme_options'; $mysavedthemeoptions=get_option($mythemeoptions); $options = $mysavedthemeoptions; if (!isset($options) || empty($options) || !is_array($options)) { $options = $mydefoptions; foreach ($options as $optionvalue) { if(!isset($optionvalue['optionid']) || empty($optionvalue['optionid'])) { $optionvalue['optionid']=''; } if(!isset($optionvalue['options']) || empty($optionvalue['options'])) { $optionvalue['options']=''; } if(!isset($optionvalue['optiondescription']) || empty($optionvalue['optiondescription'])) { $optionvalue['optiondescription']=''; } if(!isset($optionvalue['selectoptiondef']) || empty($optionvalue['selectoptiondef'])) { $optionvalue['selectoptiondef']=''; } if(isset($optionvalue['optionid']) && !empty($optionvalue['optionid'])) { $savedoptionvalue=get_option($optionvalue['optionid']); } if(!isset($savedoptionvalue) || empty ($savedoptionvalue)) { $savedoptionvalue=$optionvalue['selectoptiondef']; } $setmyoptions[]=array("optionname" => $optionvalue['optionname'], "optiondescription" => $optionvalue['optiondescription'], "optionid" => $optionvalue['optionid'], "selectoptiondef" => $savedoptionvalue, "optiontype" => $optionvalue['optiontype'], "options" => $optionvalue['options']); if(isset($optionvalue['optionid']) && !empty($optionvalue['optionid'])) { delete_option($optionvalue['optionid']); } } update_option($mythemeoptions,$setmyoptions); } elseif(isset($options) && !empty($options)) { if(!($mydefoptions === $options)) { $setmyoptions=array(); foreach ($mydefoptions as $optionvalue) { if(!isset($optionvalue['optionid']) || empty($optionvalue['optionid'])) { $optionvalue['optionid']=''; } if(!isset($optionvalue['options']) || empty($optionvalue['options'])) { $optionvalue['options']=''; } if(!isset($optionvalue['optiondescription']) || empty($optionvalue['optiondescription'])) { $optionvalue['optiondescription']=''; } if(!isset($optionvalue['selectoptiondef']) || empty($optionvalue['selectoptiondef'])) { $optionvalue['selectoptiondef']=''; } if(!isset($optionvalue['options']) || empty($optionvalue['options'])) { $optionvalue['options']=''; } if(isset($AntisnewsOptions[$optionvalue['optionid']]) && !empty($AntisnewsOptions[$optionvalue['optionid']])) { $savedoptionvalue=$AntisnewsOptions[$optionvalue['optionid']]; } elseif(isset($optionvalue['selectoptiondef']) && !empty($optionvalue['selectoptiondef'])) { $savedoptionvalue=$optionvalue['selectoptiondef']; } else { $savedoptionvalue=''; } $setmyoptions[]=array("optionname" => $optionvalue['optionname'], "optiondescription" => $optionvalue['optiondescription'], "optionid" => $optionvalue['optionid'], "selectoptiondef" => $savedoptionvalue, "optiontype" => $optionvalue['optiontype'], "options" => $optionvalue['options']); } update_option($mythemeoptions,$setmyoptions); } } } function do_options_update_theme() { global $this_theme,$themeoptionsprefix,$optionsupdated,$optionsreset; global $metaoptions,$googleanalyticsoptions,$logotaglineoptions,$adsettingsoptions,$miscellaneoussidebaroptions,$stickypostssettings,$horizontalnavigationmenuoptions,$featuredslideroptions,$featured2options,$featured3options,$featured4options,$featured5options,$featured6options,$featured7options,$generalthumbnailoptions,$commentformoptions,$customsidebarelementoptions,$standardconfigops; $myantisoptions=array_merge($metaoptions,$googleanalyticsoptions,$logotaglineoptions,$adsettingsoptions,$miscellaneoussidebaroptions,$stickypostssettings,$horizontalnavigationmenuoptions,$featuredslideroptions,$featured2options,$featured3options,$featured4options,$featured5options,$featured6options,$featured7options,$generalthumbnailoptions,$commentformoptions,$customsidebarelementoptions,$standardconfigops); $myantisoptionname=$themeoptionsprefix.'_theme_options'; $myantisoptionsaved=get_myoptionsarray($myantisoptions); if (!isset($myantisoptionsaved) || empty($myantisoptionsaved) || !is_array($myantisoptionsaved)) { $optionsforupdate = $myantisoptions; } else { $optionsforupdate = $myantisoptionsaved; } if ( isset($_REQUEST['page']) && ($_REQUEST['page'] == basename(__FILE__) ) ) { if( isset($_REQUEST['action']) && ( 'updateoptions' == $_REQUEST['action'] )) { foreach ($optionsforupdate as $optionvalue) { if(isset($optionvalue['optionid']) && !empty($optionvalue['optionid'])) { if( isset( $_REQUEST[ $optionvalue['optionid'] ] ) ) { $myantisoptionvalue = $_REQUEST[ $optionvalue['optionid'] ]; } else { $myantisoptionvalue=$optionvalue['selectoptiondef']; } } $mypoptions[]=array("optionname" => $optionvalue['optionname'], "optiondescription" => $optionvalue['optiondescription'], "optionid" => $optionvalue['optionid'], "selectoptiondef" => $myantisoptionvalue, "optiontype" => $optionvalue['optiontype'], "options" => $optionvalue['options']); } update_option($myantisoptionname,$mypoptions); $optionsupdated=true; } else if( isset($_REQUEST['action']) && ( 'reset' == $_REQUEST['action'] )) { if(isset($_REQUEST['w']) && !empty($_REQUEST['w'])) { $whichoptions=$_REQUEST['w']; } if($whichoptions == 1) { $options=$metaoptions; } elseif($whichoptions == 2) { $options=$googleanalyticsoptions; } elseif($whichoptions == 3) { $options=$logotaglineoptions; } elseif($whichoptions == 4) { $options=$adsettingsoptions; } elseif($whichoptions == 5) { $options=$miscellaneoussidebaroptions; } elseif($whichoptions == 6) { $options=$stickypostssettings; } elseif($whichoptions == 7) { $options=$horizontalnavigationmenuoptions; } elseif($whichoptions == 8) { $options=$featuredslideroptions; } elseif($whichoptions == 9) { $options=$featured2options; } elseif($whichoptions == 10) { $options=$featured3options; } elseif($whichoptions == 11) { $options=$featured4options; } elseif($whichoptions == 12) { $options=$featured5options; } elseif($whichoptions == 13) { $options=$featured6options; } elseif($whichoptions == 14) { $options=$generalthumbnailoptions; } elseif($whichoptions == 15) { $options=$commentformoptions; } elseif($whichoptions == 16) { $options=$customsidebarelementoptions; } elseif($whichoptions == 17) { $options=$standardconfigops; } elseif($whichoptions == 18) { $options=$featured7options; } elseif($whichoptions == 'all') { $options=array_merge($metaoptions,$googleanalyticsoptions,$logotaglineoptions,$adsettingsoptions,$miscellaneoussidebaroptions,$stickypostssettings,$horizontalnavigationmenuoptions,$featuredslideroptions,$featured2options,$featured3options,$featured4options,$featured5options,$featured6options,$featured7options,$generalthumbnailoptions,$commentformoptions,$customsidebarelementoptions,$standardconfigops); } foreach ($options as $option) { if(isset($option['optionid']) && !empty($option['optionid'])) { $optionidsfordel[]=$option['optionid']; } } foreach ($optionsforupdate as $optionvalue) { if(in_array($optionvalue['optionid'],$optionidsfordel)) { $myoptiondelvalue = get_def_opt_val($options,$optionvalue['optionid']); if(!isset($myoptiondelvalue) || empty($myoptiondelvalue)) { $myoptiondelvalue=""; } $myoptionvalue = "$myoptiondelvalue"; } else { $myoptionvalue=$optionvalue['selectoptiondef']; } $mypoptions[]=array("optionname" => $optionvalue['optionname'], "optiondescription" => $optionvalue['optiondescription'], "optionid" => $optionvalue['optionid'], "selectoptiondef" => $myoptionvalue, "optiontype" => $optionvalue['optiontype'], "options" => $optionvalue['options']); } update_option($myantisoptionname,$mypoptions); $optionsupdated=true; } } add_theme_page($this_theme." Options", $this_theme." Options", 'edit_themes', basename(__FILE__), 'display_page_options_antisnews', ''); } function display_page_options_antisnews() { global $themeoptionsprefix; global $optionsreset,$optionsupdated,$this_theme; global $metaoptions,$googleanalyticsoptions,$logotaglineoptions,$adsettingsoptions,$miscellaneoussidebaroptions,$stickypostssettings,$horizontalnavigationmenuoptions,$featuredslideroptions,$featured2options,$featured3options,$featured4options,$featured5options,$featured6options,$featured7options,$generalthumbnailoptions,$commentformoptions,$customsidebarelementoptions,$standardconfigops; global $PageMetaSettings,$GoogleAnalyticsSettings,$BlogNameTaglineSettings,$AdsSettings,$MiscellaneousSidebarSettings,$StickyPostsSettings,$HorizontalNavigationMenuSettings,$FeaturedSliderSettings,$FeaturedCategory2Options,$FeaturedCategory3Options,$FeaturedCategory4Options,$FeaturedCategory5Options,$FeaturedCategory6Options,$FeaturedCategory7Options,$StandardThumbnailSettings,$CommentFormSettings,$CustomLatestPostsRecentCommentsSettings,$StandardConfigurationOptions; $mymergedoptions=array_merge($metaoptions,$googleanalyticsoptions,$logotaglineoptions,$adsettingsoptions,$miscellaneoussidebaroptions,$stickypostssettings,$horizontalnavigationmenuoptions,$featuredslideroptions,$featured2options,$featured3options,$featured4options,$featured5options,$featured6options,$featured7options,$generalthumbnailoptions,$commentformoptions,$customsidebarelementoptions,$standardconfigops); if(isset($_REQUEST['action']) && !empty($_REQUEST['action']) && ($_REQUEST['action'] == 'loadstandardoptionsform')) { if(isset($_REQUEST['antistandops']) && !empty($_REQUEST['antistandops'])) { $whichoptions=$_REQUEST['antistandops']; if($whichoptions == 1) { $options=$metaoptions; } elseif($whichoptions == 2) { $options=$googleanalyticsoptions; } elseif($whichoptions == 3) { $options=$logotaglineoptions; } elseif($whichoptions == 4) { $options=$adsettingsoptions; } elseif($whichoptions == 5) { $options=$miscellaneoussidebaroptions; } elseif($whichoptions == 6) { $options=$stickypostssettings; } elseif($whichoptions == 7) { $options=$horizontalnavigationmenuoptions; } elseif($whichoptions == 8) { $options=$featuredslideroptions; } elseif($whichoptions == 9) { $options=$featured2options; } elseif($whichoptions == 10) { $options=$featured3options; } elseif($whichoptions == 11) { $options=$featured4options; } elseif($whichoptions == 12) { $options=$featured5options; } elseif($whichoptions == 13) { $options=$featured6options; } elseif($whichoptions == 14) { $options=$generalthumbnailoptions; } elseif($whichoptions == 15) { $options=$commentformoptions; } elseif($whichoptions == 16) { $options=$customsidebarelementoptions; } elseif($whichoptions == 17) { $options=$standardconfigops; } elseif($whichoptions == 18) { $options=$featured7options; } else { $options=$logotaglineoptions; } } else { $options=$mymergedoptions; } do_page_antisnews($options,$whichoptions); } else { ?>