mirror of
https://github.com/WenPai-org/wp-chinese-converter.git
synced 2025-08-08 03:29:14 +08:00
Modify the static file directory
This commit is contained in:
parent
30fb92ad32
commit
8100990c19
7 changed files with 31 additions and 14 deletions
BIN
.DS_Store
vendored
Normal file
BIN
.DS_Store
vendored
Normal file
Binary file not shown.
BIN
assets/.DS_Store
vendored
Normal file
BIN
assets/.DS_Store
vendored
Normal file
Binary file not shown.
17
assets/css/wpcs-style.css
Normal file
17
assets/css/wpcs-style.css
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
|
||||||
|
/*Switcher Widget Button*/
|
||||||
|
a.wpcs_link {
|
||||||
|
margin-left: 10px;
|
||||||
|
padding: 2% 9%;
|
||||||
|
border-radius: 3px;
|
||||||
|
background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 0));
|
||||||
|
border: 1px solid #eaeaea;
|
||||||
|
color: #707070;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 10pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.wpcs_link:hover {
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
color: #333;
|
||||||
|
}
|
12
convert.php
12
convert.php
|
@ -1,13 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* 本文件是為第三方應用預留的. 本插件中不會載入和使用這個文件.
|
* 本文档是为第三方应用预留的. 本插件中不会加载和使用这个文档.
|
||||||
*
|
*
|
||||||
* 通過include本文件, 您可以使用中文繁簡轉換函數zhconversion($str, $variant)
|
* 通过include本文档, 您可以使用中文繁简转换函数zhconversion($str, $variant)
|
||||||
* 如果$_GET['doconversion']或$_POST['doconversion'])有設置, 本文件將獲取$_REQUEST['data']并把其轉換為$_REQUEST['variant']語言后輸出.
|
* 如果$_GET['doconversion']或$_POST['doconversion'])有设置, 本文档将获取$_REQUEST['data']并把其转换为$_REQUEST['variant']语言后输出.
|
||||||
*
|
*
|
||||||
* 您不應該也不需要在Wordpress程序, 插件/主題 或 任何已經包含wp-config.php文件的php程序中包含本文件
|
* 您不应该也不需要在Wordpress进程, 插件/主题 或 任何已经包含wp-config.php文档的php进程中包含本文档
|
||||||
*
|
*
|
||||||
* 本插件目录下convert.html是一个简单的在线繁简转换工具, 使用了本php文件. 当作是本插件的bonus吧 ^_^
|
* 本插件目录下convert.html是一个简单的在线繁简转换工具, 使用了本php文档. 当作是本插件的bonus吧 ^_^
|
||||||
*/
|
*/
|
||||||
|
|
||||||
global $zh2Hans, $zh2Hant, $zh2TW, $zh2CN, $zh2SG, $zh2HK;
|
global $zh2Hans, $zh2Hant, $zh2TW, $zh2CN, $zh2SG, $zh2HK;
|
||||||
|
@ -77,4 +77,4 @@ function zhconversion_zh($str) {
|
||||||
return $str;
|
return $str;
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -43,7 +43,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//define('wpcs_DEBUG', true); $wpcs_deubg_data = array(); //uncomment this line to enable debug
|
//define('wpcs_DEBUG', true); $wpcs_deubg_data = array(); //uncomment this line to enable debug
|
||||||
define('wpcs_ROOT_URL', WP_PLUGIN_URL . '/' . str_replace(basename( __FILE__), "", plugin_basename(__FILE__)));
|
define('wpcs_DIR_URL', WP_PLUGIN_URL . '/' . str_replace(basename( __FILE__), "", plugin_basename(__FILE__)));
|
||||||
define('wpcs_VERSION', '1.0');
|
define('wpcs_VERSION', '1.0');
|
||||||
|
|
||||||
$wpcs_options = get_option('wpcs_options');
|
$wpcs_options = get_option('wpcs_options');
|
||||||
|
@ -253,9 +253,9 @@ var wpcs_target_lang=\"$wpcs_target_lang\";var wpcs_noconversion_url=\"$wpcs_noc
|
||||||
//]]>
|
//]]>
|
||||||
</script>';
|
</script>';
|
||||||
if( !$wpcs_direct_conversion_flag )
|
if( !$wpcs_direct_conversion_flag )
|
||||||
wp_enqueue_script('wpcs-search-js', wpcs_ROOT_URL . 'search-variant.min.js', array(), '1.1', false);
|
wp_enqueue_script('wpcs-search-js', wpcs_DIR_URL . 'assets/js/search-variant.min.js', array(), '1.1', false);
|
||||||
//echo '<script type="text/javascript" src="' . wpcs_ROOT_URL . 'search-variant.min.js' . '"></script>';
|
//echo '<script type="text/javascript" src="' . wpcs_DIR_URL . 'assets/js/search-variant.min.js' . '"></script>';
|
||||||
|
|
||||||
if( $wpcs_direct_conversion_flag ||
|
if( $wpcs_direct_conversion_flag ||
|
||||||
( ( class_exists('All_in_One_SEO_Pack') || class_exists('Platinum_SEO_Pack') ) &&
|
( ( class_exists('All_in_One_SEO_Pack') || class_exists('Platinum_SEO_Pack') ) &&
|
||||||
!is_single() && !is_home() && !is_page() && !is_search() )
|
!is_single() && !is_home() && !is_page() && !is_search() )
|
||||||
|
@ -628,10 +628,10 @@ function _wpcs_permalink_preg_callback($matches) {
|
||||||
function wpcs_link_conversion($link, $variant = null) {
|
function wpcs_link_conversion($link, $variant = null) {
|
||||||
global $wpcs_options;
|
global $wpcs_options;
|
||||||
|
|
||||||
static $wpcs_wp_homepath;
|
static $wpcs_wp_home;
|
||||||
if( empty($wpcs_wp_homepath) ) {
|
if( empty($wpcs_wp_home) ) {
|
||||||
$home = parse_url(home_url());
|
$home = parse_url(home_url());
|
||||||
$wpcs_wp_homepath = trailingslashit($home["path"]);
|
$wpcs_wp_home = trailingslashit($home["path"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( $variant === null ) $variant = $GLOBALS['wpcs_target_lang'];
|
if( $variant === null ) $variant = $GLOBALS['wpcs_target_lang'];
|
||||||
|
@ -641,7 +641,7 @@ function wpcs_link_conversion($link, $variant = null) {
|
||||||
return add_query_arg('variant', $variant, $link);
|
return add_query_arg('variant', $variant, $link);
|
||||||
if($wpcs_options['wpcs_use_permalink'] == 1)
|
if($wpcs_options['wpcs_use_permalink'] == 1)
|
||||||
return user_trailingslashit(trailingslashit($link) . $variant);
|
return user_trailingslashit(trailingslashit($link) . $variant);
|
||||||
return preg_replace('#^(http(s?)://[^/]+' . $wpcs_wp_homepath . ')#', '\\1' . $variant . '/', $link);
|
return preg_replace('#^(http(s?)://[^/]+' . $wpcs_wp_home . ')#', '\\1' . $variant . '/', $link);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue