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

', 'after_title' => '

', )); unregister_sidebar_widget ('Links'); // ?? register_sidebar_widget('Links for Freshy', 'yy_widget_links'); } function yy_widget_links($args) { global $wpdb; $title = empty($options['title']) ? __('Links') : $options['title']; $link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM $wpdb->linkcategories"); ?>

post_status=='static' || is_page()) && $notfound!='1' && $args_pages!='none') { $current_page = $post->ID; $i=0; // loop to get the top parent page while($current_page) { $i++; if (i>100) break; // avoid infinite loop $page_query = $wpdb->get_row("SELECT ID, post_title, post_parent FROM $wpdb->posts WHERE ID = '$current_page'"); $current_page = $page_query->post_parent; } $parent_id = $page_query->ID; $parent_title = $page_query->post_title; $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_parent = '$parent_id'"); ?>

' . $r['title_li'] . ''; } $output = apply_filters('wp_list_pages', $output); if ( $r['echo'] ) echo $output; else return $output; } // modded version to highlight parent menu ! function freshy_page_level_out($parent, $page_tree, $args, $depth = 0, $echo = true) { global $wp_query, $post, $wpdb; $queried_obj = $wp_query->get_queried_object(); $output = ''; $current_page = $post->ID; $i=0; // loop to get the top parent page while($current_page) { $i++; if (i>100) break; // avoid infinite loop $page_query = $wpdb->get_row("SELECT ID, post_title, post_parent FROM $wpdb->posts WHERE ID = '$current_page'"); $current_page = $page_query->post_parent; } $parent_id = $page_query->ID; if ( $depth ) $indent = str_repeat("\t", $depth); if ( !is_array($page_tree[$parent]['children']) ) return false; foreach ( $page_tree[$parent]['children'] as $page_id ) { $cur_page = $page_tree[$page_id]; $title = $cur_page['title']; $css_class = 'page_item'; if ( $page_id == $queried_obj->ID || $page_id == $parent_id) $css_class .= ' current_page_item'; $output .= $indent . '
  • ' . $title . ''; if ( isset($cur_page['ts']) ) { $format = get_settings('date_format'); if ( isset($args['date_format']) ) $format = $args['date_format']; $output .= " " . mysql2date($format, $cur_page['ts']); } if ( isset($cur_page['children']) && is_array($cur_page['children']) ) { $new_depth = $depth + 1; if ( !$args['depth'] || $depth < ($args['depth']-1) ) { $output .= "$indent\n"; } } $output .= "$indent
  • \n"; } if ( $echo ) echo $output; else return $output; } // SET OPTIONS $freshy_options=array(); //update_option('freshy_options', $freshy_options); $freshy_theme_default=array(); $freshy_theme_red=array(); $freshy_theme_blue=array(); $freshy_theme_lime=array(); freshy_set_options(); function freshy_set_options() { global $freshy_options, $freshy_theme_red, $freshy_theme_lime, $freshy_theme_blue; $freshy_theme_default['highlight_color']='#FF3C00'; $freshy_theme_default['description_color']='#ADCF20'; $freshy_theme_default['author_color']='#a3cb00'; $freshy_theme_default['sidebar_bg']='#FFFFFF'; $freshy_theme_default['sidebar_titles_color']='#f78b0c'; $freshy_theme_default['sidebar_titles_bg']='#FFFFFF'; $freshy_theme_default['menu_bg']='menu_start_triple.gif'; $freshy_theme_default['menu_color']='#000000'; $freshy_theme_default['header_bg']='header_image6.jpg'; $freshy_theme_default['header_bg_custom']=''; $freshy_theme_default['sidebar_titles_type']='stripes'; $freshy_theme_default['first_menu_label']='Home'; $freshy_theme_default['blog_menu_label']='Blog'; $freshy_theme_default['last_menu_label']='Contact'; $freshy_theme_default['last_menu_type']=''; $freshy_theme_default['contact_email']=''; $freshy_theme_default['contact_link']=''; $freshy_theme_default['menu_type']='auto'; $freshy_theme_default['args_pages']='sort_column=menu_order&title_li='; $freshy_theme_default['args_cats']='hide_empty=0&sort_column=name&optioncount=1&title_li=&hierarchical=1&feed=RSS&feed_image='.get_bloginfo('stylesheet_directory').'/images/icons/feed-icon-10x10.gif'; $freshy_theme_lime['highlight_color']='#FF3C00'; $freshy_theme_lime['description_color']='#ADCF20'; $freshy_theme_lime['author_color']='#a3cb00'; $freshy_theme_lime['sidebar_bg']='#FFFFFF'; $freshy_theme_lime['sidebar_titles_color']='#f78b0c'; $freshy_theme_lime['sidebar_titles_bg']='#FFFFFF'; $freshy_theme_lime['menu_bg']='menu_start_triple.gif'; $freshy_theme_lime['menu_color']='#000000'; $freshy_theme_lime['header_bg']='header_image6.jpg'; $freshy_theme_lime['header_bg_custom']=''; $freshy_theme_lime['sidebar_titles_type']='stripes'; $freshy_theme_red['highlight_color']='#d80f2a'; $freshy_theme_red['description_color']='#eca50d'; $freshy_theme_red['author_color']='#eca50d'; $freshy_theme_red['sidebar_bg']='#F3F3F3'; $freshy_theme_red['sidebar_titles_color']='#000000'; $freshy_theme_red['sidebar_titles_bg']='#c2c2c2'; $freshy_theme_red['menu_bg']='menu_start_triple_red.gif'; $freshy_theme_red['menu_color']='#ffffff'; $freshy_theme_red['header_bg']='header_image8.jpg'; $freshy_theme_red['header_bg_custom']=''; $freshy_theme_red['sidebar_titles_type']='stripes'; $freshy_theme_blue['highlight_color']='#f5690c'; $freshy_theme_blue['description_color']='#ff6c00'; $freshy_theme_blue['author_color']='#f5bb0c'; $freshy_theme_blue['sidebar_bg']='#dbefff'; $freshy_theme_blue['sidebar_titles_color']='#0f80d8'; $freshy_theme_blue['sidebar_titles_bg']='#FFFFFF'; $freshy_theme_blue['menu_bg']='menu_start_triple_lightblue.gif'; $freshy_theme_blue['menu_color']='#ffffff'; $freshy_theme_blue['header_bg']='header_image3.jpg'; $freshy_theme_blue['header_bg_custom']=''; $freshy_theme_blue['sidebar_titles_type']='stripes'; /* if (get_option('freshy_options')) { $freshy_options = get_option('freshy_options'); } else { $freshy_options=$freshy_theme_default; update_option('freshy_options', $freshy_options); } */ if (get_option('freshy_options')) { $existing_options = get_option('freshy_options'); foreach ($freshy_theme_default as $key=>$val) { $freshy_options[$key]=$val; } foreach ($existing_options as $key=>$val) { $freshy_options[$key]=$val; } } else { $freshy_options=$freshy_theme_default; update_option('freshy_options', $freshy_options); } } // ADD HEAD TO THE TEMPLATE add_action('wp_head', 'freshy_head'); function freshy_head() { global $freshy_options, $freshy_theme_lime; $menu_triple = str_replace("menu_start_triple", "menu_triple", $freshy_options['menu_bg']); $menu_end_triple = str_replace("menu_start_triple", "menu_end_triple", $freshy_options['menu_bg']); ?> '; } function freshy_add_theme_page() { add_theme_page('Freshy Theme Options', 'Freshy Theme Options', 'edit_themes', basename(__FILE__), 'freshy_theme_page'); } function freshy_set_theme($theme,$options) { global $freshy_options, $freshy_theme_red, $freshy_theme_lime, $freshy_theme_blue; if ($theme=='lime') { foreach ($freshy_theme_lime as $key=>$val) { $freshy_options[$key]=$val; } } else if ($theme=='red') { foreach ($freshy_theme_red as $key=>$val) { $freshy_options[$key]=$val; } } else if ($theme=='blue') { foreach ($freshy_theme_blue as $key=>$val) { $freshy_options[$key]=$val; } }/* else if ($theme=='red') $freshy_options=$freshy_theme_red; else if ($theme=='blue') $freshy_options=$freshy_theme_blue;*/ $freshy_options['theme']=$theme; $freshy_options['advanced_options']=$options; update_option('freshy_options', $freshy_options); } function freshy_list_files($dirpath,$filter='') { $returned_array=array(); $dh = opendir($dirpath); while (false !== ($file = readdir($dh))) { if (!is_dir("$dirpath/$file")) { if ($filter!='' && strstr($file, $filter) != false) $returned_array[$file] = $file; else if ($filter=='') $returned_array[$file] = $file; } } closedir($dh); return $returned_array; } function freshy_theme_page() { global $freshy_options; if ( $_GET['page'] == basename(__FILE__) ) { $array_themes_strings = array('lime','blue','red'); if (isset($_POST['freshy_options_update'])) { $freshy_updated_options = array(); $freshy_updated_options = $_POST; if (isset($freshy_updated_options['theme']) && $freshy_updated_options['changedtheme']==1) freshy_set_theme($freshy_updated_options['theme'],$freshy_updated_options['advanced_options']); else { update_option('freshy_options', $freshy_updated_options); $freshy_options = get_option('freshy_options'); echo '

    ' . __('Freshy options updated.','freshy') . '

    '; } } echo '

    '.__('Freshy Options','freshy').'

    '.__('Theme switcher','freshy').'

    note : just choose the theme and update, it won\'t save other changes
    '.__('Top Menu options','freshy').' '; /* */ if(function_exists('yy_menu')) { echo ' '; } /* echo ' */ echo '


    info : modifying these labels should break internationalisation


    info : this is specially for YammYamm


    '.__('Advanced options','freshy').'

    '; echo '

    Preview (updated when options are saved)

    '; } } function freshy_stupid_dir() { return substr(strrchr(get_bloginfo('stylesheet_directory'), "/"),1); } function freshy_theme_page_head() { ?>
  • ') : $options['html_title_before']; $a = empty($options['html_title_after']) ? __('') : $options['html_title_after']; $title = empty($options['title']) ? __('Blogroll') : $options['title']; if (is_home()) { echo $before_widget; echo $before_title . $title . $after_title; echo ''; echo $after_widget; echo '
  • '; } } /*********************************************************************************/ /* pt-bookmarks widget control /*********************************************************************************/ function web_bookmarks_control() { $options = $newoptions = get_option('web_bookmarks'); if ( $_POST['bookmarks-submit'] ) { $newoptions['title'] = strip_tags(stripslashes($_POST['bookmarks-title'])); $newoptions['html_title_before'] = stripslashes($_POST['bookmarks-before']); $newoptions['html_title_after'] = stripslashes($_POST['bookmarks-after']); } if ( $options != $newoptions ) { $options = $newoptions; update_option('web_bookmarks', $options); } $title = wp_specialchars($options['title']); $html_title_before = wp_specialchars($options['html_title_before']); $html_title_after = $options['html_title_after']; ?>

  • '.pt_replacevideo($mediaid, $content).'

    '; echo $after_widget; } /*********************************************************************************/ /* wordTube widget control /*********************************************************************************/ // Admin section function web_wordtube_control() { global $wpdb; $options = get_option('web_wordtube'); if ( !is_array($options) ) $options = array('title'=>'', 'mediaid'=>'0'); if ( $_POST['wordtube-submit'] ) { $options['title'] = strip_tags(stripslashes($_POST['wordtube-title'])); $options['mediaid'] = $_POST['wordtube-mediaid']; update_option('web_wordtube', $options); } $title = htmlspecialchars($options['title'], ENT_QUOTES); // The Box content echo '

    '; echo '

    '; echo '

    '; echo ''; } ?>