'
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', ));?>
  • id="li-comment-">
    ' ); ?> %s says:'), get_comment_author_link()) ?>
    comment_approved == '0') : ?>
    $depth, 'max_depth' => $args['max_depth']))) ?>
    blueocean Options, or /wp-admin/themes.php?page=blueocean-options * in your WordPress directory. * @package blueocean */ class Options { var $installed; var $deleted; var $update_notification; var $sidebar_pp_type; var $header; var $display_title; var $display_tagline; var $nav_pages; var $collapsed_pages; var $home_link_name; var $nav_extlinkcat; var $style; var $asidescategory; var $centred_theme; var $swap_sides; var $tags_everywhere; var $show_categories; var $show_authors; var $use_pages; /** * blueocean_options_defaults() - Sets Options object's properties to their default values. */ function get_blueocean_option($name) { global $blueocean_options; if(!is_object($blueocean_options)) flush_blueocean_options(); return $blueocean_options->$name; } function flush_blueocean_options() { global $blueocean_options; $blueocean_options = new Options; $blueocean_options->blueocean_options_get(); if(!get_option('blueocean_options') || isset($blueocean_options->deleted)) $blueocean_options->blueocean_options_defaults(); } /** * blueocean_options_get() - Sets Options properties to the values retrieved from the database. */ function blueocean_options_get() { $saved_options = maybe_unserialize(get_option('blueocean_options')); if(!empty($saved_options) && is_object($saved_options)) { foreach($saved_options as $name => $value) { $this->$name = $value; } } } function theme_version() { $themedata = get_theme_data(TEMPLATEPATH . '/style.css'); $version = trim($themedata['Version']); if (strlen($version) > 0) return $version; } /** * blueocean_options_defaults() - Sets Options object's properties to their default values. */ function blueocean_options_defaults() { $this->update_notification = true; $this->sidebar_pp_type = 'main'; $this->header = 'logo.jpg'; $this->display_title = true; $this->display_tagline = true; $this->nav_pages = false; $this->collapsed_pages = ''; $this->home_link_name = __('Home','blueocean'); $this->nav_extlinkcat = 0; $this->style = false; $this->asidescategory = 0; $this->centred_theme = true; $this->swap_sides = false; $this->swap_title_order = false; $this->tags_everywhere = false; $this->show_categories = true; $this->show_authors = true; $this->use_pages = true; } /** * blueocean_options_update() - Sets Options properties to the values set on the Options page. * * Note that this function doesn't save anything to the database, that's the * preserve of save_blueocean_options(). * @see save_blueocean_options() */ function blueocean_options_update() { if(($_POST['delete_options'] == 1)) { $this->deleted = time(); } elseif($_POST['restore_options'] == 1) { unset($this->deleted); } else { if($_POST['update_notification'] == 'off') $this->update_notification = false; elseif($_POST['update_notification'] == 'on') $this->update_notification = true; $header = $_POST['header_image']; if(isset($header)) { $header = str_replace('-thumb', '', $header); $this->header = $header; } $nav_pages = $_POST['nav_pages']; if(isset($nav_pages)) { $nav_pages = implode(',', $nav_pages); $this->nav_pages = $nav_pages; } else { $this->nav_pages = false; } $collapsed_pages = $_POST['collapsed_pages']; if(isset($collapsed_pages)) { $this->collapsed_pages = $collapsed_pages; } else { $this->collapsed_pages = ''; } $stylefile = $_POST['alternate_style']; if(is_valid_blueocean_style($stylefile)) $this->style = $stylefile; elseif(!$stylefile) $this->style = false; $this->display_title = (bool) $_POST['display_title']; $this->display_tagline = (bool) $_POST['display_tagline']; $this->show_categories = (bool) $_POST['show_categories']; $this->tags_everywhere = (bool) $_POST['tags_everywhere']; $this->use_pages = (bool) $_POST['use_pages']; $this->centred_theme = (bool) $_POST['centred_theme']; $this->swap_sides = (bool) $_POST['swap_sides']; $this->swap_title_order = (bool) $_POST['swap_title_order']; $this->asidescategory = $_POST['asides_category']; $this->nav_extlinkcat = $_POST['nav_extlinkcat']; $this->home_link_name = $_POST['home_link_name']; $this->sidebar_type = $_POST['sidebar_type']; $this->sidebar_pp_type = $_POST['sidebar_pp_type']; $this->show_authors = blueocean_should_show_authors(); unset($this->deleted); } } } /** * save_blueocean_options() - Saves a new set of blueocean options. * * If the blueocean Options page request includes a $_POST call * and it's been generated by hitting the 'submit' button, this * function will generate a new Options object, set its properties * to the existing set of options, and then save the new options * over the old ones. It then flushes the options so the Options * page, which executes after this function, will display the new * values rather than the old ones. * @see blueoceanupdate() which it replaces */ function save_blueocean_options() { $blueocean_options = new Options; $blueocean_options->blueocean_options_get(); if(ready_to_delete_options($blueocean_options->deleted)) { delete_option('blueocean_options'); flush_blueocean_options(); return; } blueocean_upgrade_and_flush_options(); if(isset($_POST['submit'])) { $blueocean_options->blueocean_options_update(); update_option('blueocean_options', serialize($blueocean_options)); } flush_blueocean_options(); } /** * flush_blueocean_options() - Flushes blueocean's options for use by the theme. * * Creates a new Options object, and gets the current options. If * no options have been set in the database, it will return the * defaults. Additionally, if the 'deleted' property has been set * then the function will check to see if it was set more than two * hours ago--if it was, the blueocean_options database row will be * dropped. If the 'deleted' property has been set, then the defaults * will be returned regardless of whether other options are set. * @global object $blueocean_options * @return object $blueocean_options */ function flush_blueocean_options() { global $blueocean_options; $blueocean_options = new Options; $blueocean_options->blueocean_options_get(); if(!get_option('blueocean_options') || isset($blueocean_options->deleted)) $blueocean_options->blueocean_options_defaults(); } /** * update_blueocean_option() - Updates the given blueocean option with a new value. * * This function can be used either to update a particular option * with a new value, or to delete that option altogether by setting * $drop to true. * @param string $option * @param string $value * @param boolean $drop * @global object $blueocean_options */ function update_blueocean_option($option, $value) { $blueocean_options = new Options; $blueocean_options->blueocean_options_get(); if(empty($value)) unset($blueocean_options->$option); else $blueocean_options->$option = $value; update_option('blueocean_options', serialize($blueocean_options)); flush_blueocean_options(); } /** * get_blueocean_option() - Returns the given blueocean option. * * @param string $name * @return mixed */ function get_blueocean_option($name) { global $blueocean_options; if(!is_object($blueocean_options)) flush_blueocean_options(); return $blueocean_options->$name; } function blueocean_headerimage() { if(get_theme_mod('header_image')) { $header_img_url = get_header_image(); } elseif(get_blueocean_option('header')) { if(get_blueocean_option('header') != 'blank.gif') { $header_img_url = get_bloginfo('template_directory') . '/images/' . get_blueocean_option('header'); } } else { $header_img_url = get_bloginfo('template_directory') . '/images/logo.jpg'; } if($header_img_url) { if(get_blueocean_option('display_title')) { $header_img_alt = __('Header image','blueocean'); } else { $header_img_alt = get_bloginfo('name'); } $header_img_tag = "

    " .get_bloginfo('name') . "

    ". get_bloginfo('description')."
    "; if(!get_blueocean_option('display_title') && !is_wp_front_page()) { $header_img_tag = sprintf( '%3$s', __('Return to main page','blueocean'), user_trailingslashit(get_bloginfo('url')), $header_img_tag ); } echo '
    ' . $header_img_tag.'
    ';}} ?>