Index: trunk/wp-content/plugins/xpressme/include/custom_functions.php
===================================================================
--- trunk/wp-content/plugins/xpressme/include/custom_functions.php	(revision 144)
+++ trunk/wp-content/plugins/xpressme/include/custom_functions.php	(revision 145)
@@ -31,4 +31,5 @@
 function xpress_is_theme_sidebar_disp(){
 	global $xpress_config;
+	if (is_wordpress_style()) return true;
 	return $xpress_config->is_theme_sidebar_disp;
 }	
@@ -276,18 +277,48 @@
 }
 
-function xpress_the_content($more_link_text = '',$excerpt_size = 0,$show = true)
-{
-	$content = get_the_content();	
-	if($excerpt_size > 0) {
-
-		$content = apply_filters('the_excerpt_rss', $content);
-		$content = strip_tags($content);
-
-		if (mb_strlen($content) > $excerpt_size){ 
-			$content = mb_substr($content, 0, $excerpt_size); 
-			$content .= '... ';
-			if (!empty($more_link_text)) $content .= '<p align="center"><a href="'. get_permalink() . "\">".$more_link_text .'</a></p>';
+function get_xpress_excerpt_contents($excerpt_length_word,$excerpt_length_character,$more_link_text = '') {
+	global $post,$xpress_config;
+	
+	$blog_encoding = get_option('blog_charset');
+	$text = get_the_content('');
+	$text = strip_shortcodes( $text );
+	$text = apply_filters('the_content', $text);
+	$text = str_replace(']]>', ']]&gt;', $text);
+	$text = strip_tags($text);
+	$is_almost_ascii = ($xpress_config->ascii_judged_rate < round(@(mb_strlen($text, $blog_encoding) / strlen($text)) * 100)) ? true : false;
+	if($is_almost_ascii) {
+		$words = explode(' ', $text, $excerpt_length_word + 1);
+
+		if(count($words) > $excerpt_length_word) {
+			array_pop($words);
+			array_push($words, ' ... ');
+			$text = implode(' ', $words);
+			if (!empty($more_link_text)) $text .= '<p align="center"><a href="'. get_permalink() . "\">".$more_link_text .'</a></p>';
+
 		}
 	}
+	elseif(mb_strlen($text, $blog_encoding) > $excerpt_length_character) {
+		$text = mb_substr($text, 0, $xpress_config->excerpt_length_character, $blog_encoding) . ' ... ';
+		if (!empty($more_link_text)) $text .= '<p align="center"><a href="'. get_permalink() . "\">".$more_link_text .'</a></p>';
+	}
+
+	return $text;
+}
+
+function xpress_the_content($more_link_text = null, $stripteaser = 0, $more_file = '',$show = true)
+{
+	global $post,$xpress_config;
+	
+	
+	if ($xpress_config->is_content_excerpt){
+		$excerpt_length_word = $xpress_config->excerpt_length_word;
+		$excerpt_length_character = $xpress_config->excerpt_length_character;
+		$more_link_text = $xpress_config->more_link_text;
+		$content = get_xpress_excerpt_contents($excerpt_length_word,$excerpt_length_character,$more_link_text);
+	} else {
+		$content = get_the_content($more_link_text,$stripteaser,$more_file);
+		$content = apply_filters('the_content', $content);
+		$content = str_replace(']]>', ']]&gt;', $content);
+	}	
 	if(empty($show)) return $content;
 	echo $content;
