WordPress.org

Ready to get started?Download WordPress

Forums

Theme supposed to add button to dashboard (2 posts)

  1. halrabeah
    Member
    Posted 5 years ago #

    Hello everyone,

    I'm a few days old to wordpress, I upgraded from my web host's preinstalled 2.35 i believe, to 2.8 yesterday. I found a great theme that I am looking forward to using, called sero. Install went fine, and it works, however they have included a script that adds a theme setup button to the dashboard, and it just won't show up. This theme has been confirmed to work in wordpress up till 2.7. However I'm sure this is a simple fix that I'm missing. Thanks for all help in advance.

    Here is the script code.

    <?php
    //////////////////////////////
    // Setup Admin Page <head> //
    ////////////////////////////
    function admin_page_head(){
        ?>
        <script type="text/javascript">
        //toggle function
        $jQuery = jQuery.noConflict();
        $jQuery(document).ready(function(){
        	$jQuery(".toggle_body").hide();
        	$jQuery(".toggle_head").click(function(){
        		$jQuery(this).next(".toggle_body").slideToggle(600);
        	});
            $jQuery(".toggle_all").click(function(){
        		$jQuery(".toggle_body").show();
        	});
            $jQuery(".toggle_all_hide").click(function(){
        		$jQuery(".toggle_body").hide();
        	});
        });
        </script>
        <script type="text/javascript">
        //Multi pick
        $jQuery = jQuery.noConflict();
        $jQuery(function() {
            $jQuery(".sero_big_three .option").click(function() {
                var pick = "";
                $jQuery(this).toggleClass("active");
                $jQuery(".sero_big_three .active").each(function() {
                    pick += $jQuery(this).attr("value") + ",";
                });
                $jQuery(".sero_big_three_pick").attr("value", pick);
            });
    
            $jQuery(".sero_main_nav .option").click(function() {
                var pick = "";
                $jQuery(this).toggleClass("active");
                $jQuery(".sero_main_nav .active").each(function() {
                    pick += $jQuery(this).attr("value") + ",";
                });
                $jQuery(".sero_main_nav_pick").attr("value", pick);
            });
    
            $jQuery(".sero_footer_nav .option").click(function() {
                var pick = "";
                $jQuery(this).toggleClass("active");
                $jQuery(".sero_footer_nav .active").each(function() {
                    pick += $jQuery(this).attr("value") + ",";
                });
                $jQuery(".sero_footer_nav_pick").attr("value", pick);
            });
        });
        </script>
    <script type="text/javascript">
    //Select to input
    function Process(selection){
      var frm = document.getElementById("seroform");
      frm.sero_frontpage_id.value = selection;
    }
    </script>
        <style type="text/css" media="screen">
        .serowrap .form-table td {
        	border-bottom-width: 8px;
        	border-bottom-style: solid;
            }
    
        .serowrap .form-table td td{
            border-bottom:1px solid #d6dbe7;
            }
    
        .serowrap .form-table th {
        	border-bottom:1px solid #d6dbe7;
            }
    
        .clear{
            clear:both;
            height:1px;
            font-size:1px;
            border:none;
            background:transparent;
            overflow:hidden;
            margin:0;
            padding:0;
            }
    
        ul.admin-cat-list, .admin-cat-list ul{
            list-style-type:none;
            display:inline;
            margin:0;
            padding:0;
            }
    
        .admin-cat-list li,.admin-cat-list ul li{
            display: inline;
            padding:2px 5px;
            }
    
        .instructions_row{
            background:#cfe3f4;
            }
    
        .toggle_all,.toggle_all_hide{
            padding:5px;
            margin:5px;
            border:1px solid #ccc;
            }
    
        .toggle_title{
            margin:2px 0px 10px 0px;
            padding:5px 0px;
            color:#879FBA;
            font-size:15px;
            }
    
          .toggle_head {
          	padding: 4px;
            margin-left:6px;
          	cursor: pointer;
          	position: relative;
            border:1px solid #6F8CAC;
            background:#eff8ff;
            font-size:10px;
            }
    
          .toggle_body {
          	padding: 10px 4px;
            }
    
          .option {
            white-space: nowrap;
            overflow: visible;
            cursor: default;
            border:1px solid #6F8CAC;
            margin:5px;
            padding:2px;
            width:12em;
            }
    
          .active {
            background: #FFD799;
            }
    
          .no-option {
            white-space: nowrap;
            overflow: visible;
            cursor: default;
            border:0px solid transparent;
            margin:auto;
            padding:auto;
            width:auto;
            }
        </style>
        <?php
    }
    add_action('admin_head', 'admin_page_head');
    
    /////////////////////
    // Core Variables //
    ///////////////////
    //Theme Administration Functions by ChurchWebDeveloper.com
        $themename = "Sero";
        $shortname = "sero";
    
    //Directory Images
        $bg_images = get_dir_images("/images/backgrounds");
        $footer_images = get_dir_images("/images/footer");
        $frontpage_images = get_dir_images("/images/carousel");
        $logo_images = get_dir_images("/images/logo");
    
    //Pages
        $your_pages =  get_page_ids();
        $your_pages_array =  get_page_ids("array");
    
    //Categories
        $your_cats =  get_cat_ids();
        $your_cats_array =  get_cat_ids("array");
    
    //Categories and Pages Merged
    if(is_array($your_pages_array) && is_array($your_cats_array)){
    	$cats_and_pages_array = array_merge($your_pages_array,$your_cats_array);
    }
    else{
    	if(is_array($your_pages_array)){
    		$cats_and_pages_array =	$your_pages_array;
    	}
    	if(is_array($your_cats_array)){
    		$cats_and_pages_array =	$your_cats_array;
    	}
    }
    
    ////////////////////
    // Theme Options //
    //////////////////
        $options = array (
        array(	"name" => "",
        		"desc" => "Address and Phone Numbers",
        		"id" => "",
        		"std" => "",
        		"type" => "toggle_start",
                "parameters" => ""
        ),
    
        array(	"name" => "Address and Phone Numbers",
        		"desc" => "Enter as much of your physical address as you'd like. Phone numbers should be listed as: Name of Phone: Number",
        		"id" => "",
        		"std" => "",
        		"type" => "instructions",
                "parameters" => ""
        ),
    
        array(	"name" => "Street",
        		"desc" => "",
        		"id" => $shortname."_address_street",
        		"std" => "987 Main Street, Some City, State, 12345",
        		"type" => "text",
                "parameters" => array("size" => "60", "maxlength" => "128")
        ),
    
        array(	"name" => "Phone 1",
        		"desc" => "",
        		"id" => $shortname."_address_phone1",
        		"std" => "Office: 123-456-7890",
        		"type" => "text",
                "parameters" => array("size" => "30", "maxlength" => "64")
        ),
    
        array(	"name" => "Phone 2",
        		"desc" => "",
        		"id" => $shortname."_address_phone2",
        		"std" => "Prayer: 123-987-6543",
        		"type" => "text",
                "parameters" => array("size" => "30", "maxlength" => "64")
        ),
    
        array(	"name" => "",
        		"desc" => "",
        		"id" => "",
        		"std" => "",
        		"type" => "toggle_end",
                "parameters" => ""
        ),
    
        array(	"name" => "",
        		"desc" => "Logo, Colors and Background",
        		"id" => "",
        		"std" => "",
        		"type" => "toggle_start",
                "parameters" => ""
        ),
    
        array(	"name" => "Customizing Your Logo, Colors and Backgrounds",
        		"desc" => "You can change the primary color and background of your site using the dropdown boxes below.<br /><br />Setting the logo option to <strong>none</strong> will display the title and tagline of your site in text. You can upload a <strong>custom logo</strong> using FTP to the <strong>/images/logos</strong> folder located in the Sero theme folder. Custom logos should be no more than <strong>500px</strong> wide and roughly <strong>100px</strong> high. You can upload <strong>custom backgrounds</strong> using FTP to the <strong>/images/backgrounds</strong> folder located in the Sero theme folder. Custom backgrounds will repeat in x and should fade to #180f07 at the bottom edge.",
        		"id" => "",
        		"std" => "",
        		"type" => "instructions",
                "parameters" => ""
        ),
    
        array(	"name" => "Color Variant",
        		"desc" => "",
        		"id" => $shortname."_color_variant",
        		"std" => "seagreen",
        		"type" => "select",
                "parameters" => array("Sea Green" => "seagreen", "Red" => "red", "Blue" => "blue", "Green" => "green", "Gray" => "gray")
        ),
    
        array(	"name" => "Background Image",
        		"desc" => "",
        		"id" => $shortname."_background",
        		"std" => "stone",
        		"type" => "select",
                "parameters" => $bg_images
        ),
    
        array(	"name" => "Logo",
        		"desc" => "",
        		"id" => $shortname."_logo",
        		"std" => "none",
        		"type" => "select",
                "parameters" => $logo_images
        ),
    
        array(	"name" => "",
        		"desc" => "",
        		"id" => "",
        		"std" => "",
        		"type" => "toggle_end",
                "parameters" => ""
        ),
    
        array(	"name" => "",
        		"desc" => "Main Navigation",
        		"id" => "",
        		"std" => "",
        		"type" => "toggle_start",
                "parameters" => ""
        ),
    
        array(	"name" => "Setting Up Main Navigation",
        		"desc" => "Click the boxes below to build your main navigation. The Sero theme has room for <strong>4 to 6</strong> navigation items depending on how long the text of each item is.",
        		"id" => "",
        		"std" => "",
        		"type" => "instructions",
                "parameters" => ""
        ),
    
        array(	"name" => "Select 4-6 Items",
        		"desc" => "Selected IDs: ",
        		"id" => $shortname."_main_nav",
        		"std" => "none",
        		"type" => "multiselect",
                "parameters" => $cats_and_pages_array,
                "parameters2" => array("size" => "36", "maxlength" => "128")
        ),
    
        array(	"name" => "",
        		"desc" => "",
        		"id" => "",
        		"std" => "",
        		"type" => "toggle_end",
                "parameters" => ""
        ),
    
        array(	"name" => "",
        		"desc" => "Footer Navigation",
        		"id" => "",
        		"std" => "",
        		"type" => "toggle_start",
                "parameters" => ""
        ),
    
        array(	"name" => "Setting Up Footer Navigation",
        		"desc" => "Click the boxes below to build your footer navigation. The Sero theme has room for <strong>10 to 12</strong> navigation items depending on how long the text of each item is.",
        		"id" => "",
        		"std" => "",
        		"type" => "instructions",
                "parameters" => ""
        ),
    
        array(	"name" => "Select 10-12 Items",
        		"desc" => "Selected IDs: ",
        		"id" => $shortname."_footer_nav",
        		"std" => "none",
        		"type" => "multiselect",
                "parameters" => $cats_and_pages_array,
                "parameters2" => array("size" => "56", "maxlength" => "128")
        ),
    
        array(	"name" => "",
        		"desc" => "",
        		"id" => "",
        		"std" => "",
        		"type" => "toggle_end",
                "parameters" => ""
        ),
    
        array(	"name" => "",
        		"desc" => "Sidebar: The 3 Big  Links",
        		"id" => "",
        		"std" => "",
        		"type" => "toggle_start",
                "parameters" => ""
        ),
    
        array(	"name" => "Setting Up the 3 Big Sidebar Links",
        		"desc" => "Click <strong>3</strong> of the boxes below to choose them as links for the big sidebar navigation area.",
        		"id" => "",
        		"std" => "",
        		"type" => "instructions",
                "parameters" => ""
        ),
    
        array(	"name" => "Select Exactly 3 Items",
        		"desc" => "",
        		"id" => $shortname."_big_three",
        		"std" => "none",
        		"type" => "multiselect",
                "parameters" => $cats_and_pages_array,
                "parameters2" => array("size" => "10", "maxlength" => "15")
        ),
    
        array(	"name" => "",
        		"desc" => "",
        		"id" => "",
        		"std" => "",
        		"type" => "toggle_end",
                "parameters" => ""
        ),
    
        array(	"name" => "",
        		"desc" => "Sidebar Widgets",
        		"id" => "",
        		"std" => "",
        		"type" => "toggle_start",
                "parameters" => ""
        ),
    
        array(	"name" => "Add a Widget Enabled Sidebar",
        		"desc" => "Select <strong>yes</strong> to add a third sidebar tab which can be populated with WordPress widgets available on the <strong>Design >> Widgets</strong> tab. The sidebar tab title defines the text that will appear in the tab.<br /><br /><strong>Example:</strong> If you wanted to add a tab that contained recent comments you might enter \"Comments\" as the title and then add the Recent Comments widget in the widgets area.",
        		"id" => "",
        		"std" => "",
        		"type" => "instructions",
                "parameters" => ""
        ),
    
        array(	"name" => "Enable sidebar?",
        		"desc" => "",
        		"id" => $shortname."_widgets_tab_enabled",
        		"std" => "no",
        		"type" => "select",
                "parameters" => array("No" => "no", "Yes" => "yes")
        ),
    
        array(	"name" => "Sidebar Tab Title",
        		"desc" => "",
        		"id" => $shortname."_widgets_tab_title",
        		"std" => "",
        		"type" => "text",
                "parameters" => array("size" => "10", "maxlength" => "32")
        ),
    
        array(	"name" => "",
        		"desc" => "<a href=\"widgets.php\">Add Widgets</a>",
        		"id" => "",
        		"std" => "",
        		"type" => "none",
                "parameters" => ""
        ),
    
        array(	"name" => "",
        		"desc" => "",
        		"id" => "",
        		"std" => "",
        		"type" => "toggle_end",
                "parameters" => ""
        ),
    
        array(	"name" => "",
        		"desc" => "Frontpage Content",
        		"id" => "",
        		"std" => "",
        		"type" => "toggle_start",
                "parameters" => ""
        ),
    
        array(	"name" => "Setting Frontpage Content and Length",
        		"desc" => "Select the page content that will be displayed on the front page. You may optionally enter the number of words you'd like shown from this content.",
        		"id" => "",
        		"std" => "",
        		"type" => "instructions",
                "parameters" => ""
        ),
    
        array(	"name" => "Frontpage Content",
        		"desc" => "",
        		"id" => $shortname."_frontpage_id",
        		"std" => "",
        		"type" => "select-text",
                "parameters" => $your_pages,
                "parameters2" => array("size" => "2", "maxlength" => "5", "tip" => "<i>Tip: Enter a post's id number above to display its content on the frontpage.</i>")
        ),
    
        array(	"name" => "Frontpage Length",
        		"desc" => "Specify the number of words shown from your frontpage content. Leave blank or enter All to show full post.",
        		"id" => $shortname."_frontpage_excerpt",
                "std" => "All",
                "type" => "text",
                "parameters" => array("size" => "3", "maxlength" => "5")
        ),
    
        array(	"name" => "",
        		"desc" => "",
        		"id" => "",
        		"std" => "",
        		"type" => "toggle_end",
                "parameters" => ""
        ),
    
        array(	"name" => "",
        		"desc" => "News and Events",
        		"id" => "",
        		"std" => "",
        		"type" => "toggle_start",
                "parameters" => ""
        ),
    
        array(	"name" => "Setting Your News and Events Categories",
        		"desc" => "Select which category of posts you'd like to use as your news and events categories. <strong>Please Note:</strong> The sidebar will only display future dated posts for the events category you choose. <br /><br /> <strong>How to Publish an Event:</strong> Choose <a href=\"post-new.php\">Write > Post</a> from the main navigation. Give your event a title and enter any important information in the main post area. On the right side of the write post page find the <strong>Publish Status</strong> area and select the <strong>Edit</strong> link next to the text \"publish immediately\". Enter the date and time of your event (must be in the future to be displayed) and hit the <strong>Publish</strong> button.",
        		"id" => "",
        		"std" => "",
        		"type" => "instructions",
                "parameters" => ""
        ),
    
        array(	"name" => "News Category",
        		"desc" => "",
                "label1" => "Select Your News Category",
        		"id" => $shortname."_news_id",
        		"std" => "",
                "type" => "select",
                "parameters" => $your_cats
        ),
    
        array(	"name" => "",
        		"desc" => "Number of <strong>News</strong> items to display.",
                "id" => $shortname."_news_limit",
                "std" => "7",
                "type" => "text",
                "parameters" => array("size" => "2", "maxlength" => "5")
        ),
    
        array(	"name" => "Events Category",
        		"desc" => "The sidebar will only display future dated posts from this category.",
                "label1" => "Select Your Events Category",
        		"id" => $shortname."_events_id",
        		"std" => "",
                "type" => "select",
                "parameters" => $your_cats
        ),
    
        array(	"name" => "",
        		"desc" => "Number of <strong>Events</strong> items to display.",
        		"id" => $shortname."_events_limit",
        		"std" => "7",
        		"type" => "text",
                "parameters" => array("size" => "2", "maxlength" => "5")
        ),
    
        array(	"name" => "",
        		"desc" => "",
        		"id" => "",
        		"std" => "",
        		"type" => "toggle_end",
                "parameters" => ""
        ),
    
        array(	"name" => "",
        		"desc" => "Front Page Slideshow",
        		"id" => "",
        		"std" => "",
        		"type" => "toggle_start",
                "parameters" => ""
        ),
    
        array(	"name" => "Using the Frontpage Slideshow",
        		"desc" => "The frontpage slideshow is typically used to highlite sermon series or major church events.<br /><br />Create your own slideshow images <strong>535px wide by 260px high</strong> and then FTP them to the <strong>/images/carousel</strong> folder inside the Sero theme folder, the drop down list will automatically populate with images in this folder. You can add a URL to link the image to a page with more information.",
        		"id" => "",
        		"std" => "",
        		"type" => "instructions",
                "parameters" => ""
        ),
    
        array(	"name" => "Cycle Speed",
        		"desc" => "",
        		"id" => $shortname."_fp_speed",
        		"std" => "Average",
        		"type" => "select",
                "parameters" => array("Very Slow" => "10000", "Slow" => "7000", "Average" => "5000", "Fast" => "3000", "Very Fast" => "1000")
        ),
        array(	"name" => "Image 1",
        		"desc" => "<br />Enter the web address you'd like to link this slide to (optional).",
        		"id1" => $shortname."_fp_image_1",
                "id2" => $shortname."_fp_link_1",
        		"std1" => "sample1.jpg",
                "std2" => "http://www.churchwebdeveloper.com",
        		"type" => "select-image",
                "parameters" => $frontpage_images
        ),
    
        array(	"name" => "Image 2",
        		"desc" => "<br />Enter the web address you'd like to link this slide to (optional).",
        		"id1" => $shortname."_fp_image_2",
                "id2" => $shortname."_fp_link_2",
        		"std1" => "sample2.jpg",
                "std2" => "http://",
        		"type" => "select-image",
                "parameters" => $frontpage_images
        ),
    
        array(	"name" => "Image 3",
        		"desc" => "<br />Enter the web address you'd like to link this slide to (optional).",
        		"id1" => $shortname."_fp_image_3",
                "id2" => $shortname."_fp_link_3",
        		"std1" => "sample3.jpg",
                "std2" => "http://",
        		"type" => "select-image",
                "parameters" => $frontpage_images
        ),
    
        array(	"name" => "Image 4",
        		"desc" => "<br />Enter the web address you'd like to link this slide to (optional).",
        		"id1" => $shortname."_fp_image_4",
                "id2" => $shortname."_fp_link_4",
        		"std1" => "sample4.jpg",
                "std2" => "",
        		"type" => "select-image",
                "parameters" => $frontpage_images
        ),
    
        array(	"name" => "",
        		"desc" => "",
        		"id" => "",
        		"std" => "",
        		"type" => "toggle_end",
                "parameters" => ""
        ),
    
        array(	"name" => "",
        		"desc" => "Footer Images",
        		"id" => "",
        		"std" => "",
        		"type" => "toggle_start",
                "parameters" => ""
        ),
    
        array(	"name" => "Uploading Footer Images",
        		"desc" => "Footer images can be used to highlight upcoming events, special announcements or other church related information.<br /><br /> Create your own footer images <strong>180px wide by 70px high</strong> and then FTP them to the <strong>/images/footer</strong> folder inside the Sero theme folder, the drop down list will automatically populate with images in this folder. You can add a URL to link the image to a page with more information.",
        		"id" => "",
        		"std" => "",
        		"type" => "instructions",
                "parameters" => ""
        ),
    
        array(	"name" => "Image 1",
        		"desc" => "<br />Enter the web address you'd like to link this image to (optional).",
        		"id1" => $shortname."_footer_image_1",
                "id2" => $shortname."_footer_link_1",
        		"std1" => "sample1.jpg",
                "std2" => "http://",
        		"type" => "select-image",
                "parameters" => $footer_images
        ),
    
        array(	"name" => "Image 2",
        		"desc" => "<br />Enter the web address you'd like to link this image to (optional).",
        		"id1" => $shortname."_footer_image_2",
                "id2" => $shortname."_footer_link_2",
        		"std1" => "sample2.jpg",
                "std2" => "http://",
        		"type" => "select-image",
                "parameters" => $footer_images
        ),
    
        array(	"name" => "Image 3",
        		"desc" => "<br />Enter the web address you'd like to link this image to (optional).",
        		"id1" => $shortname."_footer_image_3",
                "id2" => $shortname."_footer_link_3",
        		"std1" => "sample3.jpg",
                "std2" => "http://",
        		"type" => "select-image",
                "parameters" => $footer_images
        ),
    
        array(	"name" => "Image 4",
        		"desc" => "<br />Enter the web address you'd like to link this image to (optional).",
        		"id1" => $shortname."_footer_image_4",
                "id2" => $shortname."_footer_link_4",
        		"std1" => "sample4.jpg",
                "std2" => "http://",
        		"type" => "select-image",
                "parameters" => $footer_images
        ),
    
        array(	"name" => "",
        		"desc" => "",
        		"id" => "",
        		"std" => "",
        		"type" => "toggle_end",
                "parameters" => ""
        )
    );
    
    ///////////////////////////////////////
    // Process Updates (3 field support //
    /////////////////////////////////////
    function mytheme_add_admin() {
        global $userdata, $themename, $shortname, $options;
        get_currentuserinfo() ;
        if ($userdata->user_level != 10){
        }
        else{
            if($_GET['page'] == basename(__FILE__)){
                if('save' == $_REQUEST['action']){
                    foreach ($options as $value) {
                        //Field 1
                        if(isset($_REQUEST[ $value['id']])){
                            update_option($value['id'], $_REQUEST[ $value['id']]);
                        }
                        else{
                            delete_option( $value['id'] );
                        }
                        //Field 2
                        if(isset($_REQUEST[ $value['id1']])){
                            update_option($value['id1'], $_REQUEST[ $value['id1']]);
                        }
                        else{
                            delete_option( $value['id1'] );
                        }
                        //Field 3
                        if(isset($_REQUEST[ $value['id2']])){
                            update_option($value['id2'], $_REQUEST[ $value['id2']]);
                        }
                        else{
                            delete_option( $value['id2'] );
                        }
                    }
                    header("Location: admin.php?page=theme-admin.php&saved=true");
                    die;
                }
            }
            else{
            }
            //Add admin page to backend
            add_menu_page($themename." Theme by ChurchWebDeveloper.com", "$themename Theme", 'edit_themes', basename(__FILE__), 'mytheme_admin');
        }
    }
    
    ///////////////////////////
    // Construct Admin Page //
    /////////////////////////
    function mytheme_admin() {
        global $themename, $shortname, $options;
        if ( $_REQUEST['saved'] ) echo '<div id="message" class="updated fade"><p><strong>'.$themename.' settings saved.</strong></p></div>';
        if ( $_REQUEST['reset'] ) echo '<div id="message" class="updated fade"><p><strong>'.$themename.' settings reset.</strong></p></div>';
        ?>
    <div class="wrap serowrap">
    <p>
        <?php _e('For more information about the the Sero Church theme or to help contribute to the project please visit <a href="http://www.churchwebdeveloper.com">ChurchWebDeveloper.com</a>. ', 'sero'); ?>
    </p>
    <p>
        <span class="toggle_all">+ Expand All</span>
        <span class="toggle_all_hide">- Collapse All</span>
    </p>
        <form method="post" id="seroform">
        <table class="form-table" style="background:#eaf3fa; margin:0; padding:0;" cellpadding="0" cellspacing="0">
            <?php foreach ($options as $value) {
            //get parameters
            $parameters = $value['parameters'];
            $parameters2 = $value['parameters2'];
            //print_r($parameters);
        	switch ( $value['type'] ) {
            case 'toggle_start':
    		    ?>
                <tr style="margin:0; padding:0; background:#eaf3fa;">
                    <td align="top">
                        <div class="toggle_title"><strong><?php echo $value['desc']; ?></strong></div>
                        <span class="toggle_head">Show / Hide</span>
                        <div class="toggle_body">
                        <table>
    
    		<?php
    		break;
    
            case 'toggle_end':
    		    ?>
                        </table>
                        </div>
                    </td>
                </tr>
    		<?php
    		break;
    
            case 'instructions':
    		    ?>
    		    <tr valign="top">
    		        <td colspan="2" class="instructions_row">
                        <fieldset>
                            <legend><h2 style="font-size:18px; padding:4px 0; border-bottom:1px solid #BDD9F0;"> &nbsp;Instructions: <?php echo $value['name']; ?></h2></legend>
                            <p><?php echo $value['desc']; ?> </p>
                            <p>Don't forget to <strong>"Save Changes"</strong> at the bottom when finished editing all drop down areas</p>
                        </fieldset>
    
    		        </td>
    		    </tr>
    		<?php
    		break;
    
            case 'none':
    		    ?>
    		    <tr valign="top">
    		        <th scope="row"><?php echo $value['name']; ?></th>
    		        <td>
    			        <?php echo $value['desc']; ?>
    		        </td>
    		    </tr>
    		<?php
    		break;
    
            case 'text':
    		    ?>
    		    <tr valign="top">
    		        <th scope="row"><?php echo $value['name']; ?></th>
    		        <td>
    		            <input name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (get_settings($value['id'])){ echo get_settings($value['id']); } else { echo $value['std']; } ?>" size="<?php echo $parameters['size']; ?>" maxlength="<?php echo $parameters['maxlength']; ?>" />
    			        <?php echo $value['desc']; ?>
    		        </td>
    		    </tr>
    		<?php
    		break;
    
            case 'double-text':
    		    ?>
    		    <tr valign="top">
    		        <th scope="row"><?php echo $value['name']; ?></th>
    		        <td>
                        <div style="float:left; width:170px;">
                            <?php echo $value['label1']; ?><input name="<?php echo $value['id1']; ?>" id="<?php echo $value['id1']; ?>" type="text" value="<?php if ( get_settings( $value['id1'] ) != "") { echo get_settings( $value['id1'] ); } else { echo $value['std1']; } ?>" size="<?php echo $parameters['size']; ?>" maxlength="<?php echo $parameters['maxlength']; ?>" />
                        </div>
                        <div style="float:left;">
                            <?php echo $value['label2']; ?><input name="<?php echo $value['id2']; ?>" id="<?php echo $value['id2']; ?>" type="text" value="<?php if ( get_settings( $value['id2'] ) != "") { echo get_settings( $value['id2'] ); } else { echo $value['std2']; } ?>" size="<?php echo $parameters['size']; ?>" maxlength="<?php echo $parameters['maxlength']; ?>" />
                        </div>
                        <div class="clear"></div>
                        <p style="padding:5px;">
                            <?php echo $value['desc']; ?>
                        </p>
    
    		        </td>
    		    </tr>
    		<?php
    		break;
    		case 'color':
    		    ?>
    		    <tr valign="top">
    		        <th scope="row"><?php echo $value['name']; ?></th>
    		        <td>
    		            <input name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if ( get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" size="<?php echo $parameters['size']; ?>" maxlength="<?php echo $parameters['maxlength']; ?>" />
                        <input type="button" value="Color picker" onclick="showColorPicker(this,document.forms[0].<?php echo $value['id']; ?>)">
                        <?php echo $value['desc']; ?>
    		        </td>
    		    </tr>
    		<?php
    		break;
    
    		case 'select':
    		?>
    		<tr valign="top">
    	        <th style="width:18%;"><?php echo $value['name']; ?></th>
    	        <td>
                    <select name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>">
                        <?php foreach ($parameters as $pkey => $pvalue) { ?>
                        <option value="<?php echo $pvalue; ?>" <?php if (get_settings($value['id']) == $pvalue) { echo ' selected="selected"'; }?>> <?php echo $pkey; ?> </option>
                    <?php } ?>
                    </select>
                    <?php echo $value['desc']; ?>
    	        </td>
    	    </tr>
    		<?php
    		break;
    
            case 'multiselect':
    		    ?>
        		<tr valign="top">
        	        <th style="width:18%;"><?php echo $value['name']; ?></th>
        	        <td>
                        <div class="select <?php echo $value['id']; ?>">
                            <?php
                                if(get_settings($value['id'])){
                                    $ms_ids = explode(",", get_settings($value['id']));
                                }
                            ?>
                            <?php foreach ($parameters as $pkey => $pvalue) { ?>
                                <div style="float:left; width:10em; margin:2px; padding:2px;" class="<?php if (in_array($pvalue,$ms_ids)){ echo "active"; } ?> option" value="<?php echo $pvalue; ?>"><?php echo $pkey; ?></div>
                            <?php } ?>
                            <div class="clear"></div>
                        </div>
                        <?php echo $value['desc']; ?>
                        <input name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if ( get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" class="<?php echo $value['id']; ?>_pick" size="<?php echo $parameters2['size']; ?>" maxlength="<?php echo $parameters2['maxlength']; ?>"/>
        	        </td>
        	    </tr>
    		<?php
    		break;
    
    		case 'select-text':
    		    ?>
        		<tr valign="top">
        	        <th style="width:18%;"><?php echo $value['name']; ?></th>
        	        <td>
                        <?php echo $value['desc']; ?>
                        <select id="<?php echo $value['id']; ?>_select" onchange="Process(this.options[this.selectedIndex].value)">
                            <option value="0" <?php if (get_settings($value['id']) == $pvalue) { echo ' selected="selected"'; }?>>Latest Post</option>
                            <?php foreach ($parameters as $pkey => $pvalue) { ?>
                            <option value="<?php echo $pvalue; ?>" <?php if (get_settings($value['id']) == $pvalue) { echo ' selected="selected"'; }?>> <?php echo $pkey; ?> </option>
                        <?php } ?>
                        </select>
                        <input name="<?php echo $value['id']; ?>"  type="<?php echo $value['type']; ?>" value="<?php if ( get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" class="<?php echo $value['id']; ?>_pick" size="<?php echo $parameters2['size']; ?>" maxlength="<?php echo $parameters2['maxlength']; ?>"/>
                        <br /><?php echo $parameters2['tip']; ?>
                    </td>
        	    </tr>
    		<?php
    		break;
    
        	case 'select-image':
    		?>
    		<tr valign="top">
    	        <th style="width:18%;"><?php echo $value['name']; ?></th>
    	        <td>
                    <div style="float:left; width:160px;">
                        <select name="<?php echo $value['id1']; ?>" id="<?php echo $value['id1']; ?>" style="width:150px; display:block;">
                            <?php foreach ($parameters as $pkey => $pvalue) { ?>
                                <option value="<?php echo $pvalue; ?>" <?php if (get_settings($value['id1']) == $pvalue) { echo ' selected="selected"'; }?>><?php echo $pkey; ?></option>
                            <?php } ?>
                        </select>
                    </div>
                    <div style="float:left;">
                        <input name="<?php echo $value['id2']; ?>" id="<?php echo $value['id2']; ?>" type="<?php echo $value['type']; ?>" value="<?php if ( get_settings( $value['id2'] ) != "") { echo get_settings( $value['id2'] ); } else { echo $value['std2']; } ?>" size="50" maxlength="512" />
                        <?php echo $value['desc']; ?>
                    </div>
                    <div class="clear"></div>
    	        </td>
    	    </tr>
    		<?php
    		break;
    
    		case 'textarea':
    		?>
    		<tr valign="top">
    	        <th style="width:18%;"><?php echo $value['name']; ?></th>
    	        <td>
                    <?php echo $value['desc']; ?>
                    <textarea name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" cols="<?php echo $parameters['cols']; ?>" rows="<?php echo $parameters['rows']; ?>"><?php
                        if( get_settings($value['id']) != "") {
                            echo stripslashes(get_settings($value['id']));
                        }
                        else{
                            echo $value['std'];
                        }?>
                    </textarea>
    	        </td>
    	    </tr>
    		<?php
    		break;
    
    		case "radio":
    		?>
    		<tr valign="top">
    	        <th style="width:18%;"><?php echo $value['name']; ?></th>
    	        <td>
    	            <?php foreach ($parameters as $pkey => $pvalue) {
    				$radio_setting = get_settings($value['id']);
    				if($radio_setting != ''){
    		    		if ($pvalue == get_settings($value['id']) ) {
    						$checked = "checked=\"checked\"";
    						} else {
    							$checked = "";
    						}
    				}else{
    					if($pvalue == $value['std']){
    						$checked = "checked=\"checked\"";
    					}else{
    						$checked = "";
    					}
    				}?>
    	            <input type="radio" name="<?php echo $value['id']; ?>" value="<?php echo $pvalue; ?>" <?php echo $checked; ?> /><?php echo $pkey; ?><br />
    	            <?php } ?>
    	        </td>
    	    </tr>
    		<?php
    		break;
    
    		case "checkbox":
    		?>
    			<tr valign="top">
    		        <th style="width:18%;"><?php echo $value['name']; ?></th>
    		        <td>
    		           <?php
    						if(get_settings($value['id'])){
    							$checked = "checked=\"checked\"";
    						}else{
    							$checked = "";
    						}
    					?>
    		            <input type="checkbox" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" value="true" <?php echo $checked; ?> />
    		            <?php  ?>
    			    <?php echo $value['desc']; ?>
    		        </td>
    		    </tr>
    			<?php
    		break;
    		default:
    		break;
    	}
    }
    ?>
    </table>
        <p class="submit">
            <input name="save" type="submit" value="Save Changes" style="padding:14px; font-size:17px;" />
            <input type="hidden" name="action" value="save" />
        </p>
    </form>
    <p>
        <?php _e('For more information about the the Sero Church theme or to help contribute to the project please visit <a href="http://www.churchwebdeveloper.com">ChurchWebDeveloper</a>. ', 'sero'); ?>
    </p>
    
    <?php
    }
    //Add admin update process, which also adds admin page
    add_action('admin_menu' , 'mytheme_add_admin');
    ?>
  2. kurtfeigel
    Member
    Posted 5 years ago #

    From the theme website

    Important:

    If you do not see the Sero Theme Options link after activating the theme, go to the Users tab, make a new user with administrator privileges and then login with the new admin account.

    I did this and the button appeared.

    Hope that helps

Topic Closed

This topic has been closed to new replies.

About this Topic