user_level > 3)
return true;
else
return false;
}
function xpress_is_wpmu() {
global $xoops_config;
return $xoops_config->is_wpmu;
}
function xpress_is_wp_version($operator='==',$comp_version){
global $xoops_config;
return version_compare($xoops_config->wp_version, $comp_version, $operator);
}
function xpress_is_theme_sidebar_disp(){
global $xpress_config;
if (is_wordpress_style()) return true;
return $xpress_config->is_theme_sidebar_disp;
}
function xpress_is_author_view_count(){
global $xpress_config;
return $xpress_config->is_author_view_count;
}
function xpress_is_multi_user(){
global $xpress_config;
return $xpress_config->is_multi_user;
}
function xpress_the_title($args = '')
{
$defaults = array(
'echo' => 1
);
$r = wp_parse_args( $args, $defaults );
extract( $r );
$output = '
' . "\n";
if ($echo)
echo $output;
else
return $output;
}
function xpress_selected_author($args ='' ) {
$defaults = array(
'echo' => 1
);
$r = wp_parse_args( $args, $defaults );
extract( $r );
$output = '';
$author_cookie = get_xpress_dir_name() . "_select_author" ;
if (!empty($_COOKIE[$author_cookie])){
$uid = intval($_COOKIE[$author_cookie]);
$user_info = get_userdata($uid);
$output = $user_info->display_name;
}
if ($echo)
echo $output;
else
return $output;
}
function xpress_selected_author_id($args ='' ) {
$defaults = array(
'echo' => 1
);
$r = wp_parse_args( $args, $defaults );
extract( $r );
$output = '';
$author_cookie = get_xpress_dir_name() . "_select_author" ;
if (!empty($_COOKIE[$author_cookie])){
$output = intval($_COOKIE[$author_cookie]);
} else {
$output = '';
}
if ($echo)
echo $output;
else
return $output;
}
function xpress_now_user_level($args ='' ) {
global $current_user;
$defaults = array(
'echo' => 1
);
$r = wp_parse_args( $args, $defaults );
extract( $r );
$output = @$current_user->user_level;
if ($echo)
echo $output;
else
return $output;
}
function xpress_credit($args ='')
{
global $wp_version , $xoops_config;
if ($xoops_config->is_wpmu) {
global $wpmu_version;
}
$defaults = array(
'echo' => 1,
'no_link' => 0
);
$r = wp_parse_args( $args, $defaults );
extract( $r );
$xpress_version = $xoops_config->module_version;
$xpress_codename = $xoops_config->module_codename;
if ($no_link){
$output = 'XPressME Ver.' . sprintf('%.2f %s',$xpress_version,$xpress_codename);
if ($xoops_config->is_wpmu) {
$output .= '(included WordPress MU ' . $wpmu_version. ')';
} else {
if (strstr($wp_version,'ME')){
$output .= '(included WordPress ' . $wp_version . ')';
} else {
$output .= '(included WordPress ' . $wp_version . ')';
}
}
} else {
$output = '(.*)<\/strong>(.*)';
if ( preg_match ( "/".$pattern."/i", $trackback->comment_content , $match ) ){
$title = $match[1];
$content = $match[2];
}
if (empty($title)) $title = $trackback->comment_author;
$row_data = array(
'ID' => $trackback->comment_ID ,
'post_ID' => $trackback->comment_post_ID ,
'site_name' => $trackback->comment_author ,
'site_url' => $trackback->comment_author_url ,
'title' => $title ,
'content' => $content ,
'date' => $trackback->comment_timestamp ,
'date_gmt' => $trackback->comment_timestamp_gmt ,
'agent' => $trackback->comment_agent ,
'type' => $trackback->comment_type ,
'IP' => $trackback->comment_author_IP ,
);
array_push($ret,$row_data);
}
return $ret;
}
return false;
}
function xpress_get_calendar($args = '') {
global $wpdb, $m, $monthnum, $year, $wp_locale, $posts , $xoops_config;
$defaults = array(
sun_color => '#DB0000',
sat_color => '#004D99',
initial => true
);
$r = wp_parse_args( $args, $defaults );
extract( $r );
ob_start();
get_calendar(true);
$calendar = ob_get_contents();
ob_end_clean();
$calendar = preg_replace('//', ' | ', $calendar); //days align center
$calendar = preg_replace('/ | /', ' | ', $calendar); //today align center
$calendar = preg_replace('/' . $sun_match[2] . ''. $sun_match[3];
$calendar = str_replace($sun_head,$sun_head_after,$calendar);
}
if(preg_match('/'. $pattrn . '/' ,$sat_head,$sat_match)){
$sat_head_after = $sat_match[1] . '' . $sat_match[2] . ''. $sat_match[3];
$calendar = str_replace($sat_head,$sat_head_after,$calendar);
}
}
return $calendar;
}
?> |