<?php
	
function xpress_credit($show = false)
{
	global $xoopsModule,$wp_version;
	
	$ret = '<a href="http://www.toemon.com"'. " target='_blank'" . '>XPressME Ver.' . sprintf('%.2f %s',$xoopsModule->getInfo('version'),$xoopsModule->getInfo('codename')) .'</a>';
	if (strstr($wp_version,'ME')){
		$ret .= '(included <a href="http://wpme.sourceforge.jp/" title="Powered by WordPress"'." target='_blank'". '>WordPress ' . $wp_version . '</a>)';
	} else {
		$ret .= '(included <a href="http://ja.wordpress.org/" title="Powered by WordPress"'." target='_blank'". '>WordPress ' . $wp_version . '</a>)';
	}

	if (empty($show))
		return $ret;
	else
		echo $ret;
}

function xpress_convert_time($show = false)
{
	$ret =  timer_stop(0) .'sec. ';
	if (empty($show))
		return $ret;
	else
		echo $ret;
}

function xpress_is_theme_sidebar_disp(){
	$config = new XPressME_Class();
	return $config->is_theme_sidebar_disp;
}	

function xpress_left_arrow_post_link($show = false)
{
	$config = new XPressME_Class();
	$ret = '';		
	
	if($config->is_left_postnavi_old){
		$link_title = $config->old_post_link_text;
		ob_start();
		if ($config->is_postnavi_title_disp)
			previous_post_link('&laquo; %link');
		else 
			previous_post_link('&laquo; %link',$link_title);
		$ret = ob_get_contents();
		ob_end_clean();
	} else {
		$link_title = $config->newer_post_link_text;
		ob_start();
		if ($config->is_postnavi_title_disp)
			next_post_link('&laquo; %link');
		else
			next_post_link('&laquo; %link',$link_title);
		$ret = ob_get_contents();
		ob_end_clean();
	}
	$ret = str_replace('">','" title="'.$link_title . '">' , $ret);

	if (empty($show))
		return $ret;
	else
		echo $ret;	
}

function xpress_right_arrow_post_link($show = false)
{
	$config = new XPressME_Class();
	$ret = '';		
	
	if($config->is_left_postnavi_old){
		$link_title = $config->newer_post_link_text;
		ob_start();
		if ($config->is_postnavi_title_disp)
			next_post_link('%link &raquo;');
		else
			next_post_link('%link &raquo;',$link_title);
		$ret = ob_get_contents();
		ob_end_clean();
	} else {
		$link_title = $config->old_post_link_text;
		ob_start();
		if ($config->is_postnavi_title_disp)
			previous_post_link('%link &raquo;');
		else 
			previous_post_link('%link &raquo;',$link_title);
		$ret = ob_get_contents();
		ob_end_clean();
	}
	$ret = str_replace('">','" title="'.$link_title . '">' , $ret);

	if (empty($show))
		return $ret;
	else
		echo $ret;	
}
?>