readOptions(); if ( !empty($option['lang']) ) { $locale = $option['lang']; } else { $locale = 'en_US'; } } //$locale = 'en_US'; $domain = 'ed2kls'; load_textdomain ($domain, dirname (__FILE__) . '/lang/' . $domain . '-' . $locale . '.mo'); } function addHead() { global $ed2klspage; $ed2klspage = 1; $cssUrl = constant('ED2KLS_URL') . '/ed2kls.css?v=' . constant('ED2KLS_VERSION'); if ( file_exists(TEMPLATEPATH . '/ed2kls.css') ) { $cssUrl = get_bloginfo('template_url') . '/ed2kls.css'; } echo ' '; } function addFooter() { global $ed2klsnumber; if ($ed2klsnumber >= 1) { echo '
'; } } function shortcodeEd2k( $atts = array(), $content = NULL, $code = 'ed2k' ) { if ( $content === NULL ) { return ''; } global $eD2kLSOption, $ed2klspage; $option = $eD2kLSOption->readOptions(); $myatts = shortcode_atts( $option, $atts ); if ( !is_singular() && $myatts['forall'] == 'false' || $myatts['format'] == '2' || $ed2klspage === 0 ) { return $this->convert2anchor($content); } global $ed2klsnumber; $ed2klsnumber += 1; $myno = strval($ed2klsnumber); return $this->convert2table($content, $myatts, $myno); } function shortcodeEd2kCmt( $atts = array(), $content = NULL, $code = 'ed2k' ) { if ( $content === NULL ) { return ''; } return $this->convert2anchor($content); } function convert2anchor( $content ) { $newcontent = ''; $newcontent .= '';
$content = preg_replace (
"/(?ed2k: ' . $name . '
';
} else {
$myline = preg_replace (
"/
|<\/p>|
|
|
/i",
"",
$myline
);
$myline = trim($myline);
if ($myline !== "") {
$newcontent .= '' . $myline . '
';
}
}
}
$newcontent .= '