• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wpsc_get_template_file_path函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中wpsc_get_template_file_path函数的典型用法代码示例。如果您正苦于以下问题:PHP wpsc_get_template_file_path函数的具体用法?PHP wpsc_get_template_file_path怎么用?PHP wpsc_get_template_file_path使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了wpsc_get_template_file_path函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: _wpsc_maybe_update_user_log_file

function _wpsc_maybe_update_user_log_file()
{
    $hashes = array('3.8' => '1526bcf18869f9ea2f4061f528a1a21a', '3.8.4' => '1d17c7fb086e2afcf942ca497629b4c9', '3.8.8' => 'f9549ba1b1956c78f96b1551ab965c13', '3.8.9' => '4d0bcba88d211147399e79661cf3b41d', '3.8.10' => '09e2cb9c753587c9228a4e9e8008a82f');
    if (function_exists('wpsc_flush_theme_transients')) {
        wpsc_flush_theme_transients(true);
    }
    // Using TEv2
    if (!function_exists('wpsc_get_template_file_path')) {
        return;
    }
    //Make sure the theme has actually been moved.
    $file = wpsc_get_template_file_path('wpsc-user-log.php');
    if (false !== strpos(WPSC_CORE_THEME_PATH, $file)) {
        return;
    }
    //If it has been moved, but it's the 3.8.10 version, we should be good to go.
    $hash = md5_file($file);
    if ($hashes['3.8.10'] === $hash) {
        return;
    }
    //At this point, we know the file has been moved to the active file folder.  Checking now if it has been modified.
    if (in_array($hash, $hashes)) {
        //We now know that they've moved the file, but haven't actually changed anything.  We can safely overwrite the file with the new core file.
        @copy($file, path_join(get_stylesheet_directory(), 'wpsc-user-log.php'));
    } else {
        //This means they have indeed changed the file.  We need to add a notice letting them know about the issue and how to fix it.
        update_option('_wpsc_3811_user_log_notice', '1');
    }
}
开发者ID:ashik968,项目名称:digiplot,代码行数:29,代码来源:4.php


示例2: wpsc_show_categories

function wpsc_show_categories($content)
{
    ob_start();
    include wpsc_get_template_file_path('wpsc-category-list.php');
    $output = ob_get_contents();
    ob_end_clean();
    return $output;
}
开发者ID:ashik968,项目名称:digiplot,代码行数:8,代码来源:shortcodes.php


示例3: wpsc_shopping_basket_internals

function wpsc_shopping_basket_internals($deprecated = false, $quantity_limit = false, $no_title = false)
{
    global $wpdb;
    $display_state = '';
    if ((isset($_SESSION['slider_state']) && $_SESSION['slider_state'] == 0 || wpsc_cart_item_count() < 1) && get_option('show_sliding_cart') == 1) {
        $display_state = "style='display: none;'";
    }
    echo "    <div id='sliding_cart' class='shopping-cart-wrapper' {$display_state}>";
    include_once wpsc_get_template_file_path('wpsc-cart_widget.php');
    echo '    </div>';
}
开发者ID:ashik968,项目名称:digiplot,代码行数:11,代码来源:shopping_cart_functions.php


示例4: widget

 /**
  * Widget Output
  *
  * @param $args (array)
  * @param $instance (array) Widget values.
  */
 function widget($args, $instance)
 {
     global $wpdb;
     extract($args);
     $title = apply_filters('widget_title', empty($instance['title']) ? __('Product Categories', 'wpsc') : $instance['title']);
     echo $before_widget;
     if ($title) {
         echo $before_title . $title . $after_title;
     }
     $show_thumbnails = $instance['image'];
     if (isset($instance['grid'])) {
         $grid = (bool) $instance['grid'];
     }
     if (isset($instance['width'])) {
         $width = $instance['width'];
     }
     if (isset($instance['height'])) {
         $height = $instance['height'];
     }
     if (!isset($instance['categories'])) {
         $instance_categories = get_terms('wpsc_product_category', 'hide_empty=0&parent=0');
         if (!empty($instance_categories)) {
             foreach ($instance_categories as $categories) {
                 $instance['categories'][$categories->term_id] = 'on';
             }
         }
     }
     foreach (array_keys((array) $instance['categories']) as $category_id) {
         if (!get_term($category_id, "wpsc_product_category")) {
             continue;
         }
         if (file_exists(wpsc_get_template_file_path('wpsc-category_widget.php'))) {
             include wpsc_get_template_file_path('wpsc-category_widget.php');
         } else {
             include wpsc_get_template_file_path('category_widget.php');
         }
     }
     if (isset($grid) && $grid) {
         echo "<div class='clear_category_group'></div>";
     }
     echo $after_widget;
 }
开发者ID:RJHanson292,项目名称:WP-e-Commerce,代码行数:48,代码来源:category_widget.php


示例5: _wpsc_action_downloads_section

/**
 * Displays the Downloads template
 *
 * @access private
 * @since 3.8.10
 *
 */
function _wpsc_action_downloads_section()
{
    global $files, $products;
    $items = array();
    if (wpsc_has_downloads() && !empty($files)) {
        foreach ($files as $key => $file) {
            $item = array();
            if ($products[$key]['downloads'] > 0) {
                $url = add_query_arg('downloadid', $products[$key]['uniqueid'], home_url());
                $item['title'] = sprintf('<a href="%1$s">%2$s</a>', esc_url($url), esc_html($file['post_title']));
            } else {
                $item['title'] = esc_html($file['post_title']);
            }
            $item['downloads'] = $products[$key]['downloads'];
            $item['datetime'] = date(get_option('date_format'), strtotime($products[$key]['datetime']));
            $items[] = (object) $item;
        }
    }
    include wpsc_get_template_file_path('wpsc-account-downloads.php');
}
开发者ID:dreamteam111,项目名称:dreamteam,代码行数:27,代码来源:wpsc-user_log_functions.php


示例6: wpsc_get_template_file_path

/**
 * Checks the active theme folder for the particular file, if it exists then return the active theme directory otherwise
 * return the global wpsc_theme_path
 * @access public
 *
 * @since 3.8
 * @param $file string filename
 * @return PATH to the file
 */
function wpsc_get_template_file_path($file = '')
{
    // If we're not looking for a file, do not proceed
    if (empty($file)) {
        return;
    }
    // No cache, so find one and set it
    if (false === ($file_path = get_transient(WPEC_TRANSIENT_THEME_PATH_PREFIX . $file))) {
        // Plugin may override the template file, get the file name and check to be sure file exists
        $file_path = apply_filters('wpsc_get_template_file_path', false);
        if (!empty($file_path) && file_exists($file_path)) {
            $file_path = realpath($file_path);
            // real path just in case plugin doesn't return canonicalized path name
            // Look for file in stylesheet directory
        } elseif (file_exists(get_stylesheet_directory() . '/' . $file)) {
            $file_path = get_stylesheet_directory() . '/' . $file;
            // Look for file in template
        } elseif (file_exists(get_template_directory() . '/' . $file)) {
            $file_path = get_template_directory() . '/' . $file;
            // Backwards compatibility
        } else {
            // Look in old theme path
            $selected_theme_check = WPSC_OLD_THEMES_PATH . get_option('wpsc_selected_theme') . '/' . str_ireplace('wpsc-', '', $file);
            // Check the selected theme
            if (file_exists($selected_theme_check)) {
                $file_path = $selected_theme_check;
                // Use the bundled file
            } else {
                $file_path = path_join(WPSC_CORE_THEME_PATH, $file);
            }
        }
        // Save the transient and update it every 12 hours
        if (!empty($file_path)) {
            set_transient(WPEC_TRANSIENT_THEME_PATH_PREFIX . $file, $file_path, 60 * 60 * 12);
        }
    } elseif (!file_exists($file_path)) {
        delete_transient(WPEC_TRANSIENT_THEME_PATH_PREFIX . $file);
        wpsc_get_template_file_path($file);
    }
    // Return filtered result
    return apply_filters(WPEC_TRANSIENT_THEME_PATH_PREFIX . $file, $file_path);
}
开发者ID:ashik968,项目名称:digiplot,代码行数:51,代码来源:template.php


示例7: wpsc_change_tax

/**
 * wpsc_change_tax function, used through ajax and in normal page loading.
 * No parameters, returns nothing
 */
function wpsc_change_tax()
{
    global $wpdb, $wpsc_cart;
    $form_id = absint($_POST['form_id']);
    $wpsc_selected_country = $wpsc_cart->selected_country;
    $wpsc_selected_region = $wpsc_cart->selected_region;
    $wpsc_delivery_country = $wpsc_cart->delivery_country;
    $wpsc_delivery_region = $wpsc_cart->delivery_region;
    $previous_country = $_SESSION['wpsc_selected_country'];
    if (isset($_POST['billing_country'])) {
        $wpsc_selected_country = $wpdb->escape($_POST['billing_country']);
        $_SESSION['wpsc_selected_country'] = $wpsc_selected_country;
    }
    if (isset($_POST['billing_region'])) {
        $wpsc_selected_region = absint($_POST['billing_region']);
        $_SESSION['wpsc_selected_region'] = $wpsc_selected_region;
    }
    $check_country_code = $wpdb->get_var(" SELECT `country`.`isocode` FROM `" . WPSC_TABLE_REGION_TAX . "` AS `region` INNER JOIN `" . WPSC_TABLE_CURRENCY_LIST . "` AS `country` ON `region`.`country_id` = `country`.`id` WHERE `region`.`id` = '" . $_SESSION['wpsc_selected_region'] . "' LIMIT 1");
    if ($_SESSION['wpsc_selected_country'] != $check_country_code) {
        $wpsc_selected_region = null;
    }
    if (isset($_POST['shipping_country'])) {
        $wpsc_delivery_country = $wpdb->escape($_POST['shipping_country']);
        $_SESSION['wpsc_delivery_country'] = $wpsc_delivery_country;
    }
    if (isset($_POST['shipping_region'])) {
        $wpsc_delivery_region = absint($_POST['shipping_region']);
        $_SESSION['wpsc_delivery_region'] = $wpsc_delivery_region;
    }
    $check_country_code = $wpdb->get_var(" SELECT `country`.`isocode` FROM `" . WPSC_TABLE_REGION_TAX . "` AS `region` INNER JOIN `" . WPSC_TABLE_CURRENCY_LIST . "` AS `country` ON `region`.`country_id` = `country`.`id` WHERE `region`.`id` = '" . $wpsc_delivery_region . "' LIMIT 1");
    if ($wpsc_delivery_country != $check_country_code) {
        $wpsc_delivery_region = null;
    }
    $wpsc_cart->update_location();
    $wpsc_cart->get_shipping_method();
    $wpsc_cart->get_shipping_option();
    if ($wpsc_cart->selected_shipping_method != '') {
        $wpsc_cart->update_shipping($wpsc_cart->selected_shipping_method, $wpsc_cart->selected_shipping_option);
    }
    $tax = $wpsc_cart->calculate_total_tax();
    $total = wpsc_cart_total();
    $total_input = wpsc_cart_total(false);
    if ($wpsc_cart->coupons_amount >= wpsc_cart_total() && !empty($wpsc_cart->coupons_amount)) {
        $total = 0;
    }
    if ($wpsc_cart->total_price < 0) {
        $wpsc_cart->coupons_amount += $wpsc_cart->total_price;
        $wpsc_cart->total_price = null;
        $wpsc_cart->calculate_total_price();
    }
    ob_start();
    include_once wpsc_get_template_file_path('wpsc-cart_widget.php');
    $output = ob_get_contents();
    ob_end_clean();
    $output = str_replace(array("\n", "\r"), array("\\n", "\\r"), addslashes($output));
    if (get_option('lock_tax') == 1) {
        echo "jQuery('#current_country').val('" . $_SESSION['wpsc_delivery_country'] . "'); \n";
        if ($_SESSION['wpsc_delivery_country'] == 'US' && get_option('lock_tax') == 1) {
            $output = wpsc_shipping_region_list($_SESSION['wpsc_delivery_country'], $_SESSION['wpsc_delivery_region']);
            $output = str_replace(array("\n", "\r"), array("\\n", "\\r"), addslashes($output));
            echo "jQuery('#region').remove();\n\r";
            echo "jQuery('#change_country').append(\"" . $output . "\");\n\r";
        }
    }
    foreach ($wpsc_cart->cart_items as $key => $cart_item) {
        echo "jQuery('#shipping_{$key}').html(\"" . wpsc_currency_display($cart_item->shipping) . "\");\n\r";
    }
    echo "jQuery('#checkout_shipping').html(\"" . wpsc_cart_shipping() . "\");\n\r";
    echo "jQuery('div.shopping-cart-wrapper').html('{$output}');\n";
    if (get_option('lock_tax') == 1) {
        echo "jQuery('.shipping_country').val('" . $_SESSION['wpsc_delivery_country'] . "') \n";
        $sql = "SELECT `country` FROM `" . WPSC_TABLE_CURRENCY_LIST . "` WHERE `isocode`='" . $_SESSION['wpsc_selected_country'] . "'";
        $country_name = $wpdb->get_var($sql);
        echo "jQuery('.shipping_country_name').html('" . $country_name . "') \n";
    }
    $form_selected_country = null;
    $form_selected_region = null;
    $onchange_function = null;
    if ($_POST['billing_country'] != 'undefined' && !isset($_POST['shipping_country'])) {
        $form_selected_country = $wpsc_selected_country;
        $form_selected_region = $wpsc_selected_region;
        $onchange_function = 'set_billing_country';
    } else {
        if ($_POST['shipping_country'] != 'undefined' && !isset($_POST['billing_country'])) {
            $form_selected_country = $wpsc_delivery_country;
            $form_selected_region = $wpsc_delivery_region;
            $onchange_function = 'set_shipping_country';
        }
    }
    if ($form_selected_country != null && $onchange_function != null) {
        $region_list = $wpdb->get_results("SELECT `" . WPSC_TABLE_REGION_TAX . "`.* FROM `" . WPSC_TABLE_REGION_TAX . "`, `" . WPSC_TABLE_CURRENCY_LIST . "`  WHERE `" . WPSC_TABLE_CURRENCY_LIST . "`.`isocode` IN('" . $form_selected_country . "') AND `" . WPSC_TABLE_CURRENCY_LIST . "`.`id` = `" . WPSC_TABLE_REGION_TAX . "`.`country_id`", ARRAY_A);
        if ($region_list != null) {
            $title = empty($_POST['billing_country']) ? 'shippingstate' : 'billingstate';
            $output = "<select name='collected_data[" . $form_id . "][1]' class='current_region' onchange='{$onchange_function}(\"region_country_form_{$form_id}\", \"{$form_id}\");' title='" . $title . "'>\n\r";
            foreach ($region_list as $region) {
                if ($form_selected_region == $region['id']) {
//.........这里部分代码省略.........
开发者ID:hornet9,项目名称:Morato,代码行数:101,代码来源:ajax.functions.php


示例8: wpsc_display_featured_products_page

/**
 * wpsc_display_products_page function.
 *
 * @access public
 * @param mixed $query
 * @return void
 */
function wpsc_display_featured_products_page()
{
    global $wp_query;
    $output = '';
    $sticky_array = get_option('sticky_products');
    if ((is_front_page() || is_home() || is_products_page()) && !empty($sticky_array) && $wp_query->post_count > 1) {
        $query = get_posts(array('post__in' => $sticky_array, 'post_type' => 'wpsc-product', 'orderby' => 'rand', 'numberposts' => 1, 'posts_per_page' => 1));
        if (count($query) > 0) {
            $GLOBALS['nzshpcrt_activateshpcrt'] = true;
            $image_width = get_option('product_image_width');
            $image_height = get_option('product_image_height');
            $featured_product_theme_path = wpsc_get_template_file_path('wpsc-featured_product.php');
            ob_start();
            include_once $featured_product_theme_path;
            $is_single = false;
            $output .= ob_get_contents();
            ob_end_clean();
            //Begin outputting featured product.  We can worry about templating later, or folks can just CSS it up.
            echo $output;
            //End output
        }
    }
}
开发者ID:androidprojectwork,项目名称:WP-e-Commerce,代码行数:30,代码来源:page.php


示例9: widget

    /**
     * Widget Output
     *
     * @param $args (array)
     * @param $instance (array) Widget values.
     *
     */
    function widget($args, $instance)
    {
        extract($args);
        // Create fancy collapser
        $fancy_collapser = '';
        if ($instance['show_sliding_cart'] == 1) {
            if (isset($_SESSION['slider_state']) && is_numeric($_SESSION['slider_state'])) {
                if ($_SESSION['slider_state'] == 0) {
                    $collapser_image = 'plus.png';
                } else {
                    $collapser_image = 'minus.png';
                }
                $fancy_collapser = ' <a href="#" onclick="return shopping_cart_collapser()" id="fancy_collapser_link"><img src="' . WPSC_CORE_IMAGES_URL . '/' . $collapser_image . '" title="" alt="" id="fancy_collapser" /></a>';
            } else {
                if (!wpsc_get_customer_meta('nzshpcart')) {
                    $collapser_image = 'plus.png';
                } else {
                    $collapser_image = 'minus.png';
                }
                $fancy_collapser = ' <a href="#" onclick="return shopping_cart_collapser()" id="fancy_collapser_link"><img src="' . WPSC_CORE_IMAGES_URL . '/' . $collapser_image . '" title="" alt="" id="fancy_collapser" /></a>';
            }
        }
        // Start widget output
        $title = apply_filters('widget_title', empty($instance['title']) ? __('Shopping Cart', 'wpsc') : $instance['title']);
        echo $before_widget;
        if ($title) {
            echo $before_title . $title . $fancy_collapser . $after_title;
        }
        // Set display state
        $display_state = '';
        if ((isset($_SESSION['slider_state']) && $_SESSION['slider_state'] == 0 || wpsc_cart_item_count() < 1) && get_option('show_sliding_cart') == 1) {
            $display_state = 'style="display: none;"';
        }
        // Output start, if we are not allowed to save results ( WPSC_DONT_CACHE ) load the cart using ajax
        $use_object_frame = false;
        if (WPSC_PAGE_CACHE_IN_USE) {
            echo '<div id="sliding_cart" class="shopping-cart-wrapper">';
            if (strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE') == false && $use_object_frame == true) {
                ?>
				<object codetype="text/html" type="text/html" data="index.php?wpsc_action=cart_html_page" border="0">
					<p><?php 
                _e('Loading...', 'wpsc');
                ?>
</p>
				</object>
				<?php 
            } else {
                ?>
				<div class="wpsc_cart_loading"><p><?php 
                _e('Loading...', 'wpsc');
                ?>
</p></div>
				<?php 
            }
            echo '</div>';
        } else {
            echo '<div id="sliding_cart" class="shopping-cart-wrapper" ' . $display_state . '>';
            include wpsc_get_template_file_path('wpsc-cart_widget.php');
            echo '</div>';
        }
        // End widget output
        echo $after_widget;
    }
开发者ID:dreamteam111,项目名称:dreamteam,代码行数:70,代码来源:shopping_cart_widget.php


示例10: _wpsc_ajax_get_cart

/**
 * Returns the Cart Widget
 *
 * @param  boolean $die          Whether or not to return the output (for new JSON requests) or to die() on the old $output / action.
 * @param  array   $cart_message An array of cart messages to be optionally passed.  Primarily passed via wpsc_add_to_cart().
 *
 * @since 3.8.11
 * @return mixed                 Returns an array of output data, alternatively
 */
function _wpsc_ajax_get_cart($die = true, $cart_messages = array())
{
    $return = array();
    if (defined('DOING_AJAX') && DOING_AJAX) {
        ob_start();
        include_once wpsc_get_template_file_path('wpsc-cart_widget.php');
        $output = ob_get_contents();
        ob_end_clean();
        $output = str_replace(array('\\n', '\\r'), '', $output);
        $return['widget_output'] = $output;
        $return['core_images_url'] = WPSC_CORE_IMAGES_URL;
        if (1 == get_option('show_sliding_cart') || empty($cart_messages)) {
            if (wpsc_cart_item_count()) {
                $_SESSION['slider_state'] = 1;
                $return['sliding_cart_state'] = 'show';
            } else {
                $_SESSION['slider_state'] = 0;
                $return['sliding_cart_state'] = 'hide';
            }
        }
        $action_output = '';
        if (has_action('wpsc_alternate_cart_html') && empty($_REQUEST['_wpsc_compat_ajax'])) {
            //Deprecated action. Do not use.  We now have a custom JS event called 'wpsc_fancy_notification'. There is access to the complete $json_response object.
            ob_start();
            echo _wpsc_get_alternate_html($cart_messages);
            $action_output = ob_get_contents();
            $output = '';
            ob_end_clean();
        }
        if (!empty($action_output)) {
            _wpsc_doing_it_wrong('wpsc_alternate_cart_html', __('As of WPeC 3.8.11, it is improper to hook into "wpsc_alternate_cart_html" to output javascript.  We now have a custom javascript event called "wpsc_fancy_notification" you can hook into.', 'wpsc'), '3.8.11');
            $return['wpsc_alternate_cart_html'] = $action_output;
        }
    }
    if ($die) {
        echo $output . $action_output;
        die;
    } else {
        return $return;
    }
}
开发者ID:dreamteam111,项目名称:dreamteam,代码行数:50,代码来源:ajax.php


示例11: wpsc_cart_item_count

            echo wpsc_cart_item_count();
            ?>
</span> <?php 
            _e('items', 'themeva');
            ?>
</a> 
                                    </span>
                                    <span class="shop-cart-icon">
                                        <a target="_parent" href="<?php 
            echo get_option('shopping_cart_url');
            ?>
"></a>
                                    </span>
                                    <div class="shopping-cart-wrapper widget_wp_shopping_cart shop-cart-contents">
                                        <?php 
            include wpsc_get_template_file_path('wpsc-cart_widget.php');
            ?>
                                    </div>
                                </li>
                            <?php 
        }
        if (of_get_option('enable_droppanel') == 'enable') {
            ?>
								<li class="toppaneltrigger">
									<a class="toggle" href="#"><i class="fa fa-lg fa-chevron-down"></i></a>
								</li>									
							<?php 
        }
        ?>
				</ul>
			</div> <!-- / tab-wrap -->
开发者ID:jgeletka,项目名称:simskin,代码行数:31,代码来源:config.header.php



注:本文中的wpsc_get_template_file_path函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wpsc_has_breadcrumbs函数代码示例发布时间:2022-05-23
下一篇:
PHP wpsc_get_state_by_id函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap