This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Use X-Forwarded-For HTTP Header to Get Visitor's Real IP Address | |
| if ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { | |
| $http_x_headers = explode( ',', $_SERVER['HTTP_X_FORWARDED_FOR'] ); | |
| $_SERVER['REMOTE_ADDR'] = $http_x_headers[0]; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Add the field to the checkout | |
| **/ | |
| add_action('woocommerce_after_order_notes', 'my_custom_checkout_field'); | |
| function my_custom_checkout_field( $checkout ) { | |
| echo '<div id="my_custom_checkout_field"><h3>'.__('My Field').'</h3>'; | |
| /** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * File: Regxp.h | |
| * Author: solution | |
| * | |
| * Created on 11. listopad 2011, 16:00 | |
| */ | |
| #include <stdio.h> | |
| #include <string.h> | |
| #include <pcre.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| define('WYSIWYG_META_BOX_ID', 'my-editor'); | |
| define('WYSIWYG_EDITOR_ID', 'myeditor'); //Important for CSS that this is different | |
| define('WYSIWYG_META_KEY', 'extra-content'); | |
| add_action('admin_init', 'wysiwyg_register_meta_box'); | |
| function wysiwyg_register_meta_box(){ | |
| add_meta_box(WYSIWYG_META_BOX_ID, __('WYSIWYG Meta Box', 'wysiwyg'), 'wysiwyg_render_meta_box', 'post'); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Second Post Editor TinyMCE Editor */ | |
| class SubContentEditor { | |
| public $meta_key = 'subcontent'; | |
| public $meta_label = 'Right Side'; // Headline above editor | |
| public $post_type = array( 'page' ); // The post type in which the editor should display | |
| public $wpautop = true; // Automatically create paragraphs? | |
| function __construct() { | |
| add_action( 'edit_form_after_editor', array( &$this, 'edit_form_after_editor' ) ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace GarantaParts.Engine.Import.TecDoc | |
| { | |
| public class SqlQueryTemplates | |
| { | |
| public static string ArticleSearchTemplate = @" | |
| SELECT DISTINCT | |
| TOF_ARTICLES.ART_ID, | |
| TOF_BRANDS.BRA_BRAND, | |
| TOF_SUPPLIERS.SUP_ID, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Custom AJAX spinner on WooCommerce checkout | |
| * The class used to load the overlay is .blockUI .blockOverlay | |
| * The class used to load the spinner is .woocommerce .loader:before | |
| * | |
| */ | |
| .woocommerce .blockUI.blockOverlay:before,.woocommerce .loader:before { | |
| height: 3em; | |
| width: 3em; | |
| position: absolute; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * set the stock status for all products in your WooCommerce store | |
| * @return void | |
| */ | |
| function woocommerce_update_stock_status(){ | |
| global $wpdb; | |
| // set all status for products with 0 or less stocked quantity |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * A simple fix for a shell execution on preg_match('/[0-9]\.[0-9]+\.[0-9]+/', shell_exec('mysql -V'), $version); | |
| * The only edit that was done is that shell_exec('mysql -V') was changed to mysql_get_server_info() because not all | |
| * systems have shell access. XAMPP, WAMP, or any Windows system might not have this type of access. mysql_get_server_info() | |
| * is easier to use because it pulls the MySQL version from phpinfo() and is compatible with all Operating Systems. | |
| * @link http://www.magentocommerce.com/knowledge-base/entry/how-do-i-know-if-my-server-is-compatible-with-magento | |
| * @author Magento Inc. | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| delimiter ;; | |
| drop procedure if exists build_catalog;; | |
| create procedure build_catalog(IN categories INT, IN products INT) | |
| begin | |
| SET @category_count = 1; | |
| SET @CATNAMEPREFIX = "Category "; | |
| SET @CATURLKEYPREFIX = "cat-"; | |
| SET @CATURLPATHPREFIX = "catpath-"; | |
| SET @ROOTCATEGORY = 2; | |
| SET @INCLUDEINMENU = 1; |
OlderNewer