__('Link & Highlight Color'), "desc" => __(''), "id" => "ia3_highlight_color", "std" => "#CC0000", "type" => "text" ), array( "name" => __('Visited Link Color'), "desc" => __(''), "id" => "ia3_lowlight_color", "std" => "#666666", "type" => "text" ), ); $ia3_cache_categories = get_categories(); $ia3_cache_pages = get_pages(); /** * @param integer * @return string * @author Ben Sekulowicz-Barclay * **/ function ia3_get_layout_text($column, $html = FALSE, $default = ' ') { $option = get_option($column); if ($html != TRUE) { $a = htmlspecialchars(strip_tags($option)); $b = htmlspecialchars(strip_tags($default)); } else { $a = stripslashes($option); $b = stripslashes($default); } return ($a !== '')? $a: $b; } /** * @param integer * @param integer * @return string * @author Ben Sekulowicz-Barclay * **/ function ia3_get_layout_select($column) { $option = get_option($column); $select = 0; if (preg_match("/^c\-(.*)/", $option, $select)) { $item = ia3_get_category($select[1]); $item_i = isset($item->cat_ID)? $item->cat_ID: 0; $item_n = isset($item->name)? $item->name: 'Unknown'; return '' . $item_n . ''; } else if (preg_match("/^p\-(.*)/", $option, $select)) { $item = ia3_get_page($select[1]); $item_i = isset($item->ID)? $item->ID: 0; $item_n = isset($item->post_title)? $item->post_title: 'Unknown'; return '' . $item_n . ''; } return ' '; } /** * @param string * @return string * @author Ben Sekulowicz-Barclay * * Returns the category based on the ID, (key) passed to it. Uses the cached array to improve performance. * **/ function ia3_get_category($key = '') { global $ia3_cache_categories; foreach($ia3_cache_categories as $c) { if ($c->cat_ID == $key) return $c; } return $ia3_cache_categories[0]; } /** * @param string * @return string * @author Ben Sekulowicz-Barclay * * Returns the key's value form the above options array, if defined. Messy, due to the structure of the Wordpress options array. * **/ function ia3_get_option($key = '') { global $ia3_options; $default; foreach($ia3_options as $option) { if ($option['id'] == $key) { $default = $option['std']; continue; } } $option = get_option($key); return ($option !== FALSE)? $option: $default; } /** * @param string * @return string * @author Ben Sekulowicz-Barclay * * Returns the page based on the ID, (key) passed to it. Uses the cached array to improve performance. * **/ function ia3_get_page($key = '') { global $ia3_cache_pages; foreach($ia3_cache_pages as $p) { if ($p->ID == $key) return $p; } return $ia3_cache_pages[0]; } function ia3_prevnext() { if(get_previous_post()): previous_post_link('%link', '« Previous'); else: ?>« Previous | Next »'); else: ?>Next »
  • id="li-comment-">
    '); ?> %s says:'), get_comment_author_link()) ?>
    comment_approved == '0') : ?>
    $depth, 'max_depth' => $args['max_depth']))) ?>
    'ia3_header_t1'), array('id' => 'ia3_header_t2'), array('id' => 'ia3_header_t3'), array('id' => 'ia3_header_t4'), array('id' => 'ia3_header_11'), array('id' => 'ia3_header_12'), array('id' => 'ia3_header_13'), array('id' => 'ia3_header_21'), array('id' => 'ia3_header_22'), array('id' => 'ia3_header_23'), array('id' => 'ia3_header_31'), array('id' => 'ia3_header_32'), array('id' => 'ia3_header_33'), array('id' => 'ia3_header_41'), array('id' => 'ia3_header_42'), array('id' => 'ia3_header_43'), array('id' => 'ia3_contact_t1'), array('id' => 'ia3_contact_t2'), array('id' => 'ia3_contact_t3'), array('id' => 'ia3_contact_t4'), array('id' => 'ia3_contact_11'), array('id' => 'ia3_contact_12'), array('id' => 'ia3_contact_13'), array('id' => 'ia3_contact_21'), array('id' => 'ia3_contact_22'), array('id' => 'ia3_contact_23'), array('id' => 'ia3_contact_31'), array('id' => 'ia3_contact_32'), array('id' => 'ia3_contact_33'), array('id' => 'ia3_contact_41'), array('id' => 'ia3_contact_42'), array('id' => 'ia3_contact_43'), array('id' => 'ia3_footer_1'), array('id' => 'ia3_footer_2'), array('id' => 'ia3_footer_3'), array('id' => 'ia3_footer_4'), )); if ($_GET['page'] == basename(__FILE__)) { if ('save' == $_REQUEST['action']) { foreach ($alt_options as $value) { update_option($value['id'], $_REQUEST[ $value['id'] ] ); } foreach ($alt_options as $value) { if (isset($_REQUEST[ $value['id']])) { update_option($value['id'], $_REQUEST[ $value['id']]); } else { delete_option($value['id']); } } header("Location: themes.php?page=functions.php&saved=true"); die; } elseif ('reset' == $_REQUEST['action']) { foreach ($alt_options as $value) { delete_option($value['id']); } header("Location: themes.php?page=functions.php&reset=true"); die; } elseif ('reset_widgets' == $_REQUEST['action']) { $null = null; update_option('sidebars_widgets',$null); header("Location: themes.php?page=functions.php&reset=true"); die; } } add_theme_page("iA3 Options", "iA3 Options", 'edit_themes', basename(__FILE__), 'ia3_admin'); } function ia3_admin() { global $ia3_options, $ia3_cache_categories, $ia3_cache_pages; if ($_REQUEST['saved']) echo '

    iA3 ' . __('settings saved.', 'thematic') . '

    '; if ($_REQUEST['reset']) echo '

    iA3 ' . __('settings reset.', 'thematic') . '

    '; if ($_REQUEST['reset_widgets']) echo '

    iA3 ' . __('widgets reset.', 'thematic') . '

    '; $header_options = array('cs' => array(), 'ps' => array()); foreach($ia3_cache_categories as $c) $header_options['cs'][$c->cat_ID] = $c->cat_name; foreach($ia3_cache_pages as $p) $header_options['ps'][$p->ID] = $p->post_title; ?>

    iA 3 – Options

    Header

    Warning – To take full advantage of the iA3 page templates, please ensure you have them set up correctly.
    " /> " /> " /> " />
    " />
    " />
    " />

    Contact

    " /> " /> " /> " />
    " /> " /> " /> " />
    " /> " /> " /> " />
    " /> " /> " /> " />

    Footer

    Other Options

    $option) { $radio_setting = get_option($value['id']); if ($radio_setting != '') { if ($key == get_option($value['id'])) { $checked = "checked=\"checked\""; } else { $checked = ""; } } else { if ($key == $value['std']) { $checked = "checked=\"checked\""; } else { $checked = ""; } } ?> /> />
    " />