cat_ID] = $ang_cat->category_nicename; } $categories_tmp = array_unshift($ang_categories, "Select a category:"); $number_entries = array("Select a Number:","1","2","3","4","5","6","7","8","9","10" ); $options = array( array ( "type" => "open", "id" => $shortname."_temp", "std" => "" ), array( "name" => "General", "type" => "heading", "id" => $shortname."_temp", "std" => "" ), array( "name" => "Styles", "desc" => "Switch Style", "id" => $shortname."_style", "type" => "select", "options" => array("Style1","Style2","Style3","Style4","Style5","Style6","Style7","Style8","Style9","Style10"), "std" => "Style1", ), array( "name" => "Hide BreadCrumbs", "desc" => "Hide Breadcrumbs?", "id" => $shortname."_breadcrumbs", "type" => "checkbox", "std" => "false" ), array( "name" => "Homepage", "type" => "heading", "id" => $shortname."_temp", "std" => "" ), array( "name" => "Slider Category", "desc" => "Select the category for slider", "id" => $shortname."_slider_cat", "type" => "select", "std" => "Select a category", "options" => $ang_categories), array( "name" => "Slider Posts Count", "desc" => "How many posts you want to show in slider?", "id" => $shortname."_slider_count", "type" => "select", "std" => "3", "options" => $number_entries), array( "name" => "Featured Posts Category", "desc" => "Select the category of featured posts", "id" =>$shortname."_featured_cat", "type" => "select", "std" => "Select a category", "options" => $ang_categories), array( "name" => "Featured Posts count", "desc" => "How many Featured posts you want to show on homepage?", "id" => $shortname."_featured_count", "type" => "select", "std" => "3", "options" => $number_entries), array( "name" => "Social Icons", "type" => "heading", "id" => $shortname."_temp", "std" => "" ), array( "name" => "Hide all the Social Icons", "id" => $shortname."_hide_social", "type" => "checkbox", "std" => ""), array( "name" => "Twitter Icon", "desc" => "Check to hide Twitter icon. If not type your twitter url below:", "id" => $shortname."_hide_tw", "type" => "checkbox", "std" => ""), array( "id" => $shortname."_tw_url", "type" => "text2", "desc" => "Type Your Twitter URL", "std" => "" ), array( "name" => "Facebook Icon", "desc" => "Check to hide Facebook icon. If not type your Facebook url below:", "id" => $shortname."_hide_fb", "type" => "checkbox", "std" => ""), array( "id" => $shortname."_fb_url", "type" => "text2", "desc" => "Type Your Facebook URL", "std" => "" ), array( "name" => "Myspace Icon", "desc" => "Check to hide Myspace icon. If not type your Myspace url below:", "id" => $shortname."_hide_ms", "type" => "checkbox", "std" => ""), array( "id" => $shortname."_ms_url", "type" => "text2", "desc" => "Type Your Myspace URL", "std" => "" ), array( "name" => "RSS Feed Icon", "desc" => "Check to hide Feedburner icon. If not type your Feedburner url below:", "id" => $shortname."_hide_rss", "type" => "checkbox", "std" => ""), array( "id" => $shortname."_rss_url", "type" => "text2", "desc" => "Type Your Feedburner URL", "std" => "" ), array( "name" => "Footer", "type" => "heading", "id" => $shortname."_temp", "std" => "" ), array( "name" => "Footer Text", "desc" => "Type your own footer text", "id" => $shortname."_text", "type" => "textarea", "std" => "©Angelia 2010") ); array( "type" => "close" ); function mytheme_add_admin() { global $themename, $shortname, $options; $optionvar = array(); if ( isset($_GET['page']) && $_GET['page'] == basename(__FILE__) ) { if ( isset($_REQUEST['action']) && 'save' == $_REQUEST['action'] ) { foreach ($options as $value) { if (isset($_REQUEST[ $value['id'] ])) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } } foreach ($options as $value) { if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } } update_option( $shortname."_options", $optionvar ); header("Location: themes.php?page=functions.php&saved=true"); die; } else if( isset($_REQUEST['action']) && 'reset' == $_REQUEST['action'] ) { foreach ($options as $value) { delete_option( $value['id'] ); } header("Location: themes.php?page=functions.php&reset=true"); die; } } add_theme_page($themename." Options", "".$themename." Options", 'edit_themes', basename(__FILE__), 'mytheme_admin'); } function mytheme_admin() { global $themename, $shortname, $options, $option_values; if ( isset($_REQUEST['saved']) && $_REQUEST['saved'] ) echo '

'.$themename.' settings saved.

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

'.$themename.' settings reset.

'; ?>

" />
" />


/>

'Sidebar' )); if ( function_exists('register_sidebar') ) register_sidebar(array( 'name' => 'Footer' )); function new_excerpt_length($length) { return 15; } add_filter('excerpt_length', 'new_excerpt_length'); function getImage($num) { global $more; $more = 1; $content = get_the_content(); $count = substr_count($content, ''); $postOutput = substr($post, 0, $imgEnd+1); $postOutput = preg_replace('/width="([0-9]*)" height="([0-9]*)"/', '',$postOutput);; $image[$i] = $postOutput; $start=$imgEnd+1; } if(stristr($image[$num],''.$image[$num].""; } $more = 0; } function the_thumb($size = "medium", $add = "") { global $wpdb, $post; $thumb = $wpdb->get_row("SELECT ID, post_title FROM {$wpdb->posts} WHERE post_parent = {$post->ID} AND post_mime_type LIKE 'image%' ORDER BY menu_order"); if(!empty($thumb)) { $image = image_downsize($thumb->ID, $size); print "{$thumb->post_title}"; } } function dimox_breadcrumbs() { $delimiter = '»'; $name = 'Home'; //text for the 'Home' link $currentBefore = ''; $currentAfter = ''; if ( !is_home() && !is_front_page() || is_paged() ) { echo '
'; global $post; $home = get_bloginfo('url'); echo '' . $name . ' ' . $delimiter . ' '; if ( is_category() ) { global $wp_query; $cat_obj = $wp_query->get_queried_object(); $thisCat = $cat_obj->term_id; $thisCat = get_category($thisCat); $parentCat = get_category($thisCat->parent); if ($thisCat->parent != 0) echo(get_category_parents($parentCat, TRUE, ' ' . $delimiter . ' ')); single_cat_title(); } elseif ( is_day() ) { echo '' . get_the_time('Y') . ' ' . $delimiter . ' '; echo '' . get_the_time('F') . ' ' . $delimiter . ' '; echo $currentBefore . get_the_time('d') . $currentAfter; } elseif ( is_month() ) { echo '' . get_the_time('Y') . ' ' . $delimiter . ' '; echo $currentBefore . get_the_time('F') . $currentAfter; } elseif ( is_year() ) { echo $currentBefore . get_the_time('Y') . $currentAfter; } elseif ( is_single() ) { $cat = get_the_category(); $cat = $cat[0]; echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' '); echo $currentBefore; the_title(); echo $currentAfter; } elseif ( is_page() && !$post->post_parent ) { echo $currentBefore; the_title(); echo $currentAfter; } elseif ( is_page() && $post->post_parent ) { $parent_id = $post->post_parent; $breadcrumbs = array(); while ($parent_id) { $page = get_page($parent_id); $breadcrumbs[] = '' . get_the_title($page->ID) . ''; $parent_id = $page->post_parent; } $breadcrumbs = array_reverse($breadcrumbs); foreach ($breadcrumbs as $crumb) echo $crumb . ' ' . $delimiter . ' '; echo $currentBefore; the_title(); echo $currentAfter; } elseif ( is_search() ) { echo $currentBefore . 'Search results for '' . get_search_query() . ''' . $currentAfter; } elseif ( is_tag() ) { echo $currentBefore . 'Posts tagged ''; single_tag_title(); echo ''' . $currentAfter; } elseif ( is_author() ) { global $author; $userdata = get_userdata($author); echo $currentBefore . 'Articles posted by ' . $userdata->display_name . $currentAfter; } elseif ( is_404() ) { echo $currentBefore . 'Error 404' . $currentAfter; } if ( get_query_var('paged') ) { if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ' ('; echo __('Page') . ' ' . get_query_var('paged'); if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ')'; } echo '
'; } } ?>