options['shipping_charge']); $i++){
//20120710ysk start 0000472
//if( $this->options['shipping_charge'][$i]['id'] === $id ){
if( (int)$this->options['shipping_charge'][$i]['id'] == (int)$id ){
//20120710ysk end
$index = $i;
}
}
if($index === false)
return -1;
else
return $index;
}
function get_initial_data($xml){
$buf = file_get_contents($xml);
preg_match_all('@.*?(.*?).*?(.*?).*?(.*?).*?(.*?).*?@s', $buf, $match, PREG_SET_ORDER);
return $match;
}
function getCurrencySymbol(){
global $usces_settings;
$cr = $this->options['system']['currency'];
list($code, $decimal, $point, $seperator, $symbol) = $usces_settings['currency'][$cr];
return $symbol;
}
function getCartItemName($post_id, $sku){
$name_arr = array();
$name_str = '';
foreach($this->options['indi_item_name'] as $key => $value){
if($value){
$pos = (int)$this->options['pos_item_name'][$key];
$ind = ($pos === 0) ? 'A' : $pos;
switch($key){
case 'item_name':
$name_arr[$ind][$key] = $this->getItemName($post_id);
break;
case 'item_code':
$name_arr[$ind][$key] = $this->getItemCode($post_id);
break;
case 'sku_name':
$name_arr[$ind][$key] = $this->getItemSkuDisp($post_id, $sku);
break;
case 'sku_code':
$name_arr[$ind][$key] = $sku;
break;
}
}
}
ksort($name_arr);
foreach($name_arr as $vals){
foreach($vals as $key => $value){
$name_str .= $value . ' ';
}
}
$name_str = apply_filters('usces_admin_order_item_name_filter', $name_str, $post_id, $sku);
return trim($name_str);
}
function getCartItemName_byOrder($cart_row){
$name_arr = array();
$name_str = '';
foreach($this->options['indi_item_name'] as $key => $value){
if($value){
$pos = (int)$this->options['pos_item_name'][$key];
$ind = ($pos === 0) ? 'A' : $pos;
switch($key){
case 'item_name':
$name_arr[$ind][$key] = $cart_row['item_name'];
break;
case 'item_code':
$name_arr[$ind][$key] = $cart_row['item_code'];
break;
case 'sku_name':
$name_arr[$ind][$key] = $cart_row['sku_name'];
break;
case 'sku_code':
$name_arr[$ind][$key] = $cart_row['sku_code'];
break;
}
}
}
ksort($name_arr);
foreach($name_arr as $vals){
foreach($vals as $key => $value){
$name_str .= $value . ' ';
}
}
$name_str = apply_filters('usces_filter_item_mame_by_order', $name_str, $cart_row);
return trim($name_str);
}
function set_reserve_pre_order_id(){
$entry = $this->cart->get_entry();
$id = ( isset($entry['reserve']['pre_order_id']) && !empty($entry['reserve']['pre_order_id']) ) ? $entry['reserve']['pre_order_id'] : uniqid('');
$this->cart->set_pre_order_id($id);
}
function get_current_pre_order_id(){
$entry = $this->cart->get_entry();
$id = ( isset($entry['reserve']['pre_order_id']) && !empty($entry['reserve']['pre_order_id']) ) ? $entry['reserve']['pre_order_id'] : NULL;
return $id;
}
function get_reserve($order_id, $key){
global $wpdb;
$order_meta_table_name = $wpdb->prefix . "usces_order_meta";
$query = $wpdb->prepare("SELECT meta_value FROM $order_meta_table_name WHERE order_id = %d AND meta_key = %s",
$order_id, $key);
$res = $wpdb->get_var($query);
return $res;
}
//20100818ysk start
//20100816ysk start
//function get_order_meta($order_id, $key) {
function get_order_meta_value($key, $order_id) {
global $wpdb;
$order_meta_table_name = $wpdb->prefix . "usces_order_meta";
$query = $wpdb->prepare("SELECT meta_value FROM $order_meta_table_name WHERE order_id = %d AND meta_key = %s",
$order_id, $key);
$res = $wpdb->get_var($query);
return $res;
}
//20100816ysk end
function set_order_meta_value($key, $meta_value, $order_id) {
global $wpdb;
//if( empty($meta_value) ) return;
if( empty($order_id) ) return;
$table_name = $wpdb->prefix . "usces_order_meta";
$query = $wpdb->prepare("SELECT count(*) FROM $table_name WHERE order_id = %d AND meta_key = %s",
$order_id, $key);
$res = $wpdb->get_var($query);
if(0 < $res) {
$query = $wpdb->prepare("UPDATE $table_name SET meta_value = %s WHERE order_id = %d AND meta_key = %s",
$meta_value,
$order_id,
$key
);
$res2 = $wpdb->query($query);
} else {
$query = $wpdb->prepare("INSERT INTO $table_name (order_id, meta_key, meta_value)
VALUES(%d, %s, %s)",
$order_id,
$key,
$meta_value
);
$res2 = $wpdb->query($query);
}
return $res2;
}
//20130524ysk start
function del_order_meta( $key, $order_id ) {
global $wpdb;
$table_name = $wpdb->prefix."usces_order_meta";
$query = $wpdb->prepare( "DELETE FROM $table_name WHERE order_id = %d AND meta_key = %s", $order_id, $key );
$res = $wpdb->query( $query );
return $res;
}
//20130524ysk end
function set_session_custom_member($member_id) {
unset($_SESSION['usces_member']['custom_member']);
$meta = usces_has_custom_field_meta('member');
if(is_array($meta)) {
$keys = array_keys($meta);
foreach($keys as $key) {
$csmb_key = 'csmb_'.$key;
$_SESSION['usces_member']['custom_member'][$key] = maybe_unserialize($this->get_member_meta_value($csmb_key, $member_id));
}
}
}
function reg_custom_member($member_id) {
//20130524ysk start 0000712
$csmb_meta = usces_has_custom_field_meta( 'member' );
if( is_array($csmb_meta) ) {
foreach( $csmb_meta as $key => $entry ) {
if( '4' == $entry['means'] ) {
$this->del_member_meta( 'csmb_'.$key, $member_id );
}
}
}
//20130524ysk end
if( !empty($_POST['custom_member']) ) {
foreach( $_POST['custom_member'] as $key => $value ) {
$csmb_key = 'csmb_'.$key;
if( is_array($value) )
$value = serialize($value);
$res = $this->set_member_meta_value($csmb_key, $value, $member_id);
if(false === $res)
return false;
}
}elseif( isset($_POST['custom_customer']) ){
foreach( $_POST['custom_customer'] as $key => $value ) {
$csmb_key = 'csmb_'.$key;
if( is_array($value) )
$value = serialize($value);
$res = $this->set_member_meta_value($csmb_key, $value, $member_id);
if(false === $res)
return false;
}
}
}
//20100818ysk end
function save_order_acting_data($rand){
global $wpdb;
$data = serialize(array( 'cart' => $this->cart->get_cart(), 'entry' => $this->cart->get_entry() ));
$table_name = $wpdb->prefix . "usces_access";
$query = $wpdb->prepare("INSERT INTO $table_name (acc_type, acc_str1, acc_date, acc_key, acc_value)
VALUES(%s, %s, now(), %s, %s)",
'acting_data',
$this->get_uscesid(false),
$rand,
$data
);
$res = $wpdb->query($query);
return $res;
}
//20100818ysk start
function set_member_meta_value($key, $meta_value, $member_id = ''){
global $wpdb;
//if( empty($meta_value) ) return;
if( WCUtils::is_blank($member_id) ) {
if( !$this->is_member_logged_in() ) return;
$member = $this->get_member();
$member_id = $member['ID'];
}
$table_name = $wpdb->prefix . "usces_member_meta";
//$query = $wpdb->prepare("SELECT meta_value FROM $table_name WHERE member_id = %d AND meta_key = %s",
$query = $wpdb->prepare("SELECT count(*) FROM $table_name WHERE member_id = %d AND meta_key = %s",
$member_id, $key);
$res = $wpdb->get_var($query);
//if($res != NULL){
if(0 < $res){
$query = $wpdb->prepare("UPDATE $table_name SET meta_value = %s WHERE member_id = %d AND meta_key = %s",
$meta_value,
$member_id,
$key
);
$res2 = $wpdb->query($query);
}else{
$query = $wpdb->prepare("INSERT INTO $table_name (member_id, meta_key, meta_value)
VALUES(%d, %s, %s)",
$member_id,
$key,
$meta_value
);
$res2 = $wpdb->query($query);
}
return $res2;
}
//20100818ysk end
function get_member_meta_value($key, $member_id){
global $wpdb;
$table_name = $wpdb->prefix . "usces_member_meta";
$query = $wpdb->prepare("SELECT meta_value FROM $table_name WHERE member_id = %d AND meta_key = %s",
$member_id, $key);
$res = $wpdb->get_var($query);
return $res;
}
function del_member_meta($key, $member_id){
global $wpdb;
$table_name = $wpdb->prefix . "usces_member_meta";
$query = $wpdb->prepare("DELETE FROM $table_name WHERE member_id = %d AND meta_key = %s",
$member_id, $key);
$res = $wpdb->query($query);
return $res;
}
function get_member_meta($member_id){
global $wpdb;
$table_name = $wpdb->prefix . "usces_member_meta";
$query = $wpdb->prepare("SELECT * FROM $table_name WHERE member_id = %d AND meta_key <> 'customer_country' AND meta_key NOT LIKE %s", $member_id, 'csmb_%');
$res = $wpdb->get_results($query, ARRAY_A);
return $res;
}
function get_settle_info_field( $order_id ){
global $wpdb;
$fields = array();
$table_name = $wpdb->prefix . "usces_order_meta";
$query = $wpdb->prepare("SELECT meta_key, meta_value FROM $table_name WHERE order_id = %d AND (meta_key LIKE %s OR meta_key = %s OR meta_key = %s OR meta_key = %s OR meta_key = %s OR meta_key = %s)",
$order_id, 'acting_%', 'settlement_id', 'order_number', 'res_tracking_id', 'SID', 'TransactionId');
$res = $wpdb->get_results($query, ARRAY_A);
if( !$res )
return $fields;
foreach( $res as $value ){
if( 'settlement_id' == $value['meta_key'] ){
$meta_values = maybe_unserialize($value['meta_value']);
if( is_array($meta_values) ){
foreach( $meta_values as $key => $meta_value ){
$fields[$key] = $meta_value;
}
}else{
$fields['settlement_id'] = $meta_values;
}
}elseif( 'order_number' == $value['meta_key'] ){
$fields['order_number'] = $value['meta_value'];
}elseif( 'res_tracking_id' == $value['meta_key'] ){
$fields['res_tracking_id'] = $value['meta_value'];
}elseif( 'SID' == $value['meta_key'] ){
$fields['SID'] = $value['meta_value'];
}elseif( 'TransactionId' == $value['meta_key'] ){
$fields['TransactionId'] = $value['meta_value'];
}elseif( 'acting_' == substr($value['meta_key'], 0, 7) ){
$meta_values = maybe_unserialize($value['meta_value']);
if(is_array($meta_values)){
foreach( $meta_values as $key => $meta_value ){
$fields[$key] = $meta_value;
}
}
}
}
return $fields;
}
function get_post_custom($post_id, $orderby='meta_id', $order='ASC'){
global $wpdb;
$table = $wpdb->prefix . "postmeta";
$meta_list = $wpdb->get_results( $wpdb->prepare("SELECT meta_key, meta_value FROM $table WHERE post_id = %d ORDER BY $orderby $order",
$post_id), ARRAY_A );
if ( !empty($meta_list) ) {
foreach ( $meta_list as $metarow) {
$mkey = $metarow['meta_key'];
$mval = $metarow['meta_value'];
$res[$mkey][] = $mval;
}
}
return $res;
}
function get_post_user_custom($post_id, $orderby='meta_id', $order='ASC'){
global $wpdb;
$res = array();
$table = $wpdb->prefix . "postmeta";
$meta_list = $wpdb->get_results( $wpdb->prepare("SELECT meta_key, meta_value FROM $table WHERE post_id = %d ORDER BY $orderby $order",
$post_id), ARRAY_A );
if ( !empty($meta_list) ) {
foreach ( $meta_list as $metarow) {
if( 0 === strpos($metarow['meta_key'], '_') )
continue;
$mkey = $metarow['meta_key'];
$mval = $metarow['meta_value'];
if( array_key_exists($mkey, $res) ){
$cval = $res[$mkey];
$cval = (array)$cval;
$cval[] = $mval;
$res[$mkey] = $cval;
}else{
$res[$mkey] = $mval;
}
}
}
return $res;
}
function get_currency($amount, $symbol_pre = false, $symbol_post = false, $seperator_flag = true ){
global $usces_settings;
$cr = $this->options['system']['currency'];
list($code, $decimal, $point, $seperator, $symbol) = $usces_settings['currency'][$cr];
if( !$seperator_flag ){
$seperator = '';
}
$price = number_format((double)$amount, $decimal, $point, $seperator);//0000652
if( $symbol_pre )
$price = ( usces_is_entity($symbol) ? mb_convert_encoding($symbol, 'UTF-8', 'HTML-ENTITIES') : $symbol ) . $price;
if( $symbol_post )
$price = $price . __($code, 'usces');
return $price;
}
function get_currency_code(){
global $usces_settings;
$cr = $this->options['system']['currency'];
list($code, $decimal, $point, $seperator, $symbol) = $usces_settings['currency'][$cr];
return $code;
}
//shortcode-----------------------------------------------------------------------------
function sc_company_name() {
return htmlspecialchars($this->options['company_name']);
}
function sc_zip_code() {
return htmlspecialchars($this->options['zip_code']);
}
function sc_address1() {
return htmlspecialchars($this->options['address1']);
}
function sc_address2() {
return htmlspecialchars($this->options['address2']);
}
function sc_tel_number() {
return htmlspecialchars($this->options['tel_number']);
}
function sc_fax_number() {
return htmlspecialchars($this->options['fax_number']);
}
function sc_inquiry_mail() {
return htmlspecialchars($this->options['inquiry_mail']);
}
function sc_payment() {
$payments = usces_get_system_option( 'usces_payment_method', 'sort' );
$htm = "\n";
foreach ( (array)$payments as $payment ) {
$htm .= "- " . htmlspecialchars($payment['name']) . "
\n";
$htm .= nl2br(htmlspecialchars($payment['explanation'])) . " \n";
}
$htm .= "
\n";
return $htm;
}
function sc_payment_title() {
$payments = $this->options['payment_method'];
$htm = "\n";
foreach ( (array)$payments as $payment ) {
$htm .= "- " . esc_html($payment['name']) . "
\n";
}
$htm .= "
\n";
return $htm;
}
function sc_cod_fee() {
return number_format($this->options['cod_fee']);
}
function sc_start_point() {
return number_format($this->options['start_point']);
}
function sc_postage_privilege() {
if(empty($this->options['postage_privilege']))
return;
return number_format($this->options['postage_privilege']);
}
function sc_shipping_charge() {
//20120710ysk start 0000472
$entry = $this->cart->get_entry();
$country = (isset($entry['delivery']['country']) && !empty($entry['delivery']['country'])) ? $entry['delivery']['country'] : $entry['customer']['country'];//20120710ysk 0000472
//20120710ysk end
$arr = array();
foreach ( (array)$this->options['shipping_charge'] as $charges ) {
//20120710ysk start 0000472
//foreach ( (array)$charges['value'] as $value ) {
foreach ( (array)$charges[$country] as $value ) {
//20120710ysk end
$arr[] = $value;
}
}
sort($arr);
$min = $arr[0];
rsort($arr);
$max = $arr[0];
if($min == $max){
$res = number_format($min);
}else{
$res = number_format($min) . __(' - ', 'usces') . number_format($max);
}
return $res;
}
function sc_site_url() {
return get_option('home');
}
function sc_button_to_cart($atts) {
extract(shortcode_atts(array(
'item' => '',
'sku' => '',
'value' => __('to the cart', 'usces'),
'force' => 0,
'quant' => 0,
'opt' => 1,
), $atts));
$post_id = $this->get_ID_byItemName($item);
$datas = $this->get_skus( $post_id, 'code' );
$zaikonum = $datas[$sku]['stocknum'];
$zaiko = $datas[$sku]['stock'];
$gptekiyo = $datas[$sku]['gp'];
$skuPrice = $datas[$sku]['price'];
$sku_enc = urlencode($sku);
$mats = compact('item','sku','value','force','quant','post_id','datas','zaikonum','zaiko','gptekiyo','skuPrice','sku_enc');
if( ! $this->is_item_zaiko( $post_id, $sku ) ){
return '' . esc_html($this->zaiko_status[$zaiko]) . '
';
}
$html = "";
$html .= '' . usces_singleitem_error_message($post_id, $sku, 'return') . '
'."\n";
return $html;
}
function filter_itemPage($content){
global $post;
$html = '';
if( ($post->post_mime_type != 'item' || !is_single()) ) return $content;
if( post_password_required($post) ) return $content;
$temp_path = apply_filters('usces_template_path_single_item', USCES_PLUGIN_DIR . '/templates/single_item.php');
include( $temp_path );
$content = apply_filters('usces_filter_itemPage', $html, $post->ID);
return $content;
}
function filter_cartContent($content) {
global $post;
$html = '';
switch($this->page){
case 'cart':
$temp_path = apply_filters('usces_template_path_cart', USCES_PLUGIN_DIR . '/templates/cart/cart.php');
include( $temp_path );
break;
case 'customer':
$temp_path = apply_filters('usces_template_path_customer', USCES_PLUGIN_DIR . '/templates/cart/customer_info.php');
include( $temp_path );
break;
case 'delivery':
$temp_path = apply_filters('usces_template_path_delivery', USCES_PLUGIN_DIR . '/templates/cart/delivery_info.php');
include( $temp_path );
break;
case 'confirm':
$temp_path = apply_filters('usces_template_path_confirm', USCES_PLUGIN_DIR . '/templates/cart/confirm.php');
include( $temp_path );
break;
case 'ordercompletion':
$temp_path = apply_filters('usces_template_path_ordercompletion', USCES_PLUGIN_DIR . '/templates/cart/completion.php');
include( $temp_path );
break;
case 'error':
$temp_path = apply_filters('usces_template_path_carterror', USCES_PLUGIN_DIR . '/templates/cart/error.php');
include( $temp_path );
break;
case 'maintenance':
$temp_path = apply_filters('usces_template_path_maintenance', USCES_PLUGIN_DIR . '/templates/cart/maintenance.php');
include( $temp_path );
break;
case 'search_item':
$temp_path = apply_filters('usces_template_path_search_item', USCES_PLUGIN_DIR . '/templates/search_item.php');
include( $temp_path );
break;
case 'wp_search':
if($post->post_mime_type == 'item'){
$temp_path = apply_filters('usces_template_path_wp_search', USCES_PLUGIN_DIR . '/templates/wp_search_item.php');
include( $temp_path );
}else{
$html = $content;
}
break;
default:
$html = $content;
}
if( $this->use_ssl && ($this->is_cart_or_member_page($_SERVER['REQUEST_URI']) || $this->is_inquiry_page($_SERVER['REQUEST_URI'])) )
$html = str_replace('src="'.site_url(), 'src="'.USCES_SSL_URL_ADMIN, $html);
$html = apply_filters('usces_filter_cartContent', $html);
$content = $html;
remove_filter('the_title', array($this, 'filter_cartTitle'));
return $content;
}
function filter_cartTitle($title) {
if( $title == 'Cart' || $title == __('Cart', 'usces') ){
switch($this->page){
case 'cart':
$newtitle = apply_filters('usces_filter_title_cart', __('In the cart', 'usces'));
break;
case 'customer':
$newtitle = apply_filters('usces_filter_title_customer', __('Customer Information', 'usces'));
break;
case 'delivery':
$newtitle = apply_filters('usces_filter_title_delivery', __('Shipping / Payment options', 'usces'));
break;
case 'confirm':
$newtitle = apply_filters('usces_filter_title_confirm', __('Confirmation', 'usces'));
break;
case 'ordercompletion':
$newtitle = apply_filters('usces_filter_title_ordercompletion', __('Completion', 'usces'));
break;
case 'error':
$newtitle = apply_filters('usces_filter_title_carterror', __('Error', 'usces'));
break;
case 'search_item':
$newtitle = apply_filters('usces_filter_title_search_item', __("'AND' search by categories", 'usces'));
break;
case 'maintenance':
$newtitle = apply_filters('usces_filter_title_maintenance', __('Under Maintenance', 'usces'));
break;
case 'login':
$newtitle = apply_filters('usces_filter_title_login', __('Log-in for members', 'usces'));
break;
default:
$newtitle = apply_filters('usces_filter_title_cart_default', $title);
}
}else{
$newtitle = $title;
}
$newtitle = apply_filters('usces_filter_cartTitle', $newtitle);
return $newtitle;
}
function action_cartFilter(){
add_filter('the_title', array($this, 'filter_cartTitle'),20);
add_filter('the_content', array($this, 'filter_cartContent'),20);
}
function action_search_item(){
include(TEMPLATEPATH . '/page.php');
exit;
}
function filter_memberContent($content) {
global $post;
$html = '';
if($this->options['membersystem_state'] == 'activate'){
if( $this->is_member_logged_in() ) {
$member_regmode = 'editmemberform';
$temp_path = apply_filters('usces_template_path_member', USCES_PLUGIN_DIR . '/templates/member/member.php');
include( $temp_path );
} else {
switch($this->page){
case 'login':
$temp_path = apply_filters('usces_template_path_login', USCES_PLUGIN_DIR . '/templates/member/login.php');
include( $temp_path );
break;
case 'lostmemberpassword':
$temp_path = apply_filters('usces_template_path_lostpassword', USCES_PLUGIN_DIR . '/templates/member/lostpassword.php');
include( $temp_path );
break;
case 'changepassword':
$temp_path = apply_filters('usces_template_path_changepassword', USCES_PLUGIN_DIR . '/templates/member/changepassword.php');
include( $temp_path );
break;
case 'newcompletion':
case 'editcompletion':
case 'lostcompletion':
case 'changepasscompletion':
$temp_path = apply_filters('usces_template_path_membercompletion', USCES_PLUGIN_DIR . '/templates/member/completion.php');
include( $temp_path );
break;
case 'newmemberform':
$member_form_title = apply_filters('usces_filter_title_newmemberform', __('New enrollment form', 'usces'));
$member_regmode = 'newmemberform';
$temp_path = apply_filters('usces_template_path_member_form', USCES_PLUGIN_DIR . '/templates/member/member_form.php');
include( $temp_path );
break;
default:
$temp_path = apply_filters('usces_template_path_login', USCES_PLUGIN_DIR . '/templates/member/login.php');
include( $temp_path );
}
}
}else{
$html .= "".__('Member Services is not running currently.','usces')."
";
}
$content = $html;
remove_filter('the_title', array($this, 'filter_memberTitle'));
return $content;
}
function filter_memberTitle($title) {
if( $this->options['membersystem_state'] == 'activate' && ($title == 'Member' || $title == __('Membership', 'usces')) ){
switch($this->page){
case 'login':
$newtitle = apply_filters('usces_filter_title_login', __('Log-in for members', 'usces'));
break;
case 'newmemberform':
$newtitle = apply_filters('usces_filter_title_newmemberform', __('New enrollment form', 'usces'));
break;
case 'lostmemberpassword':
$newtitle = apply_filters('usces_filter_title_lostmemberpassword', __('The new password acquisition', 'usces'));
break;
case 'changepassword':
$newtitle = apply_filters('usces_filter_title_changepassword', __('Change password', 'usces'));
break;
case 'newcompletion':
case 'editcompletion':
case 'lostcompletion':
case 'changepasscompletion':
$newtitle = apply_filters('usces_filter_title_changepasscompletion', __('Completion', 'usces'));
break;
case 'error':
$newtitle = apply_filters('usces_filter_title_membererror', __('Error', 'usces'));
break;
default:
$newtitle = apply_filters('usces_filter_title_member_default', $title);
}
}else{
$newtitle = $title;
}
$newtitle = apply_filters('usces_filter_memberTitle', $newtitle);
return $newtitle;
}
function action_memberFilter(){
add_filter('the_title', array($this, 'filter_memberTitle'),20);
add_filter('the_content', array($this, 'filter_memberContent'),20);
}
function filter_usces_cart_css(){
$path = get_stylesheet_directory_uri() . '/usces_cart.css';
return $path;
}
function filter_divide_item(){
global $wp_query;
if( ($this->options['divide_item'] && !is_category() && !is_search() && !is_singular() && !is_admin()) ){
$ids = $this->getItemIds( 'front' );
$wp_query->query_vars['post__not_in'] = $ids;
}
if( is_admin() ){
$ids = $this->getItemIds( 'back' );
//$wp_query->query_vars['category__not_in'] = array(USCES_ITEM_CAT_PARENT_ID);
$wp_query->query_vars['post__not_in'] = $ids;
}
do_action( 'usces_action_divide_item');
}
function load_upload_template(){
$post_id = $_POST['post_id'];
$file = 'upload_template01.php';
include(TEMPLATEPATH . '/' . $file);
exit;
}
function filter_itemimg_anchor_rel($html){
if( is_single() ){
$str = ' rel="' . $this->options['itemimg_anchor_rel'] . '"';
}else{
$str = '';
}
return $html . $str;
}
function filter_permalink( $link ) {
if(false !== strpos('?page_id=4', $link) || false !== strpos('?page_id=3', $link) || false !== strpos('usces-cart', $link) || false !== strpos('usces-member', $link) )
$link = str_replace('http://', 'https://', $link);
return $link;
}
function filter_cart_page_header($html){
if( !empty($this->options['cart_page_data']['header']['cart']) ){
$html = $this->options['cart_page_data']['header']['cart'];
}
return do_shortcode( stripslashes(nl2br($html)) );
}
function filter_cart_page_footer($html){
if( !empty($this->options['cart_page_data']['footer']['cart']) ){
$html = $this->options['cart_page_data']['footer']['cart'];
}
return do_shortcode( stripslashes(nl2br($html)) );
}
function filter_customer_page_header($html){
if( !empty($this->options['cart_page_data']['header']['customer']) ){
$html = $this->options['cart_page_data']['header']['customer'];
}
return do_shortcode( stripslashes(nl2br($html)) );
}
function filter_customer_page_footer($html){
if( !empty($this->options['cart_page_data']['footer']['customer']) ){
$html = $this->options['cart_page_data']['footer']['customer'];
}
return do_shortcode( stripslashes(nl2br($html)) );
}
function filter_delivery_page_header($html){
if( !empty($this->options['cart_page_data']['header']['delivery']) ){
$html = $this->options['cart_page_data']['header']['delivery'];
}
return do_shortcode( stripslashes(nl2br($html)) );
}
function filter_delivery_page_footer($html){
if( !empty($this->options['cart_page_data']['footer']['delivery']) ){
$html = $this->options['cart_page_data']['footer']['delivery'];
}
return do_shortcode( stripslashes(nl2br($html)) );
}
function filter_confirm_page_header($html){
if( !empty($this->options['cart_page_data']['header']['confirm']) ){
$html = $this->options['cart_page_data']['header']['confirm'];
}
return do_shortcode( stripslashes(nl2br($html)) );
}
function filter_confirm_page_footer($html){
if( !empty($this->options['cart_page_data']['footer']['confirm']) ){
$html = $this->options['cart_page_data']['footer']['confirm'];
}
return do_shortcode( stripslashes(nl2br($html)) );
}
function filter_cartcompletion_page_header($html){
if( !empty($this->options['cart_page_data']['header']['completion']) ){
$html = $this->options['cart_page_data']['header']['completion'];
}
return do_shortcode( stripslashes(nl2br($html)) );
}
function filter_cartcompletion_page_footer($html){
if( !empty($this->options['cart_page_data']['footer']['completion']) ){
$html = $this->options['cart_page_data']['footer']['completion'];
}
return do_shortcode( stripslashes(nl2br($html)) );
}
function filter_login_page_header($html){
if( !empty($this->options['member_page_data']['header']['login']) ){
$html = $this->options['member_page_data']['header']['login'];
}
return do_shortcode( stripslashes(nl2br($html)) );
}
function filter_login_page_footer($html){
if( !empty($this->options['member_page_data']['footer']['login']) ){
$html = $this->options['member_page_data']['footer']['login'];
}
return do_shortcode( stripslashes(nl2br($html)) );
}
function filter_newmember_page_header($html){
if( !empty($this->options['member_page_data']['header']['newmember']) ){
$html = $this->options['member_page_data']['header']['newmember'];
}
return do_shortcode( stripslashes(nl2br($html)) );
}
function filter_newmember_page_footer($html){
if( !empty($this->options['member_page_data']['footer']['newmember']) ){
$html = $this->options['member_page_data']['footer']['newmember'];
}
return do_shortcode( stripslashes(nl2br($html)) );
}
function filter_newpass_page_header($html){
if( !empty($this->options['member_page_data']['header']['newpass']) ){
$html = $this->options['member_page_data']['header']['newpass'];
}
return do_shortcode( stripslashes(nl2br($html)) );
}
function filter_newpass_page_footer($html){
if( !empty($this->options['member_page_data']['footer']['newpass']) ){
$html = $this->options['member_page_data']['footer']['newpass'];
}
return do_shortcode( stripslashes(nl2br($html)) );
}
function filter_changepass_page_header($html){
if( !empty($this->options['member_page_data']['header']['changepass']) ){
$html = $this->options['member_page_data']['header']['changepass'];
}
return do_shortcode( stripslashes(nl2br($html)) );
}
function filter_changepass_page_footer($html){
if( !empty($this->options['member_page_data']['footer']['changepass']) ){
$html = $this->options['member_page_data']['footer']['changepass'];
}
return do_shortcode( stripslashes(nl2br($html)) );
}
function filter_memberinfo_page_header($html){
if( !empty($this->options['member_page_data']['header']['memberinfo']) ){
$html = $this->options['member_page_data']['header']['memberinfo'];
}
return do_shortcode( stripslashes(nl2br($html)) );
}
function filter_memberinfo_page_footer($html){
if( !empty($this->options['member_page_data']['footer']['memberinfo']) ){
$html = $this->options['member_page_data']['footer']['memberinfo'];
}
return do_shortcode( stripslashes(nl2br($html)) );
}
function filter_membercompletion_page_header($html){
if( !empty($this->options['member_page_data']['header']['completion']) ){
$html = $this->options['member_page_data']['header']['completion'];
}
return do_shortcode( stripslashes(nl2br($html)) );
}
function filter_membercompletion_page_footer($html){
if( !empty($this->options['member_page_data']['footer']['completion']) ){
$html = $this->options['member_page_data']['footer']['completion'];
}
return do_shortcode( stripslashes(nl2br($html)) );
}
function action_cart_page_header(){
if( !empty($this->options['cart_page_data']['header']['cart']) ){
$html = $this->options['cart_page_data']['header']['cart'];
echo do_shortcode( stripslashes(nl2br($html)) );
}
}
function action_cart_page_footer(){
if( !empty($this->options['cart_page_data']['footer']['cart']) ){
$html = $this->options['cart_page_data']['footer']['cart'];
echo do_shortcode( stripslashes(nl2br($html)) );
}
}
function action_customer_page_header(){
if( !empty($this->options['cart_page_data']['header']['customer']) ){
$html = $this->options['cart_page_data']['header']['customer'];
echo do_shortcode( stripslashes(nl2br($html)) );
}
}
function action_customer_page_footer(){
if( !empty($this->options['cart_page_data']['footer']['customer']) ){
$html = $this->options['cart_page_data']['footer']['customer'];
echo do_shortcode( stripslashes(nl2br($html)) );
}
}
function action_delivery_page_header(){
if( !empty($this->options['cart_page_data']['header']['delivery']) ){
$html = $this->options['cart_page_data']['header']['delivery'];
echo do_shortcode( stripslashes(nl2br($html)) );
}
}
function action_delivery_page_footer(){
if( !empty($this->options['cart_page_data']['footer']['delivery']) ){
$html = $this->options['cart_page_data']['footer']['delivery'];
echo do_shortcode( stripslashes(nl2br($html)) );
}
}
function action_confirm_page_header(){
if( !empty($this->options['cart_page_data']['header']['confirm']) ){
$html = $this->options['cart_page_data']['header']['confirm'];
echo do_shortcode( stripslashes(nl2br($html)) );
}
}
function action_confirm_page_footer(){
if( !empty($this->options['cart_page_data']['footer']['confirm']) ){
$html = $this->options['cart_page_data']['footer']['confirm'];
echo do_shortcode( stripslashes(nl2br($html)) );
}
}
function action_cartcompletion_page_header(){
if( !empty($this->options['cart_page_data']['header']['completion']) ){
$html = $this->options['cart_page_data']['header']['completion'];
echo do_shortcode( stripslashes(nl2br($html)) );
}
}
function action_cartcompletion_page_footer(){
if( !empty($this->options['cart_page_data']['footer']['completion']) ){
$html = $this->options['cart_page_data']['footer']['completion'];
echo do_shortcode( stripslashes(nl2br($html)) );
}
}
function action_login_page_header(){
if( !empty($this->options['member_page_data']['header']['login']) ){
$html = $this->options['member_page_data']['header']['login'];
echo do_shortcode( stripslashes(nl2br($html)) );
}
}
function action_login_page_footer(){
if( !empty($this->options['member_page_data']['footer']['login']) ){
$html = $this->options['member_page_data']['footer']['login'];
echo do_shortcode( stripslashes(nl2br($html)) );
}
}
function action_newmember_page_header(){
if( !empty($this->options['member_page_data']['header']['newmember']) ){
$html = $this->options['member_page_data']['header']['newmember'];
echo do_shortcode( stripslashes(nl2br($html)) );
}
}
function action_newmember_page_footer(){
if( !empty($this->options['member_page_data']['footer']['newmember']) ){
$html = $this->options['member_page_data']['footer']['newmember'];
echo do_shortcode( stripslashes(nl2br($html)) );
}
}
function action_newpass_page_header(){
if( !empty($this->options['member_page_data']['header']['newpass']) ){
$html = $this->options['member_page_data']['header']['newpass'];
echo do_shortcode( stripslashes(nl2br($html)) );
}
}
function action_newpass_page_footer(){
if( !empty($this->options['member_page_data']['footer']['newpass']) ){
$html = $this->options['member_page_data']['footer']['newpass'];
echo do_shortcode( stripslashes(nl2br($html)) );
}
}
function action_changepass_page_header(){
if( !empty($this->options['member_page_data']['header']['changepass']) ){
$html = $this->options['member_page_data']['header']['changepass'];
echo do_shortcode( stripslashes(nl2br($html)) );
}
}
function action_changepass_page_footer(){
if( !empty($this->options['member_page_data']['footer']['changepass']) ){
$html = $this->options['member_page_data']['footer']['changepass'];
echo do_shortcode( stripslashes(nl2br($html)) );
}
}
function action_memberinfo_page_header(){
if( !empty($this->options['member_page_data']['header']['memberinfo']) ){
$html = $this->options['member_page_data']['header']['memberinfo'];
echo do_shortcode( stripslashes(nl2br($html)) );
}
}
function action_memberinfo_page_footer(){
if( !empty($this->options['member_page_data']['footer']['memberinfo']) ){
$html = $this->options['member_page_data']['footer']['memberinfo'];
echo do_shortcode( stripslashes(nl2br($html)) );
}
}
function action_membercompletion_page_header(){
if( !empty($this->options['member_page_data']['header']['completion']) ){
$html = $this->options['member_page_data']['header']['completion'];
echo do_shortcode( stripslashes(nl2br($html)) );
}
}
function action_membercompletion_page_footer(){
if( !empty($this->options['member_page_data']['footer']['completion']) ){
$html = $this->options['member_page_data']['footer']['completion'];
echo do_shortcode( stripslashes(nl2br($html)) );
}
}
}