\n";
};
FUNCTION obt_widget_mostcommented(){
global $wpdb;
echo "".obt_translate("Most commented posts")."
\n";
echo "\n";
flush();
$post_type = (obt_wp_is_21())? ", post_type" : "";
$now = current_time("mysql",1);
IF ($posts = $wpdb->get_results("SELECT ID, post_title, post_name, post_status{$post_type}, COUNT(comment_post_ID) AS 'total_comments' FROM {$wpdb->posts} LEFT JOIN {$wpdb->comments} ON ID = comment_post_ID WHERE comment_type IN ('','comment') AND post_status IN ('publish','static') AND post_date_gmt < '$now' AND post_password = '' AND comment_approved = '1' GROUP BY comment_post_ID ORDER BY total_comments DESC LIMIT 0,10")){
FOREACH ($posts as $post){
$post_title = apply_filters("the_title",$post->post_title);
IF (!strlen($post_title)) $post_title = obt_translate("Untitled");
$post_title = wp_specialchars($post_title,true);
$post_url = get_permalink($post->ID);
IF ($post->post_type == "page" || $post->post_status == "static") $post_url = obt_fix_link($post_url);
echo "\t- {$post_title}: ";
echo "total_comments == 1)? obt_translate("Read the comment on this post") : obt_translate("Read the comments on this post"))."\">({$post->total_comments})
";
};
}ELSE echo "\t- ".obt_translate("No comments")."
\n";
echo "
\n";
};
FUNCTION obt_widget_search(){
global $s, $obt_search_forms;
$obt_search_forms++;
echo "".obt_translate("Search")."
\n";
echo "\n";
};
FUNCTION obt_widget_subscribe(){
IF (obt_get_themeoption("feed")){
global $obt_subscribe_menus;
$obt_subscribe_menus++;
$feedburner_form = (obt_get_themeoption("subscribe-email-form") == "feedburner" && obt_get_themeoption("subscribe-email-feedburner")*1);
$feedblitz_form = (obt_get_themeoption("subscribe-email-form") == "feedblitz" && obt_get_themeoption("subscribe-email-feedblitz")*1);
echo "".obt_translate("Subscribe")."
\n";
IF ($feedburner_form || $feedblitz_form) echo "\n";
echo "\n";
IF ($feedburner_form || $feedblitz_form){
extract(wp_get_current_commenter(),EXTR_SKIP);
echo "\n";
};
echo "\n";
};
};
FUNCTION obt_widget_tags(){
global $wpdb;
IF (function_exists("wp_tag_cloud")){
flush();
$tags = $wpdb->get_results("SELECT * FROM {$wpdb->terms} LEFT JOIN {$wpdb->term_taxonomy} ON {$wpdb->terms}.term_id = {$wpdb->term_taxonomy}.term_id WHERE taxonomy = 'post_tag' AND count > 0 ORDER BY count DESC LIMIT 0,30");
usort($tags,"obt_sort_tags");
IF (count($tags)){
echo "".obt_translate("Tags")."
\n";
echo "\n";
FOREACH ($tags as $tag){
$tag_name = wp_specialchars($tag->name,true);
$tag_link = get_tag_link($tag->term_id);
$tag_feed = obt_tag_feed($tag_link);
$tag_link = obt_fix_link($tag_link);
$tag_feed = obt_fix_feed_link($tag_feed,$tag_link);
echo "\t- ";
IF (obt_use_buffer() && obt_get_themeoption("feed-tags")) echo "";
echo "{$tag_name}";
IF (!obt_use_buffer() && obt_get_themeoption("feed-tags")) echo " (RSS)";
IF (obt_use_buffer()) echo " ({$tag->count})";
ELSE echo " ({$tag->count})";
echo "
\n";
};
echo "
\n";
};
}ELSEIF (function_exists("UTW_ShowWeightedTagSet")){
global $utw, $baseurl, $home, $siteurl, $prettyurls;
$tags = $utw->GetWeightedTags("weight","desc",30,false);
IF (count($tags)){
echo "".obt_translate("Tags")."
\n";
echo "\n";
FOREACH ($tags as $tag){
$tag_name = str_replace("_"," ",$tag->tag);
$tag_name = str_replace("-"," ",$tag_name);
$tag_name = stripslashes($tag_name);
$tag_name = wp_specialchars($tag_name);
$tag_name_url = urlencode(stripslashes(strtolower($tag->tag)));
IF ($prettyurls == "yes"){
$tag_link = "{$home}{$baseurl}{$tag_name_url}/";
$tag_feed = "{$tag_link}feed/";
}ELSE{
$tag_link = "$home/index.php?tag={$tag_name_url}";
$tag_feed = "{$tag_link}&feed=rss";
};
echo "\t- ";
IF (obt_use_buffer() && obt_get_themeoption("feed-tags")) echo "";
echo "{$tag_name}";
IF (!obt_use_buffer() && obt_get_themeoption("feed-tags")) echo " (RSS)";
IF (obt_use_buffer()) echo " ({$tag->count})";
ELSE echo " ({$tag->count})";
echo "
\n";
};
echo "
\n";
};
}ELSEIF (function_exists("STP_GetTagcloud")){
global $STagging;
flush();
$tags = $STagging->getAllTags(false,false,true,true,false);
$tags = array_slice($tags,0,30);
IF (count($tags)){
echo "".obt_translate("Tags")."
\n";
echo "\n";
FOREACH ($tags as $tag){
$tag_name = wp_specialchars($tag["name"],true);
$tag_link = $tag["link"];
$tag_feed = obt_tag_feed($tag_link);
$tag_link = obt_fix_link($tag_link);
$tag_feed = obt_fix_feed_link($tag_feed,$tag_link);
echo "\t- ";
IF (obt_use_buffer() && obt_get_themeoption("feed-tags")) echo "";
echo "{$tag_name}";
IF (!obt_use_buffer() && obt_get_themeoption("feed-tags")) echo " (RSS)";
IF (obt_use_buffer()) echo " ({$tag["count"]})";
ELSE echo " ({$tag->count})";
echo "
\n";
};
echo "
\n";
};
};
};
FUNCTION obt_widget_themeswitcher(){
IF (function_exists("wp_theme_switcher")){
echo "".obt_translate("Theme switcher")."
\n";
flush();
IF (obt_use_buffer()){
ob_start();
wp_theme_switcher();
$themes = ob_get_contents();
ob_end_clean();
$themes = str_replace(array("\t"," id=\"themeswitcher\""),"",$themes);
$themes = obt_format_list($themes);
echo $themes;
}ELSE{
wp_theme_switcher();
};
echo "\n";
};
};
FUNCTION obt_widget_where(){
global $s, $obt_comments_paginated;
IF (is_home() || is_404()){
echo "".obt_translate("About")."...
\n";
include(TEMPLATEPATH."/about.php");
}ELSEIF (is_single()){
IF ($obt_comments_paginated){
global $obt_post_title, $obt_post_url;
echo "".obt_translate("Comments")."
\n";
echo "".obt_translate("You are currently viewing the comments for the post %1 on the blog %2","{$obt_post_title}","".wp_specialchars(get_bloginfo("name"),true)."").". ".obt_translate("If you haven't found what you were looking for, try the search form or browse the different categories and sections").".
\n";
}ELSE{
echo "".obt_translate("Post")."
\n";
echo "".obt_translate("You are currently viewing an individual post on the blog %1","".wp_specialchars(get_bloginfo("name"),true)."").". ".obt_translate("If you haven't found what you were looking for, try the search form or browse the different categories and sections").".
\n";
};
}ELSEIF (is_page()){
IF ($obt_comments_paginated){
global $obt_post_title, $obt_post_url;
echo "".obt_translate("Comments")."
\n";
echo "".obt_translate("You are currently viewing the comments for the section %1 on the blog %2","{$obt_post_title}","".wp_specialchars(get_bloginfo("name"),true)."").". ".obt_translate("If you haven't found what you were looking for, try the search form or browse the different categories and sections").".
\n";
}ELSE{
echo "".obt_translate("Section")."
\n";
echo "".obt_translate("You are currently viewing a section on the blog %1","".wp_specialchars(get_bloginfo("name"),true)."").". ".obt_translate("If you haven't found what you were looking for, try the search form or browse the different categories and sections").".
\n";
};
}ELSEIF (is_category()){
echo "".wp_specialchars(ucfirst(single_cat_title("",false)),true)."
\n";
IF (category_description()) echo "".category_description()."
\n";
echo "".obt_translate("You are currently viewing the posts under the category %1 on the blog %2","«".wp_specialchars(single_cat_title("",false),true)."»","".wp_specialchars(get_bloginfo("name"),true)."").". ".obt_translate("If you haven't found what you were looking for, try the search form or browse the different categories and sections").".
\n";
}ELSEIF (obt_is_tag()){
echo "".wp_specialchars(ucfirst(obt_current_tag()),true)."
\n";
echo "".obt_translate("You are currently viewing the posts tagged %1 on the blog %2","«".wp_specialchars(obt_current_tag(),true)."»","".wp_specialchars(get_bloginfo("name"),true)."").". ".obt_translate("If you haven't found what you were looking for, try the search form or browse the different categories and sections").".
\n";
}ELSEIF (is_search()){
echo "".wp_specialchars(ucfirst($s),true)."
\n";
echo "".obt_translate("You are currently viewing the posts matching the search %1 on the blog %2","«".wp_specialchars($s,true)."»","".wp_specialchars(get_bloginfo("name"),true)."").". ".obt_translate("If you haven't found what you were looking for, try the search form or browse the different categories and sections").".
\n";
}ELSEIF (is_year()){
echo "".get_the_time("Y")."
\n";
echo "".obt_translate("You are currently viewing the posts for the year %1 on the blog %2",get_the_time("Y"),"".wp_specialchars(get_bloginfo("name"),true)."").". ".obt_translate("If you haven't found what you were looking for, try the search form or browse the different categories and sections").".
\n";
}ELSEIF (is_month()){
echo "".obt_translate("%1 %2",obt_translate_months(get_the_time("F")),get_the_time("Y"))."
\n";
echo "".obt_translate("You are currently viewing the posts for the month %1 on the blog %2",obt_translate("%1 %2",obt_translate_months(get_the_time("F")),get_the_time("Y")),"".wp_specialchars(get_bloginfo("name"),true)."").". ".obt_translate("If you haven't found what you were looking for, try the search form or browse the different categories and sections").".
\n";
}ELSEIF (is_day()){
echo "".obt_translate("%2 %1 %3",get_the_time("j"),obt_translate_months(get_the_time("F")),get_the_time("Y"))."
\n";
echo "".obt_translate("You are currently viewing the posts for the day %1 on the blog %2",obt_translate("%2 %1 %3",get_the_time("j"),obt_translate_months(get_the_time("F")),get_the_time("Y")),"".wp_specialchars(get_bloginfo("name"),true)."").". ".obt_translate("If you haven't found what you were looking for, try the search form or browse the different categories and sections").".
\n";
}ELSEIF (is_author()){
echo "".wp_specialchars(get_the_author_nickname(),true)."
\n";
echo "".obt_translate("You are currently viewing the posts written by %1 on the blog %2",wp_specialchars(get_the_author_nickname()),"".wp_specialchars(get_bloginfo("name"),true)."").". ".obt_translate("If you haven't found what you were looking for, try the search form or browse the different categories and sections").".
\n";
};
};
IF (function_exists("register_sidebar")){
$sidebar_options["before_title"] = "";
$sidebar_options["after_title"] = "
";
$sidebar_options["before_widget"] = "";
$sidebar_options["after_widget"] = "";
$sidebar_options["name"] = obt_translate("Sidebar - Main");
register_sidebar($sidebar_options);
$sidebar_options["name"] = obt_translate("Sidebar - Left");
register_sidebar($sidebar_options);
$sidebar_options["name"] = obt_translate("Sidebar - Right");
register_sidebar($sidebar_options);
$sidebar_options["name"] = obt_translate("Footer - Left");
register_sidebar($sidebar_options);
$sidebar_options["name"] = obt_translate("Footer - Center");
register_sidebar($sidebar_options);
$sidebar_options["name"] = obt_translate("Footer - Right");
register_sidebar($sidebar_options);
};
IF (function_exists("register_sidebar_widget")){
FUNCTION obt_unregister_sidebar_widgets(){
unregister_sidebar_widget("Archives");
unregister_sidebar_widget("Calendar");
unregister_sidebar_widget("Categories");
unregister_sidebar_widget("Meta");
unregister_sidebar_widget("Links");
unregister_sidebar_widget("Recent Comments");
unregister_sidebar_widget("Recent Posts");
unregister_sidebar_widget("Pages");
unregister_sidebar_widget("Search");
};
add_action("widgets_init","obt_unregister_sidebar_widgets");
register_sidebar_widget(obt_translate("Archives")." [1 Blog Theme]","obt_widget_archives");
register_sidebar_widget(obt_translate("Bloggers")." [1 Blog Theme]","obt_widget_bloggers");
register_sidebar_widget(obt_translate("Calendar")." [1 Blog Theme]","obt_widget_calendar");
register_sidebar_widget(obt_translate("Categories")." [1 Blog Theme]","obt_widget_categories");
register_sidebar_widget(obt_translate("Control panel")." (".obt_translate("if you are registered and logged-in").") [1 Blog Theme]","obt_widget_admin");
register_sidebar_widget(obt_translate("Favorite sites")." [1 Blog Theme]","obt_widget_favorites");
register_sidebar_widget(obt_translate("Latest comments")." [1 Blog Theme]","obt_widget_latestcomments");
register_sidebar_widget(obt_translate("Latest posts")." [1 Blog Theme]","obt_widget_latestentries");
register_sidebar_widget(obt_translate("Log-in")." (".obt_translate("if users can register").") [1 Blog Theme]","obt_widget_login");
register_sidebar_widget(obt_translate("Most commented posts")." [1 Blog Theme]","obt_widget_mostcommented");
register_sidebar_widget(obt_translate("Pages")." [1 Blog Theme]","obt_widget_pages");
register_sidebar_widget(obt_translate("Search")." [1 Blog Theme]","obt_widget_search");
register_sidebar_widget(obt_translate("Subscribe")." (RSS) [1 Blog Theme]","obt_widget_subscribe");
register_sidebar_widget(obt_translate("Tags")." (".obt_translate("if %1 is installed","